I''m writing a game, but I''m having a problem with the lighting.
There''s a flat field, 200x200, enclosed by walls, with a light in one corner, (80,80), and it renders correctly on the walls that make up that corner, but it lights up the opposite walls fully as well, despite my best efforts to use light attenuation to stop this. Whatever numbers I use for the attenuation constant, linear attenuation and quadratic attenuation, the walls still shine with full intensity. This is the code i''m using (taken straight from the red book, but i''ve tried other numbers, from 100000 to 0.000001, for all three values.
glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 2.0);
glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 1.0);
glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.5);
can someone please help me?
We scratch our eternal itch
A twentieth century bitch
We are grateful for
Our Iron Lung
OK, so i''ve been testing the game on my friend''s pc, and the attenuation seems to work, with (kC = 0, kL = 0.0001, kQ = 0.0001) creating a very much brighter scene, and (kC = 0, kL = 0.01, kQ = 0.01) creating a very, very dim scene (have to look real close to see a very slight light in the corner), but the puzzle now is, why doesn''t the scene change at all on my computer? Has anyone got any advice/ideas?
We scratch our eternal itch A twentieth century bitch We are grateful for Our Iron Lung