Jump to content
  • Advertisement

Archived

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

Thrasmion

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!