Sign in to follow this  
Anand Baumunk

Render To Texture - depthStencilView

Recommended Posts

Anand Baumunk    699

Hello, 

I recently stumbled over a problem with my render-to-texture mechanism. I was setting

 d3d11DevCon->OMSetRenderTargets(1, &renderTargetView, 0);
, what obviously will let me render to the renderTargetView, but without using a depthStencilView.

Now, when I try to pass my depthStencilView as the last parameter, nothing gets drawn anymore. Is there a specific parameter I have to set in the depthStencilView to allow it to be used when I draw to a texture?

Again, without the depthStencilView it works fine, but of course without depth.

If you need some more code on how I initialise stuff, let me know.

 

Thank you very much!

Share this post


Link to post
Share on other sites
PKLoki    1492

Could be a few reasons. Check your depth-stencil buffer is cleared correctly unless you're reusing it from a previous pass - depth initially set to 1 typically, so things with less depth pass the depth test. Stencil typically set to 0. And check your depth stencil tests are set as you expect, i.e. you haven't inadvertently left a stencil test set inappropriately from a previous operation, or got the depth test set the wrong way round. You could try temporarily turning both tests off completely to see if anything is drawn then.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this