   Light calculations
  Hello.I'm working on a lighting shader for my models, using GLSL. I normally have directional lighting on the models, wich is easily calculated. I just rotate the normals by the bone matrices, and then pass them down to OpenGL.The game also has per-vertex dynamic lighting though, and I'm in trouble with that. What I do is check wether any the lights' radiuses are touching the bbox of the entity, and if they do, I add them to my list. Then, after I'm done with that, I pass each light down to the shader. Each light has a three float origin vector, another vector for the light color, and the radius.When calculating the light direction for the current vertex, I use the xyz component of the gl_Vertex, because I have the light origin in world-space. Now, I do a dotproduct between the vertex normal and the light direction.Right now, I'm getting issues on dynamic lights, where they only light the model when it is in a certain cone from the light. I was told that this was related to normals, and that I'd need to transform my normals to world space, but I haven't managed to find anything truly helpful on this matter.I'd be pleased if someone could help me out.Thanks. Andrew.   
  This is a simple article which includes information about lighting and even an example. http://www.gamedev.net/reference/programming/features/glsllib/   ;  If you have done some scaling you might need to multiply the normal with gl_NormalMatrix to get it correct. I do normal=normalize(gl_NormalMatrix*normal) not sure normalize is needed though.   