Sign in to follow this  

apply technique and stencil with no render target question

This topic is 1444 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 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

This topic is 1444 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.

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