Advertisement

Directx 11 Shadow mapping view projection matrix

Started by December 27, 2017 12:18 PM
3 comments, last by IAS2000 7 years, 1 month ago

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. :)

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.

Advertisement
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.

🧙

Thanks guys. I will check it out.

This topic is closed to new replies.

Advertisement