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
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Location
    Brighton, UK
    Posts
    161

    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.

Similar Threads

  1. Using frame buffer object as main window
    By scarecr0w132 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-22-2014, 10:29 PM
  2. Reading packed depth/stencil to main memory
    By carsten neumann in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-26-2010, 10:52 AM
  3. Rendering FBOdepth attachment to main depth buffer
    By MeneerDePeer in forum OpenGL: Basic Coding
    Replies: 14
    Last Post: 01-26-2008, 11:12 PM
  4. Depth buffer reading and depth buffer test
    By BurningLegion in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-15-2007, 04:09 AM
  5. depth buffer -> depth texture -> depth buffer
    By Codemonkey in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 12-23-2005, 06:27 AM

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