Z-buffering

Started by
1 comment, last by ogl 23 years, 5 months ago
How''s Z buffering implemented - is it using opengl commands? sample code anyone? Cheers
Advertisement
glEnable(GL_DEPTH_TEST); //that''s it you got z-buffering. !!

glDepthFunc(GL_LESS) //this is by default, so don''t worry about it.
if you want your depth buffer to act so that the nearer objects (rather then the farther objects) don''t get drawn then pass the above GL_GREATER. you get the idea...
Thanx

This topic is closed to new replies.

Advertisement