Game Development Community

Non-baked building shadows - again (for John Kabus)

by Fabio Luis Stange · in Torque Game Engine · 12/16/2006 (9:13 am) · 1 replies

Bringing the topic up from the public forums.

#1
12/16/2006 (1:01 pm)
Cool, like I mentioned changing the shadow distance and intensity is easy in TGE 1.5:


Changing Shadow Distance

Open the file 'lightingSystem/sgObjectShadows.cc', on line 176 you'll see:

F32 shadowLen = [b]10.0f[/b] * shapeinstance->getShape()->radius;

Increasing the value 10.0f makes the shadows project further, lowering the value shortens them.

This is a quick fix related to the shadow distance (an oversight on my part) - in the file 'game/shadow.cc' on line 504, change:

F32 val = 1.0f - mPartitionVerts[i].y * [b]0.1f[/b];

To:

F32 val = 1.0f - mPartitionVerts[i].y * [b]mInvShadowDistance[/b];


Changing Shadow Intensity

Open the file 'lightingSystem/sgLighting.h' (this is the lighting system's compile-time config file), on line 30 you'll see:

#define SG_DYNAMIC_SHADOW_INTENSITY		[b]0.5[/b]

Increase the SG_DYNAMIC_SHADOW_INTENSITY value for darker shadows and decrease it for lighter shadows.