Sign in to follow this  
lomateron

apply technique and stencil with no render target question

Recommended Posts

I have this code:

 

g_pd3dDevice->OMSetRenderTargets( 1, &g_pRT, g_pDepthStencil );

g_pTechnique->GetPassByIndex( 0 )->Apply( 0 );

g_pd3dDevice->Draw( 100, 0);

 

g_pd3dDevice->OMSetRenderTargets( 1, NULL, g_pDepthStencil );---->can I render just to the depthStencil with no render target?

g_pTechnique->GetPassByIndex( 0 )->Apply( 0 ); -------------------------->do I need to use this line? I just changed the render target to NULL

g_pd3dDevice->Draw( 100, 0);

 

Share this post


Link to post
Share on other sites

Yup, this is what you can do when you want to render depth only (for example to a shadow map). You need to pass "0" as the first argument though. This number only indicates the number of render targets you want to bind, since the maximum number of depth stencil surfaces you can bind is always one.

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