Torque 3D - Script Manual: ScatterSky Class Reference

TorqueScript

Main   Class List   Namespace List   Online

ScatterSky Class Reference
[Atmosphere]

Represents both the sun and sky for scenes with a dynamic time of day. More...

Inheritance diagram for ScatterSky:

List of all members.

Public Member Functions

void applyChanges ()
 Apply a full network update of all fields to all clients.

Public Attributes

ScatterSky

Only azimuth and elevation are networked fields. To trigger a full update of all other fields use the applyChanges ConsoleMethod.

ColorF ambientScale
 Modulates the ambient color of sunlight.
float exposure
 Controls the contrast of the sky and sun during daytime.
ColorF fogScale
 Modulates the fog color. Note that this overrides the LevelInfo.fogColor property, so you should not use LevelInfo.fogColor if the level contains a ScatterSky object.
float mieScattering
 Affects the size and intensity of light scattering around the sun.
float rayleighScattering
 Controls how blue the atmosphere is during the day.
float skyBrightness
 Global brightness and intensity applied to the sky and objects in the level.
ColorF sunScale
 Modulates the directional color of sunlight.
Advanced Lighting

Point3F attenuationRatio
 The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.
filename cookie
 A custom pattern texture which is projected from the light.
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.
float logWeight
 The logrithmic PSSM split distance factor.
int numSplits
 The logrithmic PSSM split distance factor.
Point4F overDarkFactor
 The ESM shadow darkening factor.
float shadowDistance
 The distance from the camera to extend the PSSM shadow.
float shadowSoftness
ShadowType shadowType
 The type of shadow to use on this light.
int texSize
 The texture size of the shadow map.
Orbit

float azimuth
 The horizontal angle of the sun measured clockwise from the positive Y world axis. This field is networked.
float elevation
 The elevation angle of the sun above or below the horizon. This field is networked.
float moonAzimuth
 The horizontal angle of the moon measured clockwise from the positive Y world axis. This is not animated by time or networked.
float moonElevation
 The elevation angle of the moon above or below the horizon. This is not animated by time or networked.
Lighting

float brightness
 The brightness of the ScatterSky's light object.
bool castShadows
 Enables/disables shadows cast by objects due to ScatterSky light.
Misc

float flareScale
 Changes the size and intensity of the flare.
LightFlareData flareType
 Datablock for the flare produced by the ScatterSky.
Advanced Lighting Lightmap

bool includeLightmappedGeometryInShadow
 This light should render lightmapped geometry during its shadow-map update (ignored if 'representedInLightmap' is false).
bool representedInLightmap
 This light is represented in lightmaps (static light, default: false).
ColorF shadowDarkenColor
 The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if 'representedInLightmap' is false).
Night

bool moonEnabled
 Enable or disable rendering of the moon sprite during night.
ColorF moonLightColor
 Color of light cast by the directional light during night.
string moonMat
 Material for the moon sprite.
float moonScale
 Controls size the moon sprite renders, specified as a fractional amount of the screen height.
ColorF nightColor
 The ambient color during night. Also used for the sky color if useNightCubemap is false.
string nightCubemap
 Cubemap visible during night.
ColorF nightFogColor
 The fog color during night.
bool useNightCubemap
 Transition to the nightCubemap during night. If false we use nightColor.

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

Represents both the sun and sky for scenes with a dynamic time of day.

ScatterSky renders as a dome shaped mesh which is camera relative and always overhead. It is intended to be part of the background of your scene and renders before all other objects types.

ScatterSky is designed for outdoor scenes which need to transition fluidly between radically different times of day. It will respond to time changes originating from a TimeOfDay object or the elevation field can be directly adjusted.

During day, ScatterSky uses atmosphereic sunlight scattering aproximations to generate a sky gradient and sun corona. It also calculates the fog color, ambient color, and sun color, which are used for scene lighting. This is user controlled by fields within the ScatterSky group.

During night, ScatterSky supports can transition to a night sky cubemap and moon sprite. The user can control this and night time colors used for scene lighting with fields within the Night group.

A scene with a ScatterSky should not have any other sky or sun objects as it already fulfills both roles.

ScatterSky is intended to be used with CloudLayer and TimeOfDay as part of a scene with dynamic lighting. Having a ScatterSky without a changing time of day would unnecessarily give up artistic control compared and fillrate compared to a SkyBox + Sun setup.


Member Function Documentation

void ScatterSky::applyChanges (  ) 

Apply a full network update of all fields to all clients.


Member Data Documentation

Modulates the ambient color of sunlight.

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

The horizontal angle of the sun measured clockwise from the positive Y world axis. This field is networked.

The brightness of the ScatterSky's light object.

Enables/disables shadows cast by objects due to ScatterSky light.

A custom pattern texture which is projected from the light.

The elevation angle of the sun above or below the horizon. This field is networked.

Controls the contrast of the sky and sun during daytime.

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

Changes the size and intensity of the flare.

Datablock for the flare produced by the ScatterSky.

Modulates the fog color. Note that this overrides the LevelInfo.fogColor property, so you should not use LevelInfo.fogColor if the level contains a ScatterSky object.

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

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

The logrithmic PSSM split distance factor.

Affects the size and intensity of light scattering around the sun.

The horizontal angle of the moon measured clockwise from the positive Y world axis. This is not animated by time or networked.

The elevation angle of the moon above or below the horizon. This is not animated by time or networked.

Enable or disable rendering of the moon sprite during night.

Color of light cast by the directional light during night.

Material for the moon sprite.

Controls size the moon sprite renders, specified as a fractional amount of the screen height.

The ambient color during night. Also used for the sky color if useNightCubemap is false.

Cubemap visible during night.

The fog color during night.

The logrithmic PSSM split distance factor.

The ESM shadow darkening factor.

Controls how blue the atmosphere is during the day.

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

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

The distance from the camera to extend the PSSM shadow.

The type of shadow to use on this light.

Global brightness and intensity applied to the sky and objects in the level.

Modulates the directional color of sunlight.

The texture size of the shadow map.

Transition to the nightCubemap during night. If false we use nightColor.



Copyright © GarageGames, LLC. All Rights Reserved.