This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
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
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.

engine.render Functions

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.

Provides access to Unigine rendering functions. For example, it is used by AppWall application to render onto multiple monitors.

See Also#

  • A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/rendering/ folder

Render Class

Members


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.

int engine.render.isAPISupported ( int api ) #

Returns a value indicating if the specified graphics API (Null/OpenGL/DirectX) is currently supported.

Arguments

  • int api - Graphics API ID. One of the API_* values.

Return value

1 if the specified graphics API is currently supported; otherwise, 0.

void engine.render.beginDebugGroup ( string name ) #

Starts a GPU debug group with a specified name in Microprofiler.

Arguments

  • string name - Name of debug group.

void engine.render.endDebugGroup ( ) #

Ends a GPU debug group previously started via the beginDebugGroup() method.

void engine.render.destroyCacheTexture ( UGUID guid ) #

Deletes cache (images and metadata) stored on disk for the texture with the specified GUID. Corresponding files in the data/.cache_textures will be removed.

Arguments

  • UGUID guid - Texture file GUID.

void engine.render.createCacheTexture ( UGUID guid ) #

Generates cache for the texture with the specified GUID.
Notice
Texture cache generated by this method is incomplete, only images are created, as all metadata (flags, etc.) is stored in materials.

Arguments

  • UGUID guid - Texture file GUID.

void engine.render.destroyCacheTextures ( ) #

Console: render_streaming_textures_cache_destroy
Clears texture cache (images and metadata) stored on disk. All files in the data/.cache_textures will be removed.

void engine.render.unloadCacheTextures ( ) #

Console: render_streaming_textures_cache_unload
Unloads texture cache from the memory. This method does not delete files in the data/.cache_textures.

void engine.render.createCacheTextures ( ) #

Console: render_streaming_textures_cache_create
Generates texture cache for all textures used in the project.
Notice
Texture cache generated by this method is incomplete, only images are created, as all metadata (flags, etc.) is stored in materials.

void engine.render.loadCacheTextures ( ) #

Console: render_streaming_textures_cache_load
Loads texture cache from the disk. Texture cache always remains in memory after loading.

void engine.render.getScreenshot ( Image image ) #

Takes a screenshot and puts it to the specified image.

Arguments

  • Image image - Image to which the screenshot is to be saved.

int engine.render.getMaxTextureBufferSize ( ) #

Returns the maximum size of the texture buffer.

Return value

Maximum size of the texture buffer.

void engine.render.addScriptableMaterial ( Material material ) #

Adds a new global scriptable material. To apply a scriptable material per-camera or per-player, use the addScriptableMaterial() method of the Camera class or the same method of the Player class respectively. The order of execution for scripts assigned to scriptable materials is defined by material's number in the list of materials applied globally.
Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-camera or per-player.

Arguments

  • Material material - Scriptable material to be applied globally.

void engine.render.insertScriptableMaterial ( int num, Material material ) #

Inserts a new global scriptable material to the list of globally applied scriptable materials. To apply a scriptable material per-camera or per-player, use the insertScriptableMaterial() method of the Camera class or the same method of the Player class respectively. The order of execution for scripts assigned to scriptable materials is defined by material's number in the list of materials applied globally.
Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-camera or per-player.

Arguments

  • int num - Position at which a new scriptable material is to be inserted.
  • Material material - Scriptable material to be inserted into the list of globally applied scriptable materials.

void engine.render.removeScriptableMaterial ( int num ) #

Removes the global scriptable material with the specified number.

Arguments

int engine.render.findScriptableMaterial ( Material material ) #

Returns the number of the specified scriptable material applied globally. This number determines the order in which the assigned expressions are executed.
Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-camera or per-player.

Arguments

  • Material material - Scriptable material for which a number is to be found.

Return value

Scriptable material number in the range from 0 to the total number of scriptable materials, or -1 if the specified material was not found.

void engine.render.setScriptableMaterial ( int num, Material material ) #

Replaces the scriptable material with the specified number with the new scriptable material specified. The number of material determines the order in which the expressions assigned to it are executed.
Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-camera or per-player.

Arguments

Material engine.render.getScriptableMaterial ( int num ) #

Returns a scriptable material applied globally by its number.

Arguments

Return value

Scriptable material applied globally with the specified number.

void engine.render.setScriptableMaterialEnabled ( int num, int enabled ) #

Enables or disables the scriptable material with the specified number. When a material is disabled (inactive), the scripts attached to it are not executed.

