Closed conlanpatrek closed 1 year ago
https://github.com/prime31/Nez/blob/master/Nez.Portable/Graphics/Batcher/Batcher.cs#L676-L680 - the rounding check in the Texture2D implementation
https://github.com/prime31/Nez/blob/master/Nez.Portable/Graphics/Batcher/Batcher.cs#L846 - the method missing the round
Noticed this today. Looks like there is some code in the Texture2D signature that rounds texture position, presumably to avoid sub-pixel shifting.
The Sprite signature of the same method is missing this destination rounding, so when zooming in, sprites are splitting pixels constantly.
Steps to reproduce:
Mathf.Sin()
to oscillate the position of one of the sprites back and forth in front of the other.Batcher.ShouldRoundDestinations
is set totrue
Expected: The moving sprite snaps to the same pixel grid the stationary sprite is rendered on
Actual results: The moving sprite slides fluidly at screen resolution, splitting the pixel grid