T3D 1.1 B1 BUG: Missing shadows using Pointlight and Spotlight
by JANR · in Torque 3D Professional · 07/11/2010 (6:39 am) · 6 replies
UPDATE:
-------
Seems there's no bug of note here, just unintuitive behaviour, lousy documentation and stuff crashing when used with questionable values.
Original Post:
--------------
Pointlights do not cast shadows from all faces. Specifically faces directly facing the pointlight seem to be problematic.
ShadowOK
The faces are not directly facing the light, and everything seems ok.
ShadowBUG
The light source is directly facing one side of the box, and the shadowcasting breaks.
Spotlights don't seem to cast shadows at all.
About the author
Recent Threads
#2
I'll admit I just did a quick test of it. To make it easy for myself to point the light, I set the outerAngle to 180. Which I see now is what caused the shadows to fail. from my current testing it seems shadows begin to be problematic at >170 are totally gone at 180, and are working perfectly again at 190. Is this somehow expected behaviour?
Testing various shadowtypes for the Pointlight shows that DualParaboloid does work, while all others fail the test of casting shadows from a simple cube. Is this by design?
07/11/2010 (7:44 am)
Steve, I see you are correct about the spotlight, it does cast shadows if properly configured.I'll admit I just did a quick test of it. To make it easy for myself to point the light, I set the outerAngle to 180. Which I see now is what caused the shadows to fail. from my current testing it seems shadows begin to be problematic at >170 are totally gone at 180, and are working perfectly again at 190. Is this somehow expected behaviour?
Testing various shadowtypes for the Pointlight shows that DualParaboloid does work, while all others fail the test of casting shadows from a simple cube. Is this by design?
#3
If you're having a split issue, rotate the light to what's best - but you'll always have a split somewhere.
Here's an old bug report screeny to demonstrate. You can see the split in the paraboloid in ShadowVis.

Spotlights have an inner and outer radius, make sure outer is bigger than inner, shadow strength is controlled by range - think of it like power of the beam.
07/11/2010 (8:02 am)
Paraboloids have a split in them which shows up at certain angles, toggle ShadowVis on with a light selected and you should be able to see how it's made up.If you're having a split issue, rotate the light to what's best - but you'll always have a split somewhere.
Here's an old bug report screeny to demonstrate. You can see the split in the paraboloid in ShadowVis.

