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

Thread: How to eliminate jagged edges ?

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2003
    Posts
    11

    How to eliminate jagged edges ?

    hi !

    I'm using gl_quads to draw my objects at my 3D view they are very simple objects box, cylinder, etc .. but I end up with jagged edges where two objects are intersecting. To eliminate this, enable the culling with gl_back set on, if I don't use it then the resulting rendering is worst.

    What can I do to get over this trouble.

    Thnx!

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    188

    Re: How to eliminate jagged edges ?

    I don't really understand what your problem is (Hint: a screenshot maybe useful), but if backface culling reduces the problem, you probably forgot to turn on depth testing.

    Make sure to request a depth buffer, and glEnable(GL_DEPTH_TEST). Also change your clear call to glClear(... | GL_DEPTH_BUFFER_BIT).
    355/113 -- Not the famous irrational number PI, but an incredible simulation!

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: How to eliminate jagged edges ?

    Another reason for "jagged edges" on depth tested faces is a limited depth buffer resolution.
    Check your projection matrix. In gluPerspective, glFrustum, or glOrtho calls the ratio of zFar/zNear should be as small as possible without clipping your geometry. Push zNear out and draw zFar in to increase the depth buffer precision.
    Request a 24 bit depth buffer in the pixelformat, that's what most hardware supports best.

Posting Permissions

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