This page has been translated automatically.
Programming
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
API
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
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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


void engine.render.setAlphaFade(int fade)

Enables or disables alpha-blend fading (dithering) for objects. Enabling the feature allows for objects LODs to be smoothly blended into each other over a fade distance.

Arguments

  • int fade - 1 to enable alpha fading (dithering) for objects, 0 to disable it. The default value is 1.

int engine.render.isAlphaFade()

Returns a value indicating if alpha-blend fading (dithering) is enabled for objects. When the feature is enabled, objects LODs are smoothly blended into each other over a fade distance.

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.

float engine.render.getAnimationOldTime()

Returns the previous render animation time for vegetation.

Return value

Animation time in milliseconds.

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.

void engine.render.setAntialiasing(int antialiasing)

Sets the anti-aliasing type. When 0 is passed, the function disables anti-aliasing.
Notice
The anti-aliasing type can be changed with the render_antialiasingconsole command.

Arguments

  • int antialiasing - Antialiasing type:
    • 0 - no anti-aliasing used
    • 1 - FXAA
    • 2 - TAA (by default)

int engine.render.getAntialiasing()

Returns the anti-aliasing type (if enabled). This method can be used to check the anti-aliasing type before calling FXAA/TAA-specific functions.
Notice
The anti-aliasing type can be checked by using the render_antialiasingconsole variable.

Return value

Antialiasing type:
  • 0 - no antialiasing used
  • 1 - FXAA
  • 2 - TAA (by default)

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).

void engine.render.setAuxiliary(int auxiliary)

Enables or disables the auxiliary render buffer usage. The buffer should be enabled for render and post post-processes to work.

Arguments

  • int auxiliary - 1 to use the auxiliary buffer, 0 not to use. The default value is 1.

int engine.render.isAuxiliary()

Returns a value indicating if auxiliary render buffer is used. The buffer should be enabled for render and post post-processes to work.

Return value

1 if the 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.

void engine.render.setBentNormalRayTracing(int tracing)

Enables or disables ray-traced bent normals calculation. The use of SSRTGI for bent normals allows for smooth ambient lighting.
Notice
Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Arguments

  • int tracing - 1 to enable ray-traced bent normals calculation, 0 to disable. The default value is 1.

int engine.render.isBentNormalRayTracing()

Returns a value indicating if ray-traced bent normals calculation is enabled. The use of SSRTGI for bent normals allows for smooth ambient lighting.
Notice
Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Return value

1 if ray-traced bent normals calculation is enabled; otherwise, 0.

void engine.render.setBentNormalRayTracingDenoise(int denoise)

Enables or disables noise reduction for ray-traced bent normals calculation. This option reduces noise by using the blur effect.
Notice
Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Arguments

  • int denoise - 1 to enable noise reduction for ray-traced bent normals calculation, 0 to disable. The default value is 1.

int engine.render.isBentNormalRayTracingDenoise()

Returns a value indicating if noise reduction for ray-traced bent normals calculation is enabled. This option reduces noise by using blur effect.
Notice
Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Return value

1 if noise reduction for ray-traced bent normals calculation is enabled; otherwise, 0.

void engine.render.setBentNormalRayTracingThreshold(float threshold)

Sets the threshold value for the ray-traced bent normals calculation.
Notice
Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Arguments

  • float threshold - Bent normals ray tracing threshold value. The default value is 1.0f.

float engine.render.getBentNormalRayTracingThreshold()

Returns the current threshold value for the ray-traced bent normals calculation.
Notice
Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Return value

Bent normal ray tracing threshold value. The default value is 1.0f.

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.setBloom(int bloom)

Enables or disables the bloom effect.

Arguments

  • int bloom - 1 value to enable the bloom effect, 0 to disable.

int engine.render.isBloom()

Returns a value indicating if the bloom effect is enabled.

Return value

1 if the bloom effect is enabled; otherwise, 0.

void engine.render.setBloomPasses(int passes)

Sets the number of passes for the bloom effect. During the pass a bloom texture is generating. Up to 8 bloom textures can be generated: each texture has lower resolution (original size, original size /2, original size /4, so forth) with bloom effect. After that, all these bloom textures with the different resolution are composed for the final bloom texture.

Arguments

  • int passes - Number of bloom passes. The default value is 8. The higher the value the smoother is the effect. However, this option significantly affects performance.

int engine.render.getBloomPasses()

Returns the current number of passes for the bloom effect. During the pass a bloom texture is generating. Up to 8 bloom textures can be generated: each texture has lower resolution (original size, original size /2, original size /4, so forth) with bloom effect. After that, all these bloom textures with the different resolution are composed for the final bloom texture.

Return value

Number of bloom passes.

void engine.render.setBloomPower(float power)

Sets the power of the bloom effect.
  • At the minimum value of 0.0f, the bloom effect is blurred.
  • At the maximum value of 1.0f, the bloom effect is more contrast.

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.
  • At the minimum value of 0.0f, the bloom effect is blurred.
  • At the maximum value of 1.0f, the bloom effect is more contrast.

Return value

Bloom power value within the [0.0f; 1.0f] range.

void engine.render.setBloomResolution(int resolution)

Sets the resolution of the bloom effect.

Arguments

  • int resolution - Resolution of the bloom effect:
    • 0 - quarter resolution.
    • 1 - half resolution (by default).
    • 2 - full resolution.

int engine.render.getBloomResolution()

Returns the current resolution of the bloom effect.

Return value

Resolution of the bloom effect:
  • 0 - quarter resolution.
  • 1 - half resolution (by default).
  • 2 - full resolution.

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.setClearBufferMask(int mask)

Arguments

int engine.render.getClearBufferMask()

Returns current buffer cleanup mask. This mask determines which buffers are to be cleared next time the Engine::render() is called. This method can be used to save current buffer cleanup mask to restore it later.

Return value

Buffer mask: one of the RENDER_STATE_BUFFER_* variables.

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 - quarter.

int engine.render.getCloudsDownsamplingRendering()

Returns current downsampling rendering setting for clouds. This parameter determines clouds resolution based on current screen resolution. It has a significant impact on performance.

Return value

One of the following values:
  • 0 - full.
  • 1 - half (by default).
  • 2 - quarter.

void engine.render.setCloudsDynamicCoverageArea(float area)

Sets dynamic coverage area for clouds. This parameter determines visibility distance for coverage of FieldWeather objects.
Notice
Increasing dynamic coverage area leads to reduction of quality of FieldWeather coverage texture and loss of details. This effect can be mitigated by increasing dynamic coverage resolution using setCloudsDynamicCoverageResolution() method.

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.
Notice
Increased resolution significantly affects performance.

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.setCloudsGroundShadows(int shadows)

Enables or disables rendering of shadows from the clouds on the ground.

Arguments

  • int shadows - 1 to enable rendering of shadows from the clouds on the ground, 0 to disable it. The default value is 1.

int engine.render.isCloudsGroundShadows()

Returns a value indicating if rendering of shadows from the clouds on the ground is enabled.

Return value

1 if rendering of shadows from the clouds on the ground is enabled; otherwise, 0.

void engine.render.setCloudsInterleavedRendering(int rendering)

Enables or disables interleaved rendering mode for clouds.
Notice
In cases when clouds are viewed from the ground, or from above (at significant distance) and viewer's velocities are less than 200 units per second, this parameter can be used to provide a significant gain in performance.

Arguments

  • int rendering - Interleaved rendering mode for clouds:
    • 0 - disabled (by default).
    • 1 - 2 x 2.
    • 2 - 4 x 4.
    • 3 - 8 x 8.

int engine.render.getCloudsInterleavedRendering()

Returns the value indicating current interleaved rendering mode for clouds. This feature can be used to gain performance when enabled. See getCloudsInterleavedRendering().

Return value

One of the following values:
  • 0 - disabled (by default).
  • 1 - 2 x 2.
  • 2 - 4 x 4.
  • 3 - 8 x 8.

void engine.render.setCloudsLightingConeRadius(float radius)

Sets lighting cone sampling radius for clouds lighting.
Notice
Low values may result in unnatural behavior as the position of the sun changes.

Arguments

  • float radius - Lighting cone radius in range [0.0f; 1.0f]. The default value is 0.3.

float engine.render.getCloudsLightingConeRadius()

Returns the current lighting cone sampling radius for clouds lighting.

Return value

Lighting cone radius in range [0.0f; 1.0f].

void engine.render.setCloudsLightingQuality(int quality)

Sets lighting quality for clouds. This parameter determines the number of samples used to calculate lighting for clouds.
Notice
This parameter has a significant impact on performance. Therefore, it is recommended to use low settings, when possible.

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 the 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 the 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 range [1.0f; 2048.0f], in units. The default value is 230.0f.

float engine.render.getCloudsLightingTraceLength()

Returns the 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.setCloudsSamplesCount(int count)

Sets the number of samples used for clouds rendering. The higher the value, the less noise in clouds rendering.

Arguments

  • int count - Number of samples:
    • 0 - low.
    • 1 - medium.
    • 2 - high (by default).
    • 3 - ultra.

int engine.render.getCloudsSamplesCount()

Returns the current number of samples used for clouds rendering. The higher the value, the less noise in clouds rendering.

Return value

One of the following values:
  • 0 - low.
  • 1 - medium.
  • 2 - high (by default).
  • 3 - ultra.

void engine.render.setCloudsSamplingQuality(int quality)

Sets sampling quality for clouds. This parameter sets the number of noise samples that affects the cloud shape processing quality. The higher the value, the less visual artifacts.
Notice
Visual difference between low and ultra quality is not significant. Therefore, it is recommended to use low settings, when possible, to gain performance.

Arguments

  • int quality - Sampling quality:
    • 0 - low quality (higher cloud density).
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality (lower density, the clouds are softer).

int engine.render.getCloudsSamplingQuality()

Returns the current sampling quality set for clouds. This parameter sets the number of noise samples that affects the cloud shape processing quality. The higher the value, the less visual artifacts.

Return value

Sampling quality:
  • 0 - low quality (higher cloud density).
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality (lower density, the clouds are softer).

void engine.render.setCloudsShadowShafts(int shafts)

Enables or disables shadow shafts for clouds.

Arguments

  • int shafts - 1 to enable shadow shafts for clouds, 0 to disable. The default value is 1.

int engine.render.isCloudsShadowShafts()

Returns the value indicating if shadow shafts for clouds are enabled.

Return value

1 if shadow shafts for clouds are enabled; otherwise, 0.

void engine.render.setCloudsSimplifiedDepthTest(int test)

Enables or disables simplified depth test for clouds.

Arguments

  • int test - 1 to enable simplified depth test for clouds, 0 to disable. The default value is 1.

int engine.render.isCloudsSimplifiedDepthTest()

Returns the value indicating if simplified depth test for clouds is enabled.

Return value

1 if simplified depth test for clouds is enabled; otherwise, 0.

void engine.render.setCloudsSoftIntersection(float intersection)

Sets the soft intersection distance for clouds.

Arguments

  • float intersection - Soft intersection distance (in meters) within the [0.0f; 100000.0f] range. The default value is 100.0f.

float engine.render.getCloudsSoftIntersection()

Returns the current soft intersection distance for clouds.

Return value

Soft intersection distance for clouds, in meters.

void engine.render.setCloudsTransparentOrder(int order)

Enables or disables rendering of clouds after all transparent objects (except water).

Arguments

  • int order - 1 to enable rendering of clouds after transparent, 0 to disable. The default value is 0.

int engine.render.isCloudsTransparentOrder()

Returns the value indicating if clouds are rendered after all transparent objects (except water).

Return value

1 if clouds are rendered after transparent; otherwise, 0.

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().
Source code (UnigineScript)
Image lut;
Image lut_0;
Image lut_1;

if(lut == NULL) {
	lut = new Image();
	lut_0 = new Image("unigine_project/textures/lookup_first.dds");
	lut_1 = new Image("unigine_project/textures/lookup_second.dds");
}

float k = sin(engine.game.getTime() * 2.0f) * 0.5f + 0.5f;

lut.copy(lut_0);
lut.blend(lut_1,0,0,0,0,lut.getWidth(),lut.getHeight(),k);

engine.render.setColorTextureImage(lut);

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.setCross(int cross)

Enables or disables cross flares.

Arguments

  • int cross - 1 to enable cross flares, 0 to disable.

int engine.render.isCross()

Returns a value indicating if cross flares are enabled.

Return value

1 if cross flares are enabled; otherwise, 0.

void engine.render.setCrossAngle(float angle)

Sets the cross flares orientation angle.

Arguments

  • float angle - Angle in degrees.

float engine.render.getCrossAngle()

Returns the cross flares orientation angle.

Return value

Angle between flare shafts in degrees.

void engine.render.setCrossColor(vec4 color)

Sets the color of the cross flares.

Arguments

  • vec4 color - Color of cross flares.

vec4 engine.render.getCrossColor()

Returns the color of the cross flares.

Return value

Color of the cross flares.

void engine.render.setCrossLength(float length)

Sets the length of a cross flare. Increasing this value also leads to fading of the shafts across their length.

Arguments

  • float length - Length of a cross flare relative to the screen width.

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 a multiplier for color of 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 cross flares.

Return value

Cross color scale.

void engine.render.setCrossShafts(int shafts)

Sets the number of shafts in a cross flare.
  • The minimum number of shafts is 2.
  • The maximum number of shafts is 32 (high number of flares can cause FPS drop on low-performance hardware).

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 shafts in a cross flare.
  • The minimum number of shafts is 2.
  • The maximum number of shafts is 32 (high number of flares can cause FPS drop on low-performance hardware).

Return value

Number of cross flares.

void engine.render.setCrossThreshold(float threshold)

Sets the brightness threshold for areas to produce flare: the higher the threshold value, the brighter the area should be to produce a flare.

Arguments

  • float threshold - Cross flares threshold.

float engine.render.getCrossThreshold()

Returns the current brightness threshold for areas to produce flare.

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:
Source code (XML)
<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:
Source code (XML)
<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.setDebug(int debug)

Enables or disables rendering of debug materials (the debug_materials material). Debug materials can be used for debugging of image generation stages. For example, you can render only SSR, or only cubemaps and so on.

Arguments

  • int debug - 1 to enable rendering of debug materials, 0 to disable it. The default value is 0.

int engine.render.isDebug()

Returns the value indicating whether debug materials (the debug_materials material) are rendered or not. Debug materials can be used for debugging of image generation stages.

Return value

1 if debug materials are rendered; otherwise, 0.

void engine.render.setDebugMaterials(string materials)

Updates the list of debug materials to be rendered.
Notice
Rendering of debug materials must be enabled (see the setDebug() method).

Arguments

  • string materials - List of debug materials (a comma separated string, e.g., "mat_1, mat_2, ... mat_n").

string engine.render.getDebugMaterials()

Returns the list of debug materials to be rendered as a string constant.
Notice
Rendering of debug materials must be enabled (see the setDebug() method).

Return value

List of debug materials (a comma separated string, e.g., "mat_1, mat_2, ... mat_n").

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.

void engine.render.setDecals(int decals)

Enables or disables rendering of decals.

Arguments

  • int decals - 1 to enable rendering of decals, 0 to disable it. The default value is 1.

int engine.render.isDecals()

Returns the value indicating if rendering of decals is enabled.

Return value

1 if rendering of decals is enabled; otherwise, 0.

void engine.render.setDeferredMaterial(string material)

Updates the list of materials that will be used on the Deferred Composite stage of rendering sequence. A debug material can be put here in order to be added to the final image.

Arguments

  • string material - List of composite deferred materials (a comma separated string, e.g., "mat_1, mat_2, ... mat_n").

string engine.render.getDeferredMaterial()

Returns the list of materials that are used on the Deferred Composite stage of rendering sequence.

Return value

