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: Using main depth buffer

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2008
    Posts
    1

    Using main depth buffer

    I'm porting some code from Direct3D to OpenGL and I'm a bit lost on how to approach the following:

    - Render objects to main depth and color buffers (window system provided)
    - Create a new render target (application created)
    - Turn off depth writes
    - Write new geometry to new render target using main depth buffer for depth tests

    I was looking into FBOs, but it seems like this is just not possible with them. Any suggestions? Which extensions should I be looking at?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Dec 2007
    Location
    Brighton, UK
    Posts
    156

    Re: Using main depth buffer

    - Render objects to main depth and color buffers (window system provided)
    - Copy depth values from main framebuffer to a depth texture
    - Create a new render target & attach it to fbo
    - Attach depth texture to fbo
    - Turn off depth writes
    - Render new geometry

    .. that should do the job, though there might be a faster way I didn't think.

Posting Permissions

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