Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: gouraud shading

  1. #1
    Guest

    gouraud shading

    hi guys...

    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?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: gouraud shading

    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.

  3. #3
    Intern Newbie
    Join Date
    Jul 2000
    Location
    Paris, France
    Posts
    43

    Re: gouraud shading

    hum, just don't forget to give one normal by vertex ...
    -G-

  4. #4
    Guest

    Re: gouraud shading

    i dun quite understand actually...can u explain it a lil more detail?

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: gouraud shading

    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.
    Code :
    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •