DTS Shadows not showing up...
by Shawn Simas · in · 03/22/2005 (9:13 pm) · 13 replies
I recently purchased the lighting pack and used the code included with it that had the pack already implemented into the torque base. Everything works fine except my player (I'm using a hoverVehicle) no longer casts a shadow. Also, Thomas' (Man of Ice) rigidShape resource class doesn't cast shadows either.
Is there something I must add/change to get these shadows to draw? Static shapes are drawing shadows onto the terrain fine.
Is there something I must add/change to get these shadows to draw? Static shapes are drawing shadows onto the terrain fine.
#2
Thanks for the quick reply.
03/23/2005 (10:14 am)
I decided to take your advice and check it out for the default player, and he did indeed cast a shadow, but I'm pretty sure pre-lighting pack my hovercraft did as well, I'll have to check that out when I get home, I'm at school now and only have the lighting pack integrated code.Thanks for the quick reply.
#3
My animals cast shadows fine using the "Sun" object that comes with TGE, but when I try to use a sgUniversalStaticLight instead, I don't get any shadow. This is with DTS objects trying to cast shadows onto terrain. Also of note, I merged the Lighting Pack into the RTS Pack to do this.
This is what I have it set at right now:
Here's my sunlight:
Here's my static light:
Here's the static light's datablock:
-Andy
03/23/2005 (12:23 pm)
I'm having the same problems...My animals cast shadows fine using the "Sun" object that comes with TGE, but when I try to use a sgUniversalStaticLight instead, I don't get any shadow. This is with DTS objects trying to cast shadows onto terrain. Also of note, I merged the Lighting Pack into the RTS Pack to do this.
This is what I have it set at right now:
Here's my sunlight:
new Sun() {
azimuth = "15";
elevation = "25";
color = "0.000000 0.000000 0.000000 0.000000";
ambient = "0.200000 0.200000 0.400000 1.000000";
direction = "0.635001 0.635001 -0.539941";
scale = "1 1 1";
locked = "true";
position = "0 0 0";
rotation = "1 0 0 0";
};Here's my static light:
new sgUniversalStaticLight(sunlight) {
position = "800 2000 1323.12";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "sgDefaultLightDataBlock";
Enable = "1";
IconSize = "1";
ParticleColorAttenuation = "0";
};Here's the static light's datablock:
datablock sgUniversalStaticLightData(sgDefaultLightDataBlock) {
className = "sgUniversalStaticLightData";
LightOn = "1";
Radius = "10000";
Brightness = "1";
Colour = "1.000000 0.816092 0.252874 1.000000";
FlareOn = "0";
FlareTP = "1";
FlareColour = "1.000000 1.000000 1.000000 1.000000";
ConstantSizeOn = "0";
ConstantSize = "1";
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.000000 0.000000 0.000000 1.000000";
MaxColour = "1.000000 1.000000 1.000000 1.000000";
MinBrightness = "0";
MaxBrightness = "1";
MinRadius = "0.1";
MaxRadius = "20";
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 = "1";
AdvancedLightingModel = "1";
EffectsDTSObjects = "1";
};-Andy
#5
03/23/2005 (12:35 pm)
That sounds awesome John, any chance that'll fix the shadows not showing up on a hoverVehicle? and any chance on a ETA?
#6
Thanks for your help...
Andy
03/23/2005 (12:43 pm)
I'm not sure I am understanding you. In the Modeler's Guide (in SG's docs), it clearly shows DTS objects casting shadows (the tree). Does this mean only static DTS objects can cast shadows? If so, then I am still having a problem because my trees don't cast shadows either :(Thanks for your help...
Andy
#7
I just checked it out, the player class uses different shadow code and settings than vehicle class (which derives its shadowing from ShapeBase, this is stock TGE code). Take a look at shapeBase.cc line 2487 for details, you'll want to debug the code to make sure your object is entering the shadow code, if not it's related to the engine prefs, otherwise the problem could be related to the object itself and I would try a different DTS as a test.
Andy,
Take a look at the mission file, are the objects TSStatic or StaticShape? Only TSStatics cast static shadows. Also do the objects have collision boxes and are they large enough to cast shadows onto the terrain or interiors?
Someone, :)
Someone was looking into why wheeled vehicles don't cast wheel shadows it's because wheeledVehicle class uses the underlying ShapeBase object to render the vehicle body (including the shadow) then wheeledVehicle manually renders the wheels without adding the shadows.
03/23/2005 (1:04 pm)
Shawn,I just checked it out, the player class uses different shadow code and settings than vehicle class (which derives its shadowing from ShapeBase, this is stock TGE code). Take a look at shapeBase.cc line 2487 for details, you'll want to debug the code to make sure your object is entering the shadow code, if not it's related to the engine prefs, otherwise the problem could be related to the object itself and I would try a different DTS as a test.
Andy,
Take a look at the mission file, are the objects TSStatic or StaticShape? Only TSStatics cast static shadows. Also do the objects have collision boxes and are they large enough to cast shadows onto the terrain or interiors?
Someone, :)
Someone was looking into why wheeled vehicles don't cast wheel shadows it's because wheeledVehicle class uses the underlying ShapeBase object to render the vehicle body (including the shadow) then wheeledVehicle manually renders the wheels without adding the shadows.
#8
Andy
03/23/2005 (1:36 pm)
Yes, they are acutally fxShapeReplicatedStatic, which derives from TSStatic. But I believe the problem must be the bounding boxes. Thanks for your help. BTW, my game looks purty with your lighting. Thanks!Andy
#10
mMount.object == NULL && mGenerateShadow == true &&
image->isTranslucent == true)
mGenerateShadow AND isTranslucent are both false, now I gotta figure out where I set these and im gold.
Thanks a bunches John.
03/23/2005 (2:02 pm)
If (mShapeInstance && mCloakLevel == 0.0 &&mMount.object == NULL && mGenerateShadow == true &&
image->isTranslucent == true)
mGenerateShadow AND isTranslucent are both false, now I gotta figure out where I set these and im gold.
Thanks a bunches John.
#11
03/23/2005 (7:05 pm)
Sure thing! :)
#12
03/30/2005 (9:03 pm)
Just out of curiosity, will the DTS dynamic shadow code be a free update for those who've already purchase the Lighting Pack?
Torque Owner John Kabus (BobTheCBuilder)
The static DTS shadows are different from the dynamic DTS shadows (like from the player). Version 1.3 of the Lighting Pack doesn't change any of the dynamic shadow code, so I'm not sure what's happening here. Are you using the Lighting Pack code straight from the zip file, or has it been altered? If it's been altered try using the original code and see if the player shadows show up.
Also where are you seeing the problem? Is the default player casting a dynamic shadow onto the terrain and interiors? Does the hoverVehical class cast a shadow in TGE?
-John