Gouraud shading.

Started by
1 comment, last by DarkMatter2008 15 years, 2 months ago
Hello all, Just tried my hand at Gourand shadding from a formula found on a lecture slide here:- http://local.cis.strath.ac.uk/teaching/ug/classes/52.359/lect13.ppt This was my result:- http://i459.photobucket.com/albums/qq319/y_s_wheeler/brokenshading.jpg Does this formula take for granted the vector order? I have experimenting with this, here is a better result:- http://i459.photobucket.com/albums/qq319/y_s_wheeler/brokenteappot2.jpg Does anybody know whats going on?> Thanks in advance. Update Rotation along the z axis changes the shading. despite the source i've read saying gouruad shading is rotationally inveriant with triangles. [Edited by - DarkMatter2008 on January 25, 2009 12:12:58 PM]
Advertisement
Perhaps I'm wrong, but IIRC Gouraud interpolates the illumination calculated on each vertex using the respective normal. If the normal is not shared and is truly perpenducular to the plane of the polygon it belongs to, the results are similar to your pictures. Or I didn't fully understand your issue.
Hope this helps...
The light intensities of the verticies were not the issue as they were calculated from the resulting lighting average of the polys that share it. I found that equation in a number of books which was recomended to be used with triangles, in one book it clamed that the resulting shading was rotational invarient, but as you see with the examples i have shown this is not the case. I decided to go with this method of Gouraud shading here:-

http://freespace.virgin.net/hugo.elias/graphics/x_polygo.htm

Part of the shading process is combined with the scan converter, the light intensities for left and right of the scan are calculated along with the line. Then when it comes to shading the poly it becomes a simple process of working out the gradient of the shade from left to right. This result has worked the best for me.

This topic is closed to new replies.

Advertisement