<<< Backface Culling | Index | Polygon Rendering Modes >>> |
Culling the back-facing triangles does not solve the problem with front-facing triangles positioned in front of one another.
Depth testing solves this problem and removes hidden surfaces
Each pixel has a depth (z-value)
Higher values mean closer to the camera
Pixel depth values are stored in the depth buffer
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH ); glEnable(GL_DEPTH_TEST);// Make sure the depth buffer is on.
<<< Backface Culling | Index | Polygon Rendering Modes >>> |