This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
| Three-dimensional (3D) computer graphics |
|---|
| Fundamentals |
| Primary uses |
| Related topics |

Gouraud shading (/ɡuːˈroʊ/goo-ROH), named afterHenri Gouraud, is aninterpolation method used incomputer graphics to produce continuousshading of surfaces represented bypolygon meshes. In practice, Gouraud shading is most often used to achieve continuous lighting ontriangle meshes by computing the lighting at the corners of each triangle andlinearly interpolating the resulting colours for eachpixel covered by the triangle. Gouraud first published the technique in 1971.[1][2][3] However, enhanced hardware support for superior shading models has yielded Gouraud shading largely obsolete in modern rendering.
Gouraud shading works as follows: An estimate to thesurface normal of eachvertex 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. thePhong reflection model, are then performed to produce colour intensities at the vertices. For eachscreen pixel that is covered by the polygonal mesh, colour intensities can then beinterpolated from the colour values calculated at the vertices.

Gouraud shading is considered superior toflat shading and requires significantly less processing thanPhong shading, 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 asspecular highlights, 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 byincreasing the density of vertices in the object, at some point thediminishing returns of this approach will favour switching to a more detailed shading model.
Gouraud's original paper described linear color interpolation.[1] In 1992, Blinn published an efficient algorithm for hyperbolic interpolation[4] that is used inGPUs 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".
Any linear interpolation of intensity causes derivative discontinuities which triggersMach bands, a common visual artifact of Gouraud shading.