<p>The difference is in the number of lighting calculations done. Where the lighting calculation produces some color.</p>
<p>Flat does one per face, uses the color across the face.</p>
<p>Gourand does 3 (for a triangle, one for each vertex), interpolates the color across the face.</p>
<p>Phong does a light calculation for every pixel/fragment (where the normal is interpolated across the face).</p>
<p><a href="https://i.sstatic.net/fyAFK.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fyAFK.jpg" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-04-25T19:25:46.680Z
So essentially gouraud calculates a color at 3 points and interpolates each of those 3 colors together  for each pixel making up the image of the triangle?
Hash
CC BY-SA 4.0
2021-04-25T21:39:16.083Z
Yup, with barycentric coordinates color = u * postLitColorV1 + v * postLitColorV2 + w * postLitColorV3. You can often tell when the triangles are large. I added an image. So you can see the differences in the specular highlight, bright where the normal is perpendicular to the viewing angle. In gourand this would only be at that one vertex, but in phong the normal is smoothly interpolated across the face
Andrew Wilson
CC BY-SA 4.0
2021-04-26T15:07:45.643Z
What exactly does postLitColor mean here and what is a Barycentric coordinate mean in this context? Ive tried reading into the latter, and Im quite not able to grasp it and how it gives us the triangle color

And to make sure, Phong : Calculates per pixel, shades each pixel, Gouraud : Calculates 3 vertices, shades each pixel after interpolating them based on their distance to the 3 vertices right?
Hash
CC BY-SA 4.0
2021-04-26T18:30:15.253Z
postLitColor refers to the color obtained from the lighting equation at that particular vertex, since that is the only time the lighting model is evaluated in Gouraud shading. Once you have the color values for the three vertices, you can linearly interpolate them for any point inside the triangle using a local coordinate system (u,v,w) where V1=(1,0,0), V2=(0,1,0) and V3=(0,0,1). The Wikipedia article on Barycentric coordinates has a section on triangular coordinates and conversion to/from Cartesian coordinates.
Scott McKinney
CC BY-SA 4.0
2021-04-26T19:47:52.660Z
A simple example of a possible light equation would be postLitColor= diffuseColor * dot(lightDir, normal(x)), where diffuseColor is a constant set by you, lightDir is a 3 component vector giving a directional light, and normal(x) evaluates the normal of the surface at x.
Andrew Wilson
CC BY-SA 4.0
2021-04-25T19:15:57.837Z
2021-04-25T21:39:53.277Z
2021-04-25T21:39:53.277Z
Andrew Wilson
<p>I'm a super beginner to GFX. So far I've learned about 3 shading models when rendering meshes
The first is <strong>Flat Shading</strong>. I seem to understand this, from my understanding, you take the normal of the face/polygon, apply your lighting model based on that, and the light angle, and other parameters and based on what you get, shade your polygon with  a single color, done.</p>
<p>I've learned about Phong Shading as well. Apparently Phong Shading takes the normals of the vertices of the polygon, and interpolates them for each pixel, thus sort of 'creating' a normal per every pixel, and shade accordingly. It is shaded per pixel, and as such you get smooth results</p>
<p>Gouraud shading is what I am most confused by. I referred to many online sources including this <a href="https://www.javatpoint.com/computer-graphics-gouraud-shading" rel="nofollow noreferrer">one</a> and what I dont understand is how exactly the polygon is shaded? Is it shaded per pixel?</p>
<p>From my understanding, Gouraud is the same as Phong shading except that unlike Phong interpolating vertex normals, and creates normals  for every pixel and shading each pixel, Gouraud interpolates just the vertex normals of the polygon.</p>
<p>Im not quite sure what it does after that. Does it take these interpolated vertex normals and shade the polygon in a single color? Does it shade pixel by pixel just like Phong?</p>

<shading>
How exactly does Gouraud shading apply color across a polygon? Does it do it by pixel or is it some other method?
Hash
# How exactly does Gouraud shading apply color across a polygon? Does it do it by pixel or is it some other method?

(Asked by: username_0 on 2021-04-25)

I'm a super beginner to GFX. So far I've learned about 3 shading models when rendering meshes
The first is **Flat Shading**. I seem to understand this, from my understanding, you take the normal of the face/polygon, apply your lighting model based on that, and the light angle, and other parameters and based on what you get, shade your polygon with a single color, done.

I've learned about Phong Shading as well. Apparently Phong Shading takes the normals of the vertices of the polygon, and interpolates them for each pixel, thus sort of 'creating' a normal per every pixel, and shade accordingly. It is shaded per pixel, and as such you get smooth results

Gouraud shading is what I am most confused by. I referred to many online sources including this [one](https://www.javatpoint.com/computer-graphics-gouraud-shading) and what I dont understand is how exactly the polygon is shaded? Is it shaded per pixel?

From my understanding, Gouraud is the same as Phong shading except that unlike Phong interpolating vertex normals, and creates normals for every pixel and shading each pixel, Gouraud interpolates just the vertex normals of the polygon.

Im not quite sure what it does after that. Does it take these interpolated vertex normals and shade the polygon in a single color? Does it shade pixel by pixel just like Phong?

**Tags:** shading


---

## 1 answers

### Answer by username_1 on 2021-04-25. Score: 3 | Accepted answer

The difference is in the number of lighting calculations done. Where the lighting calculation produces some color.

Flat does one per face, uses the color across the face.

Gourand does 3 (for a triangle, one for each vertex), interpolates the color across the face.

Phong does a light calculation for every pixel/fragment (where the normal is interpolated across the face).

[![enter image description here](https://i.sstatic.net/fyAFK.jpg)](https://i.sstatic.net/fyAFK.jpg)

> **Comments:**
> **username_0**: So essentially gouraud calculates a color at 3 points and interpolates each of those 3 colors together  for each pixel making up the image of the triangle?  
> **username_1**: Yup, with barycentric coordinates color = u * postLitColorV1 + v * postLitColorV2 + w * postLitColorV3. You can often tell when the triangles are large. I added an image. So you can see the differences in the specular highlight, bright where the normal is perpendicular to the viewing angle. In gourand this would only be at that one vertex, but in phong the normal is smoothly interpolated across the face  
> **username_0**: What exactly does postLitColor mean here and what is a Barycentric coordinate mean in this context? Ive tried reading into the latter, and Im quite not able to grasp it and how it gives us the triangle color  And to make sure, Phong : Calculates per pixel, shades each pixel, Gouraud : Calculates 3 vertices, shades each pixel after interpolating them based on their distance to the 3 vertices right?  
> **username_2**: postLitColor refers to the color obtained from the lighting equation at that particular vertex, since that is the only time the lighting model is evaluated in Gouraud shading. Once you have the color values for the three vertices, you can linearly interpolate them for any point inside the triangle using a local coordinate system (u,v,w) where V1=(1,0,0), V2=(0,1,0) and V3=(0,0,1). The Wikipedia article on Barycentric coordinates has a section on triangular coordinates and conversion to/from Cartesian coordinates.  
> **username_1**: A simple example of a possible light equation would be postLitColor= diffuseColor * dot(lightDir, normal(x)), where diffuseColor is a constant set by you, lightDir is a 3 component vector giving a directional light, and normal(x) evaluates the normal of the surface at x.  

---

