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#
The SSR texture.
Texture TextureSSGI#
The SSGI texture.
Texture TextureSSAO#
The SSAO texture.
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#
The refraction texture.
Texture TextureAuxiliary#
The auxiliary texture.
Texture TextureColorOpacity#
The color opacity texture.
Texture TextureOpacityDepth#
Texture TextureCurrentDepth#
Texture TextureColorOldReprojection#
Texture TextureColorOld#
The color old texture.
Texture TextureColor#
The color texture.
RenderTarget PostRenderTarget#
The post texture render.
RenderTarget RenderTarget#
The render target.
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.
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.
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.
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.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
- Render.PASS pass - Rendering pass. One of the following values:
- Material material - Material smart pointer.
void SetBufferMask ( Render.PASS pass, Material material ) #
Sets the buffer mask for a given rendering pass and material.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.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.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
- int flags - Skip flag.
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:
<!-- ... -->
<texture type="texture_name"/>
<!-- ... -->
Create a corresponding custom texture via code:
// ...
// 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:
<!-- ... -->
<texture type="texture_name"/>
<!-- ... -->
Create a corresponding custom texture via code:
// ...
// 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.
<!-- ... -->
<texture type="texture_name"/>
<!-- ... -->
Create a corresponding custom texture via code:
// ...
// 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
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)