Im trying to optimize my shadow maps by making my directional shadow maps fit in the view frustum, however this is causing me some problems. I tried several things, but all didn't work, or didn't work properly.
Assuming i only have the following information:
vec3 describing direction of the directional light
perspective camera with values (fov, width, height, near plane, far plane) and transform matrix
How can i use this information to create the correct light space matrix to generate and sample my shadow maps?
Any help would be greatly appreciated!


