PDA

View Full Version : Grey polys when Lighting is enabled....



Khrob
09-23-2000, 07:34 AM
I'm just using coloured polygons (no textures) and whenever I have it enabled, everything's a shade of grey.

It looks like the normals are fine, (since I pulled them straight out of the .ase file) but there's none of the colour info!!

Please help!

Bob
09-23-2000, 09:28 AM
You need to pass vertex colors with the glMaterial* functions.

You can also call



glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT, GL_DIFFUSE);

to tell OpenGL to use the color in glColor as the diffuse color component for front facing triangles (in this example, other combinations can also be used).

I strongly recomend you read the chapter about Lightning in the Red Book (http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/) .