PDA

View Full Version : Lighting



thados
08-19-2000, 11:11 AM
anyone know why all of my colored triangle lists turn grey scale when i enable lighting?

Bob
08-19-2000, 11:29 AM
You need to pass colors with the material-functions. It's also possible to use glColor* to define some material-values, but this is not enabled by default I think.

thados
08-19-2000, 11:39 AM
i am not using any meterials currently, do you know how to do this without haveing to use textures?

08-19-2000, 12:52 PM
material colors are not textures. They determine what colored lights to reflect and how and how much, and are sepcified by calling glMaterialfv or similar functions.

ngill
08-19-2000, 01:25 PM
or... you can do the following at in the init function:


glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_D IFFUSE);
glEnable(GL_COLOR_MATERIAL);

that way, all your materials will be the same as the color specified by glColor**();

thados
08-19-2000, 04:50 PM
thanks so much this works wonderfull