Original Post
Hi! [smile] I have a small question about (basic) shadow-mapping. This is not about the aliasing or the numerical imprecision, but more about how to "control" the shadow-map in a scene, so that the scene is correctly shadowed no matter where the eye-camera is placed or where it is looking at. (Words i use: "light-camera" = the virtual camera placed at the lightsource, "eye-camera" = the normal camera) The problem: (which leads to my question) The light-camera should be able to see at least the part of the scene that the eye-camera can see. (the entire eye-camera frustum should be within the light-camera frustum) Otherwise the parts of the scene that the eye-camera can see, but the light-camera can't see, won't be shadowed. One could move the light-camera (change the position and orientation) when the eye-camera is moved, but that will change the direction of the shadows. (and could possible miss shadows from some occluders, if the light-camera is being moved past some of those) One could of course place the light-camera such that the entire scene is visible from it - i.e. place it far away from the scene. But when using point light-sources, this will (as mentioned) change the direction of the shadows. (shadows fall differently when the light-source is far away, than when it is close) Also, it will cause great aliasing to place the light-camera this far away from the objects in the scene. (at least if the scene is sufficiently large compared to the resolution of the depth-texture) (well, at least these are problems when doing point light-sources, due to the perspective projection in pass 1. For directional light-sources, i guess it might work, because of the orthographic projection in pass 1. (as no matter how far away the objects are from the light-source, they won't change size seen from the light-cameras point of view).) My question: How is this normally handled, when applying shadow mapping to a scene? (how are those problems normally avoided / worked around?) In other words, how is shadow mapping normally used, such that you can control your lightsources and at the same time ensure shadowing of the entire visible scene? Thanx! [smile] (i only know basic shadow mapping with no fancy stuff, so please try to restrict yourself to discussing basic shadow-mapping)