ScatterSky

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

Inherit:
SceneObject

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.

Methods

void ScatterSky::applyChanges()

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

Fields

ColorF ScatterSky::ambientScale

Modulates the ambient color of sunlight.

Point3F ScatterSky::attenuationRatio

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

float ScatterSky::azimuth

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

float ScatterSky::brightness

The brightness of the ScatterSky’s light object.

bool ScatterSky::castShadows

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

ColorF ScatterSky::colorize

Tints the sky the color specified, the alpha controls the brigthness. The brightness is multipled by the value of colorizeAmt.

float ScatterSky::colorizeAmount

Controls how much the the alpha component of colorize brigthens the sky. Setting to 0 returns default behavior.

filename ScatterSky::cookie

A custom pattern texture which is projected from the light.

float ScatterSky::elevation

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

float ScatterSky::exposure

Controls the contrast of the sky and sun during daytime.

float ScatterSky::fadeStartDistance

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

float ScatterSky::flareScale

Changes the size and intensity of the flare.

LightFlareData ScatterSky::flareType

Datablock for the flare produced by the ScatterSky .

ColorF ScatterSky::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.

bool ScatterSky::includeLightmappedGeometryInShadow

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

bool ScatterSky::lastSplitTerrainOnly

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

float ScatterSky::logWeight

The logrithmic PSSM split distance factor.

float ScatterSky::moonAzimuth

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

float ScatterSky::moonElevation

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

bool ScatterSky::moonEnabled

Enable or disable rendering of the moon sprite during night.

ColorF ScatterSky::moonLightColor

Color of light cast by the directional light during night.

string ScatterSky::moonMat

Material for the moon sprite.

float ScatterSky::moonScale

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

ColorF ScatterSky::nightColor

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

string ScatterSky::nightCubemap

Cubemap visible during night.

ColorF ScatterSky::nightFogColor

The fog color during night.

int ScatterSky::numSplits

The logrithmic PSSM split distance factor.

Point4F ScatterSky::overDarkFactor

The ESM shadow darkening factor.

float ScatterSky::rayleighScattering

Controls how blue the atmosphere is during the day.

bool ScatterSky::representedInLightmap

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

ColorF ScatterSky::shadowDarkenColor

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

float ScatterSky::shadowDistance

The distance from the camera to extend the PSSM shadow.

float ScatterSky::shadowSoftness
ShadowType ScatterSky::shadowType

The type of shadow to use on this light.

float ScatterSky::skyBrightness

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

ColorF ScatterSky::sunScale

Modulates the directional color of sunlight.

float ScatterSky::sunSize

Affects the size of the sun’s disk.

int ScatterSky::texSize

The texture size of the shadow map.

bool ScatterSky::useNightCubemap

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