Original Post
I want to depth-sort transparent quads prior to rendering. What is the best way to accomplish depth sorting in OpenGL, and when should it be done? I suppose the sorting should be done after frustum culling and before rendering each quad. But, how do I get the info, from OpenGL, to do the sorting? Here's pseudo code of each frame. glMatrixMode(GL_PROJECTION) gluPerspective(...) glMatrixMode(GL_MODELVIEW) gluLookAt(...) ... Do_frustum_culling() ... for each transparent quad... glPushMatrix() glTranslated(x,y,z) glGetFloatv(GL_MODELVIEW_MATRIX, m) remove_rotations(m) glLoadMatrixf(m) glBegin(GL_QUADS)...glEnd() glPopMatrix() end for Thanks.