This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
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
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

Viewport Class

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.

The Viewport class is used to render a scene with the specified settings.

The main use cases of the Viewport class are as follows:

  1. Render a scene to the texture interface (data stays in the GPU memory), using the following methods:

    Source code (UnigineScript)
    // initialization
    Viewport viewport = new Viewport();
    
    Texture texture = new Texture();
    texture.create2D(512, 512, TEXTURE_FORMAT_RGBA8);// create 512 x 512 render target
    
    CameraPtr camera = new Camera();
    // set modelview & projection matrices to camera instance
    
    // rendering an image from the camera to the texture
    viewport.renderTexture2D(camera, texture);
  2. Render a node to a texture (data stays in the GPU memory).

Notice

To set any viewport as a main, use the setViewport() method of the Render class.

A single viewport should be used with a single camera, otherwise it may cause visual artefacts. To avoid artefacts, when using several cameras with a single viewport, all post effects must be disabled using the setSkipFlags() method with the SKIP_POSTEFFECTS flag.

See also#

Viewport Class

Members

void setNodeLightUsage ( int usage ) #

Sets a new type of lighting of the render node.

Arguments

  • int usage - The lighting type. Can be one of the following:
    • 0 - USAGE_WORLD_LIGHT (use lighting from the LightWorld set in the current loaded world).
    • 1 - USAGE_AUX_LIGHT (use lighting from the auxiliary virtual scene containing one LightWorld with 45 degrees slope angles along all axes, scattering is not used).
    • 2 - USAGE_NODE_LIGHT (use the node lighting).

int getNodeLightUsage() const#

Returns the current type of lighting of the render node.

Return value

Current lighting type. Can be one of the following:
  • 0 - USAGE_WORLD_LIGHT (use lighting from the LightWorld set in the current loaded world).
  • 1 - USAGE_AUX_LIGHT (use lighting from the auxiliary virtual scene containing one LightWorld with 45 degrees slope angles along all axes, scattering is not used).
  • 2 - USAGE_NODE_LIGHT (use the node lighting).

void setStereoOffset ( float offset ) #

Sets a new virtual camera offset (an offset after the perspective projection).

Arguments

  • float offset - The virtual camera offset in units.

float getStereoOffset() const#

Returns the current virtual camera offset (an offset after the perspective projection).

Return value

Current virtual camera offset in units.

void setStereoRadius ( float radius ) #

Sets a new radius for stereo — the half of the separation distance between the cameras (i.e. between eyes).

Arguments

  • float radius - The stereo radius in units. If a negative value is provided, 0 will be used instead.

float getStereoRadius() const#

Returns the current radius for stereo — the half of the separation distance between the cameras (i.e. between eyes).

Return value

Current stereo radius in units. If a negative value is provided, 0 will be used instead.

void setStereoDistance ( float distance ) #

Sets a new focal distance for stereo rendering (distance in the world space to the point where two views line up, i.e. to the zero parallax plane).

Arguments

  • float distance - The focal distance in units.

float getStereoDistance() const#

Returns the current focal distance for stereo rendering (distance in the world space to the point where two views line up, i.e. to the zero parallax plane).

Return value

Current focal distance in units.

isStereo() const#

Returns the current value indicating if the stereo rendering is enabled for the current viewport (one of the stereo modes is set).

Return value

Current stereo rendering for the current viewport (one of the stereo modes)

isPanorama() const#

Returns the current value indicating if the panoramic rendering is enabled.

Return value

Current panoramic rendering

void setRenderMode ( int mode ) #

Sets a new render mode. The mode determines the set of buffers to be rendered.

Arguments


int getRenderMode() const#

Returns the current render mode. The mode determines the set of buffers to be rendered.

Return value

Current render mode, one of the following:

void setMode ( ) #

Sets a new rendering mode for the current viewport.

Arguments

  • mode - The rendering mode set for the current viewport. It can be one of the stereo or panoramic modes or the default mode.

