Torque3D Documentation / _generateds / LightDescription

LightDescription

consoledoc.h

A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual "LightBase" objects.

More...

Light

LinearColorF

Changes the base color hue of the light.

float

Adjusts the lights power, 0 being off completely.

float

Controls the size (radius) of the light.

bool

Enables/disabled shadow casts by this light.

int

static shadow refresh rate (milliseconds)

int

dynamic shadow refresh rate (milliseconds)

Light Animation

Datablock containing light animation information (LightAnimData)

float

The length of time in seconds for a single playback of the light animation.

float

The phase used to offset the animation start time to vary the animation of nearby lights.

Misc

Datablock containing light flare information (LightFlareData)

float

Globally scales all features of the light flare.

Advanced Lighting

Point3F

The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.

The type of shadow to use on this light.

filename

A custom pattern texture which is projected from the light.

int

The texture size of the shadow map.

Point4F

The ESM shadow darkening factor.

float

The distance from the camera to extend the PSSM shadow.

int

The logrithmic PSSM split distance factor.

float

The logrithmic PSSM split distance factor.

float

Start fading shadows out at this distance. 0 = auto calculate this distance.

bool

This toggles only terrain being rendered to the last split of a PSSM shadow map.

Advanced Lighting Lightmap

bool

This light is represented in lightmaps (static light, default: false)

LinearColorF

The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if 'representedInLightmap' is false)

bool

This light should render lightmapped geometry during its shadow-map update (ignored if 'representedInLightmap' is false)

Public Functions

void

Force an inspectPostApply call for the benefit of tweaking via the console.

Detailed Description

A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual "LightBase" objects.

This datablock stores the properties of that light as fields that can be initialized from script.

// Declare a light description to be used on a rocket launcher projectile
datablock LightDescription(RocketLauncherLightDesc)
{
   range = 4.0;
   color = "1 1 0";
   brightness = 5.0;
   animationType = PulseLightAnim;
   animationPeriod = 0.25;
};

// Declare a ProjectileDatablock which uses the light description
datablock ProjectileData(RocketLauncherProjectile)
{
   lightDesc = RocketLauncherLightDesc;

   projectileShapeName = "art/shapes/weapons/SwarmGun/rocket.dts";

   directDamage = 30;
   radiusDamage = 30;
   damageRadius = 5;
   areaImpulse = 2500;

   // ... remaining ProjectileData fields not listed for this example
};

Light

LinearColorF color 

Changes the base color hue of the light.

float brightness 

Adjusts the lights power, 0 being off completely.

float range 

Controls the size (radius) of the light.

bool castShadows 

Enables/disabled shadow casts by this light.

int staticRefreshFreq 

static shadow refresh rate (milliseconds)

int dynamicRefreshFreq 

dynamic shadow refresh rate (milliseconds)

Light Animation

LightAnimData animationType 

Datablock containing light animation information (LightAnimData)

float animationPeriod 

The length of time in seconds for a single playback of the light animation.

float animationPhase 

The phase used to offset the animation start time to vary the animation of nearby lights.

Misc

LightFlareData flareType 

Datablock containing light flare information (LightFlareData)

float flareScale 

Globally scales all features of the light flare.

Advanced Lighting

Point3F attenuationRatio 

The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.

ShadowType shadowType 

The type of shadow to use on this light.

filename cookie 

A custom pattern texture which is projected from the light.

int texSize 

The texture size of the shadow map.

Point4F overDarkFactor 

The ESM shadow darkening factor.

float shadowDistance 

The distance from the camera to extend the PSSM shadow.

float shadowSoftness 
int numSplits 

The logrithmic PSSM split distance factor.

float logWeight 

The logrithmic PSSM split distance factor.

float fadeStartDistance 

Start fading shadows out at this distance. 0 = auto calculate this distance.

bool lastSplitTerrainOnly 

This toggles only terrain being rendered to the last split of a PSSM shadow map.

Advanced Lighting Lightmap

bool representedInLightmap 

This light is represented in lightmaps (static light, default: false)

LinearColorF shadowDarkenColor 

The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if 'representedInLightmap' is false)

bool includeLightmappedGeometryInShadow 

This light should render lightmapped geometry during its shadow-map update (ignored if 'representedInLightmap' is false)

Public Functions

apply()

Force an inspectPostApply call for the benefit of tweaking via the console.

Normally this functionality is only exposed to objects via the World Editor, once changes have been made. Exposing apply to script allows you to make changes to it on the fly without the World Editor.

note:

This is intended for debugging and tweaking, not for game play

// Change a property of the light description
RocketLauncherLightDesc.brightness = 10;

// Make it so
RocketLauncherLightDesc.apply();