polygon rendering methods

14
POLYGON RENDERING METHODS RENDERING RENDERING means giving proper means giving proper intensity at each point in a graphical intensity at each point in a graphical object to make it look like real 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.

Upload: anija-nair

Post on 17-Oct-2014

201 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Polygon Rendering Methods

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.

Page 2: Polygon Rendering Methods

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

Page 3: Polygon Rendering Methods

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.

Page 4: Polygon Rendering Methods

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.

Page 5: Polygon Rendering Methods

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.

Page 6: Polygon Rendering Methods

1

2 3

45

p

Page 7: Polygon Rendering Methods

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.

Page 8: Polygon Rendering Methods

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

Page 9: Polygon Rendering Methods

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

Page 10: Polygon Rendering Methods

Interpolation of surface normals along a polygon edgeInterpolation of surface normals along a polygon edge

Scan line

N1

N2

N

N3

Page 11: Polygon Rendering Methods

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

Page 12: Polygon Rendering Methods

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.

Page 13: Polygon Rendering Methods

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.

Page 14: Polygon Rendering Methods

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.