Perpective behavior incoherence

That’s because sprites don’t use z-buffer depth test in common render pipeline. They sort by their pivots. If one sprite’s pivot in the camera view is closer to the camera pivot than other sprite’s pivot then sprite one render above other one. When you rotate the camera you are changing this ordering.

Well, for correct sorting you need to use a mesh or model components as @britzl said. They using z-buffer by default. In render_script it looks like

render.enable_state(render.STATE_DEPTH_TEST) -- check z-buffer
render.set_depth_mask(true) -- write to z-buffer

or enable this feature to sprite predicate too. But notice that z-buffer depth test may broke render-order of self-transparent sprites.

6 Likes