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: Material problems

  1. #1
    Intern Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    54

    Material problems

    Well, let's expose the problem :
    When i change the material colors (diffuse etc) parameters with glMaterial(), and without enabling GL_COLOR_MATERIAL, i get what i want and everything is beautiful. But when i enable GL_COLOR_MATERIAL to use glColor(), the objetct becomes white. OK, I read the help : the current color (1,1,1,1) is assigned to the current material color (ambient_and_diffuse) that's why all is white. BUT why does glMaterial() not change anything ? I mean, i change the ambient and diffuse colors after this with glMaterial(), but the colors stay the same or are not what i expected to be !
    So what's my problem ? Can't glMaterial() and glColor() get together ? What did I miss ?

    Antoche

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    662

    Re: Material problems

    That's the point of GL_COLOR_MATERIAL :

    changing the color of the material with glColor! It saves from expensive state changes from setting the new material color with glMaterial.

Posting Permissions

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