Spotlights have an inner and outer radius, make sure outer is bigger than inner, shadow strength is controlled by range - think of it like power of the beam.
#4
Try creating a default spotlight from the editor in a new blank mission, and point it towards the player.
Enable shadows.
Up the texture size to 2048 to make it look a bit better.
Set the outerAngle to 180, the shadows disappear. Between 170 and 190 it has obvious issues.
In the editor I'm not able to change the shadow type for the spotlight.
Whatever I click the ShadowType stays at Spot.
ShadowViz:
If I try enabling the shadowViz from the dropdown menu. Torque crashes with the following callstack:
07/11/2010 (9:20 am)
SpotLight:Try creating a default spotlight from the editor in a new blank mission, and point it towards the player.
Enable shadows.
Up the texture size to 2048 to make it look a bit better.
Set the outerAngle to 180, the shadows disappear. Between 170 and 190 it has obvious issues.
In the editor I'm not able to change the shadow type for the spotlight.
Whatever I click the ShadowType stays at Spot.
ShadowViz:
If I try enabling the shadowViz from the dropdown menu. Torque crashes with the following callstack:
FPS Example_DEBUG.dll!Frustum::_updatePlanes() Line 231 + 0x3 bytes C++
FPS Example_DEBUG.dll!Frustum::getPosition() Line 399 C++
FPS Example_DEBUG.dll!SceneState::getCameraPosition() Line 111 + 0x1a bytes C++
FPS Example_DEBUG.dll!ProcessedShaderMaterial::setSceneInfo(SceneState * state=0x00000000, const SceneGraphData & sgData={...}, unsigned int pass=0) Line 1072 + 0x8 bytes C++
FPS Example_DEBUG.dll!MatInstance::setSceneInfo(SceneState * state=0x00000000, const SceneGraphData & sgData={...}) Line 412 C++
FPS Example_DEBUG.dll!GuiMaterialCtrl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 120 C++
FPS Example_DEBUG.dll!GuiControl::renderChildControls(Point2I offset={...}, const RectI & updateRect={...}) Line 193 C++
FPS Example_DEBUG.dll!GuiWindowCtrl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 1342 C++
FPS Example_DEBUG.dll!GuiControl::renderChildControls(Point2I offset={...}, const RectI & updateRect={...}) Line 193 C++
FPS Example_DEBUG.dll!GuiControl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 67 C++
FPS Example_DEBUG.dll!GuiCanvas::renderFrame(bool preRenderOnly=false, bool bufferSwap=true) Line 1604 C++
FPS Example_DEBUG.dll!GuiCanvas::handlePaintEvent(unsigned int did=0) Line 247 C++
FPS Example_DEBUG.dll!fastdelegate::FastDelegate1<unsigned int,void>::operator()(unsigned int p1=0) Line 990 + 0x1a bytes C++
FPS Example_DEBUG.dll!Signal<void __cdecl(unsigned int)>::trigger(unsigned int a=0) Line 326 + 0x17 bytes C++
FPS Example_DEBUG.dll!Journal::Call<Signal<void __cdecl(unsigned int)>,unsigned int>(Signal<void __cdecl(unsigned int)> * obj=0x06501b30, void (unsigned int)* method=0x105dffad, unsigned int a=0) Line 541 + 0xa8 bytes C++
FPS Example_DEBUG.dll!JournaledSignal<void __cdecl(unsigned int)>::trigger(unsigned int a=0) Line 64 + 0x12 bytes C++
FPS Example_DEBUG.dll!GuiCanvas::paint() Line 1423 C++
FPS Example_DEBUG.dll!fastdelegate::FastDelegate0<void>::operator()() Line 905 + 0x16 bytes C++
FPS Example_DEBUG.dll!Signal<void __cdecl(void)>::trigger() Line 315 + 0x13 bytes C++
FPS Example_DEBUG.dll!Process::processEvents() Line 78 C++
FPS Example_DEBUG.dll!StandardMainLoop::doMainLoop() Line 543 + 0x5 bytes C++
FPS Example_DEBUG.dll!torque_enginetick() Line 103 + 0x5 bytes C++
FPS Example_DEBUG.dll!TorqueMain(int argc=1, const char * * argv=0x01eec408) Line 369 + 0x5 bytes C++
FPS Example_DEBUG.dll!torque_winmain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x005e5590, HINSTANCE__ * __formal=0x00000000) Line 423 + 0x17 bytes C++
FPS Example_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpszCmdLine=0x005e5590, int nCommandShow=1) Line 47 + 0x16 bytes C++
FPS Example_DEBUG.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
FPS Example_DEBUG.exe!WinMainCRTStartup() Line 182 C
kernel32.dll!76e63677()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!77a69d42()
ntdll.dll!77a69d15()
#5
I guess the pointlights are working as intended, though highly unintuitive.
07/11/2010 (10:00 am)
btw thanks for the info on paraboloid shadows Steve :)I guess the pointlights are working as intended, though highly unintuitive.
#6
Spotlights only have spot as a lighting choice - 2048 is high for a shadowmap size - on "lighting settings" = "high" in options that would be 4096 for just one light.
I do think that using 180 degrees and such rather goes against the idea of a spotlight, it's not really a "spot" - keep it tight and things should be okay.
And yes I get a crash too when going out to high angles --- though I can't be certain that it's because I'm trying to do something that it wasn't designed for ...
argh! why did the Dutch have play like that ... I wanted them to win too ... well done Spain
07/11/2010 (2:59 pm)
There's a whole load of info "somewhere" in the forums ... not documented of course cos that's all still on-going ... but in various bug reports over the betas where Sickhead explained stuff. Personally I wouldn't bother hunting it ...Spotlights only have spot as a lighting choice - 2048 is high for a shadowmap size - on "lighting settings" = "high" in options that would be 4096 for just one light.
I do think that using 180 degrees and such rather goes against the idea of a spotlight, it's not really a "spot" - keep it tight and things should be okay.
And yes I get a crash too when going out to high angles --- though I can't be certain that it's because I'm trying to do something that it wasn't designed for ...
argh! why did the Dutch have play like that ... I wanted them to win too ... well done Spain
Associate Steve Acaster
[YorkshireRifles.com]
I've had no issues with spotlights - though note that they don't start at the top, that's just the fulcrum(?) where the angle meets - the actual light is someway down.