Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Outline
Polygon shading algorithms:
Constant shading Gouraud shading Phong shading
Polygon Shading
Result comparison.
Minglun Gong
Constant Shading
Also called faceted shading or flat shading. A single color is used for the entire polygon. Valid for:
Objective:
Calculate the color for all visible polygons under the given lighting condition
Question:
How to efficiently compute the color for different pixels covered by a given polygon
Monday, March 19, 2012 Minglun Gong 3
N I
Gouraud Shading
Also called intensity/color interpolation shading.
Proposed by Gouraud in 1971.
IA I1 IB ID I I2
IC
Minglun Gong
Minglun Gong
3/19/2012
Artifacts:
Missing highlights. Irregular shaped highlights. Highlight appears around the edges.
7 Monday, March 19, 2012 Minglun Gong 8
Minglun Gong
Phong Shading
Also known as normalvector interpolation shading.
Proposed by Phong in 1975. Different from Phong illumination.
N1 NB NC NA
ND N2
Minglun Gong
Minglun Gong
10
3/19/2012
Orientation Dependency
When rotating camera, the color on the surface may change. Orientation 1:
I=((IA+IB)+(IC+ID)) = (IA+IB+IC+ID) I = (IB + ID) Use orientation independent interpolation approach.
IB I ID IA I IB IA IC ID
Both Gouraud shading and Phong shading algorithms have these limitations.
Orientation 2: Solution:
IC
Minglun Gong 14
Minglun Gong
13
Jaggy Silhouettes
The shading inside the object looks smooth, but the silhouette edges may look jaggy. Interpolation in image space also ignores perspective distortion. Solution:
Use more facets to approximate the object
32 triangles
N NA
512 triangles
Minglun Gong
15
Minglun Gong
16