PDA

View Full Version : Normals and gouraud shading ?



phanie
07-12-2001, 06:15 AM
Hi !
can somebody else tell me what is exactly gouraud shading ?
in my code :
1) i define normals for each of my facets
2) i calculate normals for each vertex, by averaging the neighboring facets normals

what is the behaviour of OpenGL with such normals, and what Gouraud shading can add ?

thanks
phanie

DFrey
07-12-2001, 07:18 AM
Gouraud shading is independent of vertex normals. Except if you have lighting enabled in which case it is only indirectly dependent on the vertex normals. What you get from Gourard shading is a simple pseudo surface smoothing effect, and a better appearance overall.

Rob The Bloke
07-12-2001, 04:26 PM
ie, colours are computed at each vertex and interpolated (blended) across the surface. These colours can be specified with glColor*() or if lighting is enabled, these colours are computed using the lighting equations. Here the vertex normals are used to calculate the colour (and other stuff like lighting properties, material properties etc).

Gouraud shading falls down if the polygon is very large and a light patch should appear in the center. This is because only lighting at the vertices is calculated. Phong shading is the next step up, but takes a lot longer to calculate. If you get this problem, subdivide your polygons.

phanie
07-13-2001, 12:30 AM
thanks for your answers ! http://www.opengl.org/discussion_boards/ubb/smile.gif

almok
07-13-2001, 01:13 AM
Gouraud shading falls down if the polygon is very large and a light patch should appear in the center. This is because only lighting at the vertices is calculated. Phong shading is the next step up, but takes a lot longer to calculate. If you get this problem, subdivide your polygons.

I have a similar problem.
I have a big wall and I want to light this in
the center.
How subdivide the wall?

Rob The Bloke
07-13-2001, 05:17 AM
split your 1 polygon into say 4x4 polys or 101x polys etc. All depends on the size of the area