getMode() const#

Returns the current rendering mode for the current viewport.

Return value

Current rendering mode set for the current viewport. It can be one of the stereo or panoramic modes or the default mode.

void setSkipFlags ( int flags ) #

Sets a new skip flag set for the current viewport.

Arguments

  • int flags - The skip flag set for the current viewport.

int getSkipFlags() const#

Returns the current skip flag set for the current viewport.

Return value

Current skip flag set for the current viewport.

void setFirstFrame ( int frame ) #

Sets a new value indicating if the first frame is enabled over the current frame.

Arguments

  • int frame - The value indicating if the first frame is enabled over the current frame: 1 for the first frame flag; otherwise, 0.

int getFirstFrame() const#

Returns the current value indicating if the first frame is enabled over the current frame.

Return value

Current value indicating if the first frame is enabled over the current frame: 1 for the first frame flag; otherwise, 0.

void setAspectCorrection ( bool correction ) #

Sets a new value indicating if the aspect correction enabled for current viewport.

Arguments

  • bool correction - Set true to enable the aspect correction; false - to disable it.

bool isAspectCorrection() const#

Returns the current value indicating if the aspect correction enabled for current viewport.

Return value

true if the aspect correction is enabled; otherwise false.

int getID() const#

Returns the current Viewport ID.

Return value

Current Viewport ID.

void setPanoramaFisheyeFov ( float fov ) #

Sets a new field of view angle used for the panorama rendering mode.

Arguments

  • float fov - The field of view angle used for the panorama rendering mode, in degrees.

float getPanoramaFisheyeFov() const#

Returns the current field of view angle used for the panorama rendering mode.

Return value

Current field of view angle used for the panorama rendering mode, in degrees.

void setEnvironmentTexture ( ) #

Sets a new cubemap defining the environment color.

Arguments

  • texture - The cubemap defining the environment color.

getEnvironmentTexture() const#

Returns the current cubemap defining the environment color.

Return value

Current cubemap defining the environment color.

void setPaused ( bool paused ) #

Sets a new value indicating if the rendering in the current viewport is paused.

Arguments

  • bool paused - Set true to enable the viewport paused state; false - to disable it.

bool isPaused() const#

Returns the current value indicating if the rendering in the current viewport is paused.

Return value

true if the viewport paused state is enabled; otherwise false.

void setUseTAAOffset ( bool taaoffset ) #

Sets a new 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

  • bool taaoffset - Set true to enable skipping render mode check when using TAA; false - to disable it.

bool isUseTAAOffset() const#

Returns the current 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

true if skipping render mode check when using TAA is enabled; otherwise false.

void setLifetime ( int lifetime ) #

Sets a new value indicating how many frames temporary viewport resources are available after the viewport stops rendering.

Arguments

  • int lifetime - The number of frames during which temporary viewport resources are available after the viewport stops rendering

int getLifetime() const#

Returns the current value indicating how many frames temporary viewport resources are available after the viewport stops rendering.

Return value

Current number of frames during which temporary viewport resources are available after the viewport stops rendering

