XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Using depth buffer when rendering to 3D textures

Last post 04-17-2008 9:55 PM by Ralf Kornmann. 1 replies.
  • 04-16-2008 11:09 AM

    Using depth buffer when rendering to 3D textures

    I'm doing some work on volume modeling using Direct3D 10.  I want to be able to render to a 3D texture with one of the wslices as the render target and using a depth/stencil surface.  I tried calling OMSetRenderTargets with a render view for one of the wslices and a depth/stencil view set to a 2D texture.  The 2D texture has the same dimensions as the 3D texture and since the view of the 3D texture is only a slice, this pair should technically be feasible to use together.

    When I try this I get an error message from the debug layer saying the types of the render target and the depth target are not the same (obviously because one is a 3D texture and the other is a 2D texture).

    I was going to try making a depth/stencil format 3D texture to use with the render target 3D texture, but D3D10_DEPTH_STENCIL_VIEW_DESC does not provide for 3D textures.

    Is it possible in Direct3D 10 to use a 3D texture as a render target with depth buffering?  The only "render to volume" sample I found in the SDK is the "AdvancedParticles" sample, and it does not use depth buffering when rendering to slices in the 3D texture. 

     

  • 04-17-2008 9:55 PM In reply to

    Re: Using depth buffer when rendering to 3D textures

    Unfortunately 3D depth stencil buffers are not supported within Direct3D 10. Depending on your problem you may be able to solve it with using a 2D texture array.

Page 1 of 1 (2 items) Previous Next