Sign in to follow this  
sunrisefe

D3DXMatrixShadow and Nonplanar

Recommended Posts

sunrisefe    102
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
Evil Steve    2017
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
sunrisefe    102
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
Evil Steve    2017
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

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