I'm trying to use Ebiten to create a raycaster game and found that my distant textures aren't being rendered until I get closer to them. In my stackoverflow question I asked since I wasn't sure if it was a bug in the raycasting method or not, I ultimately found the exact reproducible problem:
First take someImage and take a SubImage of it with a pixel width of 1, but a normal height, e.g.:
thisRect := image.Rect(15, 5, 16, 250)
myImage := someImage.SubImage(thisRect).(*ebiten.Image)
Next, scale just the Y to make it smaller and draw it:
op.GeoM.Scale(1.0, 0.25)
screen.DrawImage(myImage, op)
In that case you should see a small vertical 1 pixel width strip of the image. But, now reduce the Y scale below 0.25.
op.GeoM.Scale(1.0, 0.24)
screen.DrawImage(myImage, op)
The strip doesn't draw at all!
But it will draw at a Y scale less than 0.25 if the pixel width is 2 or more:
thisRect := image.Rect(15, 5, 17, 250)
So the question is whether the Ebiten scale rendering code can be adjusted to allow a pixel width of 1 to scale smaller than 0.25.
It caused the tall wall in the background not to draw:

Hi, thank you for using Ebiten!
Unfortunately, such edge cases like rendering images with less-than-1-pixel scale depend on graphics drivers, so there is no guarantee about deterministic behavior. Thus, I'm afraid I probably cannot say the cause.
What about rendering with linear filter?
Oops sorry this is my misunderstanding, width is 1px but only Y is scaled?
Let me try, but could you give me a minimum code to reproduce this issue if possible? Thanks!
Here's a gist where I started with your highDPI example and made modifications, just tweak the values I mentioned in the issue description to see what I'm seeing.
https://gist.github.com/harbdog/075c527eb43df72fb2bd2657199185f1
OK so the cause was the mipmap selection with the linear filter: if the determinant of the geometry matrix is small, mipmap is used, but in your case, the mipmap level is so high that the image width becomes 0. This doesn't happen with the nearest filter since mipmap is not used in this case.
I think this was fixed in the latest Ebiten.
Here's a gist where I started with your highDPI example and made modifications, just tweak the values I mentioned in the issue description to see what I'm seeing.
Thanks! I could reproduce this without the fix (3cb9d18), and confirmed this doesn't happen with the fix.
Confirmed! Updated with go get -u github.com/hajimehoshi/ebiten/... and now have good rendering! The tall wall in the background is drawing :)
https://github.com/harbdog/raycaster-go

P.S. @hajimehoshi ebiten is awesome 馃憤
I'm glad to hear that. Thank you for reporting! Your game screenshot looks great!