Torque/LightingSystem/Performance Considerations

From TDN

Introduction

Performance considerations.

Contents


Dynamic DTS Shadows

Dynamic shadows create both rendering and cpu overhead, so it's a good idea to limit the usage of dynamic shadows. The easiest way to do this is to understand which object types cast dynamic shadows and to use them sparingly. Disabling animation and movement on static object shadows also helps a great deal.

DTS shadows can also be adjusted in-game to balance performance with graphic quality. The largest performance boost is achieved by disabling multiple DTS shadows, which significantly cuts down on the number of rendered shadows. Lowering the shadow detail level also helps, especially on older systems.

For more details on DTS shadows see the section DTS Lighting and Shadows.

Dynamic Lights

Dynamic lights have a high rendering overhead especially when compared with static lights which are rendered "for-free." Though dynamic lights are very usefully in many areas use them sparingly and try to keep them spread out, and avoid large radius dynamic lights at all costs.

Limit Dynamic DTS Lights

DTS objects are lit dynamically by all lights, even static lights (this has to do with the way DTS objects are rendered). As more and more lights illuminate a DTS object the rendering performance decreases especially on older cards. To avoid this use Torque's pref $pref::LightManager::sgMaxBestLights (TLK uses $pref::OpenGL::maxHardwareLights) to set an upper limit on the number of lights that can affect each DTS object.

Mix TLK and Map Lights

As more and more static lights are used, mission relight times increase. To minimize this, bake less important background lighting into the interiors using map light entities.

Ship Mission Lighting Files

To avoid the initial relight that occurs when running a mission for the first time ship the mission lighting files with your demos and games.

Use a Release Build

Release builds of Torque run anywhere from 2 to 4 times faster than debug builds, so always try to use a release build.