PDA

View Full Version : How precedence of Pixels in two List works?



Denie
06-02-2002, 09:15 PM
Hi,
I have create two list (say one cube and one plane) using glNewlist and then I draw them one before the another. The problem is that if the figures overlap, whichever one I draw the last will appear (at any specific pixel) not the one that is closer to me (or less deeper into screen)
I appreciate you help.

chmod
06-02-2002, 10:34 PM
It sounds like you might be forgetting to enable your depth buffer. Does your setup
include the lines
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
?

Denie
06-03-2002, 05:47 AM
Thanks I got it to work,, I had commented out glEnable(GLDEPTH_TEST) , because with that I could draw nothing, but then I figured that I need to Clear the Depth Buffer,, Thanks again,,,


Originally posted by chmod:
It sounds like you might be forgetting to enable your depth buffer. Does your setup
include the lines
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
?