Light always being emitted towards center of camera
by rwillis · in Torque X 2D · 03/17/2009 (5:45 am) · 6 replies
Whenever I implement a light source into my level, that light source ALWAYS emits light toward the center of the camera. It kindof looks like there's a spotlight constantly pointing at the center of the scene camera from the light source. It happens whether I use point light or directional and my fields are filled in the exact same as the one light in 2D lighting demo. Anyone else have this happen to them? Anyone know how to fix it?
#2
03/17/2009 (7:33 pm)
Yeah I have this issue as well. If you disable the normal maps how do you get light to effect anything?
#3
I'm not using normal maps right now so I don't believe it's caused by normal maps (unless it's caused by lack of normal maps).
03/17/2009 (9:13 pm)
Yeah, it looks like a band of light stretching from the light source to the center of the camera. I'm not using normal maps right now so I don't believe it's caused by normal maps (unless it's caused by lack of normal maps).
#4
@Rich - Without normal maps, Torque X will still render the materials, it defaults to a straight up (0,0,1?) normal map I believe. In older version of TX2D I read somewhere that you must have normal maps. Maybe you've got an older version?
@rwillis - I don't think it's caused by lack of normal maps as I don't have any at all in my materials. All I have is the EnableLighting box checked, my Power is 0 and my Intensity is 1.
03/18/2009 (11:12 am)
Ah bummer, I was hoping that was it. I'll keep thinking about this and see if I can remember what else I changed.@Rich - Without normal maps, Torque X will still render the materials, it defaults to a straight up (0,0,1?) normal map I believe. In older version of TX2D I read somewhere that you must have normal maps. Maybe you've got an older version?
@rwillis - I don't think it's caused by lack of normal maps as I don't have any at all in my materials. All I have is the EnableLighting box checked, my Power is 0 and my Intensity is 1.
#5
Looks like the light is always coming from the center of the screen (camera location) and pointing towards the position of the object. With or without normal maps.
03/23/2009 (11:51 am)
Getting exactly the same issue. Looks like the light is always coming from the center of the screen (camera location) and pointing towards the position of the object. With or without normal maps.
#6
The answer is to not use specular highlights. These are enabled by having a specular power and intensity > 0. So set either to 0 and the point light appears where it should. This is why Alex's lights worked.
03/25/2009 (8:53 am)
Been trying to work this out by looking at the shader used. I'm no expert on them but it looks like specular highlighing does not work, you always get a band of light from the point light to the centre of the screen (camera position) - no matter how far from the point light you are.The answer is to not use specular highlights. These are enabled by having a specular power and intensity > 0. So set either to 0 and the point light appears where it should. This is why Alex's lights worked.
Torque Owner Alex Stittle
I think it was that I was using normal maps under my material, but the normal maps were wrong. When I disabled the normal maps, everything worked ok.
If that doesn't work for you, let me know and I'll try to squeeze the memories out of my brain.
- Alex
www.stinkerstudios.com