2
\$\begingroup\$

i hope you can help me. I'm currently stuck at the creation process for projection matrices used by shadow maps.

The problem is the following: I got the spot/directional light projectionmatrix/boundingfrustum and additionally the bounding frustum of the camera projection matrix.

What i need is the minimal bounding box of these two frustums. How do i get that? Or is there a better way to create projection matrices for shadow maps?

\$\endgroup\$
1
\$\begingroup\$

everything that is visible is within [-1;-1;-1;1] [1;1;1;1] in ndc from your camera. invert the projection matrix to bring the box to world space coordinates and then make them relative to your light source by multiplying with your projection matrix of your light source. Now all you need to do is make a Bounding box of a convex shape with 8 vertices. Shouldn't be that hard.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.