Another day, another challenge
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.
Right order:
Wrong order after placing a sprite directly beside the camera:
Setup in editor (camera is selected):
Sample project:
project