Shadows D. Crowley, 2008. Shadows To know how shadows are formed.
Shadows
3
CSE 681 Shadows
description
Shadows. Testing for shadows. For each light source i If face is backface wrt light source (called self-shadowing ) Set IN-SHADOW to TRUE else Set IN-SHADOW to FALSE Construct ray from point to light source For each object Test ray-object intersection (between point and l.s.) - PowerPoint PPT Presentation
Transcript of Shadows
CSE 681
Shadows
CSE 681
Testing for shadows
CSE 681
Pseudo-code
For each light source iIf face is backface wrt light source (called self-shadowing)
Set IN-SHADOW to TRUEelse
Set IN-SHADOW to FALSEConstruct ray from point to light sourceFor each object
Test ray-object intersection (between point and l.s.)If intersection found
Set IN-SHADOW to TRUE for this light sourceBreak out of object loop
If (NOT IN-SHADOW) add in effect of light source Iaccumulate diffuse lightaccumulate specular light