glOrtho + glDepthTest

Started by
8 comments, last by Brother Bob 17 years, 9 months ago
Is there any way to use them together?
---------------------------------Upon thine ass shall I bust but a single cap.
Advertisement
Why wouldn't they work together? Just because its Ortho doesn't mean it doesn't have a depth buffer. Its just means the image isn't perspective correct, meaning images farther away get smaller.
My program works fine with glOrtho, but when i throw in glEnable(GL_DEPTH_TEST), nothing displays anymore.
---------------------------------Upon thine ass shall I bust but a single cap.
Are you clearing the depth buffer at the start of each frame?
yep. am i not supposed to?

[Edited by - F-Kop on July 3, 2006 8:19:32 PM]
---------------------------------Upon thine ass shall I bust but a single cap.

1. What value do you clear the depth buffer at? (glClearDepth)
2. What test function are you using for the depth test? (look for glDepthFunc)
1: 0.0f
2: GL_LEQUAL
---------------------------------Upon thine ass shall I bust but a single cap.
Quote:Original post by F-Kop
1: 0.0f
2: GL_LEQUAL


clear should be 1.0
Quote:Original post by MARS_999
Quote:Original post by F-Kop
1: 0.0f
2: GL_LEQUAL


clear should be 1.0


Or else it will be pretty rare to be "less or equal".
f@dzhttp://festini.device-zero.de
Quote:Original post by MARS_999
Quote:Original post by F-Kop
1: 0.0f
2: GL_LEQUAL


clear should be 1.0

Or just don't bother setting the value at all, as 1.0 is the default clear value.

This topic is closed to new replies.

Advertisement