Unigine.FieldWeather Class
Inherits from: | Field |
This class is used to create and modify a weather field. The field is applied to CloudLayer object and specifies a local weather area. This type of field makes it possible to create local storms or clouds having their own coverage texture as well as to control their movement.
The number of weather fields on the scene is not limited as their impact on performance is not significant.
Creating a Weather Field
When creating a FieldWeather node you should specify a coverage texture for it as it doesn't have any default texture.
// create a new instance of the FieldWeather class and set its transformation
FieldWeather weather = new FieldWeather();
weather.setTransform(Mat4(1));
// set the size of the field
weather.setSize(vec3(4096.0f, 4096.0f, 4096.0f));
// set the coverage texture
weather.setTexturePath("unigine_project/textures/coverage.png");
FieldWeather Class
Properties
vec3 CloudsAnimationOffset#
The Sets the offset of the FieldWeather coverage texture.
int WindEnabled#
The A value indicating if local wind inside the fieldweather is enabled.
vec3 WindAnimation#
The current local wind speed in X, Y and Z directions.
Texture Texture#
The Grabs the current coverage texture of the FieldWeather and puts it into the given Texture instance.
string TexturePath#
The current path to the fieldweather's coverage texture.
float Intensity#
The Current intensity of the fieldweather. this parameter determines the degree of impact of the fieldweather coverage texture on the clouds.
float Power#
The current power value for the fieldweather coverage texture. this parameter derermines the contrast of the coverage texture and makes it possible to gradually increase cloudiness without changing the coverage texture.
float Attenuation#
The Current attenuation factor value. this parameter indicates how much the coverage texture attenuates starting from the center of the fieldweather to its edges.
int AttenuationType#
The current type of attenuation shape.
vec3 Size#
The current size of the fieldweather.
Members
FieldWeather ( ) #
Constructor. Creates a new empty FieldWeather instance with default properties.int SetTextureImage ( Image image ) #
Sets the given image as the coverage texture of the FieldWeather.Arguments
- Image image - Image instance with a coverage texture for the FieldWeather.
Return value
1 if the coverage texture was set successfully; otherwise, 0.int GetTextureImage ( Image image ) #
Grabs the coverage texture of the FieldWeather (already loaded to GPU) and saves it into the given Image instance.Arguments
- Image image - Image instance into which the current coverage texture will be grabbed.
Return value
1 if the coverage texture was grabbed successfully; otherwise, 0.static int type ( ) #
Returns the type of the object.Return value
FieldWeather type identifier.Last update:
2020-06-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)