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

Thread: glColorMaterial().

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Bangalore, Karnataka,India
    Posts
    17

    glColorMaterial().

    Hi All,
    I want to know whay glCOlorMaterail() is used. I read that "The command glColorMaterial() is used to minimize the performance costs associated with changing material properties. This command should be used whenever a single material property, such as diffuse color, must be changed for most vertices in the scene. Any change to the current color made by a call to glColor() immediately updates the material property specified by glColorMaterial()".

    But I couldn't get anything from this on how, It effects lighting and glMaterialFv().

    Deek**** M

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: glColorMaterial().

    Hi !

    It is just another way of changing material properties that is useful if you have a lot of triangles/lines/points that use the same material execept for example the diffuse color, you can then use glColor to just update the diffuse color or any other material property pretty fast.

    the alternative is to use glMaterial...

    Mikael

Posting Permissions

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