Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University
Contents Illumination Models Shading Models for Polygons Surface Detail Shadows Transparency Global Illumination Recursive Ray Tracing Radiosity The Rendering Pipeline
Illumination Models Ambient Light: :intensity of the ambient light :ambient-reflection coefficient: 0~1 Diffuse reflection: :point light source’s intensity :diffuse-reflection coefficient: 0~1 :angle:
Diffuse Reflection
Examples
Illumination Models :light-source attenuation factor If the light is a point source Diffuse reflection: where is the distance the light travels from the point source to the surface
Examples
Colored Lights and Surfaces If an object’s diffuse color is where for the red component however, it should be generally where is the wavelength then
Specular Reflection
The Phong Illumination Model : specular-reflection coefficient: 0~1 So, the Eq. can be rewritten as: Consider the object’s specular color: : specular color
The Phong Model
The Phong Illumination Model
Examples
Calculating the Reflection Vector
The Halfway Vector
Multiple Light Sources If there are m light sources, then
Shading Models for Polygons Constant Shading Faceted Shading Flat Shading Gouraud Shading Intensity Interpolation Shading Color Interpolation Shading Phong Shading Normal-Vector Interpolation Shading
Constant Shading Assumption The light source is at infinity The viewer is at infinity The polygon represents the actual surface being modeled and is not an approximation to a curved surface: Note that N.L ,N.V are constant across the polygon face
Gouraud Shading
Gouraud v.s. Phong Shading
Phong Shading
Texture Mapping = Pattern Mapping
Bump Mapping & Displacement Mapping
Shadows If light I is blocked at this point If light I is not blocked at this point
Shadows If light I is blocked at this point If light I is not blocked at this point
Scan-Line Generation of Shadows
Shadow Volumes
Shadow Volumes
Shadow
Transparency Interpolated transparency : transparency: 0~1 Filtered transparency :transparency color
Global Illumination Direct & indirect (reflected) light sources
The Rendering Equation : intensity passing from to : emitted light intensity from to : intensity of light reflected from to from the surface at (indirect light sources) : the distance between and : all surfaces if is invisible from if is visible from
Recursive Ray Tracing surface normal reflected ray shadow ray transmitted ray
Recursive Ray Tracing surface normal reflected ray shadow ray transmitted ray
Traditional Ray Tracing
Ray Tracing + Soft Shadows
The Ray Tree Intensity of reflected ray Transmission coefficient :0~1 Intensity of transmitted ray
The Radiosity Equation : radiosity of patch i : rate at which light is emitted form patch i : reflectivity of patch i : form factor (configuration factor) : area of patch i Since Thus
The Radiosity Equation Rearranging terms Therefore Progressive refinement
Radiosity vs. Ray Tracing Ray traced image. Image rendered with radiosity. Original
Computing Form Factors
Hemisphere
Hemicube
The Rendering Pipeline Local Illumination Pipelines z-buffer and Gouraud shading z-buffer and Phong shading List-priority algorithm and Phong shading Global Illumination Pipelines Radiosity Ray tracing
Rendering Pipeline for z-buffer & Gouraud Shading
Rendering Pipeline for z-buffer & Phone shading
Rendering Pipeline for List-priority Algorithm & Gouraud Shading
Rendering Pipeline for List-priority Algorithm & Phong Shading
Rendering Pipeline for Ray Tracing