List of deferred materials (a comma separated string, e.g., "mat_1, mat_2, ... mat_n").

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.

void engine.render.setDOF(int dof)

Enables or disables the DOF (Depth Of Field) effect.

Arguments

  • int dof - 1 to enable the DOF effect, 0 to disable it. The default value is 0.

int engine.render.isDOF()

Returns the value indicating if the DOF (Depth Of Field) effect is enabled.

Return value

1 if the DOF effect is enabled; otherwise, 0.

void engine.render.setDOFBlur(float blur)

Sets the intensity of blur for the DOF (Depth Of Field) effect.

Arguments

  • float blur - DOF blur intensity value. The default value is 1.0f.

float engine.render.getDOFBlur()

Returns the intensity of blur for the DOF (Depth Of Field) effect.

Return value

DoF blur intensity value.

void engine.render.setDOFBokehMode(int mode)

Sets the shape of the Bokeh for the DOF effect. This parameter determines the way the lens renders out-of-focus points of light.
Notice
For the DOF effect, the Bokeh effect is enabled by default.

Arguments

  • int mode - The Bokeh shape:
    • 0 - ring (by default).
    • 1 - circle.

int engine.render.getDOFBokehMode()

Returns the current shape of the Bokeh for the DOF effect. This parameter determines the way the lens renders out-of-focus points of light.
Notice
For the DOF effect, the Bokeh effect is enabled by default.

Return value

The Bokeh shape:
  • 0 - ring (by default).
  • 1 - circle.

void engine.render.setDOFChromaticAberration(float aberration)

Sets the intensity of chromatic aberration for the DOF (Depth Of Field) effect.

Arguments

  • float aberration - DOF chromatic aberration intensity value. The default value is 0.0f.

float engine.render.getDOFChromaticAberration()

Returns the intensity of chromatic aberration for the DOF (Depth Of Field) effect.

Return value

DOF chromatic aberration intensity value.

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. Black zone on the DOF mask means in-focus zone.

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. Black zone on the DOF mask means in-focus zone.

Return value

Far DOF limit value in units.

void engine.render.setDOFFarFocalOffset(float offset)

Sets the offset from the focal to the farthest blurred zone for the DOF effect. In other words, the distance when background (far) is in focus.

Arguments

  • float offset - Far DOF focal offset value in units.

float engine.render.getDOFFarFocalOffset()

Returns the offset from the focal to the farthest blurred zone. In other words, the distance when background (far) is in focus.

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 visible clearly.

Arguments

  • float distance - Focal distance in units. If a negative value is provided, 0 will be used instead.

float engine.render.getDOFFocalDistance()

Returns the focal distance of the camera, i.e. a point where objects are in-focus and visible clearly.

Return value

Focal distance in units.

void engine.render.setDOFFocusImprovement(int improvement)

Enables or disables focus improvement for the DOF (Depth Of Field) effect. When enabled, transitions between the focused and unfocused parts of the scene become more accurate.

Arguments

  • int improvement - 1 to enable focus improvement for the DOF effect, 0 to disable it. The default value is 0.

int engine.render.isDOFFocusImprovement()

Returns a value indicating if the focus improvement option is enabled for the DOF (Depth Of Field) effect. When enabled, transitions between the focused and unfocused parts of the scene become more accurate.

Return value

1 if focus improvement is enabled for the DOF effect; otherwise, 0.

void engine.render.setDOFIncreasedAccuracy(int accuracy)

Enables or disables increased accuracy for the DOF (Depth Of Field) effect. Enabling the parameter allows for increasing accuracy of focusing calculation.

Arguments

  • int accuracy - 1 to enable increased accuracy for the DOF effect, 0 to disable it. The default value is 0.

int engine.render.isDOFIncreasedAccuracy()

Returns a value indicating if the increased accuracy option is enabled for the DOF (Depth Of Field) effect. When enabled, focusing calculation is performed with increased accuracy.

Return value

1 if increased accuracy is enabled for the DOF effect; otherwise, 0.

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. Black zone on the DOF mask means in-focus zone.

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. Black zone on the DOF mask means in-focus zone.

Return value

Near DOF limit value in units.

void engine.render.setDOFNearFocalOffset(float offset)

Sets the offset from the focal to the nearest blurred zone. In other words, the distance when foreground (far) is in focus.

Arguments

  • float offset - Near DOF focal offset value in units.

float engine.render.getDOFNearFocalOffset()

Returns the offset from the focal to the nearest blurred zone. In other words, the distance when foreground (far) is in focus.

Return value

Near DOF focal offset value in units.

void engine.render.setDOFQuality(int quality)

Sets the quality of the DOF (Depth Of Field) effect.

Arguments

  • int quality - The value indicating quality of the DOF effect:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int engine.render.getDOFQuality()

Returns the value indicating the quality of the DOF (Depth Of Field) effect.

Return value

The value indicating quality of the DOF effect:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

void engine.render.setDOFResolution(int resolution)

Sets the resolution of the DOF (Depth Of Field) effect.

Arguments

  • int resolution - Resolution of the DOF effect:
    • 0 - quarter resolution.
    • 1 - half resolution.
    • 2 - full resolution (by default).

int engine.render.getDOFResolution()

Returns the resolution of the DOF (Depth Of Field) effect.

Return value

Resolution of the DOF effect:
  • 0 - quarter resolution.
  • 1 - half resolution.
  • 2 - full resolution (by default).

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.setEnvironment(int environment)

Enables or disables rendering of environment of the scene.
Notice
To enable/disable environment rendering, use also render_environmentconsole command.

Arguments

  • int environment - 1 to enable rendering of environment, 0 to disable it. The default value is 1.

int engine.render.isEnvironment()

Returns the value indicating if rendering of environment of the scene is enabled.
Notice
To check if environment rendering is enabled, use also render_environmentconsole variable.

Return value

1 rendering of environment is enabled; otherwise, 0.

void engine.render.setEnvironmentCubemapBlendMode(int mode)

Sets the environment cubemap blending mode.

Arguments

  • int mode - Cubemap blending mode:
    • 0 - alpha blend (by default).
    • 1 - additive blend.
    • 2 - multiply.
    • 3 - overlay.

int engine.render.getEnvironmentCubemapBlendMode()

Returns the current environment cubemap blending mode.

Return value

Cubemap blending mode:
  • 0 - alpha blend (by default).
  • 1 - additive blend.
  • 2 - multiply.
  • 3 - overlay.

void engine.render.setEnvironmentHazeMode(int mode)

Sets the mode for the haze effect.
Notice
To set the haze mode via console, use the render_environment_hazeconsole command.

Arguments

int engine.render.getEnvironmentHazeMode()

Returns the current mode set for the haze effect.
Notice
To check the haze mode via console, use the render_environment_hazeconsole variable.

Return value

Haze mode: one of the RENDER_HAZE_* variables.

void engine.render.setExposure(float exposure)

Sets the camera exposure (a multiplier of the scene luminance and brightness). It determines the resulting amount of luminance:
  • By the minimum value of 0.0f, the image is rendered black.
  • The higher the value, the more luminance and the brighter the scene lit.

Arguments

  • float exposure - Multiplier of the scene luminance and brightness.

float engine.render.getExposure()

Returns the current camera exposure (a multiplier of the scene luminance and brightness.). It determines the resulting amount of luminance:
  • By the minimum value of 0.0f, the image is rendered black.
  • The higher the value, the more luminance and the brighter the scene lit.

Return value

Current multiplier of the scene luminance and brightness.

void engine.render.setExposureAdaptation(float adaptation)

Sets the time for the camera to adjust exposure. If 0.0f is set, instant adaptation will be used.

Arguments

  • float adaptation - Period of exposure 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 the time set for the camera to adjust exposure. If the 0.0f is returned, it means that instant adaptation is used.

Return value

Period of exposure adaptation in seconds.

float engine.render.getExposureInterpolation()

Returns the current exposure interpolation (the engine ifps multiplied by the exposure adaptation speed). The method can be used for automatic exposure adaptation.

Return value

Exposure interpolation.

void engine.render.setExposureMaxLuminance(float luminance)

Sets the maximum luminance offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the lower the value, the brighter the adapted image will be. The parameter can take on negative values.
Notice
If the specified value is less than the current minimum luminance, the minimum luminance value will be changed to the specified maximum luminance so that they are equal.

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 offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the lower the value, the brighter the adapted image is.

Return value

Maximum luminance.

void engine.render.setExposureMinLuminance(float luminance)

Sets the minimum luminance offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the higher the value, the darker the adapted image will be. The parameter can take on negative values.
Notice
If the specified value is greater than the current maximum luminance, the maximum luminance value will be changed to the specified minimum luminance so that they are equal.

Arguments

  • float luminance - Minimum luminance. The provided value is clamped to the range [-10.0f; 10.0f].

float engine.render.getExposureMinLuminance()

Returns the minimum luminance offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the higher the value, the darker the adapted image is.

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 - a static exposure. The amount of luminance is determined by the setExposure().
    • 1 - adaptive logarithmic mapping technique.
    • 2 - adaptive quadratic mapping technique.

int engine.render.getExposureMode()

Returns current adaptive exposure mode:
  • 0 - a static exposure. The amount of luminance is determined by the setExposure().
  • 1 - adaptive logarithmic mapping technique.
  • 2 - adaptive quadratic mapping technique.

Return value

The type of the 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.setFieldHeightResolution(int resolution)

Sets the resolution of the FieldHeight.

Arguments

  • int resolution - One of the following values:
    • 0 - 128 x 128.
    • 1 - 256 x 256.
    • 2 - 512 x 512 (by default).
    • 3 - 1024 x 1024.
    • 4 - 2048 x 2048.
    • 5 - 4096 x 4096.
    • 6 - 8192 x 8192.

int engine.render.getFieldHeightResolution()

Returns the value indicating the resolution of the FieldHeight.

Return value

One of the following values:
  • 0 - 128 x 128.
  • 1 - 256 x 256.
  • 2 - 512 x 512 (by default).
  • 3 - 1024 x 1024.
  • 4 - 2048 x 2048.
  • 5 - 4096 x 4096.
  • 6 - 8192 x 8192.

void engine.render.setFieldPrecision(int precision)

Sets the precision of textures used for field objects.

Arguments

  • int precision - Textures' precision:
    • 0 - 16-bit precision R16 texture (by default).
    • 1 - 32-bit precision R32F texture.

int engine.render.isFieldPrecision()

Returns the value indicating the current precision of textures used for field objects.

Return value

Textures' precision:
  • 0 - 16-bit precision R16 texture (by default).
  • 1 - 32-bit precision R32F texture.

void engine.render.setFieldShorelineResolution(int resolution)

Set resolution of the texture into which all textures set for all FieldShoreline objects are rendered.

Arguments

  • int resolution - General FieldShoreline texture resolution:
    • 0 - 128 x 128 (by default).
    • 1 - 256 x 256.
    • 2 - 512 x 512.
    • 3 - 1024 x 1024.
    • 4 - 2048 x 2048.
    • 5 - 4096 x 4096.
    • 6 - 8192 x 8192.

int engine.render.getFieldShorelineResolution()

Returns resolution of the texture into which all textures set for all FieldShoreline objects are rendered.

Return value

General FieldShoreline texture resolution:
  • 0 - 128 x 128 (by default).
  • 1 - 256 x 256.
  • 2 - 512 x 512.
  • 3 - 1024 x 1024.
  • 4 - 2048 x 2048.
  • 5 - 4096 x 4096.
  • 6 - 8192 x 8192.

void engine.render.setFilmic(int filmic)

Enables or disables the filmic tonemapping effect.

Arguments

  • int filmic - 1 to enable the filmic tonemapping effect, 0 to disable it. The default value is 1.

int engine.render.isFilmic()

Returns a value indicating if the filmic tonemapping effect is enabled.

Return value

1 if the filmic tonemapping effect is enabled; otherwise, 0.

void engine.render.setFilmicLinearAngle(float angle)

Sets the Linear Angle filmic tonemapping parameter value. This parameter controls the slope of the linear part of the tone mapping curve.

Arguments

  • float angle - Linear Angle value.

float engine.render.getFilmicLinearAngle()

Returns the current Linear Angle filmic tone mapping parameter value. This parameter controls the slope of the linear part of the tone mapping curve.

Return value

Linear Angle value.

void engine.render.setFilmicLinearScale(float scale)

Sets the Linear Strength filmic tonemapping parameter value that is used to change gray values. The Linear Scale controls the length of the tone mapping curve linear part.

Arguments

  • float scale - Linear Strength value.

float engine.render.getFilmicLinearScale()

Returns the current Linear Strength filmic tone mapping parameter value that is used to change gray values. The Linear Scale controls the length of the tone mapping curve linear part.

Return value

Linear Strength value.

void engine.render.setFilmicShoulderScale(float scale)

Sets the Shoulder Strength filmic tonemapping parameter value that is used to change bright values.

Arguments

  • float scale - Shoulder Strength value.

float engine.render.getFilmicShoulderScale()

Returns the current Shoulder Strength filmic tonemapping parameter value that is used to change bright values.

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 Scale filmic tonemapping parameter value that is used to change dark values. The Toe Scale controls the slope of the tone mapping curve toe (the area of underexposure).

Arguments

  • float scale - Toe scale value.

float engine.render.getFilmicToeScale()

Returns the current Toe Scale filmic tonemapping parameter value that is used to change dark values. The Toe Scale controls the slope of the tone mapping curve toe (the area of underexposure).

Return value

Toe scale value.

void engine.render.setFilmicWhiteLevel(float level)

Sets the Linear White Point filmic tonemapping parameter value, which is mapped as pure white in the resulted image.

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()

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 FXAA

void engine.render.setGBufferAO(int gbufferao)

Enables or disables storing ambient occlusion data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_aoconsole command.

Arguments

  • int gbufferao - 1 to enable storing ambient occlusion data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferAO()

Returns the value indicating if ambient occlusion data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_aoconsole variable.

Return value

1 if ambient occlusion data is stored in the GBuffer; otherwise, 0.

void engine.render.setGBufferLightmap(int lightmap)

Enables or disables storing lightmap data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_lightmapconsole command.

Arguments

  • int lightmap - 1 to enable storing lightmap data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferLightmap()

Returns a value indicating if lightmap data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_lightmapconsole variable.

Return value

1 if lightmap data is stored in the GBuffer; otherwise, 0.

void engine.render.setGBufferMaterial_mask(int gbuffermaterial_mask)

Enables or disables storing material mask data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_material_maskconsole command.

Arguments

  • int gbuffermaterial_mask - 1 to enable storing material mask data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferMaterial_mask()

Returns a value indicating if material mask data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_material_maskconsole variable.

Return value

1 if material mask data is stored in the GBuffer; otherwise, 0.

void engine.render.setGBufferMicrofiber(int microfiber)

Enables or disables storing microfiber data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_microfiberconsole command.

Arguments

  • int microfiber - 1 to enable storing microfiber data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferMicrofiber()

Returns a value indicating if microfiber data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_microfiberconsole variable.

Return value

1 if microfiber data is stored in the GBuffer; otherwise, 0.

void engine.render.setGBufferSpecular(int specular)

Enables or disables storing specular data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_specularconsole command.

Arguments

  • int specular - 1 to enable storing specular data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferSpecular()

Returns a value indicating if specular data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_specularconsole variable.

Return value

1 if specular data is stored in the GBuffer; otherwise, 0.

void engine.render.setGBufferTranslucent(int translucent)

Enables or disables storing translucency data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_translucentconsole command.

Arguments

  • int translucent - 1 to enable storing translucency data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferTranslucent()

Returns a value indicating if translucency data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_translucentconsole variable.

Return value

1 if translucency data is stored in the GBuffer; otherwise, 0.

void engine.render.setGBufferVelocity(int velocity)

