This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
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
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
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.

Unigine.Renderer Class

A basic interface for setting a renderer state (changing rendering passes parameters): pass shader uniforms, set modelview and projection matrices, etc. This class is used for rendering custom nodes (for example, a node inherited from ObjectExtern).

Renderer Class

Enums

RENDER_STEREO_EYE#

Stereo eye enumeration.
NameDescription
NONE = 0None of the stereo eyes.
LEFT = 1Left stereo eye.
RIGHT = 2Right stereo eye.
LEFT_FOCUS = 3Left eye focus view.
RIGHT_FOCUS = 4Right eye focus view.

Properties

Texture TextureGBufferVelocity#

Texture TextureGBufferFeatures#

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

Texture TextureGBufferMaterialMask#

Texture TextureGBufferNormal#

Texture TextureGBufferShading#

Texture TextureGBufferAlbedo#

Texture TextureClouds#

The clouds texture. This texture is rendered during the separate clouds pass.

Texture TextureAutoWhiteBalance#

Texture TextureAutoExposure#

The autoexposure texture.

Texture TextureDOFMask#

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

Texture TextureSSCurvature#

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

Texture TextureSSR#

Texture TextureSSGI#

Texture TextureSSShadowShafts#

The Screen-Space Shadow Shafts texture.

Texture TextureSSAO#

Texture TextureBentNormal#

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

Texture TextureLights#

The array texture storing contents of the deferred light buffer and the deferred reflections buffer. The texture contains four RG11B10F textures: the first layer stores the diffuse light, the second layer stores the specular light, the third one is for the environment reflection color, and the fourth one is for the environment ambient light.

Texture TextureTransparentBlur#

The transparent blur texture. This texture is rendered during the transparent blur pass.

Texture TextureRefractionMask#

The refraction mask texture.

Texture TextureRefraction#

Texture TextureAuxiliary#

Texture TextureLinearDepth#

The texture that stores linear depth data.

Texture TextureOpacityDepth#

Texture TextureCurrentDepth#

Texture TextureNormalUnpack#

The texture that stores unpacked normals.

Texture TextureColorOldReprojection#

Texture TextureColorOld#

Texture TextureColorOpacity#

The color opacity texture.

Texture TextureColor#

RenderTarget PostRenderTarget#

The post texture render.

RenderTarget RenderTarget#

int Height#

The screen height.

int Width#

The screen width.

Texture OverlapEnvironmentTexture#

The currently used environment cubemap texture.

Light CurrentLight#

The currently rendered light source. This method can be used to obtain shadow maps for a certain light source in a callback (see BEGIN_SHADOWS callbacks).

bool ObliqueFrustum#

The a value indicating if the viewing frustum is oblique.

vec4 ObliqueFrustumPlane#

The oblique near clipping plane of the viewing frustum.

float ZFar#

The Return current far clipping plane.

float ZNear#

The near clipping plane.

vec3 CameraPosition#

The camera position.

mat4 OldModelview#

The old view matrix.

mat4 IModelview#

The inverse view matrix.

mat4 Modelview#

The view matrix.

mat4 ProjectionWithoutTAA#

The projection matrix without TAA.

mat4 OldProjection#

The old projection matrix.

mat4 Projection#

The projection matrix.

Viewport Viewport#

The rendering viewport.

int StereoMode#

The stereo mode.

Renderer.RENDER_STEREO_EYE StereoCurrentEye#

The current stereo eye.

int SkipFlags#

The skip flag set for the rendering viewport.

int ReflectionViewportMask#

The reflection viewport mask.

int ViewportMask#

The viewport mask.

bool IsStereo#

The a value indicating if stereo rendering is enabled.

bool IsShadow#

The a value indicating if shadows are rendered.

bool IsReflection#

The a value indicating if reflection rendering is in progress.

bool IsNode#

The a value indicating if node rendering is in progress.

CBufferScattering ShaderCBufferScattering#

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

CBufferCamera ShaderCBufferCamera#

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

bool UseTAAOffset#

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

bool IsStereoPeripheral#

The a value indicating if peripheral stereo rendering is enabled.

Members


void ClearStates ( ) #

Clears rendering states and textures.
Notice
The shader will also be cleared.

void ClearShader ( ) #

Clears the shader.

void SetBlendFunc ( Render.PASS pass, Material material ) #

Sets the light blending function for a given rendering pass and material.

Arguments

