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 camera Light source (intensity I) Image plane ϴLϴL ϴVϴ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 camera Light sourceImage plane ϴLϴL ϴVϴV
Specular Reflection Portion of light directly reflected from surface, only visible if ϴ V = ϴ L (Snell’s law) Surface in image Not visible Light source ϴLϴL ϴVϴ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)