• Advertisement
Sign in to follow this  

D3DXMatrixShadow and Nonplanar

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

Using D3DXMatrixShadow function can cast shadow in plane,but how to cast shadow in nonplanar, such as terrain. My second question is if use instancing technique to render objects, then how to cast shadow to every instance, thank you. D3DXMATRIX * D3DXMatrixShadow( D3DXMATRIX * pOut, CONST D3DXVECTOR4 * pLight, CONST D3DXPLANE * pPlane );

Share this post


Link to post
Share on other sites
Advertisement
You can't with D3DXMatrixShadow() - it only projects vertices onto a plane. You'll need to use stencil shadows, shadow volumes, or some other shadowing technique. Have a look at the various shadowing samples in the SDK for more information.

Share this post


Link to post
Share on other sites
In fact, to cast the shadow to nonplanar is to map the shadow plane to nonplanar, right? Is there any method? For I am not very familar with kinds of texture mapping.

Share this post


Link to post
Share on other sites
There's two samples in the DirectX SDK: ShadowMap (\Samples\C++\Direct3D\ShadowMap\) and ShadowVolume (\Samples\C++\Direct3D\ShadowVolume\), and there's a few other methods (Google for D3D shadowing if you want to see what else there is).

Share this post


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

  • Advertisement