PDA

View Full Version : why do colors disappear with lighting?



04-21-2000, 05:47 AM
I have an array of vertices, an array of colors, and an array of triangles. When I render these (DrawElements) with lighting disabled I see the colors but there is no shading (obviously). When I enable lighting (ambient and diffuse) I get shading, but all the vertex colors disappear; I only get the color of the light source. How can I get my separately colored objects (vertices) to show up with proper light source shading?

04-21-2000, 08:51 AM
Never mind, I discovered that all I need to do is call glColorMaterial and enable COLOR_MATERIAL and it works.