This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials


Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

Renderer Class

Structs

struct CBufferCamera

A structure that represents a buffer for storing camera parameters.

Fields

  • int is_oblique_frustum - Flag indicating if the viewing frustum is oblique.
  • float camera_fov - Camera vertical field of view.
  • int shadow_cascade_target - Current shadow cascade used for rendering shadows.

struct CBufferScattering

A structure that represents a buffer for storing scattering parameters.

Fields

  • float environment_ambient_intensity - Intensity of the environment ambient lighting. The higher the value, the more ambient lighting affects the environment. 0s means no environment reflection.
  • float environment_reflection_intensity - Intensity of the environment reflection.
  • float environment_sky_intensity - Intensity of the environment sky. 0 means no environment sky.
  • float haze_max_distance - Distance starting from which the haze becomes completely solid, so nothing will be seen behind.
  • float haze_density - Haze density.
  • float haze_physical_start_height - Reference height value for the half visibility distance and half faloff height.
  • float haze_physical_density - Distance to the boundary at which the visibility comprises 50%. There is no zero-visibility in the real world, so the half-visibility boundary is used to adjust haze distance.
  • float haze_physical_falloff - Height of the haze density gradient. The higher the value, the longer the haze desity reduces as the height grows, making the transition between the clear sky and haze smoother.
  • float haze_physical_zero_visibility_height - Height at which the haze completely overlaps the scene.
  • float haze_physical_screen_space_global_illumination - Value indicating if the Screen-Space Haze Global Illumination effect is enabled.
  • float haze_physical_ambient_light_intensity - Intensity of the impact of the ambient lighting on haze (how much the ambient lighting affects the haze).
  • float haze_physical_ambient_color_saturation - Intensity of the ambient color's contribution to the haze (how much the sunlight affects the haze).
  • float haze_physical_sun_light_intensity - Intensity of the impact of the sunlight on haze (how much the sunlight affects the haze).
  • float haze_physical_sun_color_saturation - Intensity of the impact of the sunlight on haze (how much the sunlight affects the haze).
  • float haze_scattering_mie_intensity - Minimum Mie intensity value for geometry-occluded areas. This value specifies the fraction of Mie intensity visible when the surface is viewed from straight on.
  • float haze_scattering_mie_front_side_intensity - Falloff of the Fresnel effect for Mie intensity. This value is used to control occlusion of light from a World light source by the geometry.
  • float haze_scattering_mie_fresnel_power - Power of the Fresnel effect for Mie visibility. Higher values will tighten up the areas affected, while lower ones will allow more areas to be affected by the Fresnel effect.
  • float sky_altitude - Sky altitude.

struct CBufferTonemapper

A structure that represents a buffer for storing tone mapping parameters.

Fields

  • float filmic_saturation_recovery - Color saturation recovery value for the filmic tonemapper.
  • float aces_white_clip - White clip parameter for the ACES operator. Controls the cut-off point for white.
  • float aces_toe - Toe parameter for the ACES operator. Controls the dark color. Higher values result in darker colors.
  • float aces_shoulder_angle - Shoulder angle parameter for the ACES operator. Controls how much overshoot should be added to the curve's shoulder.
  • float aces_shoulder_strength - Shoulder strength parameter for the ACES operator. Controls the strength of the transition between the curve's midsection and the curve's shoulder.
  • float aces_shoulder_length - Shoulder length parameter for the ACES operator. Controls the amount of f-stops to add to the dynamic range of the curve. Defines how much of the highlights the curve takes into account.
  • float aces_with_reinhard_mix - ACES with Reinhard tone mapping operator contribution.
  • float aces_with_reinhard_white_clip - White clip parameter for the ACES with Reinhard operator. Controls the cut-off point for white.ACES with Reinhard operator's white clip.
  • float aces_with_reinhard_toe - Toe parameter for the ACES with Reinhard operator. Controls the dark color. Higher values result in darker colors.
  • float aces_with_reinhard_shoulder_angle - Shoulder angle parameter for the ACES with Reinhard operator. Controls how much overshoot should be added to the curve's shoulder.
  • float aces_with_reinhard_shoulder_strength - Shoulder strength parameter for the ACES with Reinhard operator. Controls the strength of the transition between the curve's midsection and the curve's shoulder.
  • float aces_with_reinhard_shoulder_length - Shoulder length parameter for the ACES with Reinhard operator. Controls the amount of f-stops to add to the dynamic range of the curve. Defines how much of the highlights the curve takes into account.
  • float reinhard_contribution - Reinhard tone mapping operator contribution.
  • float reinhard_luma_based_contribution - Reinhard Luma-Based tone mapping operator contribution. Controls the overall contribution that the Reinhard operator makes to the final color grading of the image.

