I want to render a 2D scene using opengl es 2.0. In this scene i want to have a set of sprites (quads) to be rendered. I’m using orthographic projection. I want each sprite to have some z-value which will determine if it appears on front or back. But I want to render sprites not in z-value order. So how can I still achieve z-ordering is kept?
Share
Despite the fact that you render using an ortographic projection, the 3rd dimension is still there. Just make sure that the nearz and farz values contain your objects, and remember to enable depth testing. Then you substitute all your 2D coordinates with appropriate 3D coordinates.