void SetBufferMask ( Render.PASS pass, Material material ) #

Sets the buffer mask for a given rendering pass and material.
Notice
If the material does not use a depth mask and ambient pass is specified, the BUFFER_COLOR mask will be set; otherwise, the BUFFER_ALL mask will be set.

Arguments

void SetDepthFunc ( Render.PASS pass, Material material ) #

Sets depth function for a given rendering pass and material.
Notice
If the depth_test option of the material is enabled, the DEPTH_GEQUAL function will be used; otherwise the depth comparison function will be disabled.

Arguments

  • Render.PASS pass - Rendering pass. One of the PASS_* variables, except the following: PASS_DEFERRED, PASS_SHADOW, PASS_DEPTH_PRE_PASS, PASS_EMISSION.
  • Material material - Material smart pointer.

bool HasGeodeticPivot ( ) #

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

Return value

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

void SetMaterial ( Render.PASS pass, Material material ) #

Sets material and initialize all material textures for the specified rendeting pass.

Arguments

void SetPolygonCull ( Render.PASS pass, Material material ) #

Sets the polygon culling mode for a given rendering pass and material.
Notice
If the material is one-sided, the back-facing polygons will be culled; otherwise, polygon culling for the material will be disabled.

Arguments

void SetShaderParameters ( Render.PASS pass, Shader shader, bool is_screen_space = 0 ) #

Sets the parameters of the specified shader for a given rendering pass.

Arguments

  • Render.PASS pass - Rendering pass. One of the PASS_* variables.
  • Shader shader - Shader smart pointer.
  • bool is_screen_space - Screenspace flag: 1 to set the parameters for the screen space effect; otherwise 0.

void SetShaderParameters ( Render.PASS pass, Shader shader, Material material, bool is_screen_space = 0 ) #

Sets the parameters of the specified shader for a given rendering pass and material.

Arguments

  • Render.PASS pass - Rendering pass. One of the PASS_* variables.
  • Shader shader - Shader smart pointer.
  • Material material - Material smart pointer.
  • bool is_screen_space - Screenspace flag: 1 to set the parameters for the screen space effect; otherwise 0.

void SetShaderParameters ( Render.PASS pass, Shader shader, Material material, Object object, int surface, bool is_screen_space = 0 ) #

Sets the parameters of the specified shader for a given rendering pass, material, object and surface.

Arguments

  • Render.PASS pass - Rendering pass. One of the PASS_* variables.
  • Shader shader - Shader smart pointer.
  • Material material - Material smart pointer.
  • Object object - Object smart pointer.
  • int surface - Surface number.
  • bool is_screen_space - Screenspace flag: 1 to set the parameters for the screen space effect; otherwise 0.

void SetShaderParameters ( Render.PASS pass, Material material, bool is_screen_space = 0 ) #

Sets the parameters of the shader for a given rendering pass and material.

Arguments

  • Render.PASS pass - Rendering pass. One of the PASS_* variables.
  • Material material - Material smart pointer.
  • bool is_screen_space - Screenspace flag: 1 to set the parameters for the screen space effect; otherwise 0.

void SetShaderParameters ( Render.PASS pass, Object object, int surface, bool is_screen_space = 0 ) #

Sets the parameters of the shader for a given rendering pass, object and surface.

Arguments

  • Render.PASS pass - Rendering pass. One of the PASS_* variables.
  • Object object - Object smart pointer.
  • int surface - Surface number.
  • bool is_screen_space - Screenspace flag: 1 to set the parameters for the screen space effect; otherwise 0.

int CheckSkipFlags ( int flags ) #

Returns a value indicating if the specified skip flag is set.

Arguments

Return value

1 if the specified skip flag is set; otherwise, 0.

void SaveState ( ) #

Saves current renderer matrices.

void RestoreState ( ) #

Restores current renderer matrices.

bool UseDynamicReflections ( ) #

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

Return value

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

bool UseOcclusionQueries ( ) #

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

Return value

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

bool UsePostEffects ( ) #

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

Return value

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

bool UseShadows ( ) #

Returns a value indicating if rendering of shadows is enabled.

Return value

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

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

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

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

void ResetOverlapEnvironmentTexture ( ) #

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

void RenderMeshStatic ( MeshStatic mesh, Material material, string pass_name, mat4 transform, Camera camera ) #

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

Arguments

  • MeshStatic mesh - Static 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.

bool 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.
Last update: 2023-01-16
Build: ()