   Spot Light behaving oddly
  Hi all,I have a spot light set up:* Direction: -1.0 down the Z Axis* Position: 0.5,0.5,1.0,0.0* 45 degree cut off.* The player is at 0.5,0.5,0.5* The walls and floor are all 1x1 units in size, and made from triangle fans* I've got 4 Normal vectors per 1x1 Wall(or floor or ceiling) section* I'm pretty sure my winding orders are correct (CCW for OpenGL, right?)My ideal effect is getting it looking like the player is carrying a light source akin to a lantern or wooden torch (fantasy game style).Problems:1) As you can see here when facing "East" (down the Z axis into the screen from glLoadIdentity()'s 0,0,0 )The "South" wall (right of picture) is much darker than the opposite "North" wall... But I thought the light should be between both walls with an even spread of light with the given settings.2) Also on the floor, the near-right-corner of the two floor tiles is darker than the rest of the tile....In this next shot i've wondered round a couple of corners and am facing the west wall.1) The far wall is far brighter than the walls and floor close the the player, like a more concentrated beam of light. Am I even using the right lighting method for the effect I want?2) When facing east the floor and ceiling are lit OK, when facing west north or south they are very dark do i need to re-orientate the light as I turn?Thanks in advance for the help (or a pointer to an apt tutorial or document). A lot of the tutorials I'm reading on lighting are very simple and concentrate of lighting a static cube... So i've tried to implement them in my game where the player can move and everything seems to go wrong.I even tried to implement a non-spot light and that seems to change it's lighting, wildly when the player rotates.[Edited by - Guns Akimbo on May 7, 2009 3:32:31 PM]
Quote:Original post by Guns AkimboMy ideal effect is getting it looking like the player is carrying a light source akin to a lantern or wooden torch (fantasy game style).To achieve that effect you should use a point light, not a spot light.Polygon winding doesn't have anything to do with lighting. It's the normals that define how a polygon is lit.From what you describe, I assume you use vertex lighting which calculates the lighting equation only for each vertex and interpolates the results across the polygon). Thus, in the first image the right being darker could have the reason that the left wall's vertices get more light (because they are relatively nearer to the spotlight's main axis) and due to interpolation the whole wall seems to be lighter.The far wall being lighter that the others in the second screenshot also seems to come from the vertex normals and positions. The normals point more towards the light position than the other walls', floor's and ceiling's normals and thus make the far wall be lighter.Another reason might indeed be that you don't reorient the lights as you turn. Have a look at the OpenGL FAQ.Summarizing, what you want is a point light as well as per pixel lighting (requires shaders). You could do without shaders to some extent if you tesselated your objects to use '(much) more vertices.Hope that helps.;  Thank you very much Evil,I got a rough approximation of the effect i wanted by switching to a point light and adding black fog ("Darkness"). Which lit up the corridors around the player and hid light bouncing off of distant walls.  Giving (roughly) the effect of a torch bearing adventurer wandering down dark corridors :)   