Members

getTextureGBufferVelocity() const#

Returns the current Gbuffer velocity texture.

Return value

Current Gbuffer velocity texture.

getTextureGBufferFeatures() const#

Returns the current texture that stores intensity of the screen-space bevel effect.

Return value

Current texture storing intensity of the bevels. The texture is RGBA8, the intensity value is written to the R channel.

getTextureGBufferMaterialMask() const#

Returns the current Gbuffer material mask texture.

Return value

Current Gbuffer material mask texture.

getTextureGBufferNormal() const#

Returns the current Gbuffer normal texture.

Return value

Current Gbuffer normal texture.

getTextureGBufferShading() const#

Returns the current Gbuffer shading texture.

Return value

Current Gbuffer shading texture.

getTextureGBufferAlbedo() const#

Returns the current Gbuffer albedo texture.

Return value

Current Gbuffer albedo texture.

getTextureClouds() const#

Returns the current clouds texture. This texture is rendered during the separate clouds pass.

Return value

Current clouds texture.

getTextureAutoWhiteBalance() const#

Returns the current auto white balance texture.

Return value

Current auto-white-balance texture.

getTextureAutoExposure() const#

Returns the current autoexposure texture.

Return value

Current autoexposure texture.

getTextureDOFMask() const#

Returns the current DoF mask texture. This texture is used at the camera effects stage.

Return value

Current DoF mask texture.

getTextureSSCurvature() const#

Returns the current texture used by the Screen-Space Dirt (SSDirt) effect.

Return value

Current curvature texture used by the Screen-Space Dirt (SSDirt) effect.

getTextureSSR() const#

Returns the current SSR texture.

Return value

Current SSR texture.

getTextureSSGI() const#

Returns the current SSGI texture.

Return value

Current SSGI texture.

getTextureSSShadowShafts() const#

Returns the current Screen-Space Shadow Shafts texture.

Return value

Current Screen-Space Shadow Shafts texture.

getTextureSSAO() const#

Returns the current SSAO texture.

Return value

Current SSAO texture.

getTextureBentNormal() const#

Returns the current bent normal texture. This texture is used during the Screen-Space Global Illumination stage.

Return value

Current bent normal texture.

getTextureIndirectLights() const#

Returns the current array texture storing contents of the deferred reflections buffer. The texture contains two RG11B10F textures: the first layer stores the environment reflection color, and the second layer stores the environment ambient light.

Return value

Current texture storing contents of the deferred reflections buffer.

getTextureDirectLights() const#

Returns the current array texture storing contents of the deferred light buffer. The texture contains two RG11B10F textures: the first layer stores the diffuse light, and the second layer stores the specular light.

Return value

Current texture storing contents of the deferred light buffer.

getTextureTransparentBlur() const#

Returns the current transparent blur texture. This texture is rendered during the transparent blur pass.

Return value

Current transparent blur texture.

getTextureRefractionMask() const#

Returns the current refraction mask texture.

Return value

Current refraction mask texture.

getTextureRefraction() const#

Returns the current refraction texture.

Return value

Current refraction texture.

getTextureAuxiliary() const#

Returns the current auxiliary texture.

Return value

Current auxiliary texture.

getTextureLinearDepth() const#

Returns the current texture that stores linear depth data.

Return value

Current texture that stores linear depth data.

getTextureOpacityDepth() const#

Returns the current opacity depth texture.

Return value

Current opacity depth texture.

getTextureCurrentDepth() const#

Returns the current depth texture.

Return value

Current depth texture.

getTextureNormalUnpack() const#

Returns the current texture that stores unpacked normals. Available for the following post-effects: SSR, SSGI, SSRTGI, Shadows screen space.

Return value

Current texture that stores unpacked normals.

getTextureColorOldReprojection() const#

Returns the current color old reprojection texture.

Return value

Current color old reprojection texture.

getTextureColorOld() const#

Returns the current color old texture.

Return value

Current color old texture.

getTextureColorOpacity() const#

Returns the current color opacity texture.

Return value

Current color opacity texture.

getTextureColor() const#

Returns the current color texture.

Return value

Current color texture.

getPostRenderTarget() const#

Returns the current post texture render.

Return value

Current post render target.

getRenderTarget() const#

Returns the current render target.

Return value

Current render target.

int getHeight() const#

Returns the current screen height.

Return value

Current screen height.

int getWidth() const#

Returns the current screen width.

Return value

Current screen width.

getCurrentLight() const#

Returns the current rendered light source. This method can be used to obtain shadow maps for a certain light source in an event handler (see BeginShadows event).

Return value

Current rendered light source.

void setObliqueFrustum ( bool frustum ) #

Sets a new value indicating if the viewing frustum is oblique.
Notice
It is recommended to set oblique viewing frustum using this method, as it doesn't affect the projection matrix. To specify the near clipping plane use the setObliqueFrustumPlane() method.

Arguments

  • bool frustum - Set true to enable viewing frustum is oblique; false - to disable it.

bool isObliqueFrustum() const#

Returns the current value indicating if the viewing frustum is oblique.
Notice
It is recommended to set oblique viewing frustum using this method, as it doesn't affect the projection matrix. To specify the near clipping plane use the setObliqueFrustumPlane() method.

Return value

true if viewing frustum is oblique; otherwise false.

float getZFar() const#

Returns the current far clipping plane.

Return value

Current far clipping plane.

float getZNear() const#

Returns the current near clipping plane.

Return value

Current near clipping plane.

getIModelview() const#

Returns the current inverse view matrix.

Return value

Current inverse view matrix.

getProjectionWithoutTAA() const#

Returns the current projection matrix without TAA.

Return value

Current projection matrix without TAA.

getViewport() const#

Returns the current rendering viewport smart pointer.

Return value

Current rendering viewport smart pointer.

void setProjectionFullViewport ( ) #

Sets a new full viewport projection matrix. In PSSM, the full viewport is the 0th cascade; in VR foveated rendering, it's the context viewport. This matrix can be used to derive Screen Space Scaling of the object (e.g. ObjectParticles), ensuring they maintain consistent size across cascades and context/focus viewports.

Arguments

  • viewport - The projection matrix to be used for full viewport rendering.

getProjectionFullViewport() const#

Returns the current full viewport projection matrix. In PSSM, the full viewport is the 0th cascade; in VR foveated rendering, it's the context viewport. This matrix can be used to derive Screen Space Scaling of the object (e.g. ObjectParticles), ensuring they maintain consistent size across cascades and context/focus viewports.

Return value

Current projection matrix to be used for full viewport rendering.

int getStereoMode() const#

Returns the current stereo mode.

Return value

Current

getStereoCurrentEye() const#

Returns the current stereo eye.

Return value

Current

int getSkipFlags() const#

Returns the current skip flag for the rendering viewport.

Return value

Current skip flag.

int getReflectionViewportMask() const#

Returns the current reflection viewport mask.

Return value

Current reflection viewport mask.

int getViewportMask() const#

Returns the current viewport mask.

Return value

Current viewport mask.

bool isStereo() const#

Returns the current value indicating if stereo rendering is enabled.

Return value

true if stereo rendering is enabled; otherwise false.

bool isShadow() const#

Returns the current value indicating if shadows are rendered.

Return value

true if shadows rendering is enabled; otherwise false.

bool isReflection() const#

Returns the current value indicating if reflection rendering is in progress.

Return value

true if reflection rendering is in progress; otherwise false.

bool isNode() const#

Returns the current value indicating if node rendering is in progress.

Return value

true if node rendering is in progress; otherwise false.

getShaderCBufferScattering() const#

Returns the current buffer containing scattering parameters to be passed to a custom shader. This method can be used in a event handler to obtain scattering parameters at a certain stage of the rendering sequence and pass them to a custom shader.

Return value

Current buffer containing scattering parameters to be passed to a custom shader.

getShaderCBufferCamera() const#

Returns the current buffer containing camera parameters to be passed to a custom shader. This method can be used in a event handler to obtain camera parameters at a certain stage of the rendering sequence and pass them to a custom shader.

Return value

Current buffer containing camera parameters to be passed to a custom shader.

bool isStereoPeripheral() const#

Returns the current value indicating if peripheral stereo rendering is enabled.

Return value

true if peripheral stereo rendering is enabled; otherwise false.

CBufferTonemapper getShaderCBufferTonemapper() const#

Returns the current buffer containing tone mapping parameters to be passed to a custom shader. This method can be used in a event handler to obtain tone mapping parameters at a certain stage of the rendering sequence and pass them to a custom shader.

Return value

Current buffer containing tone mapping parameters to be passed to a custom shader.

void setVR ( int vr ) #

Sets a new value indicating if the VR rendering mode is enabled.

Arguments

  • int vr - The the VR rendering mode

int isVR() const#

Returns the current value indicating if the VR rendering mode is enabled.

Return value

Current the VR rendering mode

int hasGeodeticPivot ( ) #

Returns a value indicating if the rendering scene has a GeodeticPivot.

Return value

1 if the rendering scene has a GeodeticPivot; otherwise, 0.

int isNode ( ) #

Returns a value indicating if node rendering is in progress.

Return value

1 if the node rendering is in progress, otherwise 0.

int isReflection ( ) #

Returns a value indicating if reflection rendering is in progress.

Return value

1 if reflection rendering is in progress, otherwise 0.

int isShadow ( ) #

Returns a value indicating if shadows are rendered.

Return value

1 if shadows are rendered; otherwise, 0.

int isStereo ( ) #

Returns a value indicating if stereo rendering is enabled.

Return value

1 if the stereo rendering is enabled; otherwise, 0.

int getStereoCurrentEye ( ) #

Returns the current stereo eye.

Return value

Texture getTextureDirectLights ( ) #

Returns the array texture storing contents of the deferred light buffer. The texture contains two RG11B10F textures: the first layer stores the diffuse light, and the second layer stores the specular light.

Return value

A texture storing contents of the deferred light buffer.

Texture getTextureIndirectLights ( ) #

Returns the array texture storing contents of the deferred reflections buffer. The texture contains two RG11B10F textures: the first layer stores the environment reflection color, and the second layer stores the environment ambient light.

Return value

A texture storing contents of the deferred reflections buffer.

Texture getTextureSSShadowShafts ( ) #

Returns the Screen-Space Shadow Shafts texture.

Return value

Screen-Space Shadow Shafts texture.

RenderTarget getRenderTarget ( ) #

Returns the render target.

Return value

Render target.

RenderTarget getPostRenderTarget ( ) #

Returns the post texture render.

Return value

Post render target.

int useDynamicReflections ( ) #

Returns a value indicating if rendering of dynamic reflections is enabled.

Return value

1 if rendering of dynamic reflections is enabled; otherwise, 0.

int useOcclusionQueries ( ) #

Returns a value indicating if the occlusion query test is enabled.

Return value

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

int usePostEffects ( ) #

Returns a value indicating if rendering of post effects is enabled.

Return value

1 if rendering of post effects is enabled; otherwise, 0.

int useShadows ( ) #

Returns a value indicating if rendering of shadows is enabled.

Return value

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

int useTAA ( ) #

Returns a value indicating if the Temporal Anti-Aliasing (TAA) is enabled.

Return value

1 if the Temporal Anti-Aliasing (TAA) is enabled; otherwise, 0.

void setUseTAAOffset ( int offset ) #

Sets a value indicating if skipping render mode check is enabled for using TAA. Can be used to ensure proper TAA calculation when rendering mode for the Viewport is set to RENDER_DEPTH.

Arguments

  • int offset - 1 to enable skipping render mode check and use TAA; otherwise 0.

int isUseTAAOffset ( ) #

Returns a value indicating if skipping render mode check is enabled for using TAA. Can be used to ensure proper TAA calculation when rendering mode for the Viewport is set to RENDER_DEPTH.

Return value

1 if skipping render mode check is enabled for using TAA; otherwise 0.

int useVelocityBuffer ( ) #

Returns a value indicating if rendering to the velocity buffer is enabled.

Return value

1 if rendering to the velocity buffer is enabled; otherwise, 0.

int useVisualizer ( ) #

Returns a value indicating if rendering of the visualizer is enabled.

Return value

1 if rendering of the visualizer is enabled; otherwise, 0.

Texture createCustomTexture3D ( string name, int width, int height, int depth, int format, int flags = 0 ) #

Creates a custom 3D texture. Such textures can be used in your materials.

In your base material:

Source code (XML)
<!-- ... -->
<texture type="texture_name"/>
<!-- ... -->

Create a corresponding custom texture via code:

Source code (C++)
// ...
 // creating a custom texture
 Renderer::createCustomTexture3D("texture_name", 512, 512, 512, Texture::FORMAT_RGBA8);

Arguments

  • string name - Texture name.
  • int width - Texture width, in pixels.
  • int height - Texture height, in pixels.
  • int depth - Texture depth, in pixels.
  • int format - Texture format, one of the TEXTURE_FORMAT_ values.
  • int flags - Texture flags. A combination of flags (such as TEXTURE_FORMAT_USAGE_, TEXTURE_SAMPLER_WRAP_, etc.)