Enables or disables storing velocity data in the GBuffer.
Notice
The feature can be enabled/disabled by using the render_gbuffer_velocityconsole command.

Arguments

  • int velocity - 1 to enable storing velocity data in the GBuffer, 0 to disable it. The default value is 1.

int engine.render.isGBufferVelocity()

Returns a value indicating if velocity data is stored in the GBuffer.
Notice
To check if the feature is enabled, use the render_gbuffer_velocityconsole variable.

Return value

1 if velocity data is stored in the GBuffer; 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.setLens(int lens)

Enables or disables lens flares.

Arguments

  • int lens - Positive integer to enable lens flares, 0 to disable.

int engine.render.isLens()

Returns a value indicating if lens flares are enabled.

Return value

Positive integer if lens flares are enabled; otherwise, 0.

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, green 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, green 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.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.

void engine.render.setLightsForwardPerObjectEnv(int env)

Sets the maximum number of environment probes per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 environment probes per object.
Notice
To set the value via the console, use the render_lights_env_per_forward_objectconsole command.

Arguments

  • int env - Maximum number of environment probes per object within the [0; 128] range. The default value is 4.

int engine.render.getLightsForwardPerObjectEnv()

Returns the current maximum number of environment probes per object (available only for materials rendered in the forward rendering pass).
Notice
To get the value via the console, use the render_lights_env_per_forward_objectconsole variable.

Return value

Maximum number of environment probes per object within the [0; 128] range.

void engine.render.setLightsForwardPerObjectOmni(int omni)

Sets the maximum number of omni lights per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 omni lights per object.
Notice
To set the value via the console, use the render_lights_omni_per_forward_objectconsole command.

Arguments

  • int omni - Maximum number of omni lights per object within the [0; 128] range. The default value is 4.

int engine.render.getLightsForwardPerObjectOmni()

Returns the current maximum number of omni lights per object (available only for materials rendered in the forward rendering pass).
Notice
To get the value via the console, use the render_lights_omni_per_forward_objectconsole variable.

Return value

Maximum number of omni lights per object within the [0; 128] range.

void engine.render.setLightsForwardPerObjectProj(int proj)

Sets the maximum number of projected lights per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 projected lights per object.
Notice
To set the value via the console, use the render_lights_proj_per_forward_objectconsole command.

Arguments

  • int proj - Maximum number of projected lights per object within the [0; 128] range. The default value is 4.

int engine.render.getLightsForwardPerObjectProj()

Returns the current maximum number of projected lights per object (available only for materials rendered in the forward rendering pass).
Notice
To get the value via the console, use the render_lights_proj_per_forward_objectconsole variable.

Return value

Maximum number of projected lights per object within the [0; 128] range.

void engine.render.setLightsForwardPerObjectWorld(int world)

Sets the maximum number of world lights per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 world lights per object.
Notice
To set the value via the console, use the render_lights_world_per_forward_objectconsole command.

Arguments

  • int world - Maximum number of world lights per object within the [0; 128] range. The default value is 4.

int engine.render.getLightsForwardPerObjectWorld()

Returns the current maximum number of world lights per object (available only for materials rendered in the forward rendering pass).
Notice
To get the value via the console, use the render_lights_world_per_forward_objectconsole variable.

Return value

Maximum number of world lights per object within the [0; 128] range.

void engine.render.setLightsMaxPerBatch(int batch)

Sets the maximum number of lights rendered by a tile per batch call. With lights batching optimization, omni lights divided into tiles are rendered in batches: each tile renders the specified number of lights per batch. It allows decreasing the number of DIP calls and increasing performance. The optimization works only for omni lights with point shape and without shadows.
Notice
To set the value via the console, use the render_lights_max_per_batchconsole command.

Arguments

  • int batch - Maximum number of lights per batch within the [0; 1024] range. The default value is 1024.
    Notice
    0 disables batching optimization.

int engine.render.getLightsMaxPerBatch()

Returns the current maximum number of lights rendered by a tile per batch call. With lights batching optimization, omni lights divided into tiles are rendered in batches: each tile renders the specified number of lights per batch. It allows decreasing the number of DIP calls and increasing performance. The optimization works only for omni lights with point shape and without shadows.
Notice
To get the value via the console, use the render_lights_max_per_batchconsole variable.

Return value

Maximum number of lights per batch within the [0; 1024] range.
Notice
0 means batching optimization is disabled.

void engine.render.setLightsSpecular(int specular)

Enables or disables rendering of specular highlights.
Notice
To set the value via the console, use the render_lights_specularconsole command.

Arguments

  • int specular - 1 to enable rendering of specular highlights, 0 to disable it. The default value is 1.

int engine.render.isLightsSpecular()

Returns the value indicating if rendering of specular highlights is enabled.
Notice
To get the value via the console, use the render_lights_specularconsole variable.

Return value

1 if rendering of specular highlights is enabled; otherwise, 0.

void engine.render.setLightsTileGridSize(int size)

Sets the number of grid tiles per axis for tiled rendering optimization. During this optimization, the screen space is divided into tiles that render lights in batches. The optimization works only for omni lights with point shape and without shadows.
Notice
To set the value via the console, use the render_lights_tile_grid_sizeconsole command.

Arguments

  • int size - Number of grid tiles per axis within the [1; 32] range. The default value is 8.

int engine.render.getLightsTileGridSize()

Returns the current number of grid tiles per axis for tiled rendering optimization. During this optimization, the screen space is divided into tiles that render lights in batches. The optimization works only for omni lights with point shape and without shadows.
Notice
To get the value via the console, use the render_lights_tile_grid_sizeconsole variable.

Return value

Number of grid tiles per axis within the [1; 32] range.

void engine.render.setMaxFieldAnimations(int animations)

Sets the maximum limit of FieldAnimation nodes allowed to be used in shaders.
Notice
To set the value via the console, use the render_max_field_animationsconsole command.

Arguments

  • int animations - Maximum number of FieldAnimation nodes allowed.
    Notice
    Higher values will affect shader compilation time and performance

int engine.render.getMaxFieldAnimations()

Returns the maximum limit of FieldAnimation nodes allowed to be used in shaders.
Notice
To get the value via the console, use the render_max_field_animationsconsole command.

Return value

Maximum number of FieldAnimation nodes allowed.
Notice
Higher values will affect shader compilation time and performance

void engine.render.setMaxFieldHeights(int heights)

Sets the maximum limit of FieldHeight nodes allowed to be used in shaders.
Notice
To set the value via the console, use the render_max_field_heightsconsole command.

Arguments

  • int heights - Maximum number of FieldHeight nodes allowed.
    Notice
    Higher values will affect shader compilation time and performance

int engine.render.getMaxFieldHeights()

Returns the maximum limit of FieldHeight nodes allowed to be used in shaders.
Notice
To get the value via the console, use the render_max_field_heightsconsole command.

Return value

Maximum number of FieldHeight nodes allowed.
Notice
Higher values will affect shader compilation time and performance

void engine.render.setMaxFieldShorelines(int shorelines)

Sets the maximum limit of FieldShoreline nodes allowed to be used in shaders.
Notice
To set the value via the console, use the render_max_field_shorelinesconsole command.

Arguments

  • int shorelines - Maximum number of FieldShoreline nodes allowed.
    Notice
    Higher values will affect shader compilation time and performance

int engine.render.getMaxFieldShorelines()

Returns the maximum limit of FieldShoreline nodes allowed to be used in shaders.
Notice
To get the value via the console, use the render_max_field_shorelinesconsole command.

Return value

Maximum number of FieldShoreline nodes allowed.
Notice
Higher values will affect shader compilation time and performance

void engine.render.setMaxFieldSpacers(int spacers)

Sets the maximum limit of FieldSpacer nodes allowed to be used in shaders.
Notice
To set the value via the console, use the render_max_field_spacersconsole command.

Arguments

  • int spacers - Maximum number of FieldSpacer nodes allowed.
    Notice
    Higher values will affect shader compilation time and performance

int engine.render.getMaxFieldSpacers()

Returns the maximum limit of FieldSpacer nodes allowed to be used in shaders.
Notice
To set the value via the console, use the render_max_field_spacersconsole command.

Return value

Maximum number of FieldSpacer nodes allowed.
Notice
Higher values will affect shader compilation time and performance

void engine.render.setMotionBlur(int blur)

Enables or disables the motion blur effect.

Arguments

  • int blur - 1 to enable the motion blur effect, 0 to disable it. The default value is 1.

int engine.render.isMotionBlur()

Returns a value indicating if the motion blur effect is enabled.

Return value

1 if the motion blur effect is enabled; otherwise, 0.

void engine.render.setMotionBlurMaxVelocity(float velocity)

Sets the maximum possible amount of motion blur for moving physical objects. When their body velocity exceeds the set value, they will be blurred as if they have the maximum velocity set by the parameter. This parameter should be used:
  • To avoid excessive blurring of fast moving objects.
  • To save performance, as increasing the object's velocity leads increasing the radius of the motion blur effect that drops performance at too high values.

Arguments

  • float velocity - Maximum scaled velocity of moving physical bodies used for the motion blur effect.

float engine.render.getMotionBlurMaxVelocity()

Returns the current maximum possible amount of motion blur for moving physical objects.

Return value

Maximum scaled velocity of moving physical bodies used for the motion blur effect.

void engine.render.setMotionBlurNeatSilhouettes(int silhouettes)

Enables or disables the neat silhouettes option for motion blur. This option keeps contours of objects in front of the camera unblurred.

Arguments

  • int silhouettes - 1 to enable the neat silhouettes option for motion blur, 0 to disable it. The default value is 1.

int engine.render.isMotionBlurNeatSilhouettes()

Returns a value indicating if neat silhouettes option for motion blur is enabled. This option keeps contours of objects in front of the camera unblurred.

Return value

1 if the neat silhouettes option is enabled; otherwise, 0.

void engine.render.setMotionBlurNoiseIntensity(float intensity)

Sets the intensity of the noise used in the motion blur.

Arguments

  • float intensity - Noise intensity value within the [0.0f; 1.0f] range. The default value is 0.25f.

float engine.render.getMotionBlurNoiseIntensity()

Returns the current intensity of the noise used in the motion blur.

Return value

Noise intensity.

void engine.render.setMotionBlurNumSteps(int steps)

Sets the number of steps used in the motion blur. The higher the value, the more correct the motion blur effect is. At low values, moving objects may look doubled, however, performance will increase.

Arguments

  • int steps - Number of steps in range [2;64]. The default value is 4.

int engine.render.getMotionBlurNumSteps()

Returns the current number of steps used in the motion blur. The higher the value, the more correct the motion blur effect is. At low values, moving objects may look doubled, however, performance will increase.

Return value

Number of steps.

void engine.render.setMotionBlurVelocityScale(float scale)

Sets amount of motion blur for moving physical bodies. The higher the value, the more blurred the objects will appear when moving.

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. The higher the value, the more blurred the objects will appear when moving.

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.

void engine.render.setOccluders(int occluders)

Enables or disables rendering of occluders.

Arguments

  • int occluders - 1 to enable rendering of occluders, 0 to disable it. The default value is 1.

int engine.render.isOccluders()

Returns a value indicating if rendering of occluders is enabled.

Return value

1 if rendering of occluders is enabled; otherwise, 0.

void engine.render.setOcclusionQueries(int queries)

Enables or disables additional hardware occlusion query test before sending data to GPU.

Arguments

  • int queries - 1 to enable additional hardware occlusion query test, 0 to disable it. The default value is 1.

int engine.render.isOcclusionQueries()

Returns a value indicating if additional hardware occlusion query test before sending data to GPU is enabled.

Return value

1 if if additional hardware occlusion query test is enabled; otherwise, 0.

void engine.render.setOcclusionQueriesNumFrames(int frames)

Sets the number of frames for additional hardware occlusion query test performed before sending data to GPU.

Arguments

  • int frames - Number of frames. The value within the [0; 1024] range. The default value is 5.

int engine.render.getOcclusionQueriesNumFrames()

Returns the current number of frames for additional hardware occlusion query test performed before sending data to GPU.

Return value

Number of frames. The value within the [0; 1024] range.

void engine.render.setPanorama(int panorama)

Sets the mode of panoramic rendering.
Notice
If panoramic rendering is enabled, underwater shafts and water line effects will be disabled.

Arguments

  • int panorama - One of the following values:
    • 0 - disabled (by default).
    • 1 - 180-degree panorama with curved edges.
    • 2 - 180-degree linear panorama without distortion at the edges.
    • 3 - 180-degree spherical panorama (fisheye).
    • 4 - a 360-degree panorama with curved edges.
    • 5 - a 360-degree linear panorama without distortion at the edges.
    • 6 - 360-degree spherical panorama (fisheye).

int engine.render.getPanorama()

Returns the value indicating current mode of panoramic rendering.
Notice
If panoramic rendering is enabled, underwater shafts and water line effects will be disabled.

Return value

One of the following values:
  • 0 - disabled (by default).
  • 1 - 180-degree panorama with curved edges.
  • 2 - 180-degree linear panorama without distortion at the edges.
  • 3 - 180-degree spherical panorama (fisheye).
  • 4 - a 360-degree panorama with curved edges.
  • 5 - a 360-degree linear panorama without distortion at the edges.
  • 6 - 360-degree spherical panorama (fisheye).

void engine.render.setParallax(int parallax)

Enables or disables parallax occlusion mapping.

Arguments

  • int parallax - 1 to enable parallax occlusion mapping, 0 to disable it. The default value is 1.

int engine.render.isParallax()

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
and reflective tessellation materials:
  • 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
and reflective tessellation materials:
  • 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.

void engine.render.setReflectionDynamic(int dynamic)

Enables or disables dynamic reflections for materials.

Arguments

  • int dynamic - 1 to enable dynamic reflections for materials, 0 to disable it. The default value is 1.

int engine.render.isReflectionDynamic()

Returns a value indicating if dynamic reflections for materials are enabled.

Return value

1 if dynamic reflections for materials are enabled; otherwise, 0.

void engine.render.setReflectionDynamicBlur(int blur)

Enables or disables blurring of dynamic reflections for materials.

Arguments

  • int blur - 1 to enable blurring of dynamic reflections for materials, 0 to disable it. The default value is 0.

int engine.render.isReflectionDynamicBlur()

Returns a value indicating if blurring of dynamic reflections for materials is enabled.

Return value

1 if if blurring of dynamic reflections for materials is enabled; otherwise, 0.

void engine.render.setReflectionLods(int lods)

Enables or disables reduction of resolution of dynamic reflections when the camera moves away.

Arguments

  • int lods - 1 to enable reduction of resolution of dynamic reflections when the camera moves away, 0 to disable it. The default value is 1.

int engine.render.isReflectionLods()

Returns a value indicating if reduction of resolution of dynamic reflections when the camera moves away is enabled.

Return value

1 if reduction of resolution of dynamic reflections when the camera moves away is enabled; otherwise, 0.

void engine.render.setRefraction(int refraction)

Enables or disables refraction.

Arguments

  • int refraction - 1 to enable refraction, 0 to disable it. The default value is 1.

int engine.render.isRefraction()

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, green 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, green 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.setScreenPrecision(int precision)

Sets screen precision. This parameter determines the texture format used for rendering buffers.

Arguments

  • int precision - One of the following values:
    • 0 - RG11B10.
    • 1 - RGBA16 (by default).

int engine.render.isScreenPrecision()

Returns a value indicating the current screen screen precision. This parameter determines the texture format used for rendering buffers.

Return value

One of the following values:
  • 0 - RG11B10.
  • 1 - RGBA16 (by default).

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.

void engine.render.setShadersQuality(int quality)

Sets the quality of shaders.

Arguments

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.

void engine.render.setShadows(int shadows)

Enables or disables shadows rendering.

Arguments

  • int shadows - 1 to enable shadows rendering, 0 to skip it. The default value is 1.

int engine.render.isShadows()

Returns a value indicating whether shadows are rendered or not.

Return value

1 if shadows are rendered; otherwise, 0.

void engine.render.setShadowsAlphaTest(int test)

Enables or disables alpha test for shadows.

Arguments

  • int test - 1 to enable alpha test for shadows, 0 to disable it. The default value is 1.

int engine.render.isShadowsAlphaTest()

Returns a value indicating if alpha test is enabled for shadows.

Return value

1 if alpha test is enabled for shadows; otherwise, 0.

void engine.render.setShadowShafts(int shafts)

Enables or disables volumetric shadows.

Arguments

  • int shafts - 1 to enable volumetric shadows, 0 to disable. The default value is 0.

int engine.render.isShadowShafts()

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. 1 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.setShadowsOmniJitter(int jitter)

Enables or disables jittering for shadows casted by omni light sources.

Arguments

  • int jitter - 1 to enable jittering for shadows casted by omni light sources, 0 to disable it. The default value is 1.

int engine.render.isShadowsOmniJitter()

Returns the value indicating if jittering is enabled for shadows casted by omni light sources.

Return value

1 if jittering is enabled for shadows casted by omni light sources; otherwise, 0.

void engine.render.setShadowsPrecision(int precision)

Sets the precision of soft shadows.

Arguments

  • int precision - One of the following values:
    • 0 - 16-bit precision.
    • 1 - 32-bit precision (by default).

int engine.render.isShadowsPrecision()

Returns the current precision of soft shadows.

Return value

One of the following values:
  • 0 - 16-bit precision.
  • 1 - 32-bit precision (by default).

void engine.render.setShadowsScreenSpace(int space)

Enables or disables screen space shadows. They provide high-quality penumbra, per-light work, per-pixel detail at any zoom level and infinite visibility distance (when enabled, distant objects can cast shadows next to the horizon). Supports depth cutout parallax. Screen space shadows can be mixed with regular ones.
Notice
To set the value via the console, use the render_shadows_screenspace console command.

Arguments

  • int space - 1 to enable screen space shadows, 0 to disable. The default value is 1.

int engine.render.isShadowsScreenSpace()

Returns the value indicating if screen space shadows are enabled. They provide high-quality penumbra, per-light work, per-pixel detail at any zoom level and infinite visibility distance (when enabled, distant objects can cast shadows next to the horizon). Supports depth cutout parallax. Screen space shadows can be mixed with regular ones.
Notice
To get the value via the console, use the render_shadows_screenspace console variable.

Return value

1 if screen space shadows are enabled; otherwise, 0.

void engine.render.setShadowsSoft(int soft)

Enables or disables soft shadows.

Arguments

  • int soft - 1 to enable soft shadows, 0 to disable. The default value is 1.

int engine.render.isShadowsSoft()

Returns the value indicating if soft shadows are enabled.

Return value

1 if soft shadows are enabled; otherwise, 0.

void engine.render.setShadowsSoftQuality(int quality)

Sets the quality of soft shadows.

Arguments

  • int quality - One of the following values:
    • 0 - low.
    • 1 - medium (by default).
    • 2 - high.

int engine.render.getShadowsSoftQuality()

Returns the current quality of soft shadows.

Return value

One of the following values:
  • 0 - low.
  • 1 - medium (by default).
  • 2 - high.

void engine.render.setShadowsWorldLerpCascades(int cascades)

Enables or disables shadows cascades lerp.

Arguments

  • int cascades - 1 to enable shadows cascades lerp, 0 to disable it. The default value is 1.

int engine.render.isShadowsWorldLerpCascades()

Returns the value indicating if shadows cascades lerp is enabled.

Return value

1 if shadows cascades lerp is enabled; otherwise, 0.

void engine.render.setSharpen(int sharpen)

Enables or disables the sharpening post-processing effect.

Arguments

  • int sharpen - 1 to enable the sharpening post-processing effect, 0 to disable it. The default value is 0.

int engine.render.isSharpen()

Returns a value indicating if the sharpening post-processing effect is enabled.

Return value

1 if the sharpening post-processing effect is enabled; otherwise, 0.

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.setShowAlphaTest(int test)

Displays or hides the visualizer for transparent objects using alpha test.

Arguments

  • int test - 1 to display the visualizer for transparent objects using alpha test, 0 to hide it. The default value is 0.

int engine.render.isShowAlphaTest()

Returns a value indicating whether the visualizer is displayed for transparent objects using alpha test or not.

Return value

1 if visualizer for transparent objects using alpha test is displayed; otherwise, 0.

void engine.render.setShowAmbient(int ambient)

Enables or disables displaying the ambient pass buffer.

Arguments

  • int ambient - 1 to display the ambient pass buffer, 0 to hide it. The default value is 0.

int engine.render.isShowAmbient()

Returns a value indicating whether the ambient pass buffer is displayed or not.

Return value

1 if the ambient pass buffer is displayed; otherwise, 0.

void engine.render.setShowCascades(int cascades)

Displays or hides world shadow cascades.

Arguments

  • int cascades - 1 to display world shadow cascades, 0 to hide them. The default value is 0.

int engine.render.isShowCascades()

Returns a value indicating whether world shadow cascades are displayed or not.

Return value

1 if world shadow cascades are displayed; otherwise, 0.

void engine.render.setShowDecals(int decals)

Displays or hides the visualizer for decals.

Arguments

  • int decals - 1 to display the visualizer for decals, 0 to hide it. The default value is 0.

int engine.render.isShowDecals()

Returns a value indicating whether the visualizer is displayed for decals or not.

Return value

1 if visualizer for decals is displayed; otherwise, 0.

void engine.render.setShowDynamic(int dynamic)

Displays or hides the visualizer for dynamic objects.

Arguments

  • int dynamic - 1 to display the visualizer for dynamic objects, 0 to hide it. The default value is 0.

int engine.render.isShowDynamic()

Returns a value indicating whether the visualizer is displayed for dynamic objects or not.

Return value

1 if visualizer for dynamic objects is displayed; otherwise, 0.

void engine.render.setShowGeodeticPivot(int pivot)

Displays or hides geodetic pivots.

Arguments

  • int pivot - 1 to display geodetic pivots, 0 to hide them. The default value is 0.

int engine.render.isShowGeodeticPivot()

Returns a value indicating whether geodetic pivots are displayed or not.

Return value

1 if geodetic pivots are displayed; otherwise, 0.

void engine.render.setShowMipmaps(int mipmaps)

Displays or hides texture mipmap levels.

Arguments

  • int mipmaps - 1 to display texture mipmap levels, 0 to hide them. The default value is 0.

int engine.render.isShowMipmaps()

Returns a value indicating whether texture mipmap levels are displayed or not.

Return value

1 if texture mipmap levels are displayed; otherwise, 0.

void engine.render.setShowOccluder(int occluder)

Displays or hides the buffer used for occluders.

Arguments

  • int occluder - 1 to display the buffer used for occluders, 0 to hide it. The default value is 0.

int engine.render.isShowOccluder()

Returns a value indicating whether the buffer used for occluders is displayed in the viewport or not.

Return value

1 if the buffer used for occluders is displayed; otherwise, 0.

void engine.render.setShowQueries(int queries)

Displays or hides occlusion query boxes.

Arguments

  • int queries - 1 to display occlusion query boxes, 0 to hide them. The default value is 0.

int engine.render.isShowQueries()

Returns a value indicating whether occlusion query boxes are displayed in the viewport or not.

Return value

1 if occlusion query boxes are displayed; otherwise, 0.

void engine.render.setShowScissors(int scissors)

Displays or hides scissor rectangles.

Arguments

  • int scissors - 1 to display scissor rectangles, 0 to hide them. The default value is 0.

int engine.render.isShowScissors()

Returns a value indicating if scissor rectangles are displayed.

Return value

1 if scissor rectangles are displayed; otherwise, 0.

void engine.render.setShowTextures(int textures)

Sets the display mode for buffers used by the renderer.

Arguments

  • int textures - One of the following values:
    • 0 - hide all buffers (by default).
    • 1 - display render textures in a compact view.
    • 2 - display render textures in a full view.

int engine.render.getShowTextures()

Returns the current display mode for buffers used by the renderer.

Return value

One of the following values:
  • 0 - all buffers are hidden (by default).
  • 1 - render textures are displayed in a compact view.
  • 2 - render textures are displayed in a full view.

void engine.render.setShowTexturesNumber(int number)

Sets the number of buffers in a row displayed in the full view mode (see setShowTextures(2)).

Arguments

  • int number - Number of buffers in a row. Value within the [1; 16] range. The default value is 7.

int engine.render.getShowTexturesNumber()

Returns the current number of buffers in a row displayed in the full view mode (see setShowTextures(2)).

Return value

Number of buffers in a row.

void engine.render.setShowTexturesOffset(int offset)

Sets the number of the buffer to start displaying from in the full view mode (see setShowTextures(2)).

Arguments

  • int offset - Number of the buffer to start displaying from. Value within the [0; 52] range. The default value is 0.

int engine.render.getShowTexturesOffset()

Returns the current number of the buffer to start displaying from in the full view mode (see setShowTextures(2)).

Return value

Number of the buffer to start displaying from. Value within the [0; 52] range.

void engine.render.setShowTransparent(int transparent)

Displays or hides the visualizer for transparent objects.

Arguments

  • int transparent - 1 to display the visualizer for transparent objects, 0 to hide it. The default value is 0.

int engine.render.isShowTransparent()

Returns a value indicating whether the visualizer is displayed for transparent objects or not.

Return value

1 if visualizer for transparent objects is enabled; otherwise, 0.

void engine.render.setShowTriangles(int triangles)

Sets the wireframe mode for scene triangles.

Arguments

  • int triangles - One of the following values:
    • 0 - triangles are hidden (by default).
    • 1 - front faces with the depth test are shown.
    • 2 - front faces without the depth test are shown.
    • 3 - front and back faces without the depth test are shown.

int engine.render.getShowTriangles()

Returns the current wireframe mode for scene triangles.

Return value

One of the following values:
  • 0 - triangles are hidden (by default).
  • 1 - front faces with the depth test are shown.
  • 2 - front faces without the depth test are shown.
  • 3 - front and back faces without the depth test are shown.

void engine.render.setSkipPostMaterials(int materials)

Enables or disables skipping of the post materials pass.

Arguments

  • int materials - 1 to skip the post materials pass, 0 to disable it. The default value is 0.

int engine.render.isSkipPostMaterials()

Returns a value indicating if the post materials pass is skipped.

Return value

1 if the post materials pass is skipped; otherwise, 0.

void engine.render.setSkipRenderMaterials(int materials)

Enables or disables skipping of the render materials pass.

Arguments

  • int materials - 1 to skip the render materials pass, 0 to disable it. The default value is 0.

int engine.render.isSkipRenderMaterials()

Returns a value indicating if the render materials pass is skipped.

Return value

1 if the render materials pass is skipped; otherwise, 0.

void engine.render.setSkipTransparent(int transparent)

Enables or disables skipping of the transparent pass.

Arguments

  • int transparent - 1 to skip the transparent pass, 0 to disable it. The default value is 0.

int engine.render.isSkipTransparent()

Returns a value indicating if the transparent pass is skipped.

Return value

1 if the transparent pass is skipped; otherwise, 0.

void engine.render.setSkipTransparentAmbient(int ambient)

Enables or disables skipping of the transparent ambient pass.

Arguments

  • int ambient - 1 to skip the transparent ambient pass, 0 to disable it. The default value is 0.

int engine.render.isSkipTransparentAmbient()

Returns a value indicating if the transparent ambient pass is skipped.

Return value

1 if the transparent ambient pass is skipped; otherwise, 0.

void engine.render.setSkipTransparentDeferred(int deferred)

Enables or disables skipping of the transparent deferred pass.

Arguments

  • int deferred - 1 to skip the transparent deferred pass, 0 to disable it. The default value is 0.

int engine.render.isSkipTransparentDeferred()

Returns a value indicating if the transparent deferred pass is skipped.

Return value

1 if the transparent deferred pass is skipped; otherwise, 0.

void engine.render.setSkipTransparentLight(int light)

Enables or disables skipping of the transparent light pass.

Arguments

  • int light - 1 to skip the transparent light pass, 0 to disable it. The default value is 0.

int engine.render.isSkipTransparentLight()

Returns a value indicating if the transparent light pass is skipped.

Return value

1 if the transparent light pass is skipped; otherwise, 0.

void engine.render.setSkipTransparentMultipleEnvProbes(int probes)

Enables or disables skipping of the transparent multiple environment probes pass.

Arguments

  • int probes - 1 to skip the transparent multiple environment probes pass, 0 to disable it. The default value is 0.

int engine.render.isSkipTransparentMultipleEnvProbes()

Returns a value indicating if the transparent multiple environment probes pass is skipped.

Return value

1 if the transparent multiple environment probes pass is skipped; otherwise, 0.

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.setSSAO(int ssao)

Enables or disables the SSAO (Screen Space Ambient Occlusion) effect.

Arguments

  • int ssao - 1 to enable the SSAO effect, 0 to disable.

int engine.render.isSSAO()

Returns the value indicating if the SSAO (Screen Space Ambient Occlusion) effect is enabled.

Return value

1 if the SSAO effect is enabled; otherwise, 0.

void engine.render.setSSAOCavity(int cavity)

Enables or disables the cavity option for the SSAO (Screen Space Ambient Occlusion) effect. This option improves (sharpens) the look of junction contours at low resolutions, so it should be used for detail enhancement (small stones, bolts and so on).

Arguments

  • int cavity - 1 to enable the cavity option for the SSAO effect, 0 to disable. The default value is 1.

int engine.render.isSSAOCavity()

Returns the value indicating if the cavity option for the SSAO (Screen Space Ambient Occlusion) effect is enabled. This option improves (sharpens) the look of junction contours at low resolutions, so it should be used for detail enhancement (small stones, bolts and so on).

Return value

1 if the cavity option for the SSAO effect is enabled; otherwise, 0.

void engine.render.setSSAOCavityIntensity(float intensity)

Sets the intensity of sharpening of contours for the cavity option (see the setSSAOCavity() method).

Arguments

  • float intensity - Sharpening intensity value. The default value is 1.0f.

float engine.render.getSSAOCavityIntensity()

Returns the intensity of sharpening of contours for the cavity option (see the setSSAOCavity() method).

Return value

Sharpening intensity value. The default value is 1.0f.

void engine.render.setSSAOCavityRadius(float radius)

Sets the size of junction contours area for the cavity option (see the setSSAOCavity() method).

Arguments

  • float radius - Size of junction contours area. The default value is 1.0f.

float engine.render.getSSAOCavityRadius()

Returns the size of junction contours area for the cavity option (see the setSSAOCavity() method).

Return value

Size of junction contours area. The default value is 1.0f.

void engine.render.setSSAOIntensity(float intensity)

Sets the intensity of the SSAO (Screen Space Ambient Occlusion) for the scene. The intensity value affects brightness of shadows:
  • By the minimum value of 0.0f, the ambient occlusion shadowing is the lightest.

Arguments

  • float intensity - Intensity value of the SSAO (Screen Space Ambient Occlusion) for the scene. The default value is 1.0f.

float engine.render.getSSAOIntensity()

Returns the intensity of the SSAO (Screen Space Ambient Occlusion) for the scene. The intensity value affects brightness of shadows:
  • By the minimum value of 0.0f, the ambient occlusion shadowing is the lightest.

Return value

SSAO intensity value. The default value is 1.0f.

void engine.render.setSSAOIntensityLightedSide(float side)

Sets the intensity of the SSAO (Screen Space Ambient Occlusion) for the scene object's lighted side.

Arguments

  • float side - SSAO intensity value for the scene object's lighted side. The default value is 1.0f.

float engine.render.getSSAOIntensityLightedSide()

Returns the intensity of SSAO(Screen Space Ambient Occlusion) for the scene objects' lighted side.

Return value

SSAO intensity value for the scene object's lighted side. The default value is 1.0f.

void engine.render.setSSAOIntensityReflection(float reflection)

Sets the intensity of SSAO (Screen Space Ambient Occlusion) on reflections.

Arguments

  • float reflection - SSAO intensity value for reflections. The default value is 1.0f.

float engine.render.getSSAOIntensityReflection()

Returns the intensity of SSAO (Screen Space Ambient Occlusion) on reflections.

Return value

SSAO intensity value for reflections. The default value is 1.0f.

void engine.render.setSSAONoise(int noise)

Enables or disables noise for the SSAO (Screen Space Ambient Occlusion) effect. This option reduces banding effect.
Notice
It is recommended to use noise with TAA enabled.

Arguments

  • int noise - 1 to enable SSAO noise, 0 to disable. The default value is 1.

int engine.render.isSSAONoise()

Returns the value indicating if noise for the SSAO (Screen Space Ambient Occlusion) effect is enabled. This option reduces banding effect.
Notice
It is recommended to use noise with TAA enabled.

Return value

1 if SSAO noise is enabled; otherwise, 0.

void engine.render.setSSAOQuality(int quality)

Sets the quality of SSAO(Screen Space Ambient Occlusion).

Arguments

  • int quality - Quality of SSAO:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int engine.render.getSSAOQuality()

Returns the quality of SSAO (Screen Space Ambient Occlusion).

Return value

Quality of SSAO:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

void engine.render.setSSAORadius(float radius)

Sets the radius of SSAO (Screen Space Ambient Occlusion).The radius is the distance for each of the points in the world space, up to which they can shadow their neighboring points:
  • By low values, each point can shadow only the points in the close range.
  • By high values, each point shadows farther positioned points.

Arguments

  • float radius - SSAO radius value. The default value is 1.0f.

float engine.render.getSSAORadius()

Returns the radius of SSAO (Screen Space Ambient Occlusion).The radius is the distance for each of the points in the world space, up to which they can shadow their neighboring points:
  • By low values, each point can shadow only the points in the close range.
  • By high values, each point shadows farther positioned points.

Return value

SSAO radius value.

void engine.render.setSSAORayTracing(int tracing)

Enables or disables ray tracing for SSAO (Screen Space Ambient Occlusion) calculation. When enabled, SSAO provides more realistic shadows between the objects.
Notice
Ray-traced SSAO calculation available only when the SSRTGI technique is enabled.

Arguments

  • int tracing - 1 to enable ray tracing for SSAO calculation, 0 to disable. The default value is 1.

int engine.render.isSSAORayTracing()

Returns a value indicating if ray tracing is used for SSAO (Screen Space Ambient Occlusion) calculation. When enabled, SSAO provides more realistic shadows between the objects.
Notice
Ray-traced SSAO calculation available only when the SSRTGI technique is enabled.

Return value

1 if ray tracing is used for SSAO calculation; otherwise, 0.

void engine.render.setSSAORayTracingDenoise(int denoise)

Enables or disables noise reduction for the ray-traced SSAO (Screen Space Ambient Occlusion). This option reduces noise by using blur effect.
Notice
Ray-traced SSAO calculation available only when the SSRTGI technique is enabled.

Arguments

  • int denoise - 1 to enable noise reduction for the ray-traced SSAO, 0 to disable.

int engine.render.isSSAORayTracingDenoise()

Returns the value indicating if noise reduction for the ray-traced SSAO (Screen Space Ambient Occlusion) is enabled. This option reduces noise by using blur effect.
Notice
Ray-traced SSAO calculation available only when the SSRTGI technique is enabled.

Return value

1 if noise reduction for the ray-traced SSAO is enabled; otherwise, 0.

void engine.render.setSSAORayTracingThreshold(float threshold)

Sets the threshold value for the ray-traced SSAO (Screen Space Ambient Occlusion).
Notice
Ray-traced SSAO calculation available only when the SSRTGI technique is enabled.

Arguments

  • float threshold - SSAO ray tracing threshold value. The default value is 1.0f.

float engine.render.getSSAORayTracingThreshold()

Returns the current threshold value for the ray-traced SSAO (Screen Space Ambient Occlusion).
Notice
Ray-traced SSAO calculation available only when the SSRTGI technique is enabled.

Return value

SSAO ray tracing threshold value. The default value is 1.0f.

void engine.render.setSSAOResolution(int resolution)

Sets the resolution of SSAO (Screen Space Ambient Occlusion).

Arguments

  • int resolution - Resolution of SSAO:
    • 0 - quarter resolution.
    • 1 - half resolution (by default).
    • 2 - full resolution.

int engine.render.getSSAOResolution()

Returns the resolution of SSAO (Screen Space Ambient Occlusion).

Return value

Resolution of SSAO:
  • 0 - quarter resolution.
  • 1 - half resolution (by default).
  • 2 - full resolution.

void engine.render.setSSGI(int ssgi)

Enables or disables the SSGI (Screen Space Global Illumination) effect.
Notice
To enable or disable the effect via the console, run the render_ssgiconsole command.

Arguments

  • int ssgi - 1 to enable the SSGI effect, 0 to disable it. The default value is 0.

int engine.render.isSSGI()

Returns the value indicating if the SSGI (Screen Space Global Illumination) effect is enabled.
Notice
To check if the effect is enabled, use also the render_ssgiconsole variable.

Return value

1 if the SSGI effect is enabled; otherwise, 0.

void engine.render.setSSGIIntensity(float intensity)

Sets the intensity of the SSGI (Screen Space Global Illumination) for the scene.
  • By the minimum value of 0.0f, the global illumination is the darkest.
Notice
To set the intensity via the console, use the render_ssgi_intensityconsole command.

Arguments

  • float intensity - SSGI intensity value. The default value is 1.0f.

float engine.render.getSSGIIntensity()

Returns the intensity of the SSGI (Screen Space Global Illumination) for the scene.
  • By the minimum value of 0.0f, the global illumination is the darkest.
Notice
To get the intensity via the console, use the render_ssgi_intensityconsole variable.

Return value

SSGI intensity value. The default value is 1.0f.

void engine.render.setSSGINormalThreshold(float threshold)

Sets the normal threshold of the SSGI (Screen Space Global Illumination). It determines sensitivity of GI to normals. Normals affect ray intensity: smaller angle of incidence increases ray intensity.
  • By the minimum value of 0.0f, normals are ignored.
Notice
To set the threshold via the console, use the render_ssgi_normal_thresholdconsole command.

Arguments

  • float threshold - SSGI normal threshold value. The default value is 1.0f.

float engine.render.getSSGINormalThreshold()

Returns the normal threshold of the SSGI (Screen Space Global Illumination). It determines sensitivity of GI to normals. Normals affect ray intensity: smaller angle of incidence increases ray intensity.
  • By the minimum value of 0.0f, normals are ignored.
Notice
To get the threshold via the console, use the render_ssgi_normal_thresholdconsole variable.

Return value

SSGI normal threshold value.

void engine.render.setSSGIQuality(int quality)

Sets the quality of the SSGI (Screen Space Global Illumination). Quality means the number of the used samples:
  • Low — 4 samples
  • Medium — 8 samples
  • High — 16 samples
  • Ultra — 32 samples
Notice
To set the quality via the console, use the render_ssgi_qualityconsole command.

Arguments

  • int quality - SSGI quality:
    • 0 - Low
    • 1 - Medium (by default)
    • 2 - High
    • 3 - Ultra

int engine.render.getSSGIQuality()

Returns the quality of the SSGI (Screen Space Global Illumination). Quality means the number of the used samples:
  • Low — 4 samples
  • Medium — 8 samples
  • High — 16 samples
  • Ultra — 32 samples
Notice
To get the quality via the console, use the render_ssgi_qualityconsole variable.

Return value

SSGI quality:
  • 0 - Low
  • 1 - Medium (by default)
  • 2 - High
  • 3 - Ultra

void engine.render.setSSGIRadius(float radius)

Sets the radius of the SSGI (Screen Space Global Illumination). The radius determines the size of the region surrounding a particular sampling point:
  • By low values, each point affects only the points in the close range.
  • By high values, each point affects farther positioned points.
Notice
To set the radius via the console, use the render_ssgi_radiusconsole command.

Arguments

  • float radius - SSGI radius value. The default value is 1.0f.

float engine.render.getSSGIRadius()

Returns the radius of the SSGI (Screen Space Global Illumination). The radius determines the size of the region surrounding a particular sampling point:
  • By low values, each point affects only the points in the close range.
  • By high values, each point affects farther positioned points.
Notice
To get the radius via the console, use the render_ssgi_radiusconsole variable.

Return value

SSGI radius value. The default value is 1.0f.

void engine.render.setSSGIRayTracing(int tracing)

Enables or disables ray tracing for SSGI (Screen Space Global Illumination) calculation. When enabled, SSGI recreates light reflections from the object’s surface.
Notice
Ray-traced SSGI calculation available only when the SSRTGI technique is enabled.

Arguments

  • int tracing - 1 to enable ray tracing for SSGI calculation, 0 to disable. The default value is 1.

int engine.render.isSSGIRayTracing()

Returns the value indicating if ray tracing is used for SSGI (Screen Space Global Illumination) calculation. When enabled, SSGI recreates light reflections from the object’s surface.
Notice
Ray-traced SSGI calculation available only when the SSRTGI technique is enabled.

Return value

1 if ray tracing is used for SSGI calculation; otherwise, 0.

void engine.render.setSSGIRayTracingDenoise(int denoise)

Enables or disables noise reduction for the ray-traced SSGI (Screen Space Global Illumination). This option reduces noise by using blur effect.
Notice
Ray-traced SSGI calculation available only when the SSRTGI technique is enabled.

Arguments

  • int denoise - 1 to enable noise reduction for the ray-traced SSGI, 0 to disable.

int engine.render.isSSGIRayTracingDenoise()

Returns a value indicating if noise reduction for the ray-traced SSGI (Screen Space Global Illumination) is enabled. This option reduces noise by using blur effect.
Notice
Ray-traced SSGI calculation available only when the SSRTGI technique is enabled.

Return value

1 if noise reduction for the ray-traced SSGI is enabled; otherwise, 0.

void engine.render.setSSGIRayTracingThreshold(float threshold)

Sets the threshold value for the ray-traced SSGI (Screen Space Global Illumination).
Notice
Ray-traced SSGI calculation available only when the SSRTGI technique is enabled.

Arguments

  • float threshold - SSGI ray tracing threshold value. The default value is 1.0f.

float engine.render.getSSGIRayTracingThreshold()

Returns the current threshold value for the ray-traced SSGI (Screen Space Global Illumination).
Notice
Ray-traced SSGI calculation available only when the SSRTGI technique is enabled.

Return value

SSGI ray tracing threshold value. The default value is 1.0f.

void engine.render.setSSGIResolution(int resolution)

Sets the resolution of SSGI (Screen Space Global Illumination).
Notice
To set the value via the console, use the render_ssgi_resolutionconsole command.

Arguments

  • int resolution - SSGI resolution:
    • 0 - quarter resolution.
    • 1 - half resolution (by default).
    • 2 - full resolution.

int engine.render.getSSGIResolution()

Returns the resolution of SSGI (Screen Space Global Illumination).
Notice
To get the value via the console, use the render_ssgi_resolutionconsole variable.

Return value

SSGI resolution:
  • 0 - quarter resolution.
  • 1 - half resolution (by default).
  • 2 - full resolution.

void engine.render.setSSGIResolutionColor(int color)

Sets the resolution of the color buffer used for SSGI (Screen Space Global Illumination) calculation. This option significantly affects performance.

Arguments

  • int color - One of the following values:
    • 0 - quarter resolution.
    • 1 - half resolution (by default).
    • 2 - full resolution.

int engine.render.getSSGIResolutionColor()

Returns the resolution of the color buffer used for SSGI (Screen Space Global Illumination) calculation.

Return value

One of the following values:
  • 0 - quarter resolution.
  • 1 - half resolution (by default).
  • 2 - full resolution.

void engine.render.setSSR(int ssr)

Enables or disables the SSR (Screen Space Reflections) effect.

Arguments

  • int ssr - 1 to enable the SSR effect, 0 to disable it.

int engine.render.isSSR()

Returns the value indicating if the SSR (Screen Space Reflections) effect is enabled.

Return value

1 if the SSR effect is enabled; otherwise, 0. The default value is 1.

void engine.render.setSSRDenoise(int denoise)

Enables or disables noise reduction for the SSR (Screen Space Reflections) effect.

Arguments

  • int denoise - 1 to enable noise reduction for the SSR effect, 0 to disable it.

int engine.render.isSSRDenoise()

Returns the value indicating if noise reduction for the SSR (Screen Space Reflections) effect is enabled.

Return value

1 if noise reduction for 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. However, tiny objects may not be reflected. Disabling this mode improves quality but significantly drops performance.

Arguments

  • int tracing - 1 to enable SSR fast tracing, 0 to disable it. 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 the importance sampling mode for the SSR (Screen Space Reflections) effect. Importance sampling provides more accurate but slower calculation of SSR roughness.

Arguments

  • int sampling - 1 to enable SSR importance sampling, 0 to disable it. The default value is 0.

int engine.render.isSSRImportanceSampling()

Returns the value indicating if the importance sampling mode for the SSR (Screen Space Reflections) effect is enabled. Importance sampling provides more accurate but slower calculation of SSR roughness.

Return value

1 if SSR importance sampling is enabled; otherwise, 0.

void engine.render.setSSRIncreasedAccuracy(int accuracy)

Enables or disables increased accuracy for the SSR (Screen Space Reflections). This option reduces visual artifacts around objects, which can appear at resolution lower than full, by increasing accuracy of the last step.

Arguments

  • int accuracy - 1 to enable increased accuracy for the SSR, 0 to disable it. The default value is 0.

int engine.render.isSSRIncreasedAccuracy()

Returns a value indicating if increased accuracy option is enabled for the SSR (Screen Space Reflections). This option reduces visual artifacts around objects, which can appear at resolution lower than full, by increasing accuracy of the last step.

Return value

1 if increased accuracy is enabled for the SSR; otherwise, 0.

void engine.render.setSSRNoiseRay(float ray)

Sets the intensity of the ray noise used for SSR (Screen Space Reflections) calculation. This parameter is used to reduce the banding effect on rough reflections by using the noise.
Notice
The option is available only when importance sampling is enabled.

Arguments

  • float ray - Ray noise intensity in range [0.0f;1.0f]. The default value is 0.5f. The higher is the value, the less pronounced is the banding effect.

float engine.render.getSSRNoiseRay()

Returns the intensity of the ray noise used for SSR (Screen Space Reflections) calculation. This parameter is used to reduce the banding effect on rough reflections by using the noise.

Return value

Ray noise intensity.

void engine.render.setSSRNoiseStep(float step)

Sets the intensity of the step noise used for SSR (Screen Space Reflections) calculation. This parameter is used to reduce the banding effect of tracing by using the noise.

Arguments

  • float step - Step noise intensity. The default value is 0.3f. The higher is the value, the less pronounced is the banding effect.

float engine.render.getSSRNoiseStep()

Returns the intensity of the step noise used for SSR (Screen Space Reflections) calculation.

Return value

Step noise intensity.

void engine.render.setSSRNumRays(int rays)

Sets the number of rays of SSR (Screen Space Reflections) per pixel that are used to calculate rough refrections. Using more rays provides more precise SSR roughness calculation, however, it is more expensive.
Notice
The option is available when importance sampling is enabled.

Arguments

  • int rays - Number of rays per pixel within the [1; 64] range. The default value is 4.

int engine.render.getSSRNumRays()

Returns the number of rays of SSR (Screen Space Reflections) per pixel that are used to calculate rough refrections.
Notice
The option is available when importance sampling is enabled.

Return value

Number of rays per pixel within the [1; 64] range.

void engine.render.setSSRNumSteps(int steps)

Sets the number of steps of SSR (Screen Space Reflections) per ray that are used for trace calculation. Defines accuracy of reflections and causes a reasonable performance impact. The higher the value, the more accurate obstacles between objects are accounted.

Arguments

  • int steps - Number of steps per ray within the [1; 64] range. The default value is 16.

int engine.render.getSSRNumSteps()

Returns the number of steps of SSR (Screen Space Reflections) per ray that are used for trace calculation. The number of steps defines accuracy of reflections and causes a reasonable performance impact. The higher the value, the more accurate obstacles between objects are accounted.

Return value

Number of steps per ray within the [1; 64] range.

void engine.render.setSSRResolution(int resolution)

Sets the resolution of SSR (Screen Space Reflections).
Notice
To set the value via the console, use the console command.

Arguments

  • int resolution - SSR resolution:
    • 0 - quarter resolution.
    • 1 - half resolution (by default).
    • 2 - full resolution.

int engine.render.getSSRResolution()

Returns the resolution of SSR (Screen Space Reflections).
Notice
To get the value via the console, use the console variable.

Return value

One of the following values:
  • 0 - quarter resolution.
  • 1 - half resolution (by default).
  • 2 - full resolution.

void engine.render.setSSRResolutionColor(int color)

Sets the resolution of the color buffer used for SSR (Screen Space Reflections) calculation. This option significantly affects performance.

Arguments

  • int color - Color buffer resolution:
    • 0 - quarter resolution (by default).
    • 1 - half resolution.
    • 2 - full resolution.

int engine.render.getSSRResolutionColor()

Returns the resolution of the color buffer used for SSR (Screen Space Reflections) calculation.

Return value

Color buffer resolution:
  • 0 - quarter resolution (by default).
  • 1 - half resolution.
  • 2 - full resolution.

void engine.render.setSSRResolutionDepth(int depth)

Sets the resolution of the depth buffer used for SSR (Screen Space Reflections) calculation. This option affects detailing of reflections of tiny objects.

Arguments

  • int depth - Depth buffer resolution:
    • 0 - quarter resolution (by default).
    • 1 - half resolution.
    • 2 - full resolution.
    Notice
    To gain performance, this option can be set to lower values while enabling increased accuracy.

int engine.render.getSSRResolutionDepth()

Returns the resolution of the depth buffer used for SSR (Screen Space Reflections) calculation.

Return value

Depth buffer resolution:
  • 0 - quarter resolution (by default).
  • 1 - half resolution.
  • 2 - full resolution.

void engine.render.setSSRRoughnessQuality(int quality)

Sets the quality of SSR (Screen Space Reflections) roughness. The parameter can be changed only when the Importance sampling option is disabled.
Notice
To set the value via the console, use the render_ssr_roughness_qualityconsole command.

Arguments

  • int quality - Roughness quality:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int engine.render.getSSRRoughnessQuality()

Returns the current quality of SSR (Screen Space Reflections) roughness.
Notice
To set the value via the console, use the render_ssr_roughness_qualityconsole command.

Return value

Roughness quality:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

void engine.render.setSSRStepSize(float size)

Sets the size of the trace step used for SSR (Screen Space Reflections) calculation. The higher the value, the longer the trace. However, tiny objects may be missed. The lower the value, the more detailed will be reflections of the tiny objects.

Arguments

  • float size - Step size. The default value is 1.0f.

float engine.render.getSSRStepSize()

Returns the size of the trace step used for SSR (Screen Space Reflections) calculation.

Return value

Step size.

void engine.render.setSSRTGI(int ssrtgi)

Enables or disables the SSRTGI (Screen Space Ray-Traced Global Illumination) effect.

Arguments

  • int ssrtgi - 1 to enable the SSRTGI effect, 0 to disable. The default value is 1.

int engine.render.isSSRTGI()

Returns a value indicating if the SSRTGI (Screen Space Ray-Traced Global Illumination) effect is enabled.

Return value

1 if the SSRTGI effect is enabled; otherwise, 0.

void engine.render.setSSRTGIFastTracing(int tracing)

Enables or disables fast tracing for the SSRTGI (Screen Space Ray-Traced Global Illumination). This option dynamically changes step size to obtain indirect illumination bounces using low number of steps while keeping performance high. Disabling this option improves quality, but significantly reduces performance. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int tracing - 1 to enable fast tracing for the SSRTGI, 0 to disable. The default value is 1.

int engine.render.isSSRTGIFastTracing()

Returns a value indicating if fast tracing is enabled for the SSRTGI (Screen Space Ray-Traced Global Illumination).

Return value

1 if the SSRTGI fast tracing is enabled; otherwise, 0.

void engine.render.setSSRTGIIncreasedAccuracy(int accuracy)

Enables or disables increased accuracy for the SSRTGI (Screen Space Ray-Traced Global Illumination). This option reduces visual artifacts by increasing accuracy of the last step. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int accuracy - 1 to enable increased accuracy for the SSRTGI, 0 to disable. The default value is 1.

int engine.render.isSSRTGIIncreasedAccuracy()

Returns a value indicating if increased accuracy option is enabled for the SSRTGI (Screen Space Ray-Traced Global Illumination).

Return value

1 if increased accuracy is enabled for the SSRTGI; otherwise, 0.

void engine.render.setSSRTGINoiseRay(float ray)

Sets the intensity of the ray noise used for SSRTGI calculation. This parameter is used to reduce the banding effect on the final image by using the noise: the higher is the value, the less pronounced is the banding effect. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • float ray - Ray noise intensity in range [0.0f;1.0f]. The default value is 0.5f. The higher is the value, the less pronounced is the banding effect.

float engine.render.getSSRTGINoiseRay()

Returns the intensity of the ray noise used for SSRTGI calculation.

Return value

Ray noise intensity in range [0.0f;1.0f].

void engine.render.setSSRTGINoiseStep(float step)

Sets the intensity of the step noise used for SSRTGI calculation. This parameter is used to reduce the banding effect of tracing by using the noise: the higher is the value, the less pronounced is the banding effect. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • float step - Step noise intensity in range [0.0f;1.0f]. The default value is 0.5f. The higher is the value, the less pronounced is the banding effect.

float engine.render.getSSRTGINoiseStep()

Returns the intensity of the step noise used for SSRTGI calculation.

Return value

Step noise intensity in range [0.0f;1.0f].

void engine.render.setSSRTGINumRays(int rays)

Sets the number of rays of SSRTGI per pixel that are to calculate the final image. Using more rays provides more precise SSRTGI calculation, however, it is more expensive. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int rays - Number of rays per pixel in range [1;1024]. The default value is 8.

int engine.render.getSSRTGINumRays()

Returns the number of rays of SSRTGI per pixel that are to calculate the final image in range [1;1024].

Return value

Number of rays.

void engine.render.setSSRTGINumSteps(int steps)

Sets the number of steps of SSRTGI per ray that are used for trace calculation. The higher the value, the more accurate obstacles between objects are accounted. However, this option significantly affects performance. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int steps - Number of steps in range [1;256]. The default value is 8.

int engine.render.getSSRTGINumSteps()

Returns the number of steps of SSRTGI per ray that are used for trace calculation.

Return value

Number of steps in range [1;256].

void engine.render.setSSRTGIResolution(int resolution)

Sets the resolution of SSRTGI (Screen Space Ray-Traced Global Illumination). This option significantly affects performance. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int resolution - SSRTGI resolution:
    • 0 - quarter resolution.
    • 1 - half resolution (by default).
    • 2 - full resolution.

int engine.render.getSSRTGIResolution()

Returns the resolution of SSRTGI (Screen Space Ray-Traced Global Illumination).

Return value

SSRTGI resolution:
  • 0 - quarter resolution.
  • 1 - half resolution (by default).
  • 2 - full resolution.

void engine.render.setSSRTGIResolutionDepth(int depth)

Sets the resolution of the depth buffer used for SSRTGI (Screen Space Ray-Traced Global Illumination) calculation. This option significantly affects performance. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int depth - Depth buffer resolution:
    • 0 - quarter resolution (by default).
    • 1 - half resolution.
    • 2 - full resolution.
    Notice
    To gain performance this option can be set to lower values while enabling the increased accuracy.

int engine.render.getSSRTGIResolutionDepth()

Returns the resolution of the depth buffer used for SSRTGI (Screen Space Ray-Traced Global Illumination) calculation.

Return value

Depth buffer resolution:
  • 0 - quarter resolution (by default).
  • 1 - half resolution.
  • 2 - full resolution.

void engine.render.setSSRTGIStepSize(float size)

Sets the size of the trace step used for SSRTGI calculation. The higher the value, the longer the trace. However, tiny objects may be missed. The lower the value, the more detailed will be the tiny objects. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • float size - Step size. The default value is 1.0f.

float engine.render.getSSRTGIStepSize()

Returns the size of the trace step used for SSRTGI calculation.

Return value

Step size.

void engine.render.setSSRTGIUpscaling(int upscaling)

Enables or disables upscaling for the SSRTGI (Screen Space Ray-Traced Global Illumination). This option makes the quality of edges in half and quarter resolution look closer to full. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

  • int upscaling - 1 to enable upscaling for the SSRTGI, 0 to disable it. The default value is 1.

int engine.render.isSSRTGIUpscaling()

Returns a value indicating if the upscaling option is enabled for the SSRTGI (Screen Space Ray-Traced Global Illumination).

Return value

1 if the SSRTGI upscaling is enabled; otherwise, 0.

void engine.render.setSSRThreshold(float threshold)

Sets the threshold used for SSR (Screen Space Reflections) calculation. The threshold limits imitation of reflections in areas where SSR cannot get information. The higher the value, the less this effect is.

Arguments

  • float threshold - SSR threshold value. The default value is 1.0f

float engine.render.getSSRThreshold()

Returns the threshold used for SSR (Screen Space Reflections) calculation. The threshold limits imitation of reflections in areas where SSR cannot get information. The higher the value, the less this effect is.

Return value

SSR threshold.

void engine.render.setSSRThresholdOcclusion(float occlusion)

Sets the occlusion threshold value. The occlusion threshold limits imitation of environment cubemap occlusion in areas where SSR cannot get information. The higher the value, the less this effect is. This parameter is mainly used for indoor environment to correct false reflections on occluded areas (false reflections are replaced with black color). For outdoor environment higher values of this parameter are recommended.

Arguments

  • float occlusion - SSR threshold occlusion. The default value is 1.0f

float engine.render.getSSRThresholdOcclusion()

Returns the current occlusion threshold value. The occlusion threshold limits imitation of environment cubemap occlusion in areas where SSR cannot get information. The higher the value, the less this effect is. This parameter is mainly used for indoor environment to correct false reflections on occluded areas (false reflections are replaced with black color). For outdoor environment higher values of this parameter are recommended.

Return value

SSR threshold occlusion.

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.setSSS(int sss)

Enables or disables the SSS (subsurface scattering) effect.
Notice
To set the value via the console, use the render_sssconsole command.

Arguments

  • int sss - 1 to enable the SSS effect, 0 to disable. The default value is 0.

int engine.render.isSSS()

Returns a value indicating if the SSS (subsurface scattering) effect is enabled.
Notice
To get the value via the console, use the render_sssconsole variable.

Return value

1 if the SSS effect is enabled; otherwise, 0.

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.
Notice
To set the value via the console, use the render_sss_colorconsole command.

Arguments

  • vec4 color - A subsurface scattering color.

vec4 engine.render.getSSSColor()

Returns the current subsurface scattering color.
Notice
To get the value via the console, use the render_sss_colorconsole variable.

Return value

A subsurface scattering color.

void engine.render.setSSSQuality(int quality)

Sets the quality of the SSS (subsurface scattering) effect.
Notice
To set the value via the console, use the render_sss_qualityconsole command.

Arguments

  • int quality - SSS quality:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int engine.render.getSSSQuality()

Returns the quality of the SSS (subsurface scattering) effect.
Notice
To get the value via the console, use the render_sss_qualityconsole variable.

Return value

SSS quality:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

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.
Notice
To set the value via the console, use the render_sss_radiusconsole command.

Arguments

  • float radius - Subsurface scattering radius. The default value is 1.0f.

float engine.render.getSSSRadius()

Returns the current subsurface scattering radius.
Notice
To get the value via the console, use the render_sss_radiusconsole variable.

Return value

Subsurface scattering radius value.

void engine.render.setSSSResolution(int resolution)

Sets the resolution of the SSS (subsurface scattering) effect.
Notice
To set the value via the console, use the render_sss_resolutionconsole command.

Arguments

  • int resolution - SSS resolution:
    • 0 - half resolution (by default).
    • 1 - full resolution.

int engine.render.getSSSResolution()

Returns the resolution of the SSS (subsurface scattering) effect.
Notice
To get the value via the console, use the render_sss_resolutionconsole variable.

Return value

SSS resolution:
  • 0 - half resolution (by default).
  • 1 - full resolution.

void engine.render.setStereo(int stereo)

Sets the stereo rendering mode.
Notice
To set the value via the console, use the render_stereoconsole command. It is not possible to set a stereo mode via a console if the default system script is used; it allows for setting it only on the start-up.

Arguments

  • int stereo - Stereo rendering mode:
    • 0 - disabled (by default).
    • 1 - enabled anaglyph stereo.
    • 2 - enabled interlaced stereo.
    • 3 - enabled horizontal stereo.
    • 4 - enabled vertical stereo.

int engine.render.getStereo()

Returns the current stereo rendering mode.
Notice
To get the value via the console, use the render_stereoconsole variable.

Return value

Stereo rendering mode:
  • 0 - disabled (by default).
  • 1 - enabled anaglyph stereo.
  • 2 - enabled interlaced stereo.
  • 3 - enabled horizontal stereo.
  • 4 - enabled vertical stereo.

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.setSunShafts(int shafts)

Enables or disables the light shafts effects.
Notice
To set the value via the console, use the render_sun_shaftsconsole command.

Arguments

  • int shafts - 1 to enable light shafts, 0 to disable.

int engine.render.isSunShafts()

Returns a value indicating if light shafts are enabled.
Notice
To get the value via the console, use the render_sun_shaftsconsole variable.

Return value

1 if the light shafts are enabled; 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.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.setSupersampling(float supersampling)

Sets the number of samples per pixel used for supersampling.
Notice
To set the value via the console, use the render_supersamplingconsole command.

Arguments

  • float supersampling - Number of samples per pixel within the range [1e-6f; 8.0f]. The default value is 1.0f

float engine.render.getSupersampling()

Returns the number of samples per pixel used for supersampling.
Notice
To get the value via the console, use the render_supersamplingconsole variable.

Return value

Number of samples per pixel.

void engine.render.setTAAColorClamping(int clamping)

Enables or disables the TAA color clamping option. When enabled, the pixel color of the current and the previous frames is clamped. The image becomes more sharp, however, flickering can appear. Clamping is available only when TAA is enabled.
Notice
To set the value via the console, use the render_taa_color_clampingconsole command.

Arguments

  • int clamping - 1 to enable the TAA color clamping option, 0 to disable it. The default value is 1.

int engine.render.isTAAColorClamping()

Returns a value indicating if the TAA color clamping option is enabled. When enabled, the pixel color of the current and the previous frames is clamped. Clamping is available only when TAA is enabled.
Notice
To get the value via the console, use the render_taa_color_clampingconsole variable.

Return value

1 if TAA color clamping is enabled; otherwise, 0.

void engine.render.setTAAFixFlicker(int flicker)

Enables or disables the TAA fix flicker option. This option fixes flickering edges caused by TAA: it removes bright pixels by using the pixel brightness information from the previous frame. It is recommended to enable the option for bright thin ropes, wires and lines. The option is available only when TAA is enabled.
Notice
To set the value via the console, use the render_taa_fix_flickerconsole command.

Arguments

  • int flicker - 1 to enable the TAA fix flicker option, 0 to disable it. The default value is 1.

int engine.render.isTAAFixFlicker()

Returns a value indicating if the TAA fix flicker option is enabled. This option fixes flickering edges caused by TAA: it removes bright pixels by using the pixel brightness information from the previous frame. It is recommended to enable the option for bright thin ropes, wires and lines. The option is available only when TAA is enabled.
Notice
To get the value via the console, use the render_taa_fix_flickerconsole variable.

Return value

1 if the TAA fix flicker option is enabled; otherwise, 0.

void engine.render.setTAAFrameCount(float count)

Sets the frame count of TAA (Temporal Anti-Aliasing). Specifies the number of frames combined for pixels. The higher the value, the more frames are combined into the final image and the better anti-aliasing.
Notice
To set the value via the console, use the render_taa_frame_countconsole command.

Arguments

  • float count - TAA frame count value. The default value is 30.0f.

float engine.render.getTAAFrameCount()

Returns the frame count of TAA (Temporal Anti-Aliasing). Specifies the number of frames combined for pixels. The higher the value, the more frames are combined into the final image and the better anti-aliasing.
Notice
To get the value via the console, use the render_taa_frame_countconsole variable.

Return value

TAA frame count value.

void engine.render.setTAAMaxFrameCount(float count)

Sets the maximum frame count of TAA (Temporal Anti-Aliasing). Specifies the maximum number of frames combined for pixels that don't move relative to the screen space.
Notice
To set the value via the console, use the render_taa_max_frame_countconsole command.

Arguments

  • float count - Maximum TAA frame count value. 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 combined for pixels that don't move relative to the screen space.
Notice
To get the value via the console, use the render_taa_max_frame_countconsole variable.

Return value

Maximum TAA frame count value.

void engine.render.setTAAMinFrameCount(float count)

Sets the minimum frame count of TAA (Temporal Anti-Aliasing). Specifies the minimum number of frames combined for fast moving pixels on the screen.
Notice
To set the value via the console, use the render_taa_min_frame_countconsole command.

Arguments

  • float count - Minimum TAA frame count value. 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 combined for fast moving pixels on the screen.
Notice
To get the value via the console, use the render_taa_min_frame_countconsole variable.

Return value

Minimum TAA frame count value.

void engine.render.setTAAPreserveDetails(float details)

Sets the detail level of TAA (Temporal Anti-Aliasing). The higher the value, the more detailed the image is. Can produce additional flickering.
Notice
To set the value via the console, use the render_taa_preserve_detailsconsole command.

Arguments

  • float details - TAA detail level value. The default value is 1.5f.

float engine.render.getTAAPreserveDetails()

Returns the detail level of TAA (Temporal Anti-Aliasing). The higher the value, the more detailed the image is. Can produce additional flickering.
Notice
To get the value via the console, use the render_taa_preserve_detailsconsole variable.

Return value

TAA detail level value.

void engine.render.setTAAVelocityClamping(int clamping)

Enables or disables the TAA velocity clamping option. This option controls the number of frames combined for pixels depending on the velocity in the fragment: the number of frames is clamped to the [Min frame count;Max frame count]. It reduces blurring in dynamic scenes with a lot of moving objects.
Notice
To set the value via the console, use the render_taa_velocity_clampingconsole command.

Arguments

  • int clamping - 1 to enable the TAA velocity clamping option, 0 to disable it. The default value is 1.

int engine.render.isTAAVelocityClamping()

Returns a value indicating if the TAA velocity clamping option is enabled. T This option controls the number of frames combined for pixels depending on the velocity in the fragment: the number of frames is clamped to the [Min frame count;Max frame count]. It reduces blurring in dynamic scenes with a lot of moving objects.
Notice
To get the value via the console, use the render_taa_velocity_clampingconsole variable.

Return value

1 if TAA velocity clamping is enabled; otherwise, 0.

void engine.render.setTAAVelocityThreshold(float threshold)

Sets the velocity threshold of TAA (Temporal Anti-Aliasing), at which pixels are treated as fast moving ones.
Notice
To set the value via the console, use the render_taa_velocity_thresholdconsole command.

Arguments

  • float threshold - TAA velocity threshold value. The default value is 1.0f.

float engine.render.getTAAVelocityThreshold()

Returns the velocity threshold of TAA (Temporal Anti-Aliasing), at which pixels are treated as fast moving ones.
Notice
To get the value via the console, use the render_taa_velocity_thresholdconsole variable.

Return value

TAA velocity threshold value.

void engine.render.setTerrainAnisotropy(int anisotropy)

Sets the terrain texture anisotropy level (degree of anisotropic filtering). Anisotropy for terrain has a huge impact for the performance if terrain has a lot of tiled detail materials as anisotropy filtering for the terrain is much slower than for the other objects.
Notice
To set the value via the console, use render_terrain_anisotropyconsole command.

Arguments

  • int anisotropy - Anisotropy level:
    • 0 - anisotropy level 1.
    • 1 - anisotropy level 2.
    • 2 - anisotropy level 4 (by default).
    • 3 - anisotropy level 8.
    • 4 - anisotropy level 16.

int engine.render.getTerrainAnisotropy()

Returns the current terrain texture anisotropy level (degree of anisotropic filtering). Anisotropy for terrain has a big impact for the performance if terrain has a lot of tiled detail materials.
Notice
To get the value via the console, use render_terrain_anisotropyconsole variable.

Return value

Anisotropy level:
  • 0 - anisotropy level 1.
  • 1 - anisotropy level 2.
  • 2 - anisotropy level 4 (by default).
  • 3 - anisotropy level 8.
  • 4 - anisotropy level 16.

void engine.render.setTerrainDisplacement(int displacement)

Enables or disables displacement mapping for the terrain.
Notice
To set the value via the console, use render_terrain_displacementconsole command.

Arguments

  • int displacement - 1 to enable displacement mapping for the terrain; 0 to disable it.

int engine.render.isTerrainDisplacement()

Returns a value indicating if displacement mapping is enabled for the terrain.
Notice
To get the value via the console, use render_terrain_displacementconsole variable.

Return value

1 if displacement mapping is enabled for the terrain; otherwise, 0.

void engine.render.setTerrainRefinedAlbedo(int albedo)

Sets the type of terrain albedo textures (refined or coarse).
Notice
To set the value via the console, use render_terrain_refined_albedoconsole command.

Arguments

  • int albedo - 1 to use the refined texture, 0 to use the coarse texture. The default value is 1.

int engine.render.isTerrainRefinedAlbedo()

Returns a value indicating which type of terrain albedo textures (refined or coarse) is used.
Notice
To get the value via the console, use render_terrain_refined_albedoconsole variable.

Return value

1 if refined texture is used, 0 if coarse texture is used.

void engine.render.setTerrainRefinedMask(int mask)

Sets the type of terrain mask textures (refined or coarse).
Notice
To set the value via the console, use render_terrain_refined_maskconsole command.

Arguments

  • int mask - 1 to use the refined texture, 0 to use the coarse texture. The default value is 1.

int engine.render.isTerrainRefinedMask()

Returns a value indicating which type of terrain mask textures (refined or coarse) is used.
Notice
To get the value via the console, use render_terrain_refined_maskconsole variable.

Return value

1 if refined texture is used, 0 if coarse texture is used.

void engine.render.setTerrainRefinedNormal(int normal)

Sets the type of terrain normal textures (refined or coarse).
Notice
To set the value via the console, use render_terrain_refined_normalconsole command.

Arguments

  • int normal - 1 to use the refined texture, 0 to use the coarse texture. The default value is 1.

int engine.render.isTerrainRefinedNormal()

Returns a value indicating which type of terrain normal textures (refined or coarse) is used.
Notice
To get the value via the console, use render_terrain_refined_normalconsole variable.

Return value

1 if refined texture is used, 0 if coarse texture is used.

void engine.render.setTerrainTriplanar(int triplanar)

Enables or disables triplanar texture mapping for the terrain.
Notice
To set the value via the console, use render_terrain_triplanarconsole command.

Arguments

  • int triplanar - 1 to enable triplanar texture mapping for the terrain; 0 to use planar UV mapping instead.

int engine.render.isTerrainTriplanar()

Returns a value indicating if triplanar texture mapping is enabled for the terrain.
Notice
To get the value via the console, use render_terrain_triplanarconsole variable.

Return value

1 if triplanar texture mapping is enabled for the terrain; otherwise, 0.

void engine.render.setTexturesAnisotropy(int anisotropy)

Sets the texture anisotropy level for textures (degree of anisotropic filtering).
Notice
To set the value via the console, use render_textures_anisotropyconsole command.

Arguments

  • int anisotropy - Anisotropy level:
    • 0 - anisotropy level 1.
    • 1 - anisotropy level 2.
    • 2 - anisotropy level 4.
    • 3 - anisotropy level 8 (by default).
    • 4 - anisotropy level 16.

int engine.render.getTexturesAnisotropy()

Returns current anisotropy level for textures (degree of anisotropic filtering).
Notice
To get the value via the console, use render_textures_anisotropyconsole variable.

Return value

Anisotropy level:
  • 0 - anisotropy level 1.
  • 1 - anisotropy level 2.
  • 2 - anisotropy level 4.
  • 3 - anisotropy level 8 (by default).
  • 4 - anisotropy level 16.

void engine.render.setTexturesFilter(int filter)

Sets the texture filtering mode.
Notice
To set the value via the console, use render_textures_filterconsole command.

Arguments

  • int filter - Texture filtering mode:
    • 0 - bilinear filtering.
    • 1 - trilinear filtering (by default).

int engine.render.getTexturesFilter()

Returns the current texture filtering mode.
Notice
To get the value via the console, use render_textures_filterconsole variable.

Return value

Texture filtering mode:
  • 0 - bilinear filtering.
  • 1 - trilinear filtering (by default).

void engine.render.setTexturesMaxResolution(int resolution)

Sets the maximum resolution of all textures. The engine doesn't compress existing textures: it uses specified mipmaps of *.dds textures.
Notice
To set the value via the console, use render_textures_max_resolutionconsole command.

Arguments

  • int resolution - Maximum resolution:
    • 0 - 128 x 128.
    • 1 - 256 x 256.
    • 2 - 512 x 512.
    • 3 - 1024 x 1024.
    • 4 - 2048 x 2048.
    • 5 - 4096 x 4096.
    • 6 - 8192 x 8192 (by default).
    • 7 - 16384 x 16384.

int engine.render.getTexturesMaxResolution()

Returns the current maximum resolution of all textures. The engine doesn't compress existing textures: it uses specified mipmaps of *.dds textures.
Notice
To get the value via the console, use render_textures_max_resolutionconsole variable.

Return value

Maximum resolution:
  • 0 - 128 x 128.
  • 1 - 256 x 256.
  • 2 - 512 x 512.
  • 3 - 1024 x 1024.
  • 4 - 2048 x 2048.
  • 5 - 4096 x 4096.
  • 6 - 8192 x 8192 (by default).
  • 7 - 16384 x 16384.

void engine.render.setTexturesMinResolution(int resolution)

Sets the minimum resolution of all textures. The engine doesn't compress existing textures: it uses specified mip maps of *.dds textures.
Notice
To set the value via the console, use render_textures_min_resolution console command.

Arguments

  • int resolution - Minimum resolution:
    • 0 - 128 x 128 (by default).
    • 1 - 256 x 256.
    • 2 - 512 x 512.
    • 3 - 1024 x 1024.
    • 4 - 2048 x 2048.
    • 5 - 4096 x 4096.
    • 6 - 8192 x 8192.
    • 7 - 16384 x 16384.

int engine.render.getTexturesMinResolution()

Returns the current minimum resolution of all textures. The engine doesn't compress existing textures: it uses specified mipmaps of *.dds textures.
Notice
To get the value via the console, use render_textures_min_resolution console variable.

Return value

Minimum resolution:
  • 0 - 128 x 128 (by default).
  • 1 - 256 x 256.
  • 2 - 512 x 512.
  • 3 - 1024 x 1024.
  • 4 - 2048 x 2048.
  • 5 - 4096 x 4096.
  • 6 - 8192 x 8192.
  • 7 - 16384 x 16384.

void engine.render.setTexturesQuality(int quality)

Sets the resolution of textures.
Notice
To set the value via the console, use render_textures_qualityconsole command.

Arguments

int engine.render.getTexturesQuality()

Returns the current resolution of textures.
Notice
To get the value via the console, use render_textures_qualityconsole variable.

Return value

One of the RENDER_QUALITY_* pre-defined variables.

void engine.render.setTransparentBlur(int blur)

Enables or disables transparent blur for materials. This option makes it possible to render matte transparent materials like matte glass.
Notice
To set the value via the console, use render_transparent_blur console command.

Arguments

  • int blur - 1 to enable transparent blur for materials, 0 to disable it. The default value is 1.

int engine.render.isTransparentBlur()

Returns a value indicating if transparent blur is enabled for materials. This option makes it possible to render matte transparent materials like matte glass.
Notice
To get the value via the console, use render_transparent_blur console variable.

Return value

1 if transparent blur is enabled for materials; otherwise, 0.

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.

void engine.render.setVirtualResolution(vec2 resolution)

Sets virtual screen resolution. This option can be used to render video with high resolution (e.g. 8K) regardless of monitor's resolution.
Notice
To set the value via the console, use the render_virtual_resolution console command.

Arguments

  • vec2 resolution - Virtual screen resolution (X, Y), in pixels. The default value is (-1, -1).

vec2 engine.render.getVirtualResolution()

Returns the current virtual screen resolution.
Notice
To get the value via the console, use the render_virtual_resolution console variable.

Return value

Virtual screen resolution (X, Y), in pixels.

void engine.render.setVREmulation(int emulation)

Sets the VR-emulation mode.
Notice
To set the value via the console, use the render_vr_emulationconsole command.

Arguments

  • int emulation - VR-emulation mode:
    • 0 - disabled (by default).
    • 1 - HTC Vive emulation.
    • 2 - Oculus Rift emulation.

int engine.render.getVREmulation()

Returns the value indicating the current VR-emulation mode.
Notice
To get the value via the console, use the render_vr_emulationconsole variable.

Return value

VR-emulation mode:
  • 0 - disabled (by default).
  • 1 - HTC Vive emulation.
  • 2 - Oculus Rift emulation.

void engine.render.setWaterAnisotropy(int anisotropy)

Sets water texture anisotropy level.
Notice
To set the value via the console, use the render_water_anisotropyconsole command.

Arguments

  • int anisotropy - Anisotropy level:
    • 0 - anisotropy level 1.
    • 1 - anisotropy level 2 (by default).
    • 2 - anisotropy level 4.
    • 3 - anisotropy level 8.
    • 4 - anisotropy level 16.

int engine.render.getWaterAnisotropy()

Returns current water texture anisotropy level.
Notice
To get the value via the console, use the render_water_anisotropyconsole variable.

Return value

Anisotropy level:
  • 0 - anisotropy level 1.
  • 1 - anisotropy level 2 (by default).
  • 2 - anisotropy level 4.
  • 3 - anisotropy level 8.
  • 4 - anisotropy level 16.

void engine.render.setWaterEnvironmentProbes(int probes)

