Game Development Community

DTS and Static Shadows

by Thomas Bang · in Torque Game Engine · 09/30/2007 (3:15 am) · 7 replies

Hi

I wonder why i cant get Static Shadows on the Terrain from a Static Shape.
The Orc = dynamic Shadow
The Lattice = static Shadow???
( the Collision Mesh is set correctly !!! )

Here is a picture...

www.darkware.de/tgepostings/dts_shadow.jpg

Thanks

Thomas Bang

#1
09/30/2007 (10:55 am)
Without makeing code change to the SDK, you may use a datablock and assign the DTS as an ITEM. The ITEM class will cast a shadow.
#2
10/01/2007 (5:30 am)
I got it. Thanks.
#3
10/04/2007 (7:01 pm)
I understand what Caylo is saying, but it makes no sense why the static class doesn't create a shadow.
#4
10/05/2007 (1:43 am)
ITEM creates a dynamic shadow.
To get static shadows i wrote the following:

datablock StaticShapeData(Shape_Gitter)
{
   category = "test";
   shapeFile = "~/data/shapes/gitter2/gitter2.dts";
   shadowEnable = true;
}

If you want to receive shadows on dts-objects you have to modify the engine-source-code.
Under TorqueDemo/Source Files/game you have to modify shadow.cc

Line 21:

U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType;


Instead you have to write:

U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType | StaticShapeObjectType | StaticObjectType;


Please note: Cast and receive shadows depends on the Collisionmesh.
#5
10/06/2007 (6:24 am)
That's odd. I can get static shadow from DTS opbject by unchecking every option other than the "RecieveSunlight: in Lighting category (though I don't get dynamic shadow from player model on the model itself for some reason). Also, anyone knows how to resize those columns to read what is written in the label fields?

www.cryptikarma.com/extras/torque/shadowStatic_thumb.jpg
#6
10/08/2007 (12:18 am)
Thomas, thanks for that!

Nikhil: I don't think DTS shapes can recieve shadows, can they? Only DIFs, and they still don't self-shadow.
#7
10/09/2007 (7:48 am)
As far as I know Daniel, is right, DTS shadow over DIFs that's all.