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!
1 Answer
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 the 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.