Jump to content
  • Advertisement
Sign in to follow this  

lighting range

This topic is 4356 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

Hello, I've encountered a problem that seems (to me) quite strange. I've written some code to load and move a model, all is great. I then put lighting on. The model seemed poorly lit. I turned off all lighting except ambient. The lighting did not change. I then wrote a bit of simple code to test the lighting ie start ambient parameters all at 0.0f and the add 0.01f per frame to watch the light increase. What I found from recording the results is the max light is when my abmbient colours are at about 5. ie 0.0f is black, 5.0f is full bright daylight. This has me really confused, as I thought lighting range went from 0 to 1, not 0 to 5. Further testing of ranges shows diffuse,specular and emissions do not apppear to effect anything. Also moving the lamp possition has no effect. I'm calling lamps via this function int LightOn(GLenum lightnumber, GLfloat *ambient,GLfloat *diffused,GLfloat *spectal,GLfloat *emission,GLflloat *position) { glLightfv(lightnumber,GL_AMBIENT,ambient); glLightfv(...... for diffuse specular,emission,position glEnable(lightnumber); glEnable(GL_LIGHTING); } So if I call this function with light 0 and set Ambient[0]=0.0f,Ambiant[1]=0.0f,Ambient[2]=0.0f; The model is almost invisible, if parameters are set to 1.0f it's very dark if set to 5.0f it appears to be full daylight. Can anyone advise me on this SOLVED (can't delete) had to add glEnable(GL_NORMALIZE) [Edited by - knobby67 on August 20, 2006 7:00:56 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!