lec 8 - surface rendering and shading Flashcards
What shading techniques are there?
flat shading and full shading
What is flat shading?
When you compute the shading at some
representative point of each (visible) polygon face (may be a vertex, or the centroid of the face, assuming it lies within the face). Then use this computed value to fill the whole polygon.
What is full shading?
do the complete shading calculation at each pixel as the polygon is displayed
What are some problems of flat shading?
- the same value is used to render the entire polygon,
- it misses out on shading variations.
It is therefore realistic only for distant viewer and distant light source.
When are either flat shading or full shading inappropriate?
If our polyhedron is really intended as an approximation to a curved object.
Why are either flat shading or full shading inappropriate for curved surfaces?
The discontinuities in surface normal where the face meet will lead to artefactual discontinuities in the shading.
What are alternatives to either flat shading or full shading?
Gouraud shading and Phong shading. In both, compute an “average” surface normal at each visible vertex, by averaging the normals of the faces that meet
there.
What is Gouraud shading?
Normalised polygon surface normals averaged to obtain vertex normals in Gouraud shading
How do you calculate surface normals?
Assuming all polygons store vertices in same walking order, the sign for surface normals should be correct and obtained simply calculating the cross products of the vectors (p2 - p1) and (p3 - p2), where p1, p2 and p3 are the points that make up the polygon.
How does Gouraud shading work?
In Gouraud shading, compute the shading at each vertex.
When filling a polygon in a scan-line fashion, interpolate the shading linearly along each edge, and then interpolate linearly along each scan-line segment
What is Gouraud shading also known as?
intensity interpolated shading.
Is Gouraud shading dependant on orientation?
yes, The results of interpolated-shading is not independent of the projected polygons position
When do you get perspective distortion with Gouraud shading?
you have a polygon with vertex 1 more distant than vertex 2.
In this case you get perspective distortion, since perspective foreshortening means that the difference from one scan line to another increases in the direction of the further coordinate.
What are the side effects of perspective distortion with Gouraud shading?
you can get polygonal silhouettes and
edges can look weird.
What is Phong Shading?
Phong shading is similar to Gouraud, except interpolate the surface normals, and do full shading calculation at every pixel
using these interpolated normals