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: can i store and restore the value in z-buffer

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2001
    Posts
    8

    can i store and restore the value in z-buffer

    Hi, everybody, i want to store and restore the z-buffer value. glpushattrib only can save some mask value and testing flag, but can't save what i wish, does anybody know, is there any function (for example something like pushmatrix & popmatrix) that can store and restore z-buffer value? thx!

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

    Re: can i store and restore the value in z-buffer

    Normally with glReadPixels(,GL_DEPTH_COMPONENT,) and glDrawPixels(). Beware of destination formats which don't match the depth buffer size. GL_FLOAT will be slow, GL_UNSIGNED_INT might be fast.

    If you don't use it for a hierarchy like glPush-glPop and only a single save-restore is needed, the fastest might be GL_KTX_buffer_region or the newer WGL_ARB_buffer_region extension.
    They don't offer an interface to access the stored memory, so it can be moved around in the hardware's native format.

    [This message has been edited by Relic (edited 10-21-2002).]

Posting Permissions

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