PDA

View Full Version : Depth testing: How to



12-05-2001, 09:37 AM
I have been trying to run depth testing, and have just been using
glEnable(GL_DEPTH_TEST);

When i compile my program, the screen only gets a few scattered pixels of my pictures. What could be causing this and what could i look for to fix it?

chowe6685
12-05-2001, 10:32 AM
you should post more information, but if you are just using glEnable(GL_DEPTH_TEST) that might be a problem
try adding
glDepthFunc(GL_LEQUAL)
glEnable(GL_DEPTH_TEST)

then wherever you clear your color buffer change it from
glClear(GL_COLOR_BUFFER_BIT)
to
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)

that might help