Jump to content
  • Advertisement
Sign in to follow this  
IAS2000

DX11 Directx 11 Shadow mapping view projection matrix

Recommended Posts

Hi.

I have successfully implemented shadow mapping in directx 11. Only directional light shadows though. My problem is my current shadow viewproj matrix doesn't cover entire world. If I make it large shadow quality will drop. I need to move my viewproj matrix with camera. I tried translating matrix to my camera pos but it doesn't work. I searched online and found something about calculating viewproj matrix from current camera projection matrix but I didn't found enough resources to fully understand it. Can someone explain me? I will really appreciate it.

 

Thank you for you time. :)

Share this post


Link to post
Share on other sites
Advertisement

Directional Shadow ( aka the Sun ) require multiple shadow maps to achieve quality over large distance. The technique is called cascaded shadow maps. There is many variant to the implementation, but to his simplest, you just draw a few slices, increasing the covered area from slice to slice. Then to render the shadow, you just pick the slice based on the pixel distance.

Share this post


Link to post
Share on other sites
12 minutes ago, galop1n said:

Then to render the shadow, you just pick the slice based on the pixel distance.

You can use an hysteresis curve to avoid switching at a single distance and thus flickering.

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  

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