Hi there,
I have a couple of questions with respect to shadow mapping that I struggle to find the answers for. I understand the core process of shadow mapping. However, I'm still kind of uncertain about some implementation details.
- I'm assuming that you don't have to have an empty pixel shader for the light pass. You could attach a R32 Texture as the render target and write the depth values there. Is that correct?
- In the light pass, when manually transforming the light projected fragments from projection space to texture space, the xy coordinates should never lie outside the range [0, 1]. Is that correct?
- How do developers typically fix perspective aliasing? I understand that CSM can alleviate the problem by providing the correct resolution texture for the view distance. However, a very high resolution shadowmap is still required for up-close fragments. Rasterizing the scene and writing to the texture seems costly. Is that cost simply accepted, because there are no better alternatives?
- When using an orthographic projection for the light, how are the bounds of the frustum computed? It seems like you want to have the tightest bound possible to avoid precision related problems.
If anyone has resources or direct answers for some of these questions I'd appreciate it a lot. Thanks!