polygon rendering methods
TRANSCRIPT
POLYGON RENDERING METHODS
• RENDERINGRENDERING means giving proper intensity at each means giving proper intensity at each
point in a graphical object to make it look like real point in a graphical object to make it look like real
world object.world object.
• Different Rendering Methods are Different Rendering Methods are
– Constant Intensity Shading.Constant Intensity Shading.
– Gouraud Shading.Gouraud Shading.
– Phong Shading.Phong Shading.
– Fast Phong Shading.Fast Phong Shading.
CONSTANT INTENSITY CONSTANT INTENSITY SHADINGSHADING
• Also Called Flat ShadingAlso Called Flat Shading
• Fast and Simple MethodFast and Simple Method
• A single intensity is calculated for each A single intensity is calculated for each
polygon( in the polygon-mesh)polygon( in the polygon-mesh)
• All points in the surface of polygon are displayed All points in the surface of polygon are displayed
with the same intensity value.with the same intensity value.
N1
N2
N3
N4
For Getting Good Results Through For Getting Good Results Through Constant Intensity ShadingConstant Intensity Shading
• Object is a polyhedron.Object is a polyhedron.
• Light sources illuminating the object Light sources illuminating the object
are sufficiently far from the surfaceare sufficiently far from the surface
• The viewing position is sufficiently far The viewing position is sufficiently far
from the surface.from the surface.
GOURAUD SHADINGGOURAUD SHADING
• Intensity interpolation scheme developed by Intensity interpolation scheme developed by
Gouraud.Gouraud.
• Represents a polygon surface by linearly interpolating Represents a polygon surface by linearly interpolating
intensity across the polygon surface.intensity across the polygon surface.
• Intensity values for each polygon are matched with Intensity values for each polygon are matched with
adjacent polygon along common edges.adjacent polygon along common edges.
• Eliminates the intensity discontinuity that can occur in flat Eliminates the intensity discontinuity that can occur in flat
shading.shading.
Polygon surface is represented by the Polygon surface is represented by the following calculations:following calculations:
1.1. Determine the average unit vector at Determine the average unit vector at each polygon vertex.each polygon vertex.
2.2. Apply an illumination model to each Apply an illumination model to each vertex to calculate the vertex intensity.vertex to calculate the vertex intensity.
3.3. Linearly interpolate the vertex intensities Linearly interpolate the vertex intensities over the surface of the polygon.over the surface of the polygon.
1
2 3
45
p
AdvantagesAdvantages
It removes intensity discontinuities associated with flat It removes intensity discontinuities associated with flat
shading.shading.
DisadvantagesDisadvantages
Highlights on the surface are sometimes displayed in Highlights on the surface are sometimes displayed in
irregular shapes.irregular shapes.
Linear intensity interpolation can cause intensity stripe Linear intensity interpolation can cause intensity stripe
called called Mach bandsMach bands, to appear on the surface., to appear on the surface.
Phong ShadingPhong Shading
• Normal Vector Interpolation ShadingNormal Vector Interpolation Shading
• Developed by Developed by Phong Bui TuongPhong Bui Tuong
• Accurate method Accurate method
• Displays more realistic highlights Displays more realistic highlights
• Reduces Reduces Mach bandMach band effect effect
• Interpolate normal vectors and then apply illuminationInterpolate normal vectors and then apply illumination
Polygon surface is rendered using the following Polygon surface is rendered using the following steps :steps :
• Determine the average unit normal vector at each Determine the average unit normal vector at each
polygon vertexpolygon vertex
• Linearly interpolate the vertex normals over the Linearly interpolate the vertex normals over the
surface of the polygonsurface of the polygon
• Apply an illumination model along each scan line to Apply an illumination model along each scan line to
calculate projected pixel intensities for the surface calculate projected pixel intensities for the surface
pointspoints
Interpolation of surface normals along a polygon edgeInterpolation of surface normals along a polygon edge
Scan line
N1
N2
N
N3
Advantages n Advantages n DisadvantagesDisadvantagesAdv.Adv.
• Intensity calculations Intensity calculations produce more accurate produce more accurate resultsresults
• Displays more Displays more realistic highlightsrealistic highlights on the surface on the surface
• Greatly reduces the Greatly reduces the Mach-bandMach-band effect. [The effect. [The Mach Mach band effectband effect exaggerates the change in intensity exaggerates the change in intensity at any boundary where there is a discontinuity in at any boundary where there is a discontinuity in magnitude or slope of intensity.]magnitude or slope of intensity.]
Dis adv.Dis adv.
• Requires Requires more calculationsmore calculations
Fast Phong ShadingFast Phong Shading
• It is a goal of any one writing It is a goal of any one writing
a 3D engine.a 3D engine.
• Phong shading is still Phong shading is still
common in 3D system.common in 3D system.
• It is faster and easier way to It is faster and easier way to
approximate the intensity approximate the intensity
calculation.calculation.
Phong shading is more realistic than Gouraud Phong shading is more realistic than Gouraud
shading, but requires more computation.shading, but requires more computation.
Phong shading using differences takes about six Phong shading using differences takes about six
to seven time longer than Gouraud shading.to seven time longer than Gouraud shading.
Limitations in the normal phong shading lead to Limitations in the normal phong shading lead to
the development of fast-phong shading the development of fast-phong shading
technique.technique.
Fast Phong ShadingFast Phong Shading
• Surface Rendering can be speeded up by Surface Rendering can be speeded up by
using approximations in the illumination-using approximations in the illumination-
model calculations of normal vectors.model calculations of normal vectors.
• It approximates the intensity calculations It approximates the intensity calculations
using a Taylor-series expansion and triangular using a Taylor-series expansion and triangular
surface patches.surface patches.
• Rendering is faster than the normal Phong Rendering is faster than the normal Phong
shading.shading.