getEventEnd() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndScreen() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndVisualizer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginVisualizer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndDebugMaterials() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginDebugMaterials() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndPostMaterials() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginPostMaterials() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndCameraEffects() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginCameraEffects() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndTAA() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginTAA() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndAdaptationColor() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginAdaptationColor() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndAdaptationColorAverage() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginAdaptationColorAverage() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSrgbCorrection() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSrgbCorrection() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndTransparent() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWater() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWaterPlanarProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWaterPlanarProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWaterEnvironmentProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWaterEnvironmentProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWaterVoxelProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWaterVoxelProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWaterLights() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWaterLights() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWaterDecals() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWaterDecals() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWater() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndClouds() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginClouds() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginTransparent() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndCompositeDeferred() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginCompositeDeferred() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSky() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSky() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSSGI() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSSGI() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSSAO() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSSAO() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSSR() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSSR() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSSSS() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSSSS() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndTransparentBlurBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginTransparentBlurBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndRefractionBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginRefractionBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndAuxiliaryBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginAuxiliaryBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOpacityPlanarProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOpacityPlanarProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOpacityEnvironmentProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOpacityEnvironmentProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOpacityVoxelProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOpacityVoxelProbes() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOpacityLights() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOpacityLights() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndSSRTGI() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginSSRTGI() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndCurvatureComposite() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginCurvatureComposite() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndCurvature() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginCurvature() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOpacityDecals() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOpacityDecals() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOpacityGBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOpacityGBuffer() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndMixedRealityBlendMaskColor() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginMixedRealityBlendMaskColor() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginScreen() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndShadows() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndOmniShadow() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginOmniShadow() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndProjShadow() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginProjShadow() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndWorldShadow() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginWorldShadow() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginShadows() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventEndEnvironment() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBeginEnvironment() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

getEventBegin() const#

The event handler signature is as follows: myhandler()

Usage Example

Source code

Return value

Event reference.

static Viewport ( ) #

Creates a new viewport with default settings.

void appendSkipFlags ( int flags ) #

Appends specified skip flags to the list of currently used ones.

Arguments

int checkSkipFlags ( int flags ) #

Returns a value indicating if the specified skip flags are set for the current viewport.

Arguments

Return value

1 if the skip flags are set; otherwise, 0.

void removeSkipFlags ( int flags ) #

Removes specified skip flags from the list of currently used ones.

Arguments

void render ( Camera camera ) #

Renders an image from the specified camera.

To render an image from the camera to the RenderTarget interface, do the following:

Source code (UnigineScript)
camera = new Camera();

rendertarget->enable();
	viewport->render(camera);
rendertarget->disable();

Arguments

  • Camera camera - Camera an image from which should be rendered.

void render ( Camera camera, int width, int height ) #

Renders an image of the specified size from the specified camera to the current rendering target.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • int width - Image width, in pixels.
  • int height - Image height, in pixels.

void renderEngine ( Camera camera ) #

Renders an Engine viewport for the specified camera to the current rendering target. This method renders a splash screen and provides an image in accordance with panoramic and stereo rendering settings.

Arguments

  • Camera camera - Camera, an image from which should be rendered.

void renderTexture2D ( Camera camera, Texture texture ) #

Renders an image from the camera to the specified 2D texture.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Texture texture - Target 2D texture to save the result to.

void renderTexture2D ( Camera camera, Texture texture, int width, int height, int hdr = 0 ) #

Renders an image of the specified size from the camera to a 2D texture.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Texture texture - Target 2D texture to save the result to.
  • int width - Texture width, in pixels.
  • int height - Texture height, in pixels.
  • int hdr - HDR flag.
    Notice
    This parameter determines the format of the 2D texture:
    • 1 - texture format will be set to RGBA16F
    • 0 - texture format will be set to RGBA8

void renderTextureCube ( Camera camera, Texture texture, int local_space = false ) #

Renders the image from the camera to the cubemap texture.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Texture texture - Target Cube texture to save the result to.
  • int local_space - A flag indicating if the camera angle should be used for the cube map rendering.

void renderTextureCube ( Camera camera, Texture texture, int size, int hdr = 0, int local_space = 0 ) #

Renders the image from the camera to the cube map of the specified size.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Texture texture - Target cube map to save the result to.
  • int size - Cube map edge size.
  • int hdr - HDR flag.
    Notice
    This parameter determines the format of the 2D texture:
    • 1 - texture format will be set to RGBA16F
    • 0 - texture format will be set to RGBA8
  • int local_space - A flag indicating if the camera angle should be used for the cube map rendering.

void renderNode ( Camera camera, Node node ) #

