This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
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
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

Properties

Texture TextureGBufferVelocity#

Texture TextureGBufferFeatures#

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

Texture TextureGBufferLightmap#

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 he Screen-Space Dirt (SSDirt) effect.

Texture TextureSSR#

Texture TextureSSGI#

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 TextureColorOpacity#

The color opacity texture.

Texture TextureOpacityDepth#

Texture TextureCurrentDepth#

Texture TextureColorOldReprojection#

Texture TextureColorOld#

Texture TextureColor#

RenderTarget PostRenderTarget#

The post texture render.

RenderTarget RenderTarget#

int Height#

Current screen height.

int Width#

Current screen width.

bool IsObliqueFrustum#

A value indicating if the viewing frustum is oblique.
set
Enables or disables obliqueness of the viewing frustum.
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.
set value - 1 to enable oblique viewing frustum; 0 to disable it.

vec4 ObliqueFrustumPlane#

The oblique near clipping plane of the viewing frustum.
set
Sets the oblique near clipping plane of the viewing frustum.
Notice
This method does not affect the projection matrix. To enable the oblique frustum use the setObliqueFrustum() method.
set value - World coordinates of the oblique near clipping plane to set (Nx, Ny, Nz, D), where Nx, Ny, Nz - coordinates of the plane normal, D - distance from the origin to the plane.

float ZFar#

Return current far clipping plane.

float ZNear#

Current near clipping plane.

vec3 CameraPosition#

Current camera position.
set
Sets a new camera position.
set value - New camera position.

mat4 OldModelview#

The old view matrix.
set
Updates the old view matrix.
set value - Old view matrix to be set.

mat4 Modelview#

Current view matrix.
set
Sets current view matrix.
set value - New view matrix to be set.

mat4 OldProjection#

The old projection matrix.
set
Updates the old projection matrix.
set value - Old projection matrix to be set.

mat4 Projection#

Current projection matrix.
set
Updates the current projection matrix.
Notice
It is not recommended to use this method for setting obliqueness of the near clipping plane of the frustum, as in this case a number of features (such as clouds, shadows, TAA, a number of engine optimizations, etc.) will not function properly. Please, use the setObliqueFrustum() method instead.
set value - Projection matrix to be set.

Viewport Viewport#

The rendering viewport.

int StereoMode#

The current stereo mode.

int SkipFlags#

The skip flag set for the rendering viewport.

int ReflectionViewportMask#

The current reflection viewport mask.

int ViewportMask#

Current viewport mask.

bool IsStereo#

A value indicating if stereo rendering is enabled.

bool IsShadow#

A value indicating if shadows are rendered.

bool IsReflection#

A value indicating if reflection rendering is in progress.

bool IsNode#

A value indicating if node rendering is in progress.

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

  • Render.PASS pass - Rendering pass. One of the following values:
  • Material material - Material smart pointer.

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.

mat4 GetIModelview ( ) #

Returns current inverse view matrix.

Return value

Returns current inverse view matrix.

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

Sets material and initialize all material textures.

Arguments

  • Render.PASS pass - Rendering pass.
  • Material material - Material smart pointer.

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

  • Render.PASS pass - Rendering pass. One of the RENDER_PASS_* variables.
  • Material material - Material smart pointer.

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

Sets the polygon bias offset value for a given rendering pass and material. Polygon offset can be used to prevent the Z-fighting effect.

Arguments

  • Render.PASS pass - Rendering pass. One of the RENDER_PASS_* variables.
  • Material material - Material smart pointer.

mat4 GetProjectionWithoutTAA ( ) #

Returns current projection matrix without TAA.

Return value

Projection matrix without TAA.

void SetShaderParameters ( Render.PASS pass, Shader shader, int 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.
  • int 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, int 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.
  • int 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, int 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.
  • int is_screen_space - Screenspace flag: 1 to set the parameters for the screen space effect; otherwise 0.

void SetShaderParameters ( Render.PASS pass, Material material, int 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.
  • int 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, int 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.
  • int 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 RestoreState ( ) #

Restores current renderer matrices.

void SaveState ( ) #

Saves 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.USAGE_, Texture.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

  • string name - Texture name.
  • int width - Texture width, in pixels.
  • int height - Texture height, in pixels.
  • int format - Texture format, one of the Texture.FORMAT_ values.
  • int flags - Texture flags. A combination of flags (such as Texture.USAGE_, Texture.WRAP_, etc.)

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.USAGE_, Texture.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.
Last update: 2020-04-10
Build: ()