use depth buffer and backbuffer as a texture

Discussion in 'Rendering Technology and APIs' started by ChenA, Oct 12, 2011.

  1. ChenA

    Newcomer

    Joined:
    Aug 1, 2007
    Messages:
    5
    Likes Received:
    0
    we can use backbuffer as a texture in directx, but can't use depth buffer as a texture.
    we can use depth buffer as a texutre in opengl, but can't use backbuffer as a texture.

    i don't know why.
    anyone can explain this?
    thanks.
     
  2. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    You can use the depth buffer as a texture in DirectX. In DX9 only with vendor extensions such as DF16/DF24/INTZ/RAWZ, but in DX10 it's a standard feature.
     
  3. ChenA

    Newcomer

    Joined:
    Aug 1, 2007
    Messages:
    5
    Likes Received:
    0
    thanks, i don't know directx9 has this hack before.
     
  4. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,554
    Likes Received:
    640
    Location:
    British Columbia, Canada
    Also note that when you can set arbitrary render targets using the "back buffer" as a texture isn't really that important. Typically in a modern renderer you only really even touch the swap chain buffer at the very end of the frame as a target for the final, post-processed, tone-mapped scene. There may be minor memory savings to be had using it as a temporary buffer during frame rendering, but it's not usually significant enough to offset the limited formats and options available. Besides, you normally want some kind of AA and it's more flexible to create your own multisampled render targets and leave the swap chain in a simple "displayable" format.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...