Jump to content
  • Advertisement
Sign in to follow this  
lomateron

apply technique and stencil with no render target question

This topic is 1783 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
Advertisement

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
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!