Closed Akkete closed 10 months ago
Hi @Akkete, thank you for the excellent bug report!
I've read through it, and my gut is screaming rounding error... somewhere.
I'll see if I can replicate it, but in the meantime, I know you said it doesn't happen if you don't use Camera.LookAt
, does that mean you tried Camera.Fixed
and that was ok? I was wondering because I use Camera.Fixed
in the roguelike demo and the CloneTiles
work perfectly.
If that works, then probably it's due to loss of precision in the camera projection matrix calculation. One of the dangers of pixel art and rendering at Int
/ whole pixel precision.
Yes, changing to .withCamera(Camera.Fixed(Point(...))
or just deleting the whole line gets rid of the problem.
Whenever the viewport height is an odd number, the cropping of my tile graphics (clone tiles) is shifted so that they show a one pixel line of the below tule from the spritesheet. This only happens with height, not width for some reason. This problem goes away if I don't use
.withCamera(Camera.LookAt(Point(...)
.Pictures:
Here's my
GameScene.present
that produces the issue. Cleaned to be as minimal as I could easily get.Note that the viewport size is not actually referenced here at all.