UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials

ObjectSky Class

This class is used to create sky. It contains volumetric clouds generated by a physically accurate algorithm.

ObjectSky Class

This class inherits from Object

Members


ObjectSky ()

Constructor. Creates a new sky object.

string getDensityImageName ()

Returns the density image name used used to generate the clouds.

Return value

Density image name.

int getDensityLayer ()

Returns the layer of the density image used to generate the clouds.

Return value

Density image layer number.

vec3 getDensityOffset ()

Returns the current offset of a 3D mask of volumetric clouds. Texture coordinates are received in the first two elements of the vector.

Return value

Mask offset.

vec3 getDensityVelocity ()

Returns the current velocity vector values for shifting the density image and thus imitating wind in the clouds.

Return value

Velocity in units per second.

float getDistribute ()

Returns the density of volumetric clouds in the distance. If a low value is used, more clouds are rendered in the distance while there are less of them near the camera (the number of slices is not chnaged). The default is 4 (no visual optimization).

Return value

Distribution power.

float getExtinction ()

Returns the current probability factor for clouds extinction.

Return value

Extinction factor.

float getHumidity ()

Returns the current humidity factor.

Return value

Humidity factor.

int getMaxSlices ()

Returns the maximum number of cloud slices, which are rendered when the player moves away from the clouds (along the Z axis) further than their bounding box height.

Return value

Maximum number of cloud slices.

int getMinSlices ()

Returns the minimum number of cloud slices, which are rendered when the player is within the clouds bounding box.

Return value

Minimum number of cloud slices.

int getSimulation ()

Returns a flag if volumetric clouds are simulated in the background when the volume surface is disabled or no material is assigned to it. When weather is controlled by Tracker, clouds are enabled and rendered much faster, since all required calculations are already done. The default is 0 (not to simulate).

Return value

1 if the simulation is activated; otherwise - 0 (by default).

vec3 getSize ()

Returns the size of the generated clouds.

Return value

Clouds size.

float getTransition ()

Returns the current probability factor for condensing the water vapor into clouds.

Return value

Condensation factor.

int isSpherical ()

Returns a value indicating whether a sky background cube map should be mapped onto a whole sphere rather then a hemisphere. The default is 0 (a hemisphere).

Return value

1 if the sky is a sphere; 0, if a hemisphere.

int setDensityImageName (string name)

Updates a density image used to generate the clouds.

Arguments

  • string name - Density image name.

Return value

1 if the density image is successfully set; otherwise, 0.

void setDensityLayer (int layer)

Updates a layer of the density image that will be used to generate the clouds. The default is 0.

Arguments

  • int layer - Density image layer number from 0 to 3.

void setDensityOffset (vec3 offset)

Sets offset for a 3D mask of volumetric clouds and repositions the clouds.

Arguments

  • vec3 offset - Mask offset. Texture coordinates are passed as the first two elements of the vector; the third one is ignored.

void setDensityVelocity (vec3 velocity)

Updates the velocity vector values for shifting the density image and thus imitating wind in the clouds. If velocity values are set for the X- and Y-coordinates, the shift only applies to the chosen density image layer. If velocity value is set for the Z-coordinate, all the layers will be shifted between. The default is vec3_zero.

Arguments

  • vec3 velocity - Velocity in units per second.

void setDistribute (float distribute)

Sets the density of volumetric clouds in the distance. If a low value is set, more clouds are rendered in the distance while there are less of them near the camera (the number of slices is not chnaged). The default is 4 (no visual optimization).

Arguments

  • float distribute - Distribution power. The provided value is clamped to the range [2;4].

void setExtinction (float value)

Updates the probability factor for clouds extinction. The default is 0.1.

Arguments

  • float value - Extinction factor.

void setHumidity (float value)

Updates the humidity factor. The default is 0.01.

Arguments

  • float value - Humidity factor.

void setMaxSlices (int slices)

Updates the maximum number of cloud slices, which are rendered when the player moves away from the clouds (along the Z axis) further than their bounding box height. The maximum number will gradually decrease down to the minimum number as the player moves closer to the clouds. The default is 512 slices.

Arguments

  • int slices - Maximum number of cloud slices.

void setMinSlices (int slices)

Updates the minimum number of cloud slices, which are rendered when the player is within the clouds bounding box. The minimum number of slices will gradually increase up to the maximum number as the player moves away from the clouds. The default is 256 slices.

Arguments

  • int slices - Minimum number of cloud slices.

void setSimulation (int simulation)

Sets a flag to simulate volumetric clouds in the background when the volume surface is disabled or no material is assigned to it. When weather is controlled by Tracker, clouds are enabled and rendered much faster, since all required calculations are already done. The default is 0 (not to simulate).

Arguments

  • int simulation - 1 to simulate clouds in the background; 0 not to perform any calculations.

void setSize (vec3 size)

Updates the size of the generated clouds. The default is (8000,8000,1000).

Arguments

  • vec3 size - Clouds size.

void setSpherical (int spherical)

Sets a value indicating if a sky background cube map should be mapped onto a whole sphere rather then a hemisphere. The default is 0 (a hemisphere).

Arguments

  • int spherical - 1 for the whole sphere; 0 for a sky hemisphere.

void setTransition (float value)

Updates the probability factor for condensing the water vapor into clouds. The default is 0.005.

Arguments

  • float value - Condensation factor.
Last update: 2017-07-03