Results 1 to 2 of 2

Thread: Extracting the z-buffer

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Oklahoma
    Posts
    21

    Extracting the z-buffer

    This is a two parter. One, I have heard there is a function to extract the z-buffer from the final image but I haven't been able to find the function and two, does anyone know the formula for the z-buffer (I've been told it's non-linear normalization to increase the accuracy of near objects)?

    Thanks,
    Colby

  2. #2
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Location
    Poland
    Posts
    234

    Re: Extracting the z-buffer

    Originally posted by Colby Toland:
    does anyone know the formula for the z-buffer (I've been told it's non-linear normalization to increase the accuracy of near objects)?
    Hi!

    You can acces the contents of Z-buffer (Depth Buffer) with glReadPixels() command. Here is a sample use :

    Code :
    glReadPixels( x, y, width, height, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, array)
    ... where array is a pointer to memory where depth-values (in GLubyte type in this case) will be placed.

    If you'd like to know more about manipulating buffers, get your self accustomed to two other commands : glDrawPixels(), glCopyPixels().

    Hope it helps!

Similar Threads

  1. Extracting Y from GL_LUMINANCE
    By DrFooMod2 in forum OpenGL: GLSL
    Replies: 3
    Last Post: 06-30-2011, 06:33 PM
  2. Extracting a Vector4 from GL_MODELVIEW_MATRIX
    By wyrd in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 06-08-2004, 03:28 AM
  3. Extracting z coordinate from z buffer
    By camelo in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 07-09-2003, 01:03 AM
  4. extracting frame rate
    By imported_vijaykiran in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-22-2003, 08:09 PM
  5. Extracting color buffer from an OpenGL app.
    By Pyrolistical in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 07-15-2002, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean