lighting csis 5838: graphics and animation for gaming
TRANSCRIPT
Lighting
CSIS 5838: Graphics and Animation for Gaming
Terminology
• ϴL: Incident light angle to point on surface
• ϴV: Incident viewing angle to point on surface• K: Intensity of light source
Surface in image
Focal point of cameraLight source(intensity I)
Image plane
ϴLϴV
Reflected Light
• Amount of light received by surface proportional to K cos(ϴL) Light source
Light concentrated in smallest area at ϴL = 90°
Light more “spread out” at smaller ϴL
Shape from Shading
• Brain reverses this process, interpolating shape from shading across surface– No variation in lighting flat surface– Slow variation in lighting curved surface– Sharp variation in lighting corners
Smooth Shading
• Can create illusion that non-curved surface is curved– More efficient than adding large number of vertices
• Interpolate curve through series of edges– Often done with Bezier curves (built into Blender)
• Render image based on interpolated curves, not actual surface
Diffuse Reflection
• Portion of light “scattered” from surface, reflecting in all directions ϴV
Surface in image
Focal point of cameraLight sourceImage
plane
ϴLϴV
Specular Reflection
• Portion of light directly reflected from surface, only visible if ϴV = ϴL (Snell’s law)
Surface in image
Not visibleLight source
ϴL
ϴV
visible
Specular Reflection in Blender
• “Hardness” parameter defines additional angles at which specular light visible
• Light intensity function of |ϴL - ϴv|/hardness
ϴL - ϴV
Intensity
Hardness = 20
Hardness = 2
Lambertian Model
• Assumption: Amount of light reflected in direction ϴV = K cos(ϴV)– Most light reflected
normal to surface– Less light reflected
parallel to surface
Lambertian Model
• Amount of surface projected to camera inversely proportional to ϴV
• = 1/cos(ϴV) Light source
Smallest surface at ϴv = 90°
More surface at smaller ϴV
Lambertian Model
• Amount of light received by camera =K cos(ϴV) * 1/cos(ϴV)
• Lambertian assumption: Amount of light percieved independent of viewing direction– Simplest to compute– Close to being true for many surfaces (moon)