Skip to main content
gamedev.net
🔒 Locked

Depth TEsting does not work!

Started by Gammastrahler 4 replies 300+ views
Original Post
Gammastrahler
Gammastrahler
Hi, i´m rendering two triangles, along the z axis, the one is farther away, but when i render it (they rotate) the second (the one which is farther away) overlaps the first. i have done glEnable(GL_DEPTH_TEST) and call glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) each frame before drawing. what is wrong with my code?? thanks Gammastrahler [edited by - Gammastrahler on May 20, 2003 4:59:27 PM]
Brian Jones
Brian Jones
Did you call glClearDepth?
I don't have a signature
Gammastrahler
Gammastrahler
Have tried both, and nothing worked....

my near clip is 0.1 and far is 1000

i have tried 0.01 and 1 for near clip.... nothing worked
Gammastrahler
Gammastrahler
i have fixed it !

it was because my viewport / projection stuff was not called properly.... now it works!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.