• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# GL Light Vortex. :( {help w/lighting probs}

This topic is 5637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Well other than I cant get it to work right. more to the point. I can render a sphere to the surface, but when I turn on lighting all my poly's loose themselves to a dull monotone color. looks like this then when I turn on lighting it just turns into a grey-white mass. what might I be doing wrong? "Life is entertainment, Why let work get in the way." [edited by - thrasmion on August 19, 2003 9:34:56 PM]

##### Share on other sites
no. they don''t "lose" their colour, they ignore it. when lighting is enabled, the material-colour (white is the default) will be used. you can override this and use _your_ colours with glEnable(GL_COLOR_MATERIAL)

##### Share on other sites
This would work wouldn''t it?
unsigned char LightingEnabled  = glIsEnabled(GL_LIGHTING);//--if(LightingEnabled){glDisable(GL_LIGHTING);}RenderSphere();if(LightingEnabled){glEnable(GL_LIGHTING);}

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"

##### Share on other sites
quote:
Original post by 666_1337
no. they don't "lose" their colour, they ignore it. when lighting is enabled, the material-colour (white is the default) will be used. you can override this and use _your_ colours with glEnable(GL_COLOR_MATERIAL)

Thanks that helped, but now I have ambient but does diffuse not work on materials or just textured objects?

"Life is entertainment, Why let work get in the way."

[edited by - Thrasmion on August 19, 2003 8:29:54 AM]

[edited by - Thrasmion on August 19, 2003 8:30:24 AM]

##### Share on other sites
quote:
Original post by Thrasmion
quote:
Original post by 666_1337
no. they don't "lose" their colour, they ignore it. when lighting is enabled, the material-colour (white is the default) will be used. you can override this and use _your_ colours with glEnable(GL_COLOR_MATERIAL)

Thanks that helped, but now I have ambient but does diffuse not work on materials or just textured objects?

"Life is entertainment, Why let work get in the way."

uh no... the colour material (as far as i know) only replaces the diffuse component. if you don't get the sphere lit, it's because you have set the texture environment to decal mode. call glTexEnvi with GL_MODULATE as third parameter.

[edited by - 666_1337 on August 19, 2003 12:11:24 PM]

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 11
• 15
• 11
• 11
• ### Forum Statistics

• Total Topics
634150
• Total Posts
3015837
×