Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Render FBO to screen taking into account Depth

  1. #1
    Intern Contributor
    Join Date
    Nov 2015

    Render FBO to screen taking into account Depth

    Target: OpenGL ES 3.0

    Suppose my default Framebuffer (the screen) already contains part of my scene rendered; its color and depth buffers contain valid data.

    Now suppose I have another part of the scene rendered to an intermediate FBO 'fbo' already. Its color data is kept in texture 'mColor', which is attached to fbo.COLOR0 attachment, and its depth is kept in another texture 'mDepth', which is attached to fbo.DEPTH attachment.

    Now I would like to take mColor and render it to the Screen, with DEPTH test enabled and taking into account the depth from the 'mDepth' texture.

    Essentially it looks like when we render the Quad textured with mColor to the screen, we need to compare the Screen's depth buffer not with the depth computed from linearily interpolating the 4 verticaes of the Quad, but with depth from the 'mDepth' texture.

    How to do that?

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Search for "depth sprite".

Posting Permissions

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