Anda di halaman 1dari 3

What is the difference between

Ambient, Diffuse, and Specular reflection?

Ambient
� Approximates the effect of inter-reflections
� Sourceless – constant over entire surface
� Does not depend on surface normal
� Does not vary based on viewpoint
Diffuse
� Models rough surfaces (e.g. paper or drywall) – where
light scatters
equally in all directions
� Has a point or directional source
� Depends on surface normal – brightest where the
surface is oriented
toward the light, and falls off to zero at 90°
� Does not vary based on viewpoint
Specular
� Models highlights from smooth, shiny surfaces (e.g.
opaque plastic)
� Has a point or directional source
� Depends on surface normal
� Depends on viewpoint

Shading
Flat shading
• Entire surface (polygon) has one colour
• Cheapest to compute, and least accurate (so you need
a dense
triangulation for decent-looking results)
• OpenGL – glShadeModel(GL_FLAT)
Phong shading
• Compute illumination for every pixel during scan
conversion
• Interpolate normals at each pixel too
• Expensive, but more accurate
• Not supported in OpenGL (directly)

Gouraud shading
• Just compute illumination at vertices
• Interpolate vertex colours across polygon pixels
• Cheaper, but less accurate (spreads highlights)
• OpenGL - glShadeModel(GL_SMOOTH)

Phong illumination
• Don’t confuse shading and illumination!
• Shading describes how to apply an illumination model
to a
polygonal surface patch
• All these shading methods could use Phong illumination
(ambient,
diffuse, and specular) or any other local illumination
model

Gouraud shading is a method used in computer


graphics to simulate the differing effects of light and
colour across the surface of an object. In practice,
Gouraud shading is used to achieve smooth lighting on
low-polygon surfaces without the heavy computational
requirements of calculating lighting for each pixel. The
technique was first presented by Henri Gouraud in 1971

The basic principle behind the method is to calculate the


surface normals at the vertices of polygons in a 3D
computer model. These normals are then averaged for all
the polygons that meet at each point. Lighting
computations are then performed to produce colour
intensities at vertices. The lighting calculation used by
Gouraud was based on the Lambertian diffuse lighting
model

These colour values are then interpolated along the


edges of the polygons. To complete the shading, the
image is filled by lines drawn across the image that
interpolate between the previously calculated edge
intensities.
ouraud shading is much less processor intensive than
Phong shading, but does not calculate all desirable
lighting effects as accurately. For instance, the white
shiny spot on the surface of an apple (called a specular
highlight) is highly dependent on the normal within that
spot. If a model's vertices are not within that spot, their
colors are blended across it, making it disappear
altogetherUsing Gouraud shading, the specular highlight
will appear mysteriously and grow in intensity as the light
moves toward a position of reflexion from the observer
across the vertex. The desired result would be to see the
highlight move smoothly rather than fade out and in
between vertices.

Anda mungkin juga menyukai