Professional Documents
Culture Documents
CG Lesson10 (En)
CG Lesson10 (En)
CG Lesson10 (En)
Illuminiation and
shading
Content
1. Overview
2. Illumination
3. Shading
1.
Overview
How lights can be seen?
■ Lighting
□ How to compute the color of objects according to
the position of the light, normal vector and camera
position
■ Shading
□ Different methods to compute the color of the
entire surface
2.
Lighting
Factors affecting lighting
Light source
Surface properties
Light source
■ Light’s properties
□ Spectrum of light source (i.e. light colour)
□ Geometry properties
▫ Position
▫ Direction
▫ Shape
□ Decline in intensity
Surface properties
■ Surface properties
□ Spectrum (i.e. surface’s colour)
□ Geometry properties
▫ Position
▫ Direction
▫ Microscope structure
Lighting
E.g. a sphere
Ambient light
I = ka Ia
□ I = resulting intensity
□ Ia = light intensity
□ ka = reflectance
E.g. a sphere
Example: Ambient light
What about this?
Diffuse light
Diffuse light
l n
Example: Diffuse Light
I = kd Ip cos
■ Ip: diffuse reflectivity
■ : the angle between the normal vector
direction towards the light
■ kd: Light Intensity
E.g. sphere
(light from the left)
Specular
Highlight
Specular reflection
l = r
Specular reflection
I = ksIp (cos )
nshiny
E.g. a sphere
𝐼 = 𝐼𝑎 𝑘𝑎 + 𝐼𝑝 𝑘𝑑 cos 𝜃 + 𝑘𝑠 cos 𝑛 𝜑
𝑝
Phong lighting model
( ) ( )
lights
I = k a I a + I p k d Nˆ Lˆ + k s Vˆ Rˆ
nshiny
i =1
□ V: Vector from the surface to the viewer
□ N: Normal vector at the colored point
□ R: Normalized reflection vector
□ L: Normalized vector from the colored
point towards the light source
3.
Shading
Overview
■ by Henri Gouraud
■ Computing the color per vertex by local
illumination model
■ Then, interpolating the colors within the
polygons
□ We can interpolate the color by barycentric
coordinates
Example scene: Goraud shading
Goraud shading: Problem
■ For specular
reflection, highlight falls
off with cosnα
■ Gouraud shading
linear interpolates –
makes highlight too
big.
■ Gouraud shading
may well miss a
highlight that occurs in
the middle of the face.
Phong shading
Special thanks to all the people who made and released these
awesome resources for free:
■ Presentation template by SlidesCarnival
■ Photographs by Death to the Stock Photo (license)
■ Diverse device hand photos by Facebook Design
Resources