Return value

New created custom 3D texture.

Texture createCustomTexture2D ( string name, int width, int height, int format, int flags = 0 ) #

Creates a custom 2D texture array. Such texture can be used in your materials.

In your base material:

Source code (XML)
<!-- ... -->
<texture type="texture_name"/>
<!-- ... -->

Create a corresponding custom texture via code:

Source code (C++)
// ...
 // creating a custom texture
 Renderer::createCustomTexture2D("texture_name", 512, 512, Texture::FORMAT_RGBA8);

Arguments

Return value

New created custom 2D texture.

Texture createCustomTexture2DArray ( string name, int width, int height, int depth, int format, int flags = 0 ) #

Creates a custom 2D texture array. Such texture can be used in your materials.

Source code (XML)
<!-- ... -->
<texture type="texture_name"/>
<!-- ... -->

Create a corresponding custom texture via code:

Source code (C++)
// ...
 // creating a custom texture
 Renderer::createCustomTexture2DArray("texture_name", 512, 512, 16, Texture::FORMAT_RGBA8);

Arguments

  • string name - Texture name.
  • int width - Texture width, in pixels.
  • int height - Texture height, in pixels.
  • int depth - Number of elements in the array.
  • int format - Texture format, one of the TEXTURE_FORMAT_ values.
  • int flags - Texture flags. A combination of flags (such as TEXTURE_FORMAT_USAGE_, TEXTURE_SAMPLER_WRAP_, etc.)

Return value

New created custom 2D texture array.

Texture getCustomTexture ( string name ) #

Returns a custom texture by its name. Custom textures can be created using createCustomTexture3D(), createCustomTexture3D(), and createCustomTexture3D() methods.

Arguments

  • string name - Custom texture name.

Return value

Custom texture corresponding to the specified name, if it exists, otherwise NULL.

CBufferCamera getShaderCBufferCamera ( ) #

Returns a buffer containing camera parameters to be passed to a custom shader. This method can be used in a event handler to obtain camera parameters at a certain stage of the rendering sequence and pass them to a custom shader.

Return value

Buffer containing camera parameters to be passed to a custom shader.

CBufferScattering getShaderCBufferScattering ( ) #

Returns a buffer containing scattering parameters to be passed to a custom shader. This method can be used in a event handler to obtain scattering parameters at a certain stage of the rendering sequence and pass them to a custom shader.

Return value

Buffer containing scattering parameters to be passed to a custom shader.

Light getCurrentLight ( ) #

Returns the currently rendered light source. This method can be used to obtain shadow maps for a certain light source in a event handler (see BeginShadows event).

Return value

Currently rendered light source.

void setOverlapEnvironmentTexture ( Texture texture ) #

Sets a new environment cubemap texture.

Arguments

  • Texture texture - Environment cubemap texture to be used.

Texture getOverlapEnvironmentTexture ( ) #

Returns the currently used environment cubemap texture.

Return value

Currently used environment cubemap texture.

void resetOverlapEnvironmentTexture ( ) #

Resets the environment cubemap texture to default (no environment texture is used).

Texture getTextureNormalUnpack ( ) #

Returns the texture that stores unpacked normals. Available for the following post-effects: SSR, SSGI, SSRTGI, Shadows screen space.

Return value

The texture that stores unpacked normals.

Texture getTextureLinearDepth ( ) #

Returns the texture that stores linear depth data.

Return value

The texture that stores linear depth data.

void renderMesh ( MeshRender mesh, Material material, string pass_name, Mat4 transform, Camera camera ) #

Renders the specified render mesh with the specified material applied to it during the specified render pass as viewed from by specified camera.

Arguments

  • MeshRender mesh - Render mesh to be rendered.
  • Material material - Material to be used to render the mesh.
  • string pass_name - Name of the rendering pass during which the mesh is to be rendered.
  • Mat4 transform - Transformation to be passed to shader for rendering.
  • Camera camera - Camera to be used for mesh rendering.

int isStereoPeripheral ( ) #

Returns a value indicating if the Stereo Peripheral rendering mode is enabled. This rendering mode is used for HMDs having context (low-res) and focus (high-res) displays.

Return value

true if stereo peripheral rendering is enabled; otherwise false.

int useUpscale ( ) #

Returns a value indicating if the upscaling is enabled. It is a technology to be used to render high-resolution images based on the lower resolution source.

Return value

true if upscaling (DLSS or FSR) is used and the final image is rendered with post-processing; otherwise false.

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2025-06-30
Build: ()