This page has been translated automatically.
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::RenderEnvironmentPreset Class

Header:#include <UnigineRender.h>

The class represents an environment preset. Each preset has settings that can be get/set by using methods of the class.

To get an instance of the class, use the Render::getEnvironmentPreset() method:

Source code (C++)
// get the second environment preset
RenderEnvironmentPresetPtr preset = Render::get()->getEnvironmentPreset(1);

RenderEnvironmentPreset Class

Members


int getNum()

Returns the number of the preset.

Return value

Preset number. Available values: 0, 1, 2.

void setIntensity(float intensity)

Sets the intensity of the given preset. The preset intensity is used to blend the given environment preset with the other ones.
Notice
Presets overlay each other: the first preset overlays the zero one, the second overlays the first and the zero ones.

Arguments

  • float intensity - Intensity of the preset.

float getIntensity()

Returns the intensity of the preset. The preset intensity is used to blend the environment preset with the other ones.
Notice
Presets overlay each other: the first preset overlays the zero one, the second overlays the first and the zero ones.

Return value

Intensity of the preset.

void setScatteringGroundColor(const Math::vec4 & color)

Sets the color of the imitated landscape (ground) for the preset. For example, you can specify a green color for the forest, a brown color for the desert and so on.

Arguments

  • const Math::vec4 & color - Ground color.

Math::vec4 getScatteringGroundColor()

Returns the current color set for the imitated landscape (ground) for the preset.

Return value

Ground color.

void setScatteringMieLUTName(const char * name)

Sets the path to the Mie LUT texture (the texture for setting the color of the light round the sun) for the preset. The Mie texture is used for both sun and moon.

Arguments

  • const char * name - Path to the texture.

const char * getScatteringMieLUTName()

Returns the path to the Mie LUT texture (the texture for setting the color of the light round the sun) set for the preset. The Mie texture is used for both sun and moon.

Return value

Path to the texture.

void setScatteringLightColorLUTName(const char * name)

Sets the path to the light color texture (the texture defining the color of the LightWorld for different times of the day) for the preset.

Arguments

  • const char * name - Path to the texture.

const char * getScatteringLightColorLUTName()

Returns the path to the light color texture (the texture defining the color of the LightWorld for different times of the day).

Return value

Path to the texture.

void setScatteringGroundLUTName(const char * name)

Sets the path to the ground LUT texture (the texture imitating lighting and reflections from the landscape) for the preset.

Arguments

  • const char * name - Path to the texture.

const char * getScatteringGroundLUTName()

Returns the path to the ground LUT texture (the texture imitating lighting and reflections from the landscape) set for the preset.

Return value

Path to the texture.

void setScatteringBaseLUTName(const char * name)

Sets the path to the base LUT texture (the texture defining the base color of the sky) for the preset.

Arguments

  • const char * name - Path to the texture.

const char * getScatteringBaseLUTName()

Returns the path to the base LUT texture (the texture defining the base color of the sky) set for the preset.

Return value

Path to the texture.

void setHazeMaxDistance(float distance)

Sets the distance starting at which the haze becomes completely solid, so nothing will be seen behind. For large terrains it is recommended to the this parameter equal to your camera's Far parameter. This is required for distant objects to fade into the distance instead of being cut sharply.

Arguments

  • float distance - Haze maximum visibility distance.

float getHazeMaxDistance()

Returns the distance starting at which the haze becomes completely solid, so nothing will be seen behind.

Return value

Haze maximum visibility distance.

void setHazeColor(const Math::vec4 & color)

Sets the color of the haze for the preset. This function will take effect only if the HAZE_SOLID mode is set via setEnvironmentHazeMode().

Arguments

  • const Math::vec4 & color - Haze color.

Math::vec4 getHazeColor()

Returns the haze color for the preset.
Notice
This function will return color only if the HAZE_SOLID mode is set via setEnvironmentHazeMode().

Return value

Haze color.

void setHazeDensity(float density)

Sets the density of the haze for the preset.

Arguments

  • float density - Haze density.

float getHazeDensity()

Returns the haze density set for the preset.

Return value

Haze density.

void setReflectionIntensity(float intensity)

Sets intensity of the environment reflection for the preset. 0 value means no environment reflection for the preset.
Notice
It is recommended to use the default value of the parameter to keep the image realistic.

Arguments

  • float intensity - Intensity value of the environment reflection.

float getReflectionIntensity()

Returns the intensity of the environment reflections for the preset. 0 value means no environment reflections for the preset.

Return value

The intensity value of the environment reflections.

void setSkyIntensity(float intensity)

Sets intensity of the environment sky for the preset. 0.0f value means no environment sky for the preset.
Notice
It is recommended to use the default value of the parameter to keep the image realistic. If, for example, the sky looks too dark in contrast with lighting from it, you should check exposure and tone mapping settings before changing the environment intensity.

Arguments

  • float intensity - Intensity value of the environment sky.

float getSkyIntensity()

Returns the intensity of the environment sky set for the preset.

Return value

Intensity value of the environment sky.

void setAmbientIntensity(float intensity)

Sets the intensity of the environment ambient lighting for the preset. 0 value means no environment ambient lighting for the preset. The higher the value, the more ambient lighting affects environment.
Notice
It is recommended to use the default value of the parameter to keep the image realistic.

Arguments

  • float intensity - Intensity value of the environment ambient lighting. The value can be greater than 1.0f (useful for dark scenes).

float getAmbientIntensity()

Returns the intensity of the environment ambient lighting for the preset. 0 value means no environment ambient lighting for the preset. The higher the value, the more ambient lighting affects environment.

Return value

The intensity value of environment ambient lighting. The value can be greater than 1.0f.

void setTextureName(const char * name)

Sets the path to the cubemap defining the environment color for the preset. This texture is used for imitating landscape reflections and lighting in accordance with the ground mask.

Arguments

  • const char * name - Path to the cubemap defining the environment color.

const char * getTextureName()

Returns the path to the cubemap defining the environment color set for the preset. This texture is used for imitating landscape reflections and lighting in accordance with the ground mask.

Return value

Path to the cubemap defining the environment color.

void setTextureColor(const Math::vec4 & color)

Sets the environment color multiplier for the preset. The alpha channel defines visibility of the environment cubemap above scattering. The color multiplier is required when you need to display a sky with a photo texture and dynamic gradients at the same time.

Arguments

  • const Math::vec4 & color - The environment color multiplier.

Math::vec4 getTextureColor()

Returns the environment color multiplier set for the preset. The alpha channel defines visibility of the environment cubemap above scattering. The color multiplier is required when you need to display a sky with a photo texture and dynamic gradients at the same time.

Return value

The environment color multiplier.

void setTextureRotation(const Math::vec3 & rotation)

Sets rotation of the environment texture along three axes.

Arguments

  • const Math::vec3 & rotation - Rotation of the texture along X, Y, Z axes, in degrees.

Math::vec3 getTextureRotation()

Returns rotation of the environment texture along three axes, in degrees.

Return value

Rotation of the texture along X, Y, Z axes, in degrees.

void setTextureBlur(float blur)

Sets the blur intensity for the environment texture. This value can be used to make blurred panorama at the background.
Notice
Reflections and ambient lighting aren't blurred.

Arguments

  • float blur - Blur intensity.

float getTextureBlur()

Returns the blur intensity for the environment texture.
Notice
Reflections and ambient lighting aren't blurred.

Return value

Blur intensity.
Last update: 2017-10-20
Build: ()