0
\$\begingroup\$

I was reading Shadow Mapping with Directional Lights and noted that spotlights are implemented by rendering with the perspective projection, stating that the spotlight worked just like the camera. However, I don't see how this could be, as the cross section of a spotlight is a circle, but cross section of the perspective projection frustum is really a rectangle, so wont there either be extra information or too little? Or am I missing something. If you have any questions please feel free to ask I will try to respond as quickly as possible. Thanks a lot for your time!

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

Yes, there can be extra shadow information outside the actual cone of light. Since ultimately you mask this area anyway with an angular falloff formula or light cookie, it doesn't impact that final image observed by tje player's camera.

If you want to prevent rendering of scene geometry in these areas of the shadow map, you can first render a circular cut-out of the appropriate radius positioned at the near plane. That way any fragments of scene geometry that fall in the corners of the square will fail the early depth test and get skipped.

\$\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.