Game Development Community

Certain shadows are wrecking my brain...

by TheGasMan · in Torque Game Engine Advanced · 04/25/2008 (2:41 am) · 8 replies

I will make this simple...because it makes no sense at all to me.

datablock:
datablock StaticShapeData(jdoor_closeddts1)
{
category = "shadowmakers1";
shapeFile = "~/data/shapes/level1_specific/jdoor_closed.dts";
shadowEnable = true;
shadowCanMove = true;
shadowCanAnimate = true;
shadowSelfShadow = true;
shadowDTSShadow = true;
shadowSize = 512;
shadowAnimationFrameSkip = false;
shadowMaxVisibleDistance = 200;
shadowProjectionDistance = 100;  
shadowSphereAdjust = 1;   //wtf ?
shadowBias = 0.0001;  //untested
};

img404.imageshack.us/img404/4636/shadblockgo3.jpg

Anyone have a way to achieve this ?
[Am I insane to think this should work properly ?]

#1
04/25/2008 (12:34 pm)
It might have something to do with the kind of light you're using.
#2
04/25/2008 (2:33 pm)
No offense Dan and I know I did not give much background here...but the list of things I have tried are extensive, too extensive to list here.

- If anyone knows how to change this, let me know...'guesses' can be avoided plz.

thx
#3
04/25/2008 (2:35 pm)
Could we see the light datablock and the light object from the mission file?
#4
04/25/2008 (3:41 pm)
new sgLightObject(stat5ws) {
      canSaveDynamicFields = "1";
      Enabled = "1";
      Position = "61.3668 147.117 122.13";
      rotation = "0 0 -1 1.14533";
      scale = "1 1 1";
      dataBlock = "static_5_white_shadow";
      Enable = "1";
      IconSize = "1";
      ParticleColorAttenuation = "1";
   };

datablock sgLightObjectData(static_5_white_shadow) {
   canSaveDynamicFields = "1";
   Enabled = "1";
   LightOn = "1";
   Radius = "5";
   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 = "5";
   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 = "0";
   LerpBrightness = "0";
   LerpRadius = "0";
   LerpOffset = "0";
   LerpRotation = "0";
   StaticLight = "1";
   SpotLight = "0";
   SpotAngle = "1";
   AdvancedLightingModel = "1";
   EffectsDTSObjects = "1";
   castsShadows = "1";
   DiffuseRestrictZone = "0";
   AmbientRestrictZone = "0";
   LocalAmbientAmount = "0";
   SmoothSpotLight = "0";
   DoubleSidedAmbient = "0";
   lightingModelName = "Inverse Square";
   UseNormals = "1";
   SupportedFeatures = "Full";
   MountPoint = "0";
   MountPosition = "0 0 0";
   MountRotation = "1 0 0 0";
};

img165.imageshack.us/img165/8940/barsue5.jpgAs you can see the shadow is no where near correct.
#5
04/25/2008 (4:08 pm)
I'm not really sure if this will fix the issue or not, but could you try it with the light's datablock set to

SpotLight = "1";

And see what happens?

If that fixes it, awesome--if not, I'm going to bow out--not an area of expertise for me at all, and I know you've been experimenting with semi-random changes already, and don't want to hear more!
#6
04/25/2008 (4:38 pm)
[casual speak]
semi-random would be an understatement...I have not only randomly chosen changes throughout a broad spectrum of ideas but I have gone through the light datablock changes from A-Z, scientifically. I would assume this is a fullout engine issue related to dyn shadows since the player shadows also never 'fisheyez' but only gets longer...same thing here.

Light source location should change angulations of shadows per every shadow creating surface. This does not seem to be the idea behind the shadows in this engine...objects with separate meshes are treated as 1 mesh...this is more like get light > make flat shadow after calc'ing distance to the object's transform location. blah blah blah


Difs do not play to the same scenario of course but the shadows that difs create lack serious detail...no matter the geometry scale.
..and last of all, with the loss of dynamic projected cube-maps..well, I will stop there.

I am not here to trash anything even though some of you may think that...I am here to ask if there is a way to get what I am looking for without huge rewrites of code. Perhaps I have mistakenly overlooked something.

P.S. spotlight = doesn't fix this
#7
04/25/2008 (9:20 pm)
@EB:

This looks like you are using projected shadows. Projected shadows don't take into account the distance of the light, they really can only take into account the direction of the light, since you are projecting the shape onto a texture, and then projecting that texture onto the ground. What it sounds like you are wanting is stencil shadows (like Doom 3). This would require quite a bit of modification to the engine.
#8
04/26/2008 (3:08 pm)
""Projected shadows don't take into account the distance of the light, they really can only take into account the direction of the light, since you are projecting the shape onto a texture, and then projecting that texture onto the ground""

I thought this...but wanted to have someone verify.

Thx Jaimi