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: Depth Buffer in MesaGL

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Cali, Colombia
    Posts
    3

    Depth Buffer in MesaGL

    Sorry my english,

    I want to know how i use the depth buffer in Linux, i make all the things right (The same code runs in windows); i use glut and mesaGL, lastest libraries.

    Thanks,

    Nicolas

  2. #2
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Caracas/Venezuela
    Posts
    182

    Re: Depth Buffer in MesaGL

    This is mostly an OS independent question.
    The OS dependent part is that you have to request a depth buffer when initializong your windows for OpenGL, but if you use glut, then it is super easy. The line
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    will do it.

    Then, you have to glEnable(GL_DEPTH_TEST) (i guess you more than knew this...), and make sure your projection matrix is properlly setup to give some decent precision for the zbuffer (setting the near plane greater than 0, and the far plane not too far, see gluPerspective). Of course, there are other functions to fine tune depth testing, but the are set by default to reasonable values that work.

    I dont know what's your level in this matter, but at least this is the very basic. let me know more about your app.

Posting Permissions

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