Unigine::ObjectSky Class
Header: | #include <UnigineObjects.h> |
Inherits: | Object |
This class is used to create sky. It contains volumetric clouds generated by a physically accurate algorithm.
ObjectSky Class
Members
static ObjectSkyPtr create()
Constructor. Creates a new sky object.Ptr<ObjectSky> cast(const Ptr<Node> & node)
Casts an ObjectSky out of the Node instance.Arguments
- const Ptr<Node> & node - Pointer to Node.
Return value
Pointer to ObjectSky.Ptr<ObjectSky> cast(const Ptr<Object> & base)
Casts an ObjectSky out of the Object instance.Arguments
- const Ptr<Object> & base - Pointer to Object.
Return value
Pointer to ObjectSky.int setDensityImageName(const char * name)
Updates a density image used to generate the clouds.Arguments
- const char * name - Density image name.
Return value
1 if the density image is successfully set; otherwise, 0.const char * getDensityImageName()
Returns the density image name used used to generate the clouds.Return value
Density image name.void setDensityLayer(int layer)
Updates a layer of the density image that will be used to generate the clouds.Arguments
- int layer - Density image layer number from 0 to 3.
int getDensityLayer()
Returns the layer of the density image used to generate the clouds.Return value
Density image layer number.void setDensityOffset(const Math::vec3 & offset)
Sets offset for a 3D mask of volumetric clouds and repositions the clouds.Arguments
- const Math::vec3 & offset - Mask offset. Texture coordinates are passed as the first two elements of the vector; the third one is ignored.
Math::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.void setDensityVelocity(const Math::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.Arguments
- const Math::vec3 & velocity - Velocity in units per second.
Math::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.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).Arguments
- float distribute - Distribution power. The provided value is clamped to the range [2;4].
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 changed). 4 means visual optimization.Return value
Distribution power.void setExtinction(float extinction)
Updates the probability factor for clouds extinction.Arguments
- float extinction - Extinction factor.
float getExtinction()
Returns the current probability factor for clouds extinction.Return value
Extinction factor.void setHumidity(float humidity)
Updates the humidity factor.Arguments
- float humidity - Humidity factor.
float getHumidity()
Returns the current humidity factor.Return 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.Arguments
- int slices - Maximum number of cloud slices.
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.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.Arguments
- int slices - Minimum 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.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.Arguments
- int simulation - 1 to simulate clouds in the background; 0 not to perform any calculations.
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.Return value
1 if the simulation is activated; otherwise - 0.void setSize(const Math::vec3 & size)
Updates the size of the generated clouds.Arguments
- const Math::vec3 & size - Clouds size.
Math::vec3 getSize()
Returns the size of the generated clouds.Return value
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.Arguments
- int spherical - 1 for the whole sphere; 0 for a sky hemisphere.
int isSpherical()
Returns a value indicating whether a sky background cube map should be mapped onto a whole sphere rather then a hemisphere.Return value
1 if the sky is a sphere; 0, if a hemisphere.void setTransition(float transition)
Updates the probability factor for condensing the water vapor into clouds.Arguments
- float transition - Condensation factor.
float getTransition()
Returns the current probability factor for condensing the water vapor into clouds.Return value
Condensation factor.int type()
Returns the type of the node.Return value
Object type identifier.Last update: 2018-04-26
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)