I am in a computer graphics course and have just passed the lecture on Phong and Gouraud shading. I didn't really understand what was being said, so I turned to the textbook for clarification and found a workable example that might help me out. I'd like to discuss this example with you all.
The example says:
During triangle rasterization we are using Gouraud interpolation
of colors across a triangle to determine the colors of pixels.The triangle we are
rendering has vertices A, B, and C, with screen-space coordinates A = (30,10),
B = (30,50), and C = (60, 30).
The vertices have these RGB colors:
Ac = (25, 160, 30)
Bc = (25, 110, 30)
Cc = (25, 115, 30)
What are the RGB colors are point (a.) (30,30) and point (b.) (45, 30)?
For (a)
I spose the R and B values of A and B - they are the same, and then, since 30 lies right between 10 and 50... take the average of A and B's color value for G.
So (25, 135, 30) is the point's color values. I'll use this value in the next problem - so let's call it point M.
For (b)
the only point we have with a 30 as their y coordinate is C. Point M is at (30,30). So, since (30,30) and (60,30) have the same R and B values... I assume they are the same for the (45, 30) one. Again,we just average out the G value, since 45 is exactly between 30 and 60.
So the answer is (25, 125, 30).
So my question is - is this correct? If so - is this what is meant by interpolation - this sort of...averaging? How does Phong shading differ from this?
Gouraud is making interpolation between intensity which is faster. Phong is doing interpolation between normals which is more expensive, but you achive better quality, more smooth. You don't have discontinuity. To achive same quality Gouraud need much bigger sampling rate.