Torque/LightingSystem/Lighting Effects

From TDN

Introduction

Various light based effects.

Contents


Mounting Lights

Lights actually attach to objects instead of mounting to them, which leaves the object's mount slot open. Lights are attached to objects in script by calling:

<light object>.attachToObject(<target object>);

The light determines the mount point and offset (both position and rotation) based on the datablock members MountPoint, MountPosition, and MountRotation.

Image:TLK-Mounted.jpg

Linking Lights to Particle Systems

Dynamic lights can be linked to particle emitters so the light's color and intensity is relative to that of the emitter's particles. This creates very realistic particle effects such as fire, plasma, and sparks.

Lights are linked to particle systems by setting the light object's ParticleEmitterName property to the name of the target particle emitter node. The particle emitter node's name must be unique to all other mission objects, so the correct object can be found, and the target must be a particle emitter node (not just an emitter) otherwise the light will not link to the particle system.

Image:TLK-ParticleLink.jpg

When linked the light object's color and intensity are tied to the particle system, however the overall lighting intensity can be further adjusted using the light object's ParticleColorAttenuation property.