Sign in to follow this  
knobby67

lighting range

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this