Arguments

  • int num - Scriptable material number in the range from 0 to the total number of scriptable materials.
  • int enabled - 1 to enable the scriptable material with the specified number, 0 to disable it.

int engine.render.getScriptableMaterialEnabled ( int num ) #

Returns a value indicating if the scriptable material with the specified number is enabled (active). When a material is disabled (inactive), the scripts attached to it are not executed.

Arguments

Return value

1 if the scriptable material with the specified number is enabled; otherwise, 0.

void engine.render.swapScriptableMaterials ( int num_0, int num_1 ) #

Swaps two scriptable materials with specified numbers. The number of material determines the order in which the expressions assigned to it are executed.
Notice
Scriptable materials applied globally have their expressions executed before the ones that are applied per-camera or per-player.

Arguments

void engine.render.clearScriptableMaterials ( ) #

Clears all global scriptable materials.

Texture engine.render.getTemporaryTexture ( int width, int height, int format, int flags = 0, string name = 0 ) #

Allocates a temporary render texture with the specified width, height, format, and flags. This function can be used when you need a quick render texture to perform some temporary calculations. Release it using releaseTemporaryTexture() as soon as you're done with it, so another call can start reusing it, if necessary. In any case, such texture shall be released automatically in the next frame.

UNIGINE keeps an internal pool of temporary render textures, so a call to this method most often just returns an already created one (if the size and format match). These temporary textures are actually destroyed when they aren't used for a couple of frames.

If you are doing a series of post-processing "blits", it's best for performance to get and release a temporary render texture for each blit, instead of getting one or two render textures upfront and reusing them.

Notice
You can't depend on any particular contents of a temporary texture obtained from this function: it might be garbage, or it might be cleared to some color, depending on the platform.

It also automatically gives names to resources, which can be used for identification in debug.

Arguments

  • int width - Width of the texture, in pixels.
  • int height - Height of the texture, in pixels.
  • int format - Texture format: one of the TEXTURE_FORMAT_* values.
  • int flags - Texture flags.
  • string name - Name to be used for this temporary texture (optional).

Return value

Temporary texture.

Texture engine.render.getTemporaryTexture ( Texture texture ) #

Allocates a temporary render texture with the specified width, height, format, and flags. This function can be used when you need a quick render texture to perform some temporary calculations. Release it using releaseTemporaryTexture() as soon as you're done with it, so another call can start reusing it, if necessary. In any case, such texture shall be released automatically in the next frame.

UNIGINE keeps an internal pool of temporary render textures, so a call to this method most often just returns an already created one (if the size and format match). These temporary textures are actually destroyed when they aren't used for a couple of frames.

If you are doing a series of post-processing "blits", it's best for performance to get and release a temporary render texture for each blit, instead of getting one or two render textures upfront and reusing them.

Notice
You can't depend on any particular contents of a temporary texture obtained from this function: it might be garbage, or it might be cleared to some color, depending on the platform.

It also automatically gives names to resources, which can be used for identification in debug.

Arguments

  • Texture texture - Source texture for which a temporary texture is to be allocated in the pool.

Return value

Temporary texture.

Texture engine.render.getTemporaryTexture ( Texture texture, string name = 0 ) #

Allocates a temporary render texture for the specified source texture (using all its parameters: resolution, flags, etc.). This function can be used when you need a quick render texture to perform some temporary calculations. Release it using releaseTemporaryTexture() as soon as you're done with it, so another call can start reusing it, if necessary. In any case, such texture shall be released automatically in the next frame.

UNIGINE keeps an internal pool of temporary render textures, so a call to this method most often just returns an already created one (if the size and format match). These temporary textures are actually destroyed when they aren't used for a couple of frames.

If you are doing a series of post-processing "blits", it's best for performance to get and release a temporary render texture for each blit, instead of getting one or two render textures upfront and reusing them.

Notice
You can't depend on any particular contents of a temporary texture obtained from this function: it might be garbage, or it might be cleared to some color, depending on the platform.

It also automatically gives names to resources, which can be used for identification in debug.

Arguments

  • Texture texture - Source texture for which a temporary texture is to be allocated in the pool.
  • string name - Name to be used for this temporary texture (optional).

Return value

Temporary texture.

Texture engine.render.getTemporary2DArrayTexture ( int width, int height, int depth, int format, int flags = 0, string name = 0 ) #

