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 4 of 4

Thread: the flash problem of Antialiased line in Enable Depth Test 3D Scene!

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2002
    Location
    BeiJing,China
    Posts
    6

    the flash problem of Antialiased line in Enable Depth Test 3D Scene!

    hello, everyone.My nut is when I wanna draw some 3D lines in a 3D filled surface,and enable depth test together by using code glEnable(GL_DEPTH_TEST).Then I found the lines always flashed when I rotated the total subject(the surface and the lines).In addition, I used Antialiased lines in my coding.
    How can I solve this flashed problem??

  2. #2
    Intern Contributor
    Join Date
    Aug 2002
    Posts
    88

    Re: the flash problem of Antialiased line in Enable Depth Test 3D Scene!

    use glPolygonOffset() on the lines. i think there is a mode to do this for GL_LINES primitives. it will offset the depth values of the lines so you dont get the Z-fighting you are seeing (the flashing lines). the probelm is that depth values for the lines are almost the same as the filled surface, numerical precision errors are causing the relationship to change when you rotate. see the red book (openGL programming guide) for info.

    [This message has been edited by vshader (edited 09-19-2002).]

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    24

    Re: the flash problem of Antialiased line in Enable Depth Test 3D Scene!

    You can't use glPolygonOffset() on the lines, see :
    http://www.opengl.org/developers/faq...ffset.htm#0040

    But you can use glPolygonOffset() to push back the polygons where your lines must be drawn.

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2002
    Location
    BeiJing,China
    Posts
    6

    Re: the flash problem of Antialiased line in Enable Depth Test 3D Scene!

    I'd correct the problem by apply glPolygonOffset() in my surface codes, So it OK!
    Thank you very much!

Posting Permissions

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