Game Development Community

Shadows on terrain.

by Steve Self · in · 01/29/2006 (4:30 pm) · 6 replies

Hello,

I'm trying to build a Torque Game Engine project that is similar to the tutorial.base project up from scratch using the compiled lighting lit (with only a few changes, specifically the advanced camera resource). I've noticed that in the starter.fps folder provided as a demo, static shapes and interiors cast shadows on the terrain. However, in tutorial.base and in the folder that I'm building, the shadows don't appear.

I get the feeling that this is a really simple 'newbie' question, but can anybody tell me why this happens or where Torque decides what objects will cast shadows?

#1
01/29/2006 (5:14 pm)
Have you relit- alt L ?
#2
01/29/2006 (5:47 pm)
Yes, I've relit the mission. The strange thing is that static shapes and interiors cast static shadows onto interiors, but not the terrain.
#3
01/30/2006 (4:58 am)
Hi Steve,

Try changing the sun's azimuth by +-25 degrees, Torque's terrain lighting (in all of the engines; TGE, TSE, ...) makes some assumptions that speed up lighting tremendously, but also cause the shadows to disappear when the sun is perpendicular to any face on an interior's object box (in the mission editor). A good rule of thumb; if the terrain shadow is missing either rotate the interior slightly or change the sun's azimuth slightly.

-John
#4
01/30/2006 (8:29 pm)
Thanks John! That seemed to do the trick with making the shadow appear... I'm having another problem now, though. I noticed this mentioned before in other topics, but I didn't see any real solutions... Is there any way to increase the size of the shadow map for the terrain? I noticed in the starter.fps demo the trees cast visible shadows on the terrain. I have some trees that are a bit thinner but a lot taller that don't cast any shadow on the terrain (but do cast visible ones on interiors... the terrain gets SLIGHTLY dimmer around them but you really have to look hard). It looks as though, compared to the trees in starter.fps, they should cast a slightly visible shadow, but they don't. Any way to maybe increase the shadow map size to fit more detail, or do something like that to make the shadows more visible? Thanks!
#5
02/01/2006 (3:13 pm)
Hi Steve,

You can reduce the terrain block size (by editing the terrain in the mission editor), which makes the whole terrain smaller and makes the light map more dense. Or you can increase the size of the collision mesh so it contains more volume and casts a wider shadow.

Also you can use a StaticShape object instead, which casts projected shadows just like the player (for more details see the new and improved TLK 1.4 Modeler's Guide).

-John
#6
02/01/2006 (3:40 pm)
Thanks for the help! I didn't know about staticShapes casting projected shadows, but since I do now, I'm sure I could get the shadows to look good using a combination of staticShapes for smaller objects (shadows should probably fade at a distance for performance) and the terrain lightmap for bigger ones (like interiors). I think I've got it sorted out from here. Thanks!