Jump to content
  • Advertisement
Sign in to follow this  
sun_1997

OpenGL An urgent question about texture mapping

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 glDisabl (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?

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure why you would want to disable depth testing during texture mapping, but what is happening makes perfect sense. Those results should be expected.

If you still want to disable depth testing, _and_ ensure the underlying polygons are not visible, you will need to depth sort each polygon individually and render from back to front.

Share this post


Link to post
Share on other sites
Quote:
Original post by bpoint
I'm not sure why you would want to disable depth testing during texture mapping, but what is happening makes perfect sense. Those results should be expected.

If you still want to disable depth testing, _and_ ensure the underlying polygons are not visible, you will need to depth sort each polygon individually and render from back to front.


Exactly why do you disable depth test in the first place?? Textures triangles are like any triangles in that sense. Unless you have something special going on, don't ever disable the depth buffer.

Share this post


Link to post
Share on other sites
Quote:
Original post by kburkhart84Exactly why do you disable depth test in the first place?? Textures triangles are like any triangles in that sense. Unless you have something special going on, don't ever disable the depth buffer.

Don't quote me! I didn't ask the question! :D

Share this post


Link to post
Share on other sites
I think what you're trying to say that you needed to disable depth testing in order to have your texture be rendered properly.

If that is the case, then you're doing something wrong. Disabling depth testing is not required to perform texturing. Please post some code and I might be able to help.

Share this post


Link to post
Share on other sites
Quote:
Original post by bpoint
Quote:
Original post by kburkhart84Exactly why do you disable depth test in the first place?? Textures triangles are like any triangles in that sense. Unless you have something special going on, don't ever disable the depth buffer.

Don't quote me! I didn't ask the question! :D


I know you didn't ask the question, rather I was citing your post and using mine to confirm it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!