lighting / materials / vertex colors
I''m trying to add lighting to my scene. The first thing I did was add ambient and diffuse lights as per nehe''s instructions. Then I discovered that the lights'' color completely overwhelmed the vertex color of objects that I had drawn. I looked into materials, and found that I could change how much of each of the lights got reflected by the surfaces, and was thus able to change the colors of my objects.
My question is, is there a way to change the color of objects in a lighted scene without changing all of the material properties everytime I want to change color? For example, I''d like to be able to ignore the materials alltogether and have the vertex colors and normals determine the color of the surface. Or am I stuck with defining little arrays of rgba values every time I want a new color?
Thanks for any help
/riley
--Riley
If your only using a limited amount of materials then
you could create a display list with the required
material settings and then just call glCallList(MAT_INDEX)
when you want to change it.This will also have a slight
improvement on speed over setting the material properties
individually.
you could create a display list with the required
material settings and then just call glCallList(MAT_INDEX)
when you want to change it.This will also have a slight
improvement on speed over setting the material properties
individually.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement