• Advertisement
Sign in to follow this  

opengl texture issue

This topic is 2914 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

sorry i didnt know whether to ask this in graphics specifically because its also game programming. anyway, im programming a 3-d game with c++ and opengl. I came across a problem. if i have a polygon with a texture applied, and i have a second polygon with the same x and y values, or around the same values, with a different z value, i can see through the closest polygon and view the other polygon. is there a way to solve this? help would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
okay so lets say i have a textured square. this is texture 1. then i have one behind it. if the second texture is drawn to the screen last, no matter where it is, texture 2 will show through texture 1. so in other words, texture 1 becomes a window instead a solid.



its weird. i dont know how to fix it. if you need me to explain more ill try again

Share this post


Link to post
Share on other sites
it didnt work. i used this call


glEnable(GL_DEPTH_TEST);



i did research and was also enabled



glDepthMask(GL_TRUE);


which didnt work as well.



i'll giv screen shots. brb

Share this post


Link to post
Share on other sites
Nevermind! i fixed it. i needed to apply GLUT_DEPTH in the display mode. thanks for the help everyone. sorry about posting this in the wrong area. im as you might say a newb lol.

Share this post


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

  • Advertisement