Allocates a temporary 2D array texture with the specified width, height, number of layers, format, and flags. This function can be used when you need a quick render texture to perform some temporary calculations. Release it using releaseTemporaryTexture() as soon as you're done with it, so another call can start reusing it, if necessary. In any case, such texture shall be released automatically in the next frame.

UNIGINE keeps an internal pool of temporary render textures, so a call to this method most often just returns an already created one (if the size and format match). These temporary textures are actually destroyed when they aren't used for a couple of frames.

If you are doing a series of post-processing "blits", it's best for performance to get and release a temporary render texture for each blit, instead of getting one or two render textures upfront and reusing them.

Notice
You can't depend on any particular contents of a temporary texture obtained from this function: it might be garbage, or it might be cleared to some color, depending on the platform.

Arguments

  • int width - Width of the 2D array texture, in pixels.
  • int height - Height of the 2D array texture, in pixels.
  • int depth - Number of layers in the 2D array texture.
  • int format - Texture format: one of the TEXTURE_FORMAT_* values.
  • int flags - Texture flags.
  • string name - Name to be used for this temporary 2D array texture (optional).

Return value

Temporary 2D array texture.

Texture engine.render.getTemporary3DTexture ( int width, int height, int depth, int format, int flags = 0, string name = 0 ) #

Allocates a temporary 3D texture with the specified width, height, depth, format, and flags. This function can be used when you need a quick render texture to perform some temporary calculations. Release it using releaseTemporaryTexture() as soon as you're done with it, so another call can start reusing it, if necessary. In any case, such texture shall be released automatically in the next frame.

UNIGINE keeps an internal pool of temporary render textures, so a call to this method most often just returns an already created one (if the size and format match). These temporary textures are actually destroyed when they aren't used for a couple of frames.

If you are doing a series of post-processing "blits", it's best for performance to get and release a temporary render texture for each blit, instead of getting one or two render textures upfront and reusing them.

Notice
You can't depend on any particular contents of a temporary texture obtained from this function: it might be garbage, or it might be cleared to some color, depending on the platform.

Arguments

  • int width - Width of the 3D texture, in pixels.
  • int height - Height of the 3D texture, in pixels.
  • int depth - Depth of the 3D texture, in pixels.
  • int format - Texture format: one of the TEXTURE_FORMAT_* values.
  • int flags - Texture flags.
  • string name - Name to be used for this temporary 3D texture (optional).

Return value

Temporary 3D texture.

void engine.render.releaseTemporaryTexture ( Texture texture ) #

Releases the temporary texture previously obtained via getTemporaryTexture(), getTemporary2DArrayTexture(), or getTemporary3DTexture() method and returns it to the pool.

Arguments

  • Texture texture - Temporary texture or texture array to be returned to the pool.

RenderTarget engine.render.getTemporaryRenderTarget ( ) #

Allocates a temporary render target. This function can be used when you need a quick render target to perform some temporary calculations. Release it using releaseTemporaryRenderTarget() as soon as you're done with it, so another call can start reusing it if necessary. In any case such render target shall be released automatically in the next frame.

UNIGINE keeps an internal pool of temporary render targets, so a call to this method most often just returns an already created one (if the size and format matches). These temporary render targets are actually destroyed when they aren't used for a couple of frames.

If you are doing a series of post-processing "blits", it's best for performance to get and release a temporary render targets for each blit, instead of getting one or two render targets upfront and reusing them.

Notice
You can't depend on any particular contents of a temporary render target obtained from this function: it might be garbage, or it might be cleared to some color, depending on the platform.

Return value

Temporary render target.

void engine.render.releaseTemporaryRenderTarget ( RenderTarget render_target ) #

Releases the temporary render target previously obtained via getTemporaryRenderTarget() method and returns it to the pool.

Arguments

  • RenderTarget render_target - Temporary render target to be returned to the pool.

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.
Notice
Only 2d and 2d array textures can be compressed.

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.createMipmapsCubeGGXImage ( Image image, float quality ) #

Generates mipmaps for a cubemap image using GGX BRDF microfacet model.

Arguments

int engine.render.createMipmapsCubeGGXTexture ( Texture texture, float quality ) #

Generates mipmaps for a cubemap texture using GGX BRDF microfacet model.

Arguments

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.setColorCorrectionLUTImage ( 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 setColorCorrectionLUTPath().
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.setColorCorrectionLUTImage(lut);

Arguments

  • Image image - Color transformation image.

Return value

1 if the image is set successfully; otherwise, 0.

int engine.render.getColorCorrectionLUTImage ( 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.resetColorCorrectionCurve ( ) #

Resets the Color Correction curve to the default value.

void engine.render.resetColorCorrectionSaturationCurve ( ) #

Resets the Saturation Correction curve to the default value.

int engine.render.loadSettings ( string file, int clear = false ) #

Loads render settings from a given file.

Arguments

  • string file - Path to an XML file with desired settings.
  • int clear - Clear flag. Set 1 to clear settings before loading (new settings shall be applied right after loading them), or 0 not to clear.

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. One of the SKIP_* variables should be specified. 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 (see the light_usage argument above). 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, int hdr, int skip_flags, int light_usage, string environment_texture_name ) #

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 - Width of the image, in units.
  • int height - Height of the image, in units.
  • int hdr - HDR flag. This parameter determines the format of the 2D image:
    • 1 - image format will be set to RGBA16F. It means that the HDR image buffer will store pixel values outside the [0;1] range (i.e. both negative and positive values).
    • 0 - image format will be set to RGBA8.
  • int skip_flags - Skip the effects. One of the SKIP_* variables should be specified. 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 (see the light_usage argument above). In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.

void engine.render.renderScreenMaterial ( string material_name ) #

Arguments

  • string material_name - Material name.

void engine.render.renderScreenMaterial ( string material_name, Texture color_texture ) #

Arguments

  • string material_name - Material name.
  • Texture color_texture - Color texture.

void engine.render.renderScreenMaterial ( string material_name, string texture_name, Texture texture ) #

Arguments

  • string material_name - Material.
  • string texture_name - Material texture name.
  • Texture texture - Texture.

int engine.render.saveSettings ( string file ) #

Saves the current renderer settings to a given file.

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.

Saving into the stream requires creating a blob to save into. To restore the saved state the restoreState() method is used:

Source code (UnigineScript)
// set state
engine.render.setCloudsInterleavedRendering(0); // interleave = 0
	
// save state
Blob blob_state = new Blob();
engine.render.saveState(blob_state);
	
// change state
engine.render.setCloudsInterleavedRendering(2); // now interleave = 2
	
// restore state
blob_state->seekSet(0);			// returning the carriage to the start of the blob
engine.render.restoreState(blob_state); // restore interleave = 0

Arguments

  • Stream stream - Stream to save a state into.

Return value

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

int engine.render.restoreState ( Stream stream ) #

Restores a render state from the stream.

Restoring from the stream requires creating a blob to save into and saving the state using the saveState() method:

Source code (UnigineScript)
// set state
engine.render.setCloudsInterleavedRendering(0); // interleave = 0
	
// save state
Blob blob_state = new Blob();
engine.render.saveState(blob_state);
	
// change state
engine.render.setCloudsInterleavedRendering(2); // now interleave = 2
	
// restore state
blob_state->seekSet(0);			// returning the carriage to the start of the blob
engine.render.restoreState(blob_state); // restore interleave = 0

Arguments

  • Stream stream - Stream to restore a state from.

Return value

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

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.

string engine.render.getCloudsQualityPresetName ( int num ) #

Returns the Clouds Quality preset name by given index.

Arguments

  • int num - Clouds Quality preset index.

Return value

Clouds Quality preset name.

string engine.render.getAAPresetName ( int num ) #

Returns the AA (Anti-Aliasing) preset name by given index.

Arguments

  • int num - AA preset index.

Return value

AA preset name.

string engine.render.getTAAPresetName ( int num ) #

Returns the TAA (Temporal Anti-Aliasing) preset name by given index.

Arguments

  • int num - TAA preset index.

Return value

TAA preset name.

string engine.render.getGIPresetName ( int num ) #

Returns the GI (Global Illumination) preset name by given index.

Arguments

  • int num - GI preset index.

Return value

GI preset name.

string engine.render.getSSRTGIPresetName ( int num ) #

Returns the SSRTGI (Screen-Space Ray-Traced Global Illumination) preset name by given index.

Arguments

  • int num - SSRTGI preset index.

Return value

SSRTGI preset name.

string engine.render.getSSAOPresetName ( int num ) #

Returns the SSAO (Screen Space Ambient Occlusion) preset name by given index.

Arguments

  • int num - SSAO preset index.

Return value

SSAO preset name.

string engine.render.getSSGIPresetName ( int num ) #

Returns the SSGI (Screen-Space Global Illumination) preset name by given index.

Arguments

  • int num - SSGI preset index.

Return value

SSGI preset name.

string engine.render.getBentNormalPresetName ( int num ) #

Returns the Bent Normal preset name by given index.

Arguments

  • int num - Bent Normal preset index.

Return value

Bent Normal preset name.

string engine.render.getSSRPresetName ( int num ) #

Returns the SSR preset name by given index.

Arguments

  • int num - SSR preset index.

Return value

SSR preset name.

string engine.render.getSSSSSPresetName ( int num ) #

Returns the SSSSS preset name by given index.

Arguments

  • int num - SSSSS preset index.

Return value

SSSSS preset name.

string engine.render.getMotionBlurPresetName ( int num ) #

Returns the Motion Blur preset name by given index.

Arguments

  • int num

Return value

Motion Blur preset name.

string engine.render.getDOFPresetName ( int num ) #

Returns the DOF preset name by given index.

Arguments

  • int num

Return value

DOF preset name.

string engine.render.getLandscapeTerrainGeometryPresetName ( int num ) #

Returns the Landscape Terrain Geometry preset name by given index.

Arguments

  • int num - Landscape Terrain Geometry preset index.

Return value

Landscape Terrain Geometry preset name.

string engine.render.getLandscapeTerrainStreamingPresetName ( int num ) #

Returns the Landscape Terrain Streaming preset name by given index.

Arguments

  • int num - Landscape Terrain Streaming preset index.

Return value

Landscape Terrain Streaming preset name.

string engine.render.getWaterGeometryPresetName ( int num ) #

Returns the Global Water Geometry preset name by given index.

Arguments

  • int num - Global Water Geometry preset index.

Return value

Global Water Geometry preset name.

int engine.render.isViewportModeStereo ( int mode ) #

Returns a value indicating if the specified mode is one of the stereo rendering modes.

Arguments

Return value

1 if the specified mode is one of the stereo rendering modes; otherwise 0.

int engine.render.isViewportModePanorama ( int mode ) #

Returns a value indicating if the specified mode is one of the panorama rendering modes.

Arguments

Return value

1 if the specified mode is one of the panorama rendering modes; otherwise 0.

void engine.render.clearDebugMaterials ( ) #

Clears all global debug materials.

void engine.render.setDebugMaterial ( int num, Material material ) #

Replaces the debug material with the specified number with the new debug material specified. The number of material determines the order in which the expressions assigned to it are executed.

Arguments

Material engine.render.getDebugMaterial ( int num ) #

Returns a debug material applied globally by its number.

Arguments

Return value

Debug material applied globally with the specified number.

void engine.render.insertDebugMaterial ( int num, Material material ) #

Inserts a new global debug material to the list of globally applied debug materials.

Arguments

  • int num - Position at which a new debug material is to be inserted.
  • Material material - Debug material to be inserted into the list of globally applied debug materials.

int engine.render.findDebugMaterial ( Material material ) #

Returns the number of the specified debug material applied globally. This number determines the order in which the assigned expressions are executed.

Arguments

  • Material material - Debug material for which a number is to be found.

Return value

Debug material number in the range from 0 to the total number of debug materials, or -1 if the specified material was not found.

void engine.render.addDebugMaterial ( Material material ) #

Adds a new global debug material.

Arguments

  • Material material - Debug material to be applied globally.

void engine.render.removeDebugMaterial ( int num ) #

Removes the global debug material with the specified number.

Arguments

void engine.render.swapDebugMaterials ( int num_0, int num_1 ) #

Swaps two debug materials with specified numbers. The number of material determines the order in which the expressions assigned to it are executed.

Arguments

void engine.render.setDebugMaterialEnabled ( int num, int enabled ) #

Enables or disables the debug material with the specified number. When a material is disabled (inactive), the scripts attached to it are not executed.

Arguments

  • int num - Debug material number in the range from 0 to the total number of debug materials.
  • int enabled - 1 to enable the debug material with the specified number, 0 to disable it.

int engine.render.getDebugMaterialEnabled ( int num ) #

Returns a value indicating if the debug material with the specified number is enabled (active). When a material is disabled (inactive), the scripts attached to it are not executed.

Arguments

Return value

1 if the debug material with the specified number is enabled; otherwise, 0.

Texture engine.render.getCacheTexture ( UGUID guid ) #

Arguments

Last update: 2021-12-13
Build: ()