Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Custom Object Overlapping

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2012
    Posts
    4

    Custom Object Overlapping

    Hello.

    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.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    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 );

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •