engine.render Functions
Provides access to Unigine rendering functions. For example, it is used by AppWall application to render onto multiple monitors.
Render Class
Members
int engine.render.getAlphaFade()
Returns a value indicating if alpha fading between object LODs is enabled.Return value
1 if alpha fading is enabled; otherwise, 0.void engine.render.setAnimationLeaf(float leaf)
Sets the global scale for rotation angle of vegetation leaves.Arguments
- float leaf - Global leaf rotation angle. If a negative value is provided, 0 will be used instead.
float engine.render.getAnimationLeaf()
Returns the current scale for rotation angle of vegetation leaves.Return value
Global leaf rotation angle.void engine.render.setAnimationScale(float scale)
Sets the global scale for rotation speed of vegetation leaves.Arguments
- float scale - Global leaf rotation speed.
float engine.render.getAnimationScale()
Returns the current global scale for rotation speed of vegetation leaves.Return value
Global leaf rotation speed.void engine.render.setAnimationStem(float stem)
Sets the global scale for movement amplitude of vegetation stems.Arguments
- float stem - Global stem amplitude scale. If a negative value is provided, 0 will be used instead.
float engine.render.getAnimationStem()
Returns the current global scale for movement amplitude of vegetation stems.Return value
Global stem amplitude scale.void engine.render.setAnimationTime(float time)
Sets the render animation time for vegetation.Arguments
- float time - Animation time in milliseconds.
float engine.render.getAnimationTime()
Returns the render animation time for vegetation.Return value
Animation time in milliseconds.void engine.render.setAnimationWind(vec3 wind)
Sets the direction of wind for all vegetation (grass and trees). It is a multiplier for the stem offset (in grass, stem and leaves materials).Arguments
- vec3 wind - Offset for vegetation under wind by X, Y and Z axes.
vec3 engine.render.getAnimationWind()
Returns the current direction of wind for all vegetation (grass and trees). It is a multiplier for the stem offset (in grass, stem and leaves materials).Return value
Offset for vegetation under wind by X, Y and Z axes.int engine.render.getAntialiasing()
Returns the type of enabled anti-aliasing. This method can be used to check the anti-aliasing type before calling get/setFXAAIntensity() function.Return value
The type of antialiasing:- 0 - no antialliasing used
- 1 - FXAA
- 2 - TAA
int engine.render.getAPI()
Returns the current Graphics API, or API_UNKNOWN if API cannot be identified.Return value
The Graphics API flag (see API_* variables).int engine.render.getAuxiliary()
Returns a value indicating if auxiliary buffer is used.Return value
1 if auxiliary buffer is used; otherwise, 0.void engine.render.setBackgroundColor(vec4 color)
Sets the background color by using given vector.Arguments
- vec4 color - A background color vector.
vec4 engine.render.getBackgroundColor()
Returns the background color vector.Return value
A background color vector.Texture engine.render.getBlack2DArrayTexture()
Returns black 2D array texture.Return value
Black 2D array texture.Texture engine.render.getBlack2DTexture()
Returns black 2D texture.Return value
Black 2D texture.Texture engine.render.getBlack3DTexture()
Returns black 3D texture.Return value
Black 3D texture.Texture engine.render.getBlackCubeTexture()
Returns black Cube texture.Return value
Black Cube texture.void engine.render.setBloomEnabled(int enable)
Enables or disables the bloom effect.Arguments
- int enable - 1 value to enable the bloom effect, 0 to disable.
int engine.render.isBloomEnabled()
Returns a value indicating if the bloom effect is enabled.Return value
1 if the bloom effect is enabled; otherwise, 0.void engine.render.setBloomPower(float power)
Sets the power of the bloom effect.Arguments
- float power - Bloom power value within the [0.0f; 1.0f] range. The default value is 0.7f.
float engine.render.getBloomPower()
Returns the power of the bloom effect.Return value
Bloom power value within the [0.0f; 1.0f] range.void engine.render.setBloomScale(float scale)
Sets the scale of the bloom effect.Arguments
- float scale - Bloom scale value within the [0.0f; 1.0f] range. The default value is 0.3f.
float engine.render.getBloomScale()
Returns the scale of the bloom effect.Return value
Bloom scale value within the [0.0f; 1.0f] range.void engine.render.setBudget(float budget)
Sets the render budget value, which limits the number of loaded/created graphics resources during a frame according to loading/creation time.Arguments
- float budget - Budget value in seconds. The default value is 1/60.
float engine.render.getBudget()
Returns current render budget value, which limits the number of loaded/created graphics resources during a frame according to loading/creation time.Return value
Budget value in seconds. The default value is 1/60.void engine.render.setCameraEffectsThreshold(float threshold)
Sets the threshold, which is used to detect if an object should be blurred in the HDR mode.Arguments
- float threshold - HDR threshold. If a negative value is provided, 0 will be used instead.
float engine.render.getCameraEffectsThreshold()
Returns the brightness threshold, which is used to detect if an object should be blurred in the HDR mode.Return value
HDR threshold.void engine.render.setCloudsDownsamplingRendering(int rendering)
Sets downsampling rendering for clouds. This parameter determines clouds resolution based on current screen resolution. It has a significant impact on performance.Arguments
- int rendering - One of the following values:
- 0 - full.
- 1 - half (by default).
- 2 - quad.
int engine.render.getCloudsDownsamplingRendering()
Return value
One of the following values:- 0 - full.
- 1 - half (by default).
- 2 - quad.
void engine.render.setCloudsDynamicCoverageArea(float area)
Sets dynamic coverage area for clouds. This parameter determines visibility distance for coverage of FieldWeather objects.Arguments
- float area - Dynamic coverage area, in units. The default value is 10 000.
float engine.render.getCloudsDynamicCoverageArea()
Returns current dynamic coverage area for clouds. This parameter determines visibility distance for coverage of FieldWeather objects.Return value
Dynamic coverage area, in units.void engine.render.setCloudsDynamicCoverageResolution(int resolution)
Sets dynamic coverage resolution for clouds. This parameter determines the quality of dynamic coverage texture for FieldWeather objects. Higher values make it possible to preserve texture details at high distances.Arguments
- int resolution - One of the following values:
- 0 - 128 x 128.
- 1 - 256 x 256 (by default).
- 2 - 512 x 512.
- 3 - 1024 x 1024.
- 4 - 2048 x 2048.
int engine.render.getCloudsDynamicCoverageResolution()
Returns current dynamic coverage resolution setting for clouds. This parameter determines the quality of dynamic coverage texture for FieldWeather objects. Higher values make it possible to preserve texture details at high distances.Return value
One of the following values:- 0 - 128 x 128.
- 1 - 256 x 256 (by default).
- 2 - 512 x 512.
- 3 - 1024 x 1024.
- 4 - 2048 x 2048.
void engine.render.setCloudsInterleavedRendering(int rendering)
Enables or disables interleaved rendering mode for clouds.Arguments
- int rendering - One of the following values:
- 0 - disabled (by default).
- 1 - 2 x 2.
- 2 - 4 x 4.
int engine.render.getCloudsInterleavedRendering()
Returns the value indicating current interleaved rendering mode for clouds. This mode can be used to gain performance. See getCloudsInterleavedRendering().Return value
One of the following values:- 0 - disabled (by default).
- 1 - 2 x 2.
- 2 - 4 x 4.
void engine.render.setCloudsLightingConeRadius(float radius)
Sets lighting cone sampling radius for clouds lighting.Arguments
- float radius - Lighting cone radius. The default value is 0.3.
float engine.render.getCloudsLightingConeRadius()
Returns current cone sampling radius for clouds lighting.Return value
Lighting cone radius.void engine.render.setCloudsLightingQuality(int quality)
Sets lighting quality for clouds. This parameter determines the number of samples used to calculate lighting for clouds.Arguments
- int quality - One of the following values:
- 0 - 1 sample, low quality.
- 1 - 3 samples, medium quality (by default).
- 2 - 5 samples, high quality.
- 3 - 6 samples, ultra quality.
int engine.render.getCloudsLightingQuality()
Returns current lighting quality setting for clouds. This parameter determines the number of samples used to calculate lighting for clouds.Return value
One of the following values:- 0 - 1 sample, low quality.
- 1 - 3 samples, medium quality (by default).
- 2 - 5 samples, high quality.
- 3 - 6 samples, ultra quality.
void engine.render.setCloudsLightingTraceLength(float length)
Sets lighting trace length for clouds. This parameter determines the maximum length of a sun ray inside a cloud.Arguments
- float length - Lighting trace length, in units. The default value is 200.
float engine.render.getCloudsLightingTraceLength()
Returns current lighting trace length for clouds. This parameter determines the maximum length of a sun ray inside a cloud.Return value
Lighting trace length, in units.void engine.render.setCloudsSamplingQuality(int quality)
Sets sampling quality for clouds. This parameter determines the number of samples used and affects cloud density.Arguments
- int quality - One of the following values:
- 0 - 1 noise sample, low quality (higher cloud density).
- 1 - 3 samples, medium quality (by default).
- 2 - 5 samples, high quality.
- 3 - 6 samples, ultra quality (lower density, the clouds are softer).
int engine.render.getCloudsSamplingQuality()
Returns current sampling quality setting for clouds.Return value
One of the following values:- 0 - 1 noise sample, low quality (higher cloud density).
- 1 - 3 samples, medium quality (by default).
- 2 - 5 samples, high quality.
- 3 - 6 samples, ultra quality (lower density, the clouds are softer).
void engine.render.setClutterDistance(float distance)
Sets the distance, at which (and farther) objects with "clutter" flag on will not be rendered.Arguments
- float distance - Distance, in units.
float engine.render.getClutterDistance()
Returns a distance, at which (and farther) objects with "clutter" flag on will not be rendered.Return value
Distance, in units.void engine.render.setColorBrightness(float brightness)
Sets the current brightness of the scene.Arguments
- float brightness - Brightness. The provided value is saturated in the range [-1.0f; 1.0f].
float engine.render.getColorBrightness()
Returns the current overall brightness of the scene.Return value
Current brightness.void engine.render.setColorContrast(float contrast)
Sets the current contrast of the scene.Arguments
- float contrast - Contrast. The provided value is saturated in the range [-1.0f; 1.0f].
float engine.render.getColorContrast()
Returns the current overall contrast of the scene.Return value
Current contrast.void engine.render.setColorGamma(float gamma)
Sets the current gamma of the scene.Arguments
- float gamma - Gamma. The provided value is saturated in the range [0.5f; 1.5f].
float engine.render.getColorGamma()
Returns the current overall gamma of the scene.Return value
Current gamma.void engine.render.setColorSaturation(float saturation)
Sets the current saturation of the scene.Arguments
- float saturation - Saturation. The provided value is saturated in the range [0.0f; 2.0f].
float engine.render.getColorSaturation()
Returns the current overall saturation of the scene.Return value
Current saturation.int engine.render.setColorTextureImage(Image image)
Sets a new color transformation image (LUT). This function resets a LUT texture name to null if it has been previously set via setColorTextureName().Arguments
- Image image - Color transformation image.
Return value
1 if the image is set successfully; otherwise, 0.int engine.render.getColorTextureImage(Image image)
Return the current color transformation image (LUT).Arguments
- Image image - Image to store the color transformation texture in.
Return value
1 if an image is successfully received; otherwise, 0.void engine.render.setColorTextureName(string name)
Sets the name of a new color transformation texture (LUT).Arguments
- string name - Name of the file with the texture. If NULL (0) is passed, the texture is cleared.
string engine.render.getColorTextureName()
Returns the name of the current color transformation texture (LUT).Return value
Name of the current color transformation texture.void engine.render.setColorWhite(vec4 white)
Sets the current white balance of the scene.Arguments
- vec4 white - White balance. The provided value is saturated in the range [vec4_epsilon;vec4_one].
vec4 engine.render.getColorWhite()
Returns the current white balance of the scene.Return value
Current white balance.void engine.render.setCompositeMaterial(string material)
Sets a custom composite material that specifies a custom shader used for the final composition of the full-screen image instead of the default one.Arguments
- string material - Composite material name.
string engine.render.getCompositeMaterial()
Returns a name of the current composite material that specifies a custom shader used for the final composition of the full-screen image instead of the default one.Return value
Name of the current composite material.int engine.render.getComputeShader()
Checks if the compute shaders are available.Return value
1 if compute shaders are available; otherwise, 0.void engine.render.setCrossAngle(float angle)
Sets the angle between flare shafts of a cross flare.Arguments
- float angle - Angle in degrees.
float engine.render.getCrossAngle()
Returns the angle between flare shafts of a cross flare.Return value
Angle between flare shafts in degrees.void engine.render.setCrossColor(vec4 color)
Sets the color of a cross flares.Arguments
- vec4 color - Color of cross flares.
vec4 engine.render.getCrossColor()
Returns the color of a cross flare.Return value
Color of a cross flare.void engine.render.setCrossEnabled(int mode)
Enables or disables cross flares.Arguments
- int mode - 1 to enable cross flares, 0 to disable.
int engine.render.isCrossEnabled()
Returns a value indicating if cross flares are enabled.Return value
1 if cross flares are enabled; otherwise, 0.void engine.render.setCrossLength(float length)
Sets the length of a cross flare.Arguments
- float length - Length of a cross flare relative to the screen width. The provided value is saturated in the range [0.0f; 1.0f].
float engine.render.getCrossLength()
Returns the length of a cross flare.Return value
Length of a cross flare relative to the screen width.void engine.render.setCrossScale(float scale)
Sets the multiplier for color of HDR cross flares.Arguments
- float scale - Cross color scale. If a negative value is provided, 0 will be used instead.
float engine.render.getCrossScale()
Returns the current multiplier for color of HDR cross flares.Return value
Cross color scale.void engine.render.setCrossShafts(int shafts)
Sets the number of cross flares.Arguments
- int shafts - The number of a cross flares. The provided value is saturated in the range [2; 32].
int engine.render.getCrossShafts()
Returns the number of cross flares.Return value
Number of cross flares.void engine.render.setCrossThreshold(float threshold)
Returns the brightness threshold for cross flares.Arguments
- float threshold - Cross flares threshold.
float engine.render.getCrossThreshold()
Returns the current brightness threshold for cross flares.Return value
Cross flares threshold.void engine.render.setData(string data)
Sets user data associated with the render. This string is written directly into a *.world file. Namely, into the data child tag of the render tag, for example:<world version="1.21">
<render>
<data>User data</data>
</render>
</world>
Arguments
- string data - New user data. The data can contain an XML formatted string.
string engine.render.getData()
Returns user data associated with the render. This string is written directly into a *.world file. Namely, into the data child tag of the render tag, for example:<world version="1.21">
<render>
<data>User data</data>
</render>
</world>
Return value
User data. The data can contain an XML formatted string.void engine.render.setDecalDistance(float distance)
Sets the distance, at which (and farther) decals will not be rendered.Arguments
- float distance - Distance in units.
float engine.render.getDecalDistance()
Returns the distance, at which (and farther) decals will not be rendered.Return value
Distance in units.int engine.render.isDepthZeroToOne()
void engine.render.setDirtScale(float scale)
Sets the scale of lens dirt effect modulating the pattern of lens flares. For example, it can be used to create an effect of unclean optics when the camera looks at the sun.Arguments
- float scale - Dirt scale value within the [0.0f; 1.0f] range. The default value is 0.5f.
float engine.render.getDirtScale()
Returns the scale of lens dirt effect modulating the pattern of lens flares.Return value
Dirt scale value within the [0.0f; 1.0f] range.void engine.render.setDirtTextureName(string name)
Sets the texture that modulates the pattern of lens flares. For example, it can be used to create an effect of unclean optics when the camera looks at the sun.Arguments
- string name - Name of the lens flares modulation texture.
string engine.render.getDirtTextureName()
Returns the name of the current texture that modulates the pattern of lens flares. For example, it can be used to create an effect of light reflections or unclean optics when the camera looks at the sun.Return value
Name of the lens flares modulation texture.void engine.render.setDistanceScale(float scale)
Sets the global distance scale for all distance parameters: shadow distance, light distance, LOD distances, etc.Arguments
- float scale - Global distance scale.
float engine.render.getDistanceScale()
Returns the current global distance scale for all distance parameters: shadow distance, world lights shadows, LOD distances, etc.Return value
Global distance scale.int engine.render.getDOF()
Returns a value indicating if DoF (Depth Of Field) effect is enabled.Return value
1 if DoF effect is enabled; otherwise, 0.void engine.render.setDOFBlur(float blur)
Sets the intensity of blur for DoF (Depth Of Field) effect.Arguments
- float blur - DoF blur intensity value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getDOFBlur()
Returns the intensity of blur for DoF (Depth Of Field) effect.Return value
DoF blur intensity value within the [0.0f; 1.0f] range.void engine.render.setDOFChromaticAberration(float aberration)
Sets the intensity of chromatic aberration for DoF (Depth Of Field) effect.Arguments
- float aberration - DoF chromatic aberration intensity value within the [0.0f; 1.0f] range. The default value is 0.0f.
float engine.render.getDOFChromaticAberration()
Returns the intensity of chromatic aberration for DoF (Depth Of Field) effect.Return value
DoF chromatic aberration intensity value within the [0.0f; 1.0f] range.void engine.render.setDOFFarDistance(float distance)
Sets the far DoF limit of the camera. The distance between the camera and the furthest element that is considered to be acceptably sharp.Arguments
- float distance - Far DoF limit value in units.
float engine.render.getDOFFarDistance()
Returns the far DoF limit of the camera. The distance between the camera and the furthest element that is considered to be acceptably sharp.Return value
Far DoF limit value in units.void engine.render.setDOFFarFocalOffset(float offset)
Sets the far focal offset for DoF (Depth Of Field) effect. The offset from the focal to the farthest blurred zone.Arguments
- float offset - Far DoF focal offset value in units.
float engine.render.getDOFFarFocalOffset()
Returns the far focal offset for DoF (Depth Of Field) effect. The offset from the focal to the farthest blurred zone.Return value
Far DoF focal offset value in units.void engine.render.setDOFFocalDistance(float distance)
Sets the focal distance of the camera, i.e. a point where objects are in-focus and clear.Arguments
- float distance - Focal distance in units. If a negative value is provided, 0 will be used instead.
float engine.render.getDOFFocalDistance()
Returns a distance to objects in focus.Return value
Distance to the camera focus in units.void engine.render.setDOFNearDistance(float distance)
Sets the near DoF limit of the camera. The distance between the camera and the first element that is considered to be acceptably sharp.Arguments
- float distance - Near DoF limit value in units.
float engine.render.getDOFNearDistance()
Returns the near DoF limit of the camera. The distance between the camera and the first element that is considered to be acceptably sharp.Return value
Near DoF limit value in units.void engine.render.setDOFNearFocalOffset(float offset)
Sets the near focal offset for DoF (Depth Of Field) effect. The offset from the focal to the nearest blurred zone.Arguments
- float offset - Near DoF focal offset value in units.
float engine.render.getDOFNearFocalOffset()
Returns the near focal offset for DoF (Depth Of Field) effect. The offset from the focal to the nearest blurred zone.Return value
Near DoF focal offset value in units.void engine.render.setEnabled(int arg1)
Enables or disables the render.Arguments
- int arg1 - 1 to enable the render, 0 to disable it.
int engine.render.isEnabled()
Returns a value indicating if the render is enabled.Return value
1 if the render is enabled; otherwise, 0.void engine.render.setEnvironmentAmbientIntensity(int num, float intensity)
Sets the intensity value of the environment ambient lighting for given preset. 0 value means no environment ambient lighting for given preset.Arguments
- int num - The number of preset.
- float intensity - Intensity value of the environment ambient lighting for given preset.
float engine.render.getEnvironmentAmbientIntensity(int num = -1)
Returns the intensity value of the environment ambient lighting for given preset.Arguments
- int num - The number of preset.
Return value
The intensity value of environment ambient lighting preset.void engine.render.setEnvironmentHazeColor(int num, vec4 arg2)
Sets the color of the haze for the given preset. This function will take effect only if the HAZE_SOLID mode is used.Arguments
- int num - Preset number.
- vec4 arg2 - Haze color.
vec4 engine.render.getEnvironmentHazeColor(int num = -1)
Returns the current haze color set for the given preset.Arguments
- int num - Preset number.
Return value
Haze color.void engine.render.setEnvironmentHazeDensity(int num, float arg2)
Sets the density of the haze for the given preset.Arguments
- int num - Preset number.
- float arg2 - Haze density.
float engine.render.getEnvironmentHazeDensity(int num)
Returns the current haze density set for the given preset.Arguments
- int num - Preset number.
Return value
Haze density.void engine.render.setEnvironmentHazeMaxDistance(int num, float arg2)
Sets the distance at which the haze appears for the given preset.Arguments
- int num - Preset number.
- float arg2 - Haze maximum visibility distance.
float engine.render.getEnvironmentHazeMaxDistance(int num)
Returns the current distance at which the haze effect appears for the given preset.Arguments
- int num - Preset number.
Return value
Haze maximum distance.void engine.render.setEnvironmentHazeMode(int mode)
Sets the mode for the haze effect.Arguments
- int mode - One of the RENDER_HAZE_* variables.
int engine.render.getEnvironmentHazeMode()
Returns the current mode set for the haze effect.Return value
One of the RENDER_HAZE_* variables.void engine.render.setEnvironmentPresetIntensity(int num, float arg2)
Sets the intensity of the given preset.Arguments
- int num - Preset number.
- float arg2 - Intensity of the preset.
float engine.render.getEnvironmentPresetIntensity(int num)
Returns the intensity of the given preset.Arguments
- int num - Preset number.
Return value
Intensity of the preset.void engine.render.setEnvironmentReflectionIntensity(int num, float intensity)
Sets the intensity value of the environment reflection for given preset. 0 value means no environment reflection for given preset.Arguments
- int num - The number of preset.
- float intensity - Intensity value of the environment reflection for given preset.
float engine.render.getEnvironmentReflectionIntensity(int num = -1)
Returns the intensity value of the environment reflection for given preset.Arguments
- int num - The number of preset.
Return value
The intensity value of environment reflection preset.void engine.render.setEnvironmentScatteringBaseLUTName(int num, string arg2)
Sets the path to the base LUT texture (the texture defining the base color of the sky) for the given preset.Arguments
- int num - Preset number.
- string arg2 - Path to the texture.
string engine.render.getEnvironmentScatteringBaseLUTName(int num)
Returns the path to the base LUT texture (the texture defining the base color of the sky) set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the texture.void engine.render.setEnvironmentScatteringGroundColor(int num, vec4 arg2)
Sets the color set for the imitated landscape (ground) for the given preset.Arguments
- int num - Preset number.
- vec4 arg2 - Ground color.
vec4 engine.render.getEnvironmentScatteringGroundColor(int num)
Returns the current color set for the imitated landscape (ground).Arguments
- int num - Preset number.
Return value
Ground color.void engine.render.setEnvironmentScatteringGroundLUTName(int num, string arg2)
Sets the path to the ground LUT texture (the texture imitating lighting and reflections from the landscape) for the given preset.Arguments
- int num - Preset number.
- string arg2 - Path to the texture.
string engine.render.getEnvironmentScatteringGroundLUTName(int num)
Returns the path to the ground LUT texture (the texture imitating lighting and reflections from the landscape) set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the texture.void engine.render.setEnvironmentScatteringLightColorLUTName(int num, string arg2)
Sets the path to the light color texture (the texture defining the color of the LightWorld for different times of the day) for the given preset.Arguments
- int num - Preset number.
- string arg2 - Path to the texture.
string engine.render.getEnvironmentScatteringLightColorLUTName(int num)
Returns the path to the light color texture (the texture defining the color of the LightWorld for different times of the day).Arguments
- int num - Preset number.
Return value
Path to the texture.void engine.render.setEnvironmentScatteringMieLUTName(int num, string arg2)
Sets the path to the Mie LUT texture (the texture for setting the Mie light) for the given preset.Arguments
- int num - Preset number.
- string arg2 - Path to the texture.
string engine.render.getEnvironmentScatteringMieLUTName(int num)
Returns the path to the Mie LUT texture (the texture for setting the Mie light) set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the texture.void engine.render.setEnvironmentSkyIntensity(int num, float intensity)
Sets the intensity value of the environment sky for given preset. 0.0f value means no environment sky for given preset.Arguments
- int num - The number of preset.
- float intensity - Intensity value of the environment sky for given preset.
float engine.render.getEnvironmentSkyIntensity(int num = -1)
Returns the intensity value of the environment sky for given preset.Arguments
- int num - The number of preset.
Return value
Intensity value of the sky for given preset.void engine.render.setEnvironmentTextureColor(int num, vec4 arg2)
Sets the environment color multiplier for the given preset.Arguments
- int num - Preset number.
- vec4 arg2 - The environment color multiplier.
vec4 engine.render.getEnvironmentTextureColor(int num)
Returns the environment color multiplier set for the given preset.Arguments
- int num - Preset number.
Return value
The environment color multiplier.void engine.render.setEnvironmentTextureName(int num, string arg2)
Sets the path to the cubemap defining the environment color for the given preset.Arguments
- int num - Preset number.
- string arg2 - Path to the cubemap defining the environment color.
string engine.render.getEnvironmentTextureName(int num)
Returns the path to the cubemap defining the environment color set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the cubemap defining the environment color.void engine.render.setExposure(float exposure)
Sets the current exposure.Arguments
- float exposure - Exposure in seconds. The provided value is saturated in the range [0.0f; 4.0f].
float engine.render.getExposure()
Returns the current exposure.Return value
Current exposure in seconds.void engine.render.setExposureAdaptation(float adaptation)
Sets the current period of exposure adaptation.Arguments
- float adaptation - Period of adaptation in seconds. If a too small or even negative value is provided, 1E-6 will be used instead.
float engine.render.getExposureAdaptation()
Returns the current period of exposure adaptation.Return value
Period of exposure adaptation in seconds.void engine.render.setExposureMaxLuminance(float luminance)
Sets the maximum luminance used for rendering of adaptive exposure effect.Arguments
- float luminance - Maximum luminance. The provided value is saturated in the range [-10.0f; 10.0f].
float engine.render.getExposureMaxLuminance()
Returns the maximum luminance used for HDR rendering.Return value
Maximum luminance.void engine.render.setExposureMinLuminance(float luminance)
Sets the minimum luminance used for rendering of adaptive exposure effect.Arguments
- float luminance - Minimum luminance. The provided value is saturated in the range [-10.0f; 10.0f].
float engine.render.getExposureMinLuminance()
Returns the minimum luminance used for HDR rendering.Return value
Minimum luminance.void engine.render.setExposureMode(int mode)
Sets the mode of the adaptive exposure effect.Arguments
- int mode - The value indicating the exposure mode:
- 0 - disabled.
- 1 - logarithmic adaptive exposure.
- 2 - quadratic adaptive exposure.
int engine.render.getExposureMode()
Returns current adaptive exposure mode:- 0 - exposure is not used
- 1 - logarithmic adaptive exposure used
- 2 - quadratic adaptive exposure used
Return value
The type of exposure mode.void engine.render.setFadeColor(vec4 color)
Sets the current fade color for the scene on the screen. By gradually changing this value it is possible to create "fade in" and "fade out" effects depending on the w component of the given vector. For example, when the following vectors are passed the result will be:
- vec4(1,1,1,1) - a fully white screen. Positive w results in additive blending.
- vec4(0.5,0.5,0.5,1) - light colors on the screen.
- vec4(1,0,0,1) - R channel for all screen colors is to its maximum; G and B without changes.
- vec4(0,0,0,0) - there is no fading (no color alterations are done to the screen).
- vec4(1,1,1,-1) - a fully black screen. Negative w results inscene colors * (1 - RGB), where RGB is the first three components of the passed vector.
- vec4(0.5,0.5,0.5,-1) - dark colors on the screen.
Arguments
- vec4 color - Fade color for the scene on the screen. The provided vector represents RGB channel values (first three components) and a fading coefficient (w component). All components are saturated in the range [-1; 1].
vec4 engine.render.getFadeColor()
Returns the current fade color of the scene.Return value
Current fade color.void engine.render.setFieldDistance(float distance)
Sets the distance, at which (and farther) Field nodes will not be rendered.Arguments
- float distance - Distance in units.
float engine.render.getFieldDistance()
Returns the distance, at which (and farther) Field nodes will not be rendered.Return value
Distance in units.void engine.render.setFilmicLinearAngle(float angle)
Sets the Linear Angle filmic tonemapping parameter value.Arguments
- float angle - Liner Angle value.
float engine.render.getFilmicLinearAngle()
Returns the current Linear Angle filmic tone mapping parameter value.Return value
Liner Angle value.void engine.render.setFilmicLinearScale(float scale)
Sets the Linear Strength filmic tonemapping parameter value.Arguments
- float scale - Linear Strength value.
float engine.render.getFilmicLinearScale()
Returns the current Linear Strength filmic tone mapping parameter value.Return value
Linear Strength value.void engine.render.setFilmicShoulderScale(float scale)
Sets the Shoulder Strength filmic tonemapping parameter value.Arguments
- float scale - Shoulder Strength value.
float engine.render.getFilmicShoulderScale()
Returns the current Shoulder Strength filmic tonemapping parameter value.Return value
Shoulder Strength value.void engine.render.setFilmicToeDenominator(float denominator)
Sets the Toe Denominator filmic tonemapping parameter value.Arguments
- float denominator - Toe Denominator value.
float engine.render.getFilmicToeDenominator()
Returns the current Toe Denominator filmic tonemapping parameter value.Return value
Toe Denominator value.void engine.render.setFilmicToeNumerator(float numerator)
Sets the Toe Numerator filmic tonemapping parameter value.Arguments
- float numerator - Toe Numerator value.
float engine.render.getFilmicToeNumerator()
Sets the Toe Numerator filmic tonemapping parameter value.Return value
Toe Numerator value.void engine.render.setFilmicToeScale(float scale)
Sets the Toe Strength filmic tonemapping parameter value.Arguments
- float scale - Toe Strength value.
float engine.render.getFilmicToeScale()
Returns the current Toe Strength filmic tonemapping parameter value.Return value
Toe Strength value.void engine.render.setFilmicWhiteLevel(float level)
Sets the Linear White Point filmic tonemapping parameter value.Arguments
- float level - Linear White Point value.
float engine.render.getFilmicWhiteLevel()
Returns the current Linear White Point filmic tonemapping parameter value.Return value
Linear White Point value.void engine.render.setFirstFrame(int frame)
Sets a value indicating if the first frame should be enabled over the current frame.Arguments
- int frame - 1 to enable the first frame flag, 0 - to disable.
int engine.render.isFirstFrame()
Returns a value indicating if the first frame is enabled over the current frame.Return value
1 if the first frame flag is enabled; otherwise, 0.int engine.render.isFlipped()
Checks if the render orientation.Return value
1 if the render is flipped; otherwise, 0.void engine.render.setFXAAIntensity(float intensity)
Sets the intensity of the FXAA. Intensity specifies the sample offset of FXAA fragment.Arguments
- float intensity - Intensity value of the FXAA to be set.
float engine.render.getFXAAIntensity()
Returns the intensity value of the FXAA. Intensity specifies the sample offset of FXAA fragment.Return value
Intensity value of the FXAAint engine.render.getGeometryShader()
Returns a value indicating if geometry shader is used.Return value
1 if geometry shader is used; otherwise, 0.int engine.render.getGPUMemory()
Returns an amount of memory provided by the current GPU.Return value
Amount of memory in Mbytes.int engine.render.getGPUName()
Returns the name of the current GPU.Return value
GPU name flag.Texture engine.render.getGray2DArrayTexture()
Returns gray 2D array texture.Return value
Gray 2D array texture.Texture engine.render.getGray2DTexture()
Returns gray 2D texture.Return value
Gray 2D texture.Texture engine.render.getGray3DTexture()
Returns gray 3D texture.Return value
Gray 3D texture.Texture engine.render.getGrayCubeTexture()
Returns gray Cube texture.Return value
Gray Cube texture.void engine.render.setLensColor(vec4 color)
Sets the color of a lens flares.Arguments
- vec4 color - Color of lens flares.
vec4 engine.render.getLensColor()
Returns the color of a lens flare.Return value
Color of a lens flare.void engine.render.setLensDispersion(vec3 dispersion)
Sets the color displacement for red, greed and blue channels of the lens flares. Can be used to create light dispersion (chromatic aberrations).Arguments
- vec3 dispersion - Lens dispersion displacement per channel. If a negative value is set for a channel, 0 will be used instead.
vec3 engine.render.getLensDispersion()
Returns the current color displacement for red, greed and blue channels of the lens flares. Can be used to create light dispersion (chromatic aberrations).Return value
Lens dispersion displacement per channel.void engine.render.setLensEnabled(int mode)
Enables or disables lens flares.Arguments
- int mode - Positive integer to enable lens flares, 0 to disable.
int engine.render.isLensEnabled()
Returns a value indicating if lens flares are enabled.Return value
Positive integer if lens flares are enabled; otherwise, 0.void engine.render.setLensLength(float length)
Sets a length indicating if the whole radial lens flare is rendered on the screen or only a part of it. This option controls how lens flares pattern is distributed.Arguments
- float length - Length of the radial lens flare. The provided value is saturated in the range [0.0f; 1.0f].
float engine.render.getLensLength()
Returns the current length indicating if the whole radial lens flare is rendered on the screen or only a part of it. This option controls how lens flares pattern is distributed.Return value
Length of the lens flare.void engine.render.setLensRadius(float radius)
Sets a radius of the spherical lens flares on the screen.Arguments
- float radius - Radius of the spherical lens flares. The provided value is saturated in the range [0.0f; 1.0f], where 1.0f is a screen-wide radius (a lens flare is not visible).
float engine.render.getLensRadius()
Returns the current radius of the spherical lens flares on the screen.Return value
Radius of the spherical lens flares.void engine.render.setLensScale(float scale)
Sets the multiplier for color of HDR lens flares.Arguments
- float scale - Lens color scale. If a negative value is provided, 0.0f will be used instead.
float engine.render.getLensScale()
Returns the current multiplier for color of HDR lens flares.Return value
Lens color scale.void engine.render.setLensThreshold(float threshold)
Sets the brightness threshold for lens flares.Arguments
- float threshold - Lens flares threshold.
float engine.render.getLensThreshold()
Returns the current brightness threshold for lens flares.Return value
Lens flares threshold.void engine.render.setLightDistance(float distance)
Sets the distance, at which (and farther) dynamic lights will not be rendered.Arguments
- float distance - Distance in units.
float engine.render.getLightDistance()
Returns the distance, at which (and farther) dynamic lights will not be rendered.Return value
Distance in units.int engine.render.getMotionBlur()
Returns a value indicating if motion blur is enabled.Return value
1 if motion blur is enabled; otherwise, 0.void engine.render.setMotionBlurDepthFalloff(float falloff)
Sets motion blur falloff dependeing on depth.Arguments
- float falloff - Depth falloff.
float engine.render.getMotionBlurDepthFalloff()
Returns the motion blur falloff depending on depth.Return value
Depth falloffvoid engine.render.setMotionBlurMaxVelocity(float velocity)
Sets the maximum amount of motion blur for moving physical bodies.Arguments
- float velocity - Maximum scaled velocity of bodies used for the motion blur.
float engine.render.getMotionBlurMaxVelocity()
Returns the current maximum amount of motion blur for moving physical bodies.Return value
Maximum scaled velocity of bodies used for the motion blur.void engine.render.setMotionBlurVelocityScale(float scale)
Updates amount of motion blur for moving physical bodies.Arguments
- float scale - Scale of bodies' linear and angular velocities used for the motion blur. If a negative value is provided, 0 will be used instead.
float engine.render.getMotionBlurVelocityScale()
Returns the current amount of motion blur for moving physical bodies.Return value
Scale of bodies' linear and angular velocities used for the motion blur.int engine.render.getNumDecals()
Returns the number of rendered per frame decals that can be currently seen in the viewport (during all of the rendering passes).Return value
The number of decals.int engine.render.getNumDips()
Returns the number of draw calls used in the current scene. See Rendering Profiler article for details.Return value
The number of draw calls.int engine.render.getNumLights()
Returns the number of light passes rendered per frame. It means that the value contains the number of all light sources that are currently seen illuminating something in the viewport and also includes additional passes for rendering lights in the reflecting surfaces (if dynamical reflections are used). See Rendering Profiler article for details.Return value
The number of light passes.int engine.render.getNumMaterials()
Returns the number of materials set per frame (during all of the rendering passes) in the current scene.Return value
The number of materials.int engine.render.getNumPrimitives()
Returns the number of geometric rendered per frame primitives that can be currently seen in the viewport. See Rendering Profiler article for details.Return value
The number of primitives.int engine.render.getNumProcedurals()
Returns the number of procedurals that can be currently seen in the viewport.Return value
The number of procedurals.int engine.render.getNumReflections()
Returns the number of reflections drawn per frame that can be currently seen in the viewport. In case of cubemap reflections, if all six faces are updated, six reflections are rendered per each frame.Return value
The number of reflections.int engine.render.getNumShaders()
Returns the number of shaders set per frame. See Rendering Profiler article for details.Return value
The number of shaders.int engine.render.getNumShadows()
Returns the number of shadow passes rendered per frame. See Rendering Profiler article for details.Return value
The number of shadow passes.int engine.render.getNumSurfaces()
Returns the number of rendered per frame surfaces that can be currently seen in the viewport (in all rendering passes). See Rendering Profiler article for details.Return value
Number of surfaces.int engine.render.getNumTriangles()
Returns the number of rendered per frame triangles that can be currently seen in the viewport. See Rendering Profiler article for details.Return value
Number of triangles.void engine.render.setObjectDistance(float distance)
Sets the distance, at which (and farther) objects will not be rendered.Arguments
- float distance - Distance in units.
float engine.render.getObjectDistance()
Returns a distance, at which (and farther) objects will not be rendered.Return value
Distance in units.int engine.render.getParallax()
Returns a value indicating if parallax occlusion mapping is enabled.Return value
1 if parallax occlusion mapping is enabled; otherwise, 0.void engine.render.setPostMaterials(string materials)
Sets post postprocess materials that are applied after all other postprocess (such as HDR, DoF, etc.) are rendered. Materials are applied in the order of listing.
They are used together with Player::setPostMaterials(), if any.
Arguments
- string materials - Comma-separated list of post postprocess material names.
string engine.render.getPostMaterials()
Returns names of the current post postprocess materials that are applied after all other postprocess (such as HDR, DoF, etc.) are rendered. Materials are applied in the order of listing.
They are used together with Player::getPostMaterials(), if any.
Return value
Comma-separated list of current post postprocess material names.void engine.render.setReflectionColor(vec4 color)
Color that allows to adjust reflections of all meshes with reflective materials, i.e.:- mesh_reflection_2d_base
- mesh_reflection_cube_base
- mesh_paint_reflection_cube_base
- mesh_tessellation_reflection_2d_base
- mesh_tessellation_reflection_cube_base
- mesh_tessellation_paint_reflection_cube_base
Arguments
- vec4 color - Reflection color for reflective mesh materials.
vec4 engine.render.getReflectionColor()
Returns the color that allows to adjust reflections of all meshes with reflective materials, i.e.:- mesh_reflection_2d_base
- mesh_reflection_cube_base
- mesh_paint_reflection_cube_base
- mesh_tessellation_reflection_2d_base
- mesh_tessellation_reflection_cube_base
- mesh_tessellation_paint_reflection_cube_base
Return value
Reflection color for reflective mesh materials.void engine.render.setReflectionDistance(float distance)
Sets the distance, at which (and farther) reflections will not be rendered.Arguments
- float distance - Distance in units.
float engine.render.getReflectionDistance()
Returns the distance, at which (and farther) reflections will not be rendered.Return value
Distance in units.int engine.render.getRefraction()
Returns a value indicating if refraction is enabled.Return value
1 if refraction is enabled; otherwise, 0.void engine.render.setRefractionDispersion(vec3 dispersion)
Sets the refraction displacement for red, greed and blue channels (according to refraction texture of refractive materials). Can be used to create light dispersion (chromatic aberrations).Arguments
- vec3 dispersion - Dispersion displacement per channel. If a negative value is set for a channel, 0 will be used instead.
vec3 engine.render.getRefractionDispersion()
Returns the refraction displacement for red, greed and blue channels (according to the refraction texture of refractive materials). It can be used to create light dispersion (chromatic aberrations).Return value
Dispersion displacement.void engine.render.setRenderMaterials(string materials)
Sets render postprocess materials that are applied before all other postprocess (such as HDR, DoF, etc.) are rendered. Materials are applied in the order of listing.Arguments
- string materials - List of comma-separated postprocess material names.
string engine.render.getRenderMaterials()
Returns names of the current postprocess materials that are applied before all other postprocess (such as HDR, DoF, etc.) are rendered. Materials are applied in the order of listing.Return value
Name of the current render materials.void engine.render.setShaderDefines(string defines)
Set additional shader defines.Arguments
- string defines - Additional shader defines.
string engine.render.getShaderDefines()
Returns additional shader defines.Return value
Additional shader defines.int engine.render.getShadersQuality()
Returns the quality of shaders.Return value
One of the RENDER_QUALITY_* pre-defined variables.void engine.render.setShadowDistance(float distance)
Sets the distance, at which (and farther) shadows will not be rendered.Arguments
- float distance - Distance in units.
float engine.render.getShadowDistance()
Returns the distance, at which (and farther) shadows will not be rendered.Return value
Distance in units.int engine.render.getShadowShafts()
Returns a value indicating if volumetric shadows are enabled.Return value
1 if volumetric shadows are enabled; otherwise, 0.void engine.render.setShadowShaftsExposure(float exposure)
Sets the contrast used for volumetric shadows.Arguments
- float exposure - Shadow contrast. The provided value will be saturated in the range [0.0f; 1.0f]. 0.0f means that the shadows are not seen at all.
float engine.render.getShadowShaftsExposure()
Returns the contrast used for volumetric shadows.Return value
Shadow contrast.void engine.render.setShadowShaftsLength(float length)
Sets the length of volumetric shadows.Arguments
- float length - Shadow length. The provided value will be saturated in the range [0.0f; 1.0f]. 0.0f means that there are no shadows. 0 means that the shadows are long enough to occupy the whole screen.
float engine.render.getShadowShaftsLength()
Returns the length of volumetric shadows.Return value
Shadow length.void engine.render.setSharpenIntensity(float intensity)
Sets intensity of the sharpening effect.Arguments
- float intensity - Intensity of the sharpening effect.
float engine.render.getSharpenIntensity()
Returns intensity of the sharpening effect.Return value
Intensity of the sharpening effect.void engine.render.setSkyRotation(quat rotation)
Sets sky rotation.Arguments
- quat rotation - Sky rotation quaternion.
quat engine.render.getSkyRotation()
Returns sky rotation.Return value
Sky rotation quaternion.void engine.render.setSSAOIntensity(float intensity)
Sets the intensity of the SSAO(Screen Space Ambient Occlusion) for the scene.Arguments
- float intensity - Intensity value of the SSAO(Screen Space Ambient Occlusion) for the scene.
float engine.render.getSSAOIntensity()
Returns the intensity of the SSAO(Screen Space Ambient Occlusion) for the scene.Return value
SSAO intensity value.void engine.render.setSSAOIntensityLightedSide(float intensity)
Sets the intensity of the SSAO(Screen Space Ambient Occlusion) for the scene object's lighted side.Arguments
- float intensity - SSAO intensity value for the scene object's lighted side.
float engine.render.getSSAOIntensityLightedSide()
Returns the intensity of the SSAO(Screen Space Ambient Occlusion) for the scene objects' lighted side.Return value
SSAO intensity value for the scene object's lighted side.void engine.render.setSSAORadius(float radius)
Sets the radius of the SSAO(Screen Space Ambient Occlusion).Arguments
- float radius - SSAO radius value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getSSAORadius()
Returns the radius of the SSAO(Screen Space Ambient Occlusion).Return value
SSAO radius value within the [0.0f; 1.0f] range.void engine.render.setSSGIIntensity(float intensity)
Sets the intensity of the SSGI (Screen Space Global Illumination) for the scene.Arguments
- float intensity - SSGI intensity value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getSSGIIntensity()
Returns the intensity of the SSGI (Screen Space Global Illumination) for the scene.Return value
SSGI intensity value within the [0.0f; 1.0f] range.void engine.render.setSSGINormalThreshold(float threshold)
Sets the normal threshold of the SSGI (Screen Space Global Illumination).Arguments
- float threshold - SSGI normal threshold value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getSSGINormalThreshold()
Returns the normal threshold of the SSGI (Screen Space Global Illumination).Return value
SSGI normal threshold value within the [0.0f; 1.0f] range.void engine.render.setSSGIRadius(float radius)
Sets the radius of the SSGI (Screen Space Global Illumination).Arguments
- float radius - SSGI radius value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getSSGIRadius()
Returns the radius of the SSGI (Screen Space Global Illumination).Return value
SSGI radius value within the [0.0f; 1.0f] range.void engine.render.setSSREnabled(int enabled)
Enables or disables the SSR (Screen Space Reflections) effect.Arguments
- int enabled - 1 to enable the SSR effect, 0 to disable.
int engine.render.isSSREnabled()
Returns the value indicating if the SSR (Screen Space Reflections) effect is enabled.Return value
1 if the SSR effect is enabled; otherwise, 0.void engine.render.setSSRFastTracing(int tracing)
Enables or disables fast tracing for the SSR (Screen Space Reflections) effect. This mode makes it possible to obtain distant reflections using low number of steps while keeping performance high. Disabling this mode improves quality but significantly drops performance.Arguments
- int tracing - 1 to enable SSR fast tracing, 0 to disable. The default value is 1.
int engine.render.isSSRFastTracing()
Returns the value indicating if fast tracing for the SSR (Screen Space Reflections) effect is enabled.Return value
1 if SSR fast tracing is enabled; otherwise, 0.void engine.render.setSSRImportanceSampling(int sampling)
Enables or disables importance sampling mode for the SSR (Screen Space Reflections) effect.Arguments
- int sampling - 1 to enable SSR importance sampling, 0 to disable.
int engine.render.isSSRImportanceSampling()
Returns the value indicating if importance sampling mode for the SSR (Screen Space Reflections) effect is enabled.Return value
1 if SSR importance sampling is enabled; otherwise, 0.void engine.render.setSSRNoise(int noise)
Enables or disables noise for the SSR (Screen Space Reflections) effect.Arguments
- int noise - 1 to enable SSR noise, 0 to disable. The default value is 1.
int engine.render.isSSRNoise()
Returns the value indicating if noise for the SSR (Screen Space Reflections) effect is enabled.Return value
1 if SSR noise is enabled; otherwise, 0.void engine.render.setSSRNumRays(int rays)
Sets the number of rays of SSR (Screen Space Reflections). Using more rays takes away the noise of reflections but is rather expensive.Arguments
- int rays - Number of rays of SSR within the [1; 2048] range. The default value is 4.
int engine.render.getSSRNumRays()
Returns the number of rays of SSR (Screen Space Reflections).Return value
Number of rays of SSR within the [1; 2048] range.void engine.render.setSSRNumSteps(int steps)
Sets the number of steps of SSR (Screen Space Reflections). Defines the accuracy of reflections and causes a reasonable performance impact.Arguments
- int steps - Number of steps of SSR within the [1; 64] range. The default value is 16.
int engine.render.getSSRNumSteps()
Returns the number of steps of SSR (Screen Space Reflections).Return value
Number of steps of SSR within the [1; 64] range.void engine.render.setSSRResolution(int resolution)
Sets the quality of SSR (Screen Space Reflections).Arguments
- int resolution - One of the following values:
- 0 - render reflections in quad resolution.
- 1 - render reflections in half resolution (by default).
- 1 - render reflections in full resolution.
int engine.render.getSSRResolution()
Returns the value indicating the quality of SSR (Screen Space Reflections).Return value
One of the following values:- 0 - render reflections in quad resolution.
- 1 - render reflections in half resolution (by default).
- 1 - render reflections in full resolution.
void engine.render.setSSRRoughnessQuality(int quality)
Sets the quality of SSR (Screen Space Reflections) roughness.Arguments
- int quality - One of the following values:
- 0 - low quality.
- 1 - medium quality (by default).
- 2 - high quality.
- 3 - ultra quality.
int engine.render.getSSRRoughnessQuality()
Returns the current quality value of SSR (Screen Space Reflections) roughness.Return value
One of the following values:- 0 - low quality.
- 1 - medium quality (by default).
- 2 - high quality.
- 3 - ultra quality.
void engine.render.setSSRScale(float scale)
Sets the scale of SSR (Screen Space Reflections).Arguments
- float scale - SSR scale value within the [0.0f; 10.0f] range. The default value is 1.0f.
float engine.render.getSSRScale()
Returns the current scale value of SSR (Screen Space Reflections).Return value
SSR scale value within the [0.0f; 10.0f] range.void engine.render.setSSRStretching(float stretching)
Sets the stretching factor (for information lost screen places) of SSR (Screen Space Reflections).Arguments
- float stretching - Stretching factor within the [0.0f; 10.0f] range. The default value is 0.5f.
float engine.render.getSSRStretching()
Returns the current stretching factor (for information lost screen places) of SSR (Screen Space Reflections).Return value
Stretching factor within the [0.0f; 10.0f] range.void engine.render.setSSRVisibilityRoughnessMax(float max)
Sets the maximum roughness value, starting from which the SSR (Screen Space Reflections) effect is not rendered.Arguments
- float max - Maximum roughness value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getSSRVisibilityRoughnessMax()
Returns the maximum roughness value, starting from which the SSR (Screen Space Reflections) effect is not rendered.Return value
Maximum roughness value within the [0.0f; 1.0f] range.void engine.render.setSSRVisibilityRoughnessMin(float min)
Sets the minimum roughness value, starting from which the SSR (Screen Space Reflections) effect begins to fade out.Arguments
- float min - Minimum roughness value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getSSRVisibilityRoughnessMin()
Returns the minimum roughness value, starting from which the SSR (Screen Space Reflections) effect begins to fade out.Return value
Minimum roughness value within the [0.0f; 1.0f] range.void engine.render.setSSSColor(vec4 color)
Sets a subsurface scattering color used to simulate the subsurface component of skin lighting, i.e. the light that bounces inside of the subsurface tissue layers (epidermis and dermis) before exiting. For skin, subsurface color is reddish, due to blood circulating in skin tissues.Arguments
- vec4 color - A subsurface scattering color.
vec4 engine.render.getSSSColor()
Returns the current subsurface scattering color.Return value
A subsurface scattering color.void engine.render.setSSSRadius(float radius)
Sets the subsurface scattering radius: distance in the screen space, within which colors will be sampled. It controls how much wrinkles, pores and cavities will be blurred and highlighted. The higher the value, the farther subsurface scattering reaches. Too high values result in the ghosting effect. By the minimum value of 0, no subsurface scattering is rendered.Arguments
- float radius - Subsurface scattering radius.
float engine.render.getSSSRadius()
Returns the current subsurface scattering radius.Return value
Subsurface scattering radius value.void engine.render.setStereoDistance(float distance)
Sets the focal distance for stereo rendering (distance in the world space to the point where two views line up, i.e. to the zero parallax plane).Arguments
- float distance - Focal distance for stereo rendering, in units.
float engine.render.getStereoDistance()
Returns the focal distance for stereo rendering (distance in the world space to the point where two views line up).Return value
Focal distance for stereo rendering, in units.void engine.render.setStereoOffset(float offset)
Sets the virtual camera offset (an offset after the perspective projection).Arguments
- float offset - Virtual camera offset in units.
float engine.render.getStereoOffset()
Returns the virtual camera offset (an offset after the perspective projection).Return value
Virtual camera offset in units.void engine.render.setStereoRadius(float radius)
Sets the radius for stereo (the half of the separation distance between the cameras).Arguments
- float radius - Stereo radius, in units. If a negative value is provided, 0 will be used instead.
float engine.render.getStereoRadius()
Returns the current radius for stereo (the half of the separation distance between the cameras).Return value
Stereo radius, in units.int engine.render.getStructuredBuffers()
Checks, if StructuredBuffers are available.Return value
1 if StructuredBuffers are available; otherwise, 0.void engine.render.setSunShaftsAttenuation(float attenuation)
Sets the power of fading for HDR shaft flare across its length.Arguments
- float attenuation - Fading power. The provided value will be clamped to [0.0f; 1.0f] range.
float engine.render.getSunShaftsAttenuation()
Returns the current power of fading for HDR shaft flare across its length.Return value
Fading power.void engine.render.setSunShaftsColor(vec4 color)
Sets the color of the lens shafts.Arguments
- vec4 color - Color of lens shafts.
vec4 engine.render.getSunShaftsColor()
Returns the current color of the lens shafts.Return value
Color of lens shafts.void engine.render.setSunShaftsEnabled(int enable)
Enables or disables lens shafts.Arguments
- int enable - Positive integer to enable lens shafts, 0 to disable.
int engine.render.isSunShaftsEnabled()
Returns a value indicating if flare shafts are enabled.Return value
Positive integer if flare shafts are enabled; otherwise, 0.void engine.render.setSunShaftsLength(float length)
Sets the length of flare shafts.Arguments
- float length - Length of flare shafts relative to the screen width. The provided value is saturated in the range [0.0f; 1.0f].
float engine.render.getSunShaftsLength()
Returns the length of a flare shaft.Return value
Length of a flare shaft relative to the screen width.void engine.render.setSunShaftsScale(float scale)
Sets the multiplier for color of HDR shaft flares.Arguments
- float scale - Shaft color scale. If a negative value is provided, 0.0f will be used instead.
float engine.render.getSunShaftsScale()
Returns the current multiplier for color of HDR shaft flares.Return value
Shaft color scale.void engine.render.setSunShaftsThreshold(float threshold)
Sets the brightness threshold for flare shafts.Arguments
- float threshold - Flare shafts threshold.
float engine.render.getSunShaftsThreshold()
Returns the current brightness threshold for flare shafts.Return value
Flare shafts threshold.void engine.render.setTAAFrameCount(float count)
Sets the frame count of TAA (Temporal Anti-Aliasing). Specifies the number of frame for velocity buffer.Arguments
- float count - TAA frame count value within the [0.0f; 30.0f] range. The default value is 30.0f.
float engine.render.getTAAFrameCount()
Returns the frame count of TAA (Temporal Anti-Aliasing). Specifies the number of frame for velocity buffer.Return value
TAA frame count value within the [0.0f; 30.0f] range.void engine.render.setTAAMaxFrameCount(float count)
Sets the maximum frame count of TAA (Temporal Anti-Aliasing). Specifies the maximum number of frames for velocity buffer.Arguments
- float count - Maximum TAA frame count value within the [0.0f; 60.0f] range. The default value is 60.0f.
float engine.render.getTAAMaxFrameCount()
Returns the maximum frame count of TAA (Temporal Anti-Aliasing). Specifies the maximum number of frames for velocity buffer.Return value
Maximum TAA frame count value within the [0.0f; 60.0f] range.void engine.render.setTAAMinFrameCount(float count)
Sets the minimum frame count of TAA (Temporal Anti-Aliasing). Specifies the minimum number of frames for velocity buffer.Arguments
- float count - Minimum TAA frame count value within the [0.0f; 4.0f] range. The default value is 4.0f.
float engine.render.getTAAMinFrameCount()
Returns the minimum frame count of TAA (Temporal Anti-Aliasing). Specifies the minimum number of frames for velocity buffer.Return value
Minimum TAA frame count value within the [0.0f; 4.0f] range.void engine.render.setTAAPreserveDetails(float details)
Sets the detail level of TAA (Temporal Anti-Aliasing). The higher the value - the more detailed is the image. Can produce additional flickering.Arguments
- float details - TAA detail level value within the [0.0f; 1.5f] range. The default value is 1.5f.
float engine.render.getTAAPreserveDetails()
Returns the detail level of TAA (Temporal Anti-Aliasing).Return value
TAA detail level value within the [0.0f; 1.5f] range.void engine.render.setTAAVelocityThreshold(float threshold)
Sets the velocity threshold of TAA (Temporal Anti-Aliasing). This value specifies the intensity of velocity clamping.Arguments
- float threshold - TAA velocity threshold value within the [0.0f; 1.0f] range. The default value is 1.0f.
float engine.render.getTAAVelocityThreshold()
Returns the velocity threshold of TAA (Temporal Anti-Aliasing). This value specifies the intensity of velocity clamping.Return value
TAA velocity threshold value within the [0.0f; 1.0f] range.int engine.render.getTessellation()
Returns a value indicating if tessellation is enabled.Return value
1 if tessellation is enabled; otherwise, 0.void engine.render.setTessellationDistance(float distance)
Sets the multiplier for the corresponding material parameter. Tessellation distance sets the distance after which the surfaces are not tessellated.Arguments
- float distance - Tessellation distance multiplier. If a negative value is provided, 0 will be used instead.
float engine.render.getTessellationDistance()
Returns the multiplier for the corresponding material parameter, that controls the distance after which surfaces are not tessellated.Return value
Tessellation distance multiplier.void engine.render.setTessellationFactor(float factor)
Sets the multiplier for the corresponding material parameter. Tessellation factor that controls subdivision of triangles into smaller ones.Arguments
- float factor - Tessellation factor multiplier. If a negative value is provided, 0 will be used instead.
float engine.render.getTessellationFactor()
Returns the multiplier for the corresponding material parameter that controls subdivision of triangles into smaller ones.Return value
Tessellation factor multiplier.void engine.render.setTessellationScale(float scale)
Sets the multiplier for the corresponding material parameter. Tessellation scale determines displacement factor for tessellated surfaces (to what extent geometry is extruded).Arguments
- float scale - Tessellation scale multiplier. If a negative value is provided, 0.0f will be used instead.
float engine.render.getTessellationScale()
Returns the multiplier for the corresponding material parameter that determines displacement factor for the tessellated surfaces (to what extent geometry is extruded).Return value
Tessellation scale multiplier.int engine.render.getTexturesQuality()
Returns the quality of textures.Return value
One of the RENDER_QUALITY_* pre-defined variables.void engine.render.setViewport(Viewport viewport)
Sets a viewport for a main application window.Arguments
- Viewport viewport - Viewport instance.
Viewport engine.render.getViewport()
Returns a main application window viewport.Return value
Viewport instance.Texture engine.render.getWhite2DArrayTexture()
Returns white 2D array texture.Return value
White 2D array texture.Texture engine.render.getWhite2DTexture()
Returns white 2D texture.Return value
White 2D texture.Texture engine.render.getWhite3DTexture()
Returns white 3D texture.Return value
White 3D texture.Texture engine.render.getWhiteCubeTexture()
Returns white Cube texture.Return value
White Cube texture.void engine.render.setWireframeColor(vec4 color)
Sets the color fot the wireframe.Arguments
- vec4 color - Wireframe color to be set.
vec4 engine.render.getWireframeColor()
Returns the color of the wireframe.Return value
Wireframe color.int engine.render.compressBCTexture(Texture texture, Image & destination, int quality = 1, int compressed_format = 0, int skip_mip_maps = 0)
Compresses given texture by using specified compression format.Arguments
- Texture texture - Source data to be compressed.
- Image & destination - The result of compression.
- int quality - 0 is for low quality (very fast), 1 is for high quality.
- int compressed_format - One of the compressed BC format.
- int skip_mip_maps - Ignore texture mip-maps flag. 1 is for ignoring; otherwise, 0.
Return value
1 if the compression was performed successfully; otherwise, 0.int engine.render.createMipmapsCubeGGX(Image image, float quality)
Generates mipmaps for a cubemap using GGX BRDF microfacet model.Arguments
- Image image - Cubemap image. IMAGE_CUBE or IMAGE_CUBE_ARRAY types are accepted.
- float quality - Quality value within the [0.0f; 1.0f] range.
int engine.render.createShorelineDistanceField(Image image, Image mask, int shoreline_radius, int blur_radius, int downsample_resolution)
Grabs a shoreline distance field texture with the specified parameters.Arguments
- Image image - Image to grab a shoreline texture to.
- Image mask - An R16 mask texture Image. Each pixel of the mask has the following color value:0 if water level at this point of the grid is above the terrain level; otherwise, 65535.
- int shoreline_radius - Shoreline radius value within the [4; 128] range. Padding distance (from the shore to the beginning of swash zone).
- int blur_radius - Blur radius value within the [0; 32] range. Higher values make shoreline smoother.
- int downsample_resolution - Texture resolution value, can be one of the following: 16, 32, 64, 128, 256, 512, 1024, 2048.
Return value
1 if the shoreline distance field texture is grabbed successfully; otherwise, 0.int engine.render.loadSettings(string file)
Loads render settings from a given file.Arguments
- string file - Path to an XML file with desired settings.
Return value
1 if the settings are loaded successfully; otherwise, 0.int engine.render.loadWorld(Xml xml)
Loads render state from the Xml.Arguments
- Xml xml - Xml node.
Return value
1 if the state is loaded successfully; otherwise, 0.void engine.render.renderImage2D(Camera camera, Image image, int skip_flags)
Renders the scene into a 2D image in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class.Arguments
- Camera camera - Camera to be used.
- Image image - Image to save the result to.
- int skip_flags - Skip the effects:
- VIEWPORT_SKIP_SHADOWS
- VIEWPORT_SKIP_VISUALIZER
- VIEWPORT_SKIP_SRGB
- VIEWPORT_SKIP_POSTEFFECTS
- VIEWPORT_SKIP_VELOCITY
- VIEWPORT_SKIP_DYNAMIC_REFLECTIONS
0 enables all the effects.
void engine.render.renderImage2D(Camera camera, Image image, int width, int height, int hdr, int skip_flags)
Renders the scene into a 2D image of the given size in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class.Arguments
- Camera camera - Camera to be used.
- Image image - Image to save the result to.
- int width - Width of the projected image, in units.
- int height - Height of the projected image, in units.
- int hdr - 1 - enable HDR, 0 - disable HDR.
- int skip_flags - Skip the effects:
- VIEWPORT_SKIP_SHADOWS
- VIEWPORT_SKIP_VISUALIZER
- VIEWPORT_SKIP_SRGB
- VIEWPORT_SKIP_POSTEFFECTS
- VIEWPORT_SKIP_VELOCITY
- VIEWPORT_SKIP_DYNAMIC_REFLECTIONS
0 enables all the effects.
void engine.render.renderImageCube(Camera camera, Image image, int skip_flags)
Renders the scene into a cube map image in accordance with the specified parameters.Arguments
- Camera camera - Camera to be used.
- Image image - Image to save the result to.
- int skip_flags - Skip the effects:
- VIEWPORT_SKIP_SHADOWS
- VIEWPORT_SKIP_VISUALIZER
- VIEWPORT_SKIP_SRGB
- VIEWPORT_SKIP_POSTEFFECTS
- VIEWPORT_SKIP_VELOCITY
- VIEWPORT_SKIP_DYNAMIC_REFLECTIONS
0 enables all the effects.
void engine.render.renderImageCube(Camera camera, Image image, int size, int hdr, int skip_flags, int local_space = 0)
Renders the scene into a cube map in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class.Arguments
- Camera camera - Camera to be used.
- Image image - Image to save the result to.
- int size - Texture dimensions (cube map edge size).
- int hdr - 1 - enable HDR; 0 - disable HDR.
- int skip_flags - Skip the effects:
- VIEWPORT_SKIP_SHADOWS
- VIEWPORT_SKIP_VISUALIZER
- VIEWPORT_SKIP_SRGB
- VIEWPORT_SKIP_POSTEFFECTS
- VIEWPORT_SKIP_VELOCITY
- VIEWPORT_SKIP_DYNAMIC_REFLECTIONS
0 enables all the effects.
- int local_space - 1 - local space coordinates; 0 - world space coordinates.
void engine.render.renderNodeImage2D(Camera camera, Node node, Image image, int skip_flags, int light_usage, string environment_texture_name)
Renders the given node into a 2D image in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class. The node can be rendered using the specific type of lighting and environment cubemap.Arguments
- Camera camera - Camera to be used.
- Node node - Node to be rendered.
- Image image - Image to save the result to.
- int skip_flags - Skip the effects:
- VIEWPORT_SKIP_SHADOWS
- VIEWPORT_SKIP_VISUALIZER
- VIEWPORT_SKIP_SRGB
- VIEWPORT_SKIP_POSTEFFECTS
- VIEWPORT_SKIP_VELOCITY
- VIEWPORT_SKIP_DYNAMIC_REFLECTIONS
0 enables all the effects.
- int light_usage - Sets the light sources that will affect the node (one of the USAGE_*_LIGHTING Viewport class variables.)
- string environment_texture_name - Path to the environment cubemap to be used. Takes effect if the first (auxiliary light) or second (node light) lighting mode is used. In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.
void engine.render.renderNodeImage2D(Camera camera, Node node, Image image, int width, int height, string hdr)
Renders the 2D image of the given node in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class. The node can be rendered using the specific type of lighting and environment cubemap.Arguments
- Camera camera - Camera to be used.
- Node node - Node to be rendered.
- Image image - Image to save the result to.
- int width - Skip the effects:
- VIEWPORT_SKIP_SHADOWS
- VIEWPORT_SKIP_VISUALIZER
- VIEWPORT_SKIP_SRGB
- VIEWPORT_SKIP_POSTEFFECTS
- VIEWPORT_SKIP_VELOCITY
- VIEWPORT_SKIP_DYNAMIC_REFLECTIONS
0 enables all the effects.
- int height - Sets the light sources that will affect the node (one of the USAGE_*_LIGHTING Viewport class variables.)
- string hdr - Path to the environment cubemap to be used. Takes effect if the first (auxiliary light) or second (node light) lighting mode is used. In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.
void engine.render.renderProcedurals(Vector<Material> materials)
Renders post-process materials with procedural textures (calculated on GPU using custom shaders) that are assigned to surfaces.Arguments
- Vector<Material> materials - Procedural materials list.
int engine.render.restoreState(Stream stream)
Restores a render state from the stream.Arguments
- Stream stream - Stream to restore a state from.
Return value
1 if the state is restored successfully; otherwise, 0.int engine.render.saveSettings(string file)
Saves the current renderer settings to a given file.Arguments
- string file - Path to a target file.
Return value
1 if the settings are saved successfully; otherwise, 0.int engine.render.saveState(Stream stream)
Saves a render state into the stream.Arguments
- Stream stream - Stream to save a state into.
Return value
1 if the state is saved successfully; otherwise, 0.int engine.render.saveWorld(Xml xml)
Saves the render state into the given Xml node.Arguments
- Xml xml - Xml node.