Jump to content
  • Advertisement
Sign in to follow this  
judeclarke

Creating a texture for a render target that needs its own depth buffer

This topic is 881 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to render to a texture with a depth buffer that is a different size then one I traditionally render to. To do this am creating a texture with CreateTexture2D with the flags D3D11_BIND_SHADER_RESOURCE and D3D11_BIND_DEPTH_STENCIL. The problem I then run into is that I can not create a RenderTargetView because it will require me to use the flag D3D11_BIND_DEPTH_STENCIL, but I can not with D3D11_BIND_DEPTH_STENCIL. Since I can not create a RenderTargetView I can not end up creating my texture to use for rendering on my model.
 
How can I end up creating a render target that I render to with a custom depth buffer where I can create a texture for it to use with rendering?

Share this post


Link to post
Share on other sites
Advertisement
You can't have a texture that's both a render target and a depth buffer, those are mutually exclusive. You need to create a separate render target texture, and a separate depth texture.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!