Z Order Questions (Solved)

Hi there,

I noticed in the default render script that the tile predicate is drawn with depth testing disabled. This should mean that the z position of sprites shouldn’t be taken into consideration when drawing in a orthographic projection.

Are sprites ordered by their z position in the engine before drawing? And if not, what mechanism is causing z ordering to work without a depth buffer?

Correct. We sort all the renderable items with the same predicate into batches using the Z value.

You can read more about draw calls and batches in this great forum post:

4 Likes