Jump to content
  • Advertisement
Sign in to follow this  
kodaman

D3D 9.2 Managed - Shadows and C#

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

Can anyone provide any info or a link to such info about shadows in C#? This is a simple box shadow, therefore, shadow volumes or maps are not necessary, but neither is speed. Managed d3d includes a method: Matrix.Shadow which accepts a Vector4 and a Plane. Unfortunately, I cannot find ANY info on this function beyond MSDN's wimpy syntax help. Assistance appreciated.

Share this post


Link to post
Share on other sites
Advertisement
The vector is the direction of the light. The Plane is the plane (in camera space) to project your geometry on. Set the matrix as your object matrix, set a dark gray color and no texture, turn on framebuffer blending with ONE,ZERO blending (i e, dest = src*dest), and render your shadow-casting object last in the scene. It will be squashed (flattened) onto the plane, and the framebuffer blending will darken whatever is there.

Ideally, the Plane you pass in is coincident with your floor :-)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!