Contents
How does the shadow map work in omnidirectional?
With omnidirectional shadow maps we have two render passes: first we generate the depth map and second, we use the depth map in the normal render pass to create shadows in the scene. With the framebuffer object and the cubemap this process looks a bit like this:
How big of a texture do you need for a shadow map?
Here we use a 1024×1024 16-bit depth texture to contain the shadow map. 16 bits are usually enough for a shadow map. Feel free to experiment with these values. Note that we use a depth texture, not a depth renderbuffer, since we’ll need to sample it later.
How does the algorithm for shadow mapping work?
The basic shadowmap algorithm consists in two passes. First, the scene is rendered from the point of view of the light. Only the depth of each fragment is computed. Next, the scene is rendered as usual, but with an extra test to see it the current fragment is in the shadow. The “being in the shadow” test is actually quite simple.
What should the bias be for shadow mapping?
What’s more, a bias of 0.005 seems too much on the ground, but not enough on curved surface : some artefacts remain on the cylinder and on the sphere. A common approach is to modify the bias according to the slope : Shadow acne is now gone, even on curved surfaces.
How is shadow mapping done in learn OpenGL?
Shadow mapping therefore consists of two passes: first we render the depth map, and in the second pass we render the scene as normal and use the generated depth map to calculate whether fragments are in shadow. It may sound a bit complicated, but as soon as we walk through the technique step-by-step it’ll likely start to make sense.
Which is the best technique for point shadows?
This technique is known as point (light) shadows or more formerly as omnidirectional shadow maps. This tutorial builds upon the previous shadow mapping tutorial so unless you’re familiar with traditional shadow mapping it is advised to read the shadow mapping tutorial first.