   SpotLight, Still issues, last time ill post on it, i swear! :)
  OK here it goes hopefully the last and final time I post about this.  Basically Im at the point im not going to implement spot lights.  Enough time spent, but last shot here it goes:My problem is, my spot lights point at the ground fine but for some reason they dont angle correct.  For instance when the light hits the ground instead of being oval shaped(shot at 45 degree angle) it just gets to be a bigger circle.  But the sides of the circle should be coming in because of the distance.  The math seems absolutly right to me.  SO, if anyone can notice anything about this please post.  Also note i am doing deferred lighting, but that shouldnt change anything except all of the work is inside the pixel shader.CODE:float4 TSpotLightingPS(VS_OUTPUT1 In) : COLOR{half4 Color= tex2D(MRT0, In.TexCoord);half3 Normal= normalize(2 * (tex2D(MRT1, In.TexCoord) - 0.5));half2 PositionXY= tex2D(MRT2, In.TexCoord);half2 PositionZW= tex2D(MRT3, In.TexCoord);half4 Position= float4(PositionXY.xy, PositionZW.xy);half3 toLight=  (LightVector - Position);half3 toLightDir= normalize(toLight.xyz);half atten = saturate(1 - dot( (toLight / tester[2]), (toLight / tester[2]) )); // tester[2] == LightRangehalf Diffuse = saturate(dot(Normal, toLightDir.xyz));half cosAngle = dot( toLightDir.xyz, LightDir );//dot( LightDir, toLightDir.xyz );half spotFactor = smoothstep( tester[1], tester[0], cosAngle );return ( ( spotFactor * LightColor * (Color * Diffuse) ) * atten);}pixelfragment TSpotPixelFragment = compile_fragment ps_2_0 TSpotLightingPS();pixelfragment FSpotPixelFragment = compile_fragment ps_2_0 TSpotLightingPS();Thanks alot everyone!--Brad   
  One thing I noticed which is wrong (if I´m correct) is your normal:half3 Normal= normalize(2 * (tex2D(MRT1, In.TexCoord) - 0.5));should behalf3 Normal= normalize(2 * (tex2D(MRT1, In.TexCoord) - 1.0));But this shouldn´t change the appearance of the light´s cone itself and I think therefore isn´t related to the problem you describe.dot(toLight, toLight)would be the squared distance of the point to the light source, if I understand that correctly anddot(toLight / lightRange, toLight / lightRange)would be (squared distance / lightRange squared). Therefore I guesshalf atten = saturate(1 - dot((toLight / tester[2]), (toLight / tester[2])));should be correct, though it might be better to calculate (toLight / tester[2]) once and multiply that by itself.Sry for the blah, but I´m trying to verify the factors in your return statementreturn (spotFactor * lightColor * color * diffuse * atten);I´d expect 'lightColor' and 'color' to be the correct values, since they´re not calculated in that fragment. 'atten' seems to be correct, too. 'diffuse' won´t be correct, since your normal values aren´t, but as I said, I don´t think this would change the shape of the light´s cone. Perhaps I´m wrong there.The last factor that remains is spotFactor, which is calculated byhalf cosAngle = dot(toLightDir.xyz, lightDir);half spotFactor = smoothstep(tester[1], tester[0], cosAngle);'cosAngle' should be correct. I don´t know what tester[1] and tester[0] are, but I guess tester[1] is the cosine of the outer angle of the spot (the angle at which there should be no light at all) and tester[0] is the cosine of the inner angle of the spot (the angle at which the light starts to fade out). If this is correct, spotFactor should be correct, too. If tester[0] and tester[1] are other values, then I don´t understand that line or it is incorrect.Sry for the long post again, I guess it wasn´t that helpful, but perhaps I´m wrong there ;)   ;  Yea you are correct in what you said, and tester[0] and tester[1] are the cone angles( both set at 0.5) for testing purposes.  Any ideas on what might need changed then?  Ive gone through it as well without being able to find out why the cone shape doesnt lengthen when at angles(which it should).Thanks for going through it all though, maybe it will help someone else pitch at it.Also, the normal needs 0.5 not 1.0.  When I use 1.0 it only lights half the screen, leaves anything less black :(.--Brad[Edited by - xsirxx on December 13, 2005 7:58:01 PM];  Any ideas at all?  Thanks.   