Renders the given node with all children to the current rendering target.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Node node - Node to be rendered.

void renderNode ( Camera camera, Node node, int width, int height ) #

Renders the given node with all children to the current rendering target.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Node node - Node to be rendered.
  • int width - Image width, in pixels.
  • int height - Image height, in pixels.

void renderNodeTexture2D ( Camera camera, Node node, Texture texture, int width, int height, int hdr ) #

Renders the given node with all children to the 2D texture of the specified size.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Node node - Node to be rendered.
  • Texture texture - Target 2D texture to save the result to.
  • int width - Texture width, in pixels.
  • int height - Texture height, in pixels.
  • int hdr - HDR flag.
    Notice
    This parameter determines the format of the 2D texture:
    • 1 - texture format will be set to RGBA16F
    • 0 - texture format will be set to RGBA8

void renderNodeTexture2D ( Camera camera, Node node, Texture texture ) #

Renders the given node with all children to the specified 2D texture.

Arguments

  • Camera camera - Camera, an image from which should be rendered.
  • Node node - Node to be rendered.
  • Texture texture - Target 2D texture to save the result to.

void renderStereo ( Camera camera_left, Camera camera_right, string stereo_material ) #

Renders a stereo image in the current viewport.

Arguments

  • Camera camera_left - Camera that renders an image for the left eye.
  • Camera camera_right - Camera that renders an image for the right eye.
  • string stereo_material - List of names of stereo materials to be used.

void renderStereoPeripheral ( Camera camera_left, Camera camera_right, Camera camera_focus_left, Camera camera_focus_right, Texture texture_left, Texture texture_right, Texture texture_focus_left, Texture texture_focus_right, string stereo_material ) #

Renders a stereo image for HMDs having context (peripheral) and focus displays. This method saves performance on shadows and reflections along with other optimizations reducing rendering load, such as reduced resolutions for textures.

Arguments

  • Camera camera_left - Camera that renders an image for the left context (low-res) display.
  • Camera camera_right - Camera that renders an image for the right context (low-res) display.
  • Camera camera_focus_left - Camera that renders an image for the left focus (high-res) display.
  • Camera camera_focus_right - Camera that renders an image for the right focus (high-res) display.
  • Texture texture_left - Texture to save the image rendered for the left context (low-res) display.
  • Texture texture_right - Texture to save the image rendered for the right context (low-res) display.
  • Texture texture_focus_left - Texture to save the image rendered for the left focus (high-res) display.
  • Texture texture_focus_right - Texture to save the image rendered for the right focus (high-res) display.
  • string stereo_material - List of names of stereo materials to be used.

void setStereoHiddenAreaMesh ( Mesh hidden_area_mesh_left, Mesh hidden_area_mesh_right ) #

Sets custom meshes to be used for culling pixels, that are not visible in VR.
Notice

Arguments

  • Mesh hidden_area_mesh_left - Mesh representing hidden area for the left eye.
  • Mesh hidden_area_mesh_right - Mesh representing hidden area for the right eye.

void clearStereoHiddenAreaMesh ( ) #

Clears meshes that represent hidden areas for both, left and right eye. Hidden areas are used for culling pixels, that are not visible in VR

void setEnvironmentTexturePath ( string name ) #

Sets the path to the cubemap defining the environment color for the viewport. This texture is used for imitating landscape reflections and lighting in accordance with the ground mask.

Arguments

  • string name - Path to the cubemap defining the environment color.

string getEnvironmentTexturePath ( ) #

Returns the path to the cubemap defining the environment color set for the viewport. This texture is used for imitating landscape reflections and lighting in accordance with the ground mask.

Return value

Path to the cubemap defining the environment color.

void resetEnvironmentTexture ( ) #

Resets the current environment texture to the default one.

void renderVREngine ( ) #

Renders the VR viewport if VR is enabled, taking into account the vr mirror mode set.
Last update: 2024-03-27
Build: ()