Enables or disables rendering of environment probes on the water surface.
Notice
To set the value via the console, use the render_water_environment_probesconsole command.

Arguments

  • int probes - 1 to enable rendering of environment probes on the water surface, 0 to disable it. The default value is 1.

int engine.render.isWaterEnvironmentProbes()

Returns a value indicating if rendering of environment probes on the water surface is enabled.
Notice
To get the value via the console, use the render_water_environment_probesconsole variable.

Return value

1 if rendering of environment probes on the water surface is enabled; otherwise, 0.

void engine.render.setWaterFragmentDiscard(int discard)

Enables or disables full fragment discard for field spacers used with water.
Notice
To set the value via the console, use the render_water_fragment_discardconsole command.

Arguments

  • int discard - 1 to enable full fragment discard for field spacers used with water, 0 to disable it. The default value is 0.

int engine.render.isWaterFragmentDiscard()

Returns a value indicating if full fragment discard for field spacers used with water is enabled.
Notice
To get the value via the console, use the render_water_fragment_discardconsole variable.

Return value

1 if full fragment discard for field spacers used with water is enabled; otherwise, 0.

void engine.render.setWaterLights(int lights)

Enables or disables rendering of lights on the water surface.
Notice
To set the value via the console, use the render_water_lightsconsole command.

Arguments

  • int lights - 1 to enable rendering of lights on the water surface, 0 to disable it. The default value is 1.

int engine.render.isWaterLights()

Returns a value indicating if rendering of lights on the water surface is enabled.
Notice
To get the value via the console, use the render_water_lightsconsole variable.

Return value

1 if rendering of lights on the water surface is enabled; otherwise, 0.

void engine.render.setWaterOpacityDepth(int depth)

Enables or disables writing depth data for water to the opacity buffer.
Notice
To set the value via the console, use the render_water_opacity_depthconsole command.

Arguments

  • int depth - 1 to enable writing depth data for water to the opacity buffer, 0 to disable it. The default value is 1.

int engine.render.isWaterOpacityDepth()

Returns a value indicating if depth data for water is written to the opacity buffer.
Notice
To get the value via the console, use the render_water_opacity_depthconsole variable.

Return value

1 if depth data for water is written to the opacity buffer; otherwise, 0.

void engine.render.setWaterRefractionQuality(int quality)

Sets the quality of water refraction.
Notice
To set the value via the console, use the render_water_refraction_quality console command.

Arguments

  • int quality - Refraction quality:
    • 0 - low quality.
    • 1 - medium quality.
    • 2 - high quality (by default).
    • 3 - ultra quality.

int engine.render.getWaterRefractionQuality()

Returns current quality of water refraction.
Notice
To get the value via the console, use the render_water_refraction_quality console variable.

Return value

Refraction quality:
  • 0 - low quality.
  • 1 - medium quality.
  • 2 - high quality (by default).
  • 3 - ultra quality.

void engine.render.setWaterShafts(int shafts)

Enables or disables rendering of underwater shafts.
Notice
To set the value via the console, use the render_water_shaftsconsole command.

Arguments

  • int shafts - 1 to enable rendering of underwater shafts, 0 to disable it. The default value is 1.

int engine.render.isWaterShafts()

Returns a value indicating if rendering of underwater shafts is enabled.
Notice
To get the value via the console, use the render_water_shaftsconsole variable.

Return value

1 if rendering of underwater shafts is enabled; otherwise, 0.

void engine.render.setWaterShorelineWetness(int wetness)

Enables or disables the wetness effect for objects near the shoreline.
Notice
To set the value via the console, use the render_water_shoreline_wetnessconsole command.

Arguments

  • int wetness - 1 to enable shoreline wetness, 0 to disable it. The default value is 1.

int engine.render.isWaterShorelineWetness()

Returns a value indicating if the wetness effect for objects near the shoreline is enabled.
Notice
To get the value via the console, use the render_water_shoreline_wetnessconsole variable.

Return value

1 if shoreline wetness is enabled; otherwise, 0.

void engine.render.setWaterSSR(int waterssr)

Enables or disables the SSR (Screen Space Reflections) effect for water.
Notice
To set the value via the console, use the render_water_ssrconsole command.

Arguments

  • int waterssr - 1 to enable the SSR effect for water, 0 to disable.

int engine.render.isWaterSSR()

Returns the value indicating if the SSR (Screen Space Reflections) effect is enabled for water.
Notice
To get the value via the console, use the render_water_ssrconsole variable.

Return value

1 if the SSR effect is enabled for water; otherwise, 0.

void engine.render.setWaterSSRIncreasedAccuracy(int accuracy)

Enables or disables increased accuracy for the water SSR (Screen Space Reflections). This option reduces visual artifacts by increasing accuracy of the last step.
Notice
To set the value via the console, use the render_water_ssr_increased_accuracyconsole command.

Arguments

  • int accuracy - 1 to enable increased accuracy for the water SSR, 0 to disable. The default value is 0.

int engine.render.isWaterSSRIncreasedAccuracy()

Returns a value indicating if increased accuracy option is enabled for the water SSR (Screen Space Reflections).
Notice
To get the value via the console, use the render_water_ssr_increased_accuracyconsole variable.

Return value

1 if increased accuracy is enabled for the water SSR; otherwise, 0.

void engine.render.setWaterSSRQuality(int quality)

Sets the resolution of water SSR (Screen Space Reflections).
Notice
To set the value via the console, use the render_water_ssr_qualityconsole command.

Arguments

  • int quality - Water SSR quality:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int engine.render.getWaterSSRQuality()

Returns the resolution of water SSR (Screen Space Reflections).
Notice
To get the value via the console, use the render_water_ssr_qualityconsole variable.

Return value

Water SSR quality:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

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 for 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.compressImage(Image image, int quality = 1, int new_image_format = -1, int use_mip_maps = -1)

Converts the image to a specified compressed format. If compression by the GPU is not supported, the Image::compress() method will be called instead.

Arguments

  • Image image - Image to compress.
  • int quality - Compression quality:
    • 0 - fast compression, low compressed image quality.
    • 1 - high compressed image quality, slow compression (by default).
  • int new_image_format - Compressed texture format: one of the TEXTURE_FORMAT_* variables. This is an optional argument. If no format is specified, default conversion will be performed (depending on the type of the source image).
  • int use_mip_maps - Flag indicating whether texture mipmaps should be generated for the compressed image: 1 to generate mipmaps, 0 not to generate. This is an optional argument. If no value is specified, mipmaps will be generated only if the source image has the mipmaps.

Return value

1 if the image has been compressed successfully; otherwise, 0.

int engine.render.compressTexture(Texture texture, Image destination, int quality = 1, int new_texture_format = -1, int use_mip_maps = -1)

Compresses the given texture to the specified format.

Arguments

  • Texture texture - Source texture to compress.
  • Image destination - Image into which the compressed texture will be saved.
  • int quality - Compression quality:
    • 0 - fast compression, low compressed image quality.
    • 1 - high compressed image quality, slow compression (by default).
  • int new_texture_format - Compressed texture format: one of the TEXTURE_FORMAT_* variables. This is an optional argument. If no format is specified, default conversion will be performed (depending on the type of the source image).
  • int use_mip_maps - Flag indicating whether texture mipmaps should be generated for the compressed image: 1 to generate mipmaps, 0 not to generate. This is an optional argument. If no value is specified, mipmaps will be generated only if the source image has the mipmaps.

Return value

1 if the texture has been compressed successfully; otherwise, 0.

void engine.render.convertColorSpecularToMetalness(vec4 diffuse, vec4 specular, vec4 albedo, vec4 shading)

Performs color conversion from the specular workflow (diffuse, specular) to the metalness workflow (albedo, shading).

Arguments

  • vec4 diffuse - Input diffuse color.
  • vec4 specular - Input specular color.
  • vec4 albedo - Output albedo color.
  • vec4 shading - Output shading color.

void engine.render.convertImageSpecularToMetalness(Image diffuse, Image specular, Image albedo, Image shading)

Performs texture conversion from the specular workflow (diffuse, specular) to the metalness workflow (albedo, shading).

Arguments

  • Image diffuse - Input diffuse texture.
  • Image specular - Input specular texture.
  • Image albedo - Output albedo texture.
  • Image shading - Output shading texture.

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, string skip_flags)

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.
  • string skip_flags - 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.
Warning
This function is deprecated and will be removed in the next release.

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.
Warning
This function is deprecated and will be removed in the next release.

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.

Return value

1 if the state is saved successfully; otherwise, 0.

void engine.render.setEnvironmentHazeGradient(int gradient)

Sets the environment haze gradient mode.
Notice
To set the haze gradient mode via the console, use the render_environment_haze_gradient console command.

Arguments

  • int gradient - Haze gradient mode:
    • 0 should be used for short distance range (e.g. near-surface haze).
    • 1 should be used for long distance range (e.g. hazy mountains).

int engine.render.getEnvironmentHazeGradient()

Returns the current environment haze gradient mode.
Notice
To get the haze gradient mode via the console, use render_environment_haze_gradient console variable.

Return value

Haze gradient mode:
  • 0 for short distance range (e.g. near-surface haze).
  • 1 for long distance range (e.g. hazy mountains).

vec4 engine.render.getEnvironmentHazeColor()

Returns the current haze color for the preset that overlays the other ones.
Notice
This function will return color only if the RENDER_HAZE_SOLID mode is set via setEnvironmentHazeMode().
To get the haze color for the specific preset, use RenderEnvironmentPreset::getHazeColor().
Source code (UnigineScript)
// get a haze color for the preset that overlays the others
engine.render.getEnvironmentHazeColor();
// get a haze color for the second environment preset
RenderEnvironmentPreset preset = engine.render.getEnvironmentPreset(1);
preset.getHazeColor();

Return value

Haze color.

float engine.render.getEnvironmentHazeDensity()

Returns the haze density set for the preset that overlays the other ones. To get the haze density for the specific preset, use RenderEnvironmentPreset::getHazeDensity().
Source code (UnigineScript)
// get a haze density for the preset that overlays the others
engine.render.getEnvironmentHazeDensity();
// get a haze density for the second environment preset
RenderEnvironmentPreset preset = engine.render.getEnvironmentPreset(1);
preset.geHazeDensity();

Return value

Haze density.

float engine.render.getEnvironmentHazeMaxDistance()

Returns the distance starting at which the haze becomes completely solid, so nothing will be seen behind. To get the haze maximum visibility distance for the specific preset, use RenderEnvironmentPreset::getHazeMaxDistance().
Source code (UnigineScript)
// get a haze maximum visibility distance for the preset that overlays the others
engine.render.getEnvironmentHazeMaxDistance();
// get a haze maximum visibility distance for the second environment preset
RenderEnvironmentPreset preset = engine.render.getEnvironmentPreset(1);
preset.getHazeMaxDistance();

Return value

Haze maximum visibility distance.

float engine.render.getEnvironmentSkyIntensity()

Return value

Intensity value of the environment sky.

float engine.render.getEnvironmentReflectionIntensity()

Returns the intensity of the environment reflections for the preset that overlays the other ones. 0 value means no environment reflections for the preset. To get the reflection intensity for the specific preset, use RenderEnvironmentPreset::getReflectionIntensity().
Source code (UnigineScript)
// get a reflection intensity for the preset that overlays the others
engine.render.getEnvironmentReflectionIntensity();
// get a reflection intensity for the second environment preset
RenderEnvironmentPreset preset = engine.render.getEnvironmentPreset(1);
preset.getReflectionIntensity();

Return value

The intensity value of the environment reflections.

float engine.render.getEnvironmentAmbientIntensity()

Returns the intensity of the environment ambient lighting for the preset that overlays the other ones. 0 value means no environment ambient lighting for the preset. The higher the value, the more ambient lighting affects environment. To get the ambient intensity for the specific preset, use RenderEnvironmentPreset::getAmbientIntensity().
Source code (UnigineScript)
// get an ambient intensity for the preset that overlays the others
engine.render.getEnvironmentAmbientIntensity();
// get an ambient intensity for the second environment preset
RenderEnvironmentPreset preset = engine.render.getEnvironmentPreset(1);
preset.getAmbientIntensity();

Return value

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

RenderEnvironmentPreset engine.render.getEnvironmentPreset(int num)

Returns the environment preset of the given number.
Source code (UnigineScript)
// get the second environment preset
RenderEnvironmentPreset preset = engine.render.getEnvironmentPreset(1);
// print the sky intensity of the obtained preset
log.message("%f\n", preset.getSkyIntensity());

Arguments

  • int num - The number of the environment preset. The value is clamped to the [0;2] range.

Return value

Environment preset.

int API_DIRECT3D11

Description

DIRECT3D 11 API.

int API_NULL

Description

Null API name.

int API_OPENGL

Description

OpenGL API.

int API_UNKNOWN

Description

Unknown API.

int RENDER_ENVIRONMENT_NUM_PRESETS

Description

Number of environment presets.

int RENDER_EXPOSURE_DISABLED

Description

Rendering of the adaptive exposure effect is disabled.

int RENDER_EXPOSURE_LOGARITHMIC

Description

The logarithmic exposure effect is used.

int RENDER_EXPOSURE_QUADRATIC

Description

The adaptive exposure effect is rendered using quadratic function.

int GPU_AMD

Description

AMD GPU.

int GPU_APPLE

Description

Apple GPU.

int GPU_ARM

Description

ARM GPU.

int GPU_IMGTEC

Description

Imagination Technologies GPU.

int GPU_INTEL

Description

Intel GPU.

int GPU_NVIDIA

Description

NVIDIA GPU.

int GPU_QUALCOMM

Description

Qualcomm GPU.

int GPU_UNKNOWN

Description

Unknown GPU.

int RENDER_HAZE_DISABLED

Description

Rendering of the haze effect is disabled.

int RENDER_HAZE_SCATTERING

Description

Haze colored according to the sky LUT textures. This mode is recommended to achieve higher realism.

int RENDER_HAZE_SOLID

Description

Solid color haze. The haze color is set by setHazeColor().

int RENDER_NUM_PASSES

Description

Total number of rendering passes.

int RENDER_PASS_ALPHA_TEST

Description

Alpha test pass.

int RENDER_PASS_AMBIENT

Description

Ambient pass.

int RENDER_PASS_AUXILIARY

Description

Auxiliary pass.

int RENDER_PASS_DEFERRED

Description

Deferred pass.

int RENDER_PASS_DEPTH_PRE_PASS

Description

Depth pre-pass.

int RENDER_PASS_EMISSION

Description

Emission pass.

int RENDER_PASS_LIGHT_ENVIRONMENT_PROBE

Description

Light environment probe pass.

int RENDER_PASS_LIGHT_OMNI

Description

Omni light pass.

int RENDER_PASS_LIGHT_PROJ

Description

Proj light pass.

int RENDER_PASS_LIGHT_WORLD

Description

World light pass.

int RENDER_PASS_OBJECT_POST

int RENDER_PASS_POST

Description

Post materials pass.

int RENDER_PASS_REFLECTION

Description

Reflection pass.

int RENDER_PASS_REFRACTION

Description

Refraction pass.

int RENDER_PASS_SHADOW

Description

Shadow pass.

int RENDER_PASS_TRANSPARENT_BLUR

Description

Transparent blur pass.

int RENDER_PASS_VISUALIZER_SOLID

Description

Visualizer pass.

int RENDER_PASS_WIREFRAME

Description

Wireframe pass.

int RENDER_QUALITY_HIGH

Description

High quality of textures and shaders.

int RENDER_QUALITY_LOW

Description

Low quality of textures and shaders. 1/16 of the original texture will be used.

int RENDER_QUALITY_MEDIUM

Description

Medium quality of textures and shaders. 1/4 of the original texture will be used.
Last update: 2017-12-21
Build: ()