Just a quick update. I was a bit disillusioned in my last post about the lights mainly because they were just not working correctly. I just fixed it and it was too simple. I just had to note this down incase it helps with other people and also to act as a reminder for me to actually read the code I have written.
The thing is, my maps are scaled down defined by a scalar value in the map format (I know, its not a good idea to use scaling but I find it easier). Anyway, having read NBs about normals having to be one unit long otherwise lighting screws up I remembered to add glEnable(GL_NORMALIZE) (The one that requires more computing). This makes sure that the normals are 1 Unit, no matter what. So I did that but the lighting was still mucked up and looked like a normal bulb light over a model village (So the normals were still the same size- See screen shot in previous post- that was diffused on .2 ...no chance that it should illuminate to that level). Anyway, I was looking through the code and couldn't find anything that was wrong.
I left it a day or so. Then I read through the information in 'The Red Book' and scoped out something that might be the root of my problems- the lighting is calculated using the model view matrix. Whats that at the top of rendering each singular entity of geometry? glPushMatrix(). The thing is I was pushing/popping a new model matrix everytime I rendered a primitive but my ModelLighting(int LightType); function was well before I Pushed the matrix which means the lighting was being based on a non-scaled model view matrix and that meant no matter what the lighting would be screwed.
Hazzah! another problem solved.
Lesson of the day- Always read your code and keep track of the times you push/pop matricies.
[Disclaimer- Do not comment on my bad over complex programming style [smile]]
Now I have a whole load of cycles wasted on iterating through the list of lighting in my level every time I render a single primitive. Major optimizing is required! I say again- Major optimizing is required!
Anyway, thats how not to program [smile]
Catch you later, dudes