View Full Version : gouraud shading
hi guys... http://www.opengl.org/discussion_boards/ubb/smile.gif
i want to know...can i produce Gouraud Shading using OpenGL? if it can...can u guys out there show me how to do the source codes?
glShadeModel(GL_SMOOTH) to enable gouraud shading. But you shouldn't have to do anything at all to get gouraud, because it's enabled by default.
nikopol0
09-26-2000, 05:23 AM
hum, just don't forget to give one normal by vertex ...
i dun quite understand actually...can u explain it a lil more detail?
Gouraud shading is enabled by default, and there is nothing you have to do to enable it. Just try it out by passing a triangle with different colors for each vertex.
glBegin(GL_TRIANGLES);
glColor3f(...);
glVertex3f(...);
glColor3f(...);
glVertex3f(...);
glColor3f(...);
glVertex3f(...);
glEnd();
... for example. Just insert proper values and run.
Normals is just for lightning and sphere mapping (in the core at least, not counting extensions).
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.