Game Development Community

StaticShape's shadow & the sun's azimuth & elevation

by Bullitt Sesariza · in Torque Game Engine · 04/03/2008 (1:27 am) · 2 replies

Hi, I use StaticShapes for my background objects. This is one of the datablocks:
datablock StaticShapeData(phonebox)
{
   category  = "BG_Property";
   shapeFile = "~/data/shapes/PropPhone/phonebox.dts";
   shadowEnable = true;
};

The shadow works and can be casted but it seems like it was casted from the same sun's elevation and azimuth regardless of the current one. I've tried changing the elevation and azimuth and do a full relight but still the shadow doesn't move. Why does this happen? How can I solve this?

Thanks in advance.

#1
04/20/2008 (11:29 am)
Ahh I figured it out. You need to set

shadowCanMove = true;
shadowCanAnimate = true;

in the datablock of the static shape. Then the shadow will update as the static shape animates and moves.

A few things about the shadowing still preplex me. For example the player model shadows based on its mesh, not its collision mesh/bounding box - but static shapes seem to cast shadows based off their collision mesh. I also did something at one point to let the player cast shadows on static shapes - but there is a bug where sometimes the shapes improperly cast shadows on themselves and it looks really bad.

Does TGEA handle shadows better overall? Or does it suffer from the same limitations as TGE? I'm just curious in case I ever go that route if some of these odd shadowing situations improve or not.
#2
04/22/2008 (7:49 pm)
Thanks alot. I'll try it ASAP. Thanks again.


EDIT:

I've tried it. It generated a weird result. When the player enters the game, the shadow didn't change. But if I pressed the F11 and went to the world editor and back to the game, the shadow changed based on the sun's parameters. So, IMHO it would be pointless to have the shadow only if I go to the world editor first before playing the game all the time. Any suggestion to solve this?