In my OpenGL application, I used GL_GREATER option for depth test. When I was processing texture mapping, I turned off the depth test by invoking glDisable(GL_DEPTH_TEST). After finishing
texture mapping, I reopened depth test. Now the problem came, the inner texture could be seen
outside the object, and the back texture was covered in front of the front one if the front
one was mapped earlier than the back one. How can I solve this problem but not to change the
GL_GREATER option for the depth test?
I don’t understand what you mean. Generally, texturing doesn’t involve the depth buffer: it’s just a fragment coloring.
“glDisable(GL_DEPTH_TEST)” makes every Graphic Unit drawed on the screen in the order you write the corresponding code. So you got the result surprised.
If you delete the code line , every thing will be ok.