PDA

View Full Version : lighting and vertex colours



crain
03-02-2002, 03:11 AM
Is there a possibilty to set the material diffuse component to the vertex colour coming from the vertex (e.g: glColor4f()) so that you have a different colour at each vertex if desired?
Till now I have done lighting in software doing the above with sending the lit vertice's colour by glColor4f();.
To achieve this with a vertex program is also no problem (i love complete control), but what about implementations that do not support vertex_programms in hardware (like non-nvidia, non-ati cards of the last generation) ?

many thanks in advance

Chris

[This message has been edited by crain (edited 03-02-2002).]

bpeers
03-02-2002, 03:31 AM
Check out GL_COLOR_MATERIAL and glColorMaterial -- when enabled, the material color will track any color changes (via glColor or color arrays).

crain
03-02-2002, 03:34 AM
yip ... that was a rtfm on my side. should have read that ;-)

many many thanks ...

chris


Originally posted by bpeers:
Check out GL_COLOR_MATERIAL and glColorMaterial -- when enabled, the material color will track any color changes (via glColor or color arrays).