Exercise | Solution |
---|---|
Part 1The scene is a teapot jumping up and down on a textured ground quad with a point light circling the scene. We can set up this scene by combining Part 3 of Worksheet 5 with Part 3 of Worksheet 8. The main difficulties are (a) that the ground plane and the loaded object use different shaders and (b) that we need to position the teapot in the scene.
|
Bounce
Look down
Move light
|
Part 2Projection shadows have several shortcomings. A significant problem is missing self-shadowing. Shadow mapping solves most of these issues (but introduces other problems).Your task is now to replace the projection shadows from Part 1 with shadow mapping. We recommend using the “Display Shadows” section of the WebGL programming guide. This text is available on File Sharing. There are two kinds of coordinate spaces used in this assignment: camera relative and light relative. The basic steps are:
|
Bounce
Look down
Move light
See depth map
|
Part 3Compare projection shadows to shadow mapping by listing advantages and disadvantages of the two techniques.Projection shadows Pros: + Easy to implement + Computationally cheap Cons: - Only really suitable for projecting shadows into flat surfaces - Controlling the shadow's color is limited - Self-shadowing is not possible with this method Shadow mapping Pros: + Self-shadowing is not a problem + We can combine shadow and shadowed object's color to blend them any way we want + Can be used to shapes of arbitrary complexity Cons: - Harder to implement (requires separate shaders and FBOs) - Worse performance because of the intermediate texture - All kinds of problems arising from the use of a texture (aliasing, shimmering...) |