Lighting pak and shadows
by Howard Dortch · in Torque Game Engine · 07/22/2004 (3:59 am) · 11 replies
I dont seem to have shadows on Static objects like trees or crates. I have selected the cast shadow box on the objects when I place them but no shadows. I have shadow on interior buildings. Any thing I need to check?
#2
07/22/2004 (4:40 am)
Ah I guess I worded that wrong. I put a static object in the scene like a tree and it does not cast a shadow on the landscape. Relight scene, quit game, reload game, no shadow... what should I look for?
#3
07/22/2004 (4:59 am)
The Lighting Pack uses the TSStatic object's collision mesh for shadow casting (makes lighting very fast), so make sure it has a collision mesh. Also make sure it's been added to the scene as a TSStatic object and not a StaticObject.
#4
new TSStatic() {
position = "32.1837 50.4363 131.406";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/decor/barrel.dts";
castShadows = "1";
receiveLMLighting = "1";
};
07/22/2004 (7:51 am)
Collision is on since I can run into it and shoot it. Would that be a fair assessment? Here is an object, just one, does it look correct? Didn't know if there was some part of the engine that I didn't compile properly..new TSStatic() {
position = "32.1837 50.4363 131.406";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/decor/barrel.dts";
castShadows = "1";
receiveLMLighting = "1";
};
#5
Is this object small, roughly player sized? Small objects have difficulty casting shadows onto the terrain due to the relatively small terrain light map getting stretched over a large area. Try scaling the object by 10 or 50 and see if it casts a shadow, this will test to make sure your integration competed successfully.
07/22/2004 (8:19 am)
Your setup looks good.Is this object small, roughly player sized? Small objects have difficulty casting shadows onto the terrain due to the relatively small terrain light map getting stretched over a large area. Try scaling the object by 10 or 50 and see if it casts a shadow, this will test to make sure your integration competed successfully.
#6
I'm also having the same problem. I tried scaling the DTS object up and it was indeed casting a slight shadow. However, when I do scale the object to where I do see the shadow it's still very slight even though the object is sitting directly underneath a spotlight. Would it be possible to make shadows a bit more drastic?
Thanks,
cm
10/23/2005 (7:29 am)
John,I'm also having the same problem. I tried scaling the DTS object up and it was indeed casting a slight shadow. However, when I do scale the object to where I do see the shadow it's still very slight even though the object is sitting directly underneath a spotlight. Would it be possible to make shadows a bit more drastic?
Thanks,
cm
#7
10/25/2005 (2:29 am)
If you lower the ambient light level then the shadows will be darker. The default ambient light level in torque seems oddly bright to me. Just remember, if your outdoor scene is overcast (lots of clouds) you'll want a high(ish) ambient level and fairly weak sun, the opposite for clear skys and harsh shadows.
#8
The light radius is set high enough to reach the object so I'd expect the shadow to be really dark. Just as dark as the player when it's directly under the spotlight. It would suck if this was all "scale related" because I'd hate to have to resize all of my objects.
10/25/2005 (6:47 am)
Hmm... The object in question is in an interior that doesn't allow light to pass through any of the portals. There are no leaks either, so the ambient light from the outside should not be reaching the object. I have a single spotlight (from the demo) over my object, and the ambient light is completely off. Again I do see a shadow, but it's way too faint.The light radius is set high enough to reach the object so I'd expect the shadow to be really dark. Just as dark as the player when it's directly under the spotlight. It would suck if this was all "scale related" because I'd hate to have to resize all of my objects.
#9
12/20/2007 (11:39 am)
I've noticed that TSStatic will not cast the shadow from it's collision mesh unless it's rotated at some arbitrary angle, no orthogonal angles (90, 180, 270, etc...).
#10
It was always a mistery for me why some trees have shadows and some not using the same dts, until I searched a lot and found your post.
When the tree is dropped in and not "right" rotated the function
SceneLighting::TerrainProxy::getShadowedSquares
return false !
I'am still trying to figure out why.....
05/08/2008 (7:01 am)
@JeremyIt was always a mistery for me why some trees have shadows and some not using the same dts, until I searched a lot and found your post.
When the tree is dropped in and not "right" rotated the function
SceneLighting::TerrainProxy::getShadowedSquares
return false !
I'am still trying to figure out why.....
#11
05/08/2008 (11:55 am)
I made a really but hopefully not so bad hack to solve this problem. Looking which angle the shape have and add 1 degree to the shape to fake another transform.
Torque Owner John Kabus (BobTheCBuilder)
Static DTS objects cast shadows, but cannot receive them - however the modeling guide shows how to assign lights to static objects creating light/shadow regions that prevent objects behind walls or other objects from receiving light. Using this method allows for very complex interior/exterior lighting.
-John