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 3 of 3

Thread: Gouraud Texture shading

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2002
    Posts
    27

    Gouraud Texture shading

    Hi,
    (This question has actually been asked before but not answered, so let's try again...)

    I need to use the texture equivalent of gouraud shading on a triangle. That is, somehow assign a differet texture to each vertex - and smoothly shade the triangle.
    Multitexturing/env_combine/multipass texturing have great blending capabilities - but these seem to be per triangle. I.e., you can't change textures between glBegin() and glEnd(). At least, I could not find a way to do so.
    To sum up, does anyone know how to assign different texture images to vertices in order to smoothly shade these textures across a single triangle?

    thx

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jan 2001
    Posts
    181

    Re: Gouraud Texture shading

    multitexturing is per pixel. if you would have three texture units, you could bind all three textures once and blend between them in one pass over the triangle.
    a working example i do not have in mind yet, so try to figure out it by yourself.

    regards,
    jan

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jul 2001
    Location
    IL
    Posts
    113

    Re: Gouraud Texture shading

    Continuing the above (binding and activating 3 texture units). Assign per-vertex colors (1,0,0) (0,1,0) and (0,0,1). The color interpolator gives you then in (r,g,b) the 3 weights for the 3 texture units. Use register combiners to compute r*tex0 + g*tex1 + b*tex2

Posting Permissions

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