Rendering order matters in OGL. I have a cube I'm drawing from GL_QUADS. Is there an easy way to know which side should be renderd first and which last?
What if the camera moves around the cube and the cube doesn't rotate?!
NOMAD
Printable View
Rendering order matters in OGL. I have a cube I'm drawing from GL_QUADS. Is there an easy way to know which side should be renderd first and which last?
What if the camera moves around the cube and the cube doesn't rotate?!
NOMAD
You need a ZBuffer. When using a ZBuffer, it is filled with depth values, and only the pixel with the lowest depth value in the buffer is drawn to the screen. This saves you from having to know what to render first (unless you are doing alpha blending, in which case, you need to render from back to front).
You should be able to find information on how to set up a z buffer with a google search (or at nehe.gamedev.net).
Z.
Thanks Z, I'll look that up!
NOMAD
http://ask.ii.uib.no/ebt-bin/nph-dwe...oper/OpenGL_PG
that should cover almost everything.