View Full Version : Custom Object Overlapping

09-28-2012, 10:35 PM

I have the following issue with OpenGL. When I render two different colored lines overlapping, a mixture of them is displayed looking ugly. I'd like to learn how to set OpenGL to depth test, but when two objects are overlapping render the last one drawn only. If my question is unclear please let me know.

Dark Photon
09-29-2012, 05:15 PM
glDisable( GL_BLEND ). That'll stop any color "mixing". The last write will just replace what was there before.

For the depth test: glEnable( GL_DEPTH_TEST ); glDepthFunc( GL_LEQUAL );