Game Development Community

Shadows Broken in 1.7.1?

by Dave Calabrese · in Torque Game Engine Advanced · 11/04/2008 (10:35 am) · 3 replies

I've been trying on and off for the past few weeks to get dynamic (or even static) shadows to work in TGEA 1.7.1. I've been using the following articles for reference:

http://tdn.garagegames.com/wiki/Torque/LightingSystem/DTS_Lighting_and_Shadows
http://tdn.garagegames.com/wiki/TorqueShaderEngine/LightingSystem/Dynamic_Shadows
http://tdn.garagegames.com/wiki/TorqueShaderEngine/LightingSystem/Performance_Considerations#Dynamic_Lighting_Performance


Currently, I am unable to get shadows to cast from the objects at all. What I have is a DTS created room with a collision mesh, and a bunch of lights inside. Here is a datablock definition for one of the room objects:


datablock StaticShapeData(StoreMeshA)
{
	category = "Store Rooms";
	shapeFile  =  "~/data/shapes/storea.dts";
	
	shadowEnable = true;
	shadowSelfShadow = true;
	shadowDTSShadow = true;
	shadowCanAnimate = true;
	shadowCanMove = true;
	shadowSize = 256;
	shadowProjectionDistance = 40;
	shadowBias = 0;
};

The staticshape definition for when the object is placed in the world:
new StaticShape() {
      canSaveDynamicFields = "1";
      Enabled = "1";
      position = "-36.9985 179.799 224.102";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      dataBlock = "StoreMeshA";
      receiveSunLight = "1";
      receiveLMLighting = "1";
      useCustomAmbientLighting = "0";
      customAmbientLighting = "0 0 0 1";
      useLightingOcclusion = "1";
   };

(continued...)

#1
11/04/2008 (10:35 am)
Then for one of the lights I am using:

datablock sgLightObjectData(StorePointLight) {
   canSaveDynamicFields = "1";
   Enabled = "1";
   LightOn = "1";
   Radius = "4";
   Brightness = "1";
   Colour = "1 1 1 1";
   FlareOn = "0";
   FlareTP = "1";
   FlareColour = "1 1 1 1";
   ConstantSizeOn = "0";
   ConstantSize = "3";
   NearSize = "3";
   FarSize = "0.5";
   NearDistance = "10";
   FarDistance = "30";
   FadeTime = "0.1";
   BlendMode = "0";
   AnimColour = "0";
   AnimBrightness = "0";
   AnimRadius = "0";
   AnimOffsets = "0";
   AnimRotation = "0";
   LinkFlare = "1";
   LinkFlareSize = "0";
   MinColour = "0 0 0 1";
   MaxColour = "1 1 1 1";
   MinBrightness = "0";
   MaxBrightness = "1";
   MinRadius = "0.1";
   MaxRadius = "4";
   StartOffset = "-5 0 0";
   EndOffset = "5 0 0";
   MinRotation = "0";
   MaxRotation = "359";
   SingleColourKeys = "1";
   RedKeys = "AZA";
   GreenKeys = "AZA";
   BlueKeys = "AZA";
   BrightnessKeys = "AZA";
   RadiusKeys = "AZA";
   OffsetKeys = "AZA";
   RotationKeys = "AZA";
   ColourTime = "5";
   BrightnessTime = "5";
   RadiusTime = "5";
   OffsetTime = "5";
   RotationTime = "5";
   LerpColour = "1";
   LerpBrightness = "1";
   LerpRadius = "1";
   LerpOffset = "1";
   LerpRotation = "1";
   StaticLight = "1";
   SpotLight = "0";
   SpotAngle = "17.1818";
   AdvancedLightingModel = "1";
   EffectsDTSObjects = "1";
   castsShadows = "1";
   DiffuseRestrictZone = "0";
   AmbientRestrictZone = "0";
   LocalAmbientAmount = "1";
   SmoothSpotLight = "0";
   DoubleSidedAmbient = "0";
   lightingModelName = "Original Stock";
   UseNormals = "0";
   SupportedFeatures = "NoSpecCube";
   MountPoint = "0";
   MountPosition = "0 0 0";
   MountRotation = "1 0 0 0";
};

And of course, my defaults.cs properties for shadows:
$pref::LightManager::sgAtlasMaxDynamicLights = "16";
$pref::LightManager::sgDynamicShadowDetailSize = "0";
$pref::LightManager::sgDynamicShadowQuality = "0";
$pref::LightManager::sgLightingProfileAllowShadows = "1";
$pref::LightManager::sgLightingProfileQuality = "0";
$pref::LightManager::sgMaxBestLights = "10";
$pref::LightManager::sgMultipleDynamicShadows = "1";
$pref::LightManager::sgShowCacheStats = "0";
$pref::LightManager::sgUseBloom = "";
$pref::LightManager::sgUseDRLHighDynamicRange = "0";
$pref::LightManager::sgUseDynamicRangeLighting = "0";
$pref::LightManager::sgUseDynamicShadows = "1";
$pref::LightManager::sgUseToneMapping = "";

Anyone see any problems in that, or could someone maybe point me to a clear tutorial with examples that show exactly how to do this? I feel like there is something small and simple that I'm constantly missing here...

Thanks in advance for any help anyone can give!

-Dave Calabrese
Gaslight Studios
#2
11/14/2008 (9:41 am)
I assume you are deleting prefs / dso's each time you change your defaults.cs file? Also, make certain the XML settings system in common/ isn't munging your changes here either.

That's all I got.
#3
11/14/2008 (10:45 am)
Jay, the problem is not the dso's.
I am determining the shadow problem over a week and finally got it working (but not all the way).
Finally i got a single shadowed object. If all other objects, attached to it are alse shadowed.
If not - not shadowed.
Strangely but this is the situation. This is the only way to get the shadow working on a large polysoup.