The document discusses shadow mapping, a technique for real-time shadow generation in 3D graphics. Shadow mapping works by rendering the scene from the point of view of the light to generate a depth map, then using that depth map to determine whether surfaces are in shadow during the main rendering pass from the camera's point of view. Hardware support for shadow mapping allows efficient shadow tests by comparing depth map values to fragment depths.
12. Shadow Mapping with a Picture in 2D (2) light source eye position depth map Z = A fragment’s light Z = B depth map image plane eye view image plane, a.k.a. the frame buffer The A B unshadowed fragment case
13. Note image precision mismatch! The depth map could be at a different resolution from the framebuffer This mismatch can lead to artifacts Shadow Mapping with a Picture in 2D (3)
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41. Shadow Map Eye Linear Texgen Transform 1/2 1/2 1/2 1 1/2 1/2 1/2 Light frustum (projection) matrix Light view (look at) matrix Inverse eye view (look at) matrix Eye view (look at) matrix Modeling matrix x o y o z o w o x e y e z e w e = = x e y e z e w e s t r q glTexGen automatically applies this when modelview matrix contains just the eye view transform Supply this combined transform to glTexGen
42.
43.
44.
45.
46.
47.
48.
49. Hardware Shadow Map Filtering Example GL_NEAREST: blocky GL_LINEAR: antialiased edges Low shadow map resolution used to heightens filtering artifacts
50.
51.
52.
53.
54.
55. The Need for Dimming Diffuse No dimming; shadowed regions have 0% diffuse and 0% specular With dimming; shadowed regions have 40% diffuse and 0% specular Front facing shadowed regions appear unnaturally flat. Still evidence of curvature in shadowed regions. No specular in shadowed regions in both versions.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66. Four Images of Dueling Frusta Case Eye’s View Light’s View Eye’s View with projection of color-coded mipmap levels from light: Blue = magnification Red = minification Light’s View with re-projection of above image from the eye
67. Interpretation of the Four Images of the Dueling Frusta Case Eye’s View Light’s View Region that is smallest in the light’s view is a region that is very large in the eye’s view. This implies that it would require a very high-resolution shadow map to avoid obvious blocky shadow edge artifacts.
68. Example of Blocky Shadow Edge Artifacts in Dueling Frusta Situations Light position out here pointing towards the viewer. Blocky shadow edge artifacts. Notice that shadow edge is well defined in the distance.
69. Good Situation, Close to the Miner’s Lamp Eye’s View Light’s View Very similar views Note how the color-coded images share similar pattern and the coloration is uniform. Implies single depth map resolution would work well for most of the scene. Ghosting is where projection would be in shadow.