I’ve noticed that when using a perspective camera and there is a sprite with the exact same Z value, that the draw order of everything else gets flipped
While this can mostly be fixed with depth testing (and discarding fragments with alpha testing) this starts to be a problem when using semi-transparent sprites.
This might be fixable with implementing frustum culling - but I think the performance tradeoff isn’t worth it for smallish scenes.
I noticed this behavior when using Rendercam. Just didn’t include it in the sample project to have a minimal setup to reproduce this.
The camera is positioned at 0,0,0 and has no rotation.
The 4 semi-transparent sprites (shown in picture 1) have a Z value of -500 (2 in the front) and -600 (2 in the back)
With this setup, everything works fine.
If I add a 5th sprite (x = 1000, z = 0) which is directly ‘beside’ the camera and nowhere near the rendered area, the draw order of everything inside this area changes (shown in picture 2).