HOME

TheInfoList



OR:

Gouraud shading, named after Henri Gouraud, is an interpolation method used in
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
to produce continuous
shading Shading refers to the depiction of depth perception in 3D models (within the field of 3D computer graphics) or illustrations (in visual art) by varying the level of darkness. Shading tries to approximate local behavior of light on the object's ...
of surfaces represented by polygon meshes. In practice, Gouraud shading is most often used to achieve continuous lighting on
triangle mesh In computer graphics, a triangle mesh is a type of polygon mesh. It comprises a set of triangles (typically in three dimensions) that are connected by their common edges or vertices. Many graphics software packages and hardware devices can ...
es by computing the lighting at the corners of each triangle and linearly interpolating the resulting colours for each
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the smal ...
covered by the triangle. Gouraud first published the technique in 1971.


Description

Gouraud shading works as follows: An estimate to the
surface normal In geometry, a normal is an object such as a line, ray, or vector that is perpendicular to a given object. For example, the normal line to a plane curve at a given point is the (infinite) line perpendicular to the tangent line to the curve at ...
of each
vertex Vertex, vertices or vertexes may refer to: Science and technology Mathematics and computer science *Vertex (geometry), a point where two or more curves, lines, or edges meet * Vertex (computer graphics), a data structure that describes the positio ...
in a polygonal 3D model is either specified for each vertex or found by averaging the surface normals of the polygons that meet at each vertex. Using these estimates, lighting computations based on a reflection model, e.g. the
Phong reflection model The Phong reflection model (also called Phong illumination or Phong lighting) is an empirical model of the local illumination of points on a surface designed by the computer graphics researcher Bui Tuong Phong. In 3D computer graphics, it is somet ...
, are then performed to produce colour intensities at the vertices. For each screen pixel that is covered by the polygonal mesh, colour intensities can then be
interpolated In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one often has a n ...
from the colour values calculated at the vertices.


Comparison with other shading techniques

Gouraud shading is considered superior to
flat shading Shading refers to the depiction of depth perception in 3D models (within the field of 3D computer graphics) or illustrations (in visual art) by varying the level of darkness. Shading tries to approximate local behavior of light on the object's ...
and requires significantly less processing than
Phong shading In 3D computer graphics, Phong shading, Phong interpolation, or normal-vector interpolation shading is an interpolation technique for surface shading invented by computer graphics pioneer Bui Tuong Phong. Phong shading interpolates surface norm ...
, but usually results in a faceted look. In comparison to Phong shading, Gouraud shading's strength and weakness lies in its interpolation. If a mesh covers more pixels in screen space than it has vertices, interpolating colour values from samples of expensive lighting calculations at vertices is less processor intensive than performing the lighting calculation for each pixel as in Phong shading. However, highly localized lighting effects (such as
specular highlight A specular highlight is the bright spot of light that appears on shiny objects when illuminated (for example, see image on right). Specular highlights are important in 3D computer graphics, as they provide a strong visual cue for the shape of a ...
s, e.g. the glint of reflected light on the surface of an apple) will not be rendered correctly, and if a highlight lies in the middle of a polygon, but does not spread to the polygon's vertex, it will not be apparent in a Gouraud rendering; conversely, if a highlight occurs at the vertex of a polygon, it will be rendered correctly at this vertex (as this is where the lighting model is applied), but will be spread unnaturally across all neighboring polygons via the interpolation method. The problem is easily spotted in a rendering which ought to have a specular highlight moving smoothly across the surface of a model as it rotates. Gouraud shading will instead produce a highlight continuously fading in and out across neighboring portions of the model, peaking in intensity when the intended specular highlight aligns with a vertex of the model. While this problem can be fixed by increasing the density of vertices in the object, at some point the
diminishing returns In economics, diminishing returns are the decrease in marginal (incremental) output of a production process as the amount of a single factor of production is incrementally increased, holding all other factors of production equal ( ceteris paribu ...
of this approach will favour switching to a more detailed shading model. Image:Gouraud_low_anim.gif, A Gouraud-shaded sphere-like mesh - note the poor behaviour of the specular highlight. Image:Gouraud_high.gif, Another sphere-like mesh rendered with a very high polygon count.


Linear vs. hyperbolic interpolation

Gouraud's original paper described linear color interpolation. In 1992, Blinn published an efficient algorithm for hyperbolic interpolation{{cite journal , last1=Blinn , first1=James F. , title=Hyperbolic Interpolation , journal=IEEE Computer Graphics and Applications , date=July 1992 , volume=12 , issue=4 , page=89-94 , doi=10.1109/MCG.1992.10028 , ref=blinn that is used in
GPUs A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobil ...
as a perspective correct alternative to linear interpolation. Both the linear and hyperbolic variants of interpolation of colors from vertices to pixels are commonly called "Gouraud shading".


Mach bands

Any linear interpolation of intensity causes derivative discontinuities which triggers
Mach bands Mach bands is an optical illusion named after the physicist Ernst Mach. It exaggerates the contrast between edges of the slightly differing shades of gray, as soon as they contact one another, by triggering edge-detection in the human visual s ...
, a common visual artifact of Gouraud shading.


See also

*
List of common shading algorithms {{Short description, none This article lists common shading algorithms used in computer graphics. Interpolation techniques These techniques can be combined with any illumination model: * Flat shading * Gouraud shading * Phong shading Illuminatio ...
*
Blinn–Phong reflection model The Blinn–Phong reflection model, also called the modified Phong reflection model, is a modification developed by Jim Blinn to the Phong reflection model. Blinn–Phong is the default shading model used in OpenGL and Direct3D's fixed-function ...
*
Phong shading In 3D computer graphics, Phong shading, Phong interpolation, or normal-vector interpolation shading is an interpolation technique for surface shading invented by computer graphics pioneer Bui Tuong Phong. Phong shading interpolates surface norm ...


References

Shading Virtual reality Computer graphics algorithms