Results 1 to 2 of 2

Thread: Material problems

  1. #1
    Member Contributor
    Join Date
    Feb 2000

    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 ?


  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2000

    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.

Similar Threads

  1. Lighting and material problems
    By xorserq in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-31-2014, 07:40 AM
  2. normal map in material
    By vicviper in forum COLLADA
    Replies: 9
    Last Post: 06-26-2006, 12:46 PM
  3. Material Definistions
    By mphanke in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-29-2002, 07:17 PM
  4. Material
    By mphanke in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-10-2002, 02:15 PM
  5. Material
    By Claudio in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 07-09-2000, 10:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean