Shadows: Shadow Mapping. Justin Reynolds CS 134. Problems with Common Shadow Techniques. Various limitations Projected planar shadows Only works well on flat surfaces Stenciled shadow volumes Determining the shadow volume is hard work. Another Technique: Shadow Mapping.
the pointlight source
FYI: from theeye’s point-of-viewagain
FYI: from thelight’s point-of-viewagain
FYI: depth map forlight’s point-of-viewagain
Green is where the light planar distance and the light depth map are approximately equal
Non-green is where shadows should be
Render depth buffer (Z-buffer) from lights point of view,
resulting in a shadow map or depth map
Now, render scene from the eye’s point of view
for all rasterized fragments do
Determine fragment’s xyz position relative to the light
That is transform each fragment’s xyz into the light’s coordinate system
A = depth map(x,y)
B = z-value of fragment’s xyz light position
if A < B then
fragment is shadowed
fragment is lit
Notice that shadow edge is well defined in the distance.
Light position out here pointing towards the viewer.
Blocky shadow edge artifacts.