Shadows on StaticShapes
by Kiyaku · in Torque Game Engine Advanced · 10/26/2007 (12:06 am) · 5 replies
Hi,
i made a little scene and wanted to add shadows to it. In the forum, i read i have to use some code to give shapes a shadow. So i wrote this code:
Well now, i only get shadows if i add models from "Shapes - Dungeon" but not from the "StaticShape" menu.
Is it possible to give the models from "StaticShape" (in the Editor) a shadow?

i made a little scene and wanted to add shadows to it. In the forum, i read i have to use some code to give shapes a shadow. So i wrote this code:
datablock StaticShapeData(pancarte2)
{
category = "Dungeon";
shapeFile = "~/data/shapes/Dungeon/pancarte2.dts";
shadowEnable = true;
};Well now, i only get shadows if i add models from "Shapes - Dungeon" but not from the "StaticShape" menu.
Is it possible to give the models from "StaticShape" (in the Editor) a shadow?

#2
10/26/2007 (5:27 am)
How can i check that?
#3
StaticShapeBase derived only have dynamic shadows.
see here: tdn.garagegames.com/wiki/Torque/LightingSystem/DTS_Lighting_and_Shadows#DTS_Shad...
10/26/2007 (6:59 am)
I forgot something: as you don't use TSStatic they won't cast any lightmaps.StaticShapeBase derived only have dynamic shadows.
see here: tdn.garagegames.com/wiki/Torque/LightingSystem/DTS_Lighting_and_Shadows#DTS_Shad...
#4
10/27/2007 (12:29 pm)
I'm curious... anyone know why TSStatic do not cast shadows? Is it a technical, performance, or design limitation?
#5
Makes sense as well if you think about the purpose of TSStatic and especially how far they are seen (as they are not ghosted). they would cause massive performance issues or would have needed a more sophisticated shadow system (fade out ranges on the shadows etc) to be dynamic shadow capable.
Just to clarify: TSStatic CAST static shadow (lightmaps) on legacy and blended atlas. But not on unique atlas as it just does not support any lightmap at all.
And to add something to the above: you could make cast this buildings etc shadows as well. you would need to add all the needed flags for dynamic shadows and at best mark it as non-movable which will optimize its performance. There is a TDN article in the lighting system section which will explain this better than I could do this here :)
10/27/2007 (1:32 pm)
TSStatics are no ShapeBase derived class and only shape base does cast dynamic shadows.Makes sense as well if you think about the purpose of TSStatic and especially how far they are seen (as they are not ghosted). they would cause massive performance issues or would have needed a more sophisticated shadow system (fade out ranges on the shadows etc) to be dynamic shadow capable.
Just to clarify: TSStatic CAST static shadow (lightmaps) on legacy and blended atlas. But not on unique atlas as it just does not support any lightmap at all.
And to add something to the above: you could make cast this buildings etc shadows as well. you would need to add all the needed flags for dynamic shadows and at best mark it as non-movable which will optimize its performance. There is a TDN article in the lighting system section which will explain this better than I could do this here :)
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
Atlas Unique has no light map so no static shadow
Atlas blended supoorts it since TGEA 1.0.3