I use a single shadow map for a small demo scene. A scene is illuminated by a directional light. I need to set appropriate projection and view matrices for a light space. I use an orthographic projection matrix:
glm::ortho(-100.0f, 100.0f, -100.0f, 100.0f, 0.0f, 400.0f);
A view matrix is built this way:
glm::lookAt(glm::normalize(directionToLight), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
All objects are covered by the shadow map.
What do you think about that ? Is it correct ? How do you set those matrices ?