You are on page 1of 16

Shading

1
2
• The different parameters that influence the
appearance of objects are the light intensity
or direction, the orientation of the surface of
objects with regard to light sources, the color
of objects, etc.

3
Shading Models

• There are three main shading


1.  flat shading; 
2. Gouraud shading; 
3. Phong shading.

4
Flat Shading
• This is the most simple and efficient way to specify color
for an object.
• Flat shading of a polygon assumes that each polygon is
strictly planar and all the points on the polygon have
exactly the same kind of lighting treatment.
• This shading technique thus displays all the points in a
polygon with a single color.
• It defines a single color for a face. Implementations of it
may vary, but the main idea is that we use only one surface
normal per polygon.
• The color itself is uniform (unchanging) on that polygon.
5
6
7
Gouraud Shading (per vertex)

• This was invented as an improvement to allow for


more smooth transitions of the color on round
objects.
• It is the interpolation technique.
• Intensity levels are calculated at each vertex and
interpolated across the surface.

8
• Intensity values for each polygon are
matched with the values of adjacent
polygons along the common edges.
• This eliminates the intensity discontinuities
that can occur in flat shading.

9
10
Advantages:
i. It removes the intensity discontinuity which
exists in constant shading model.
ii. It can be combined with hidden surface
algorithm to fill in the visible polygons along
each scan line.

11
Disadvantages:
i. Gouraud shading has a problem with
specular reflections.
ii. Gouraud shading can introduce anomalies
known as Mach bands.

12
Phong shading
• A more accurate interpolation based
approach for rendering a polygon was
developed by Phong Bui Tuong.
• Phong shading improves upon Gouraud
shading and provides a better
approximation of the shading of a smooth
surface.
• It interpolates normal vectors instead of
intensity values. 13
• Phong shading assumes a smoothly varying
surface normal vector.
• Basically the Phong surface rendering
model is also called as normal-vector
interpolation rendering.

14
• Advantages:
• i. It displays more realistic highlights on a
surface.
• ii. It greatly reduces the Mach band effect.
• iii. It gives more accurate results.

15
• Disadvantages:
• It requires more calculations and greatly
increases the cost of shading steeply.

16

You might also like