This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and 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
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
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.projection Functions

This set of functions is available when the AppProjection plugin is loaded. This plugin allows creating multi-projector setups.

If the plugin is loaded together with the engine, the HAS_APP_PROJECTION definition is set. This definition can be used, for example, to avoid errors if the plugin is not loaded: the code in which the plugin functions are executed can be wrapped around as follows:

Source code (UnigineScript)
#ifdef HAS_APP_PROJECTION
	// engine.projection functions
#endif

AppProjection Class

Members


int engine.projection.addMesh(int num, Mesh mesh, Mat4 transform)

Adds a new mesh for the specified projection.

Arguments

  • int num - Projection number.
  • Mesh mesh - Mesh to be added.
  • Mat4 transform - Mesh transformation.

Return value

Total number of meshes for the specified projection.

void engine.projection.clear()

Sets the default values for options of each projection (i.e. for the color bias, color scale, positions of projection corners, etc.).

vec4 engine.projection.getBorders(int num, Variable id)

Returns edge correction for the specified projection.

Arguments

  • int num - Projection number in range from 0 to the number of projections.
  • Variable id - Vector with correction values for four sides.

Return value

Vector with correction values for four sides (left, right, top, bottom). The first value specifies area size (where 1 equals half of the screen) and the second power of blending.

vec4 engine.projection.getColorBias(int num)

Returns the color bias for the specified projection.

Arguments

  • int num - Projection number in range from 0 to the number of projections.

Return value

Per-channel color bias.

vec4 engine.projection.getColorScale(int num)

Returns the color multiplier for the specified projection.

Arguments

  • int num - Projection number in range from 0 to the number of projections.

Return value

Per-channel color scale.

Gui engine.projection.getGui(int num)

Returns a GUI instance to draw interface on the specified projection.

Arguments

  • int num - Projection number.

Return value

GUI instance.

void engine.projection.getLinearity(int num, Variable id)

Gets non-linear stretching ratio values for each side of the specified projection (left, right, top or bottom).

Arguments

  • int num - Projection number in range from 0 to the number of projections.
  • Variable id - Array with correction values for four sides.

Mesh engine.projection.getMesh(int num, int mesh_num)

Returns the specified mesh of the specified projection.

Arguments

  • int num - Projection number.
  • int mesh_num - Mesh number.

Return value

Mesh.

Mat4 engine.projection.getMeshTransform(int num, int mesh_num)

Returns the transformation of the specified mesh of the specified projection.

Arguments

  • int num - Projection number.
  • int mesh_num - Mesh number.

Return value

Mesh transformation.

Mat4 engine.projection.getModelview(int num)

Gets the current model-view matrix used for the specified projection.

Arguments

  • int num - Projection number.

Return value

Model-view matrix used for the specified projection.

Texture engine.projection.getMultiplyTexture(int num)

Returns the current edge blending map for the specified projection.

Arguments

  • int num - Projection number.

Return value

Current edge blending map.

int engine.projection.getPrimary()

Returns the number of projection, which is used as a primary one.

Return value

Projection number.

mat4 engine.projection.getProjection(int num)

Returns the current projection matrix used for the specified projection.

Arguments

  • int num - Projection number.

Return value

Projection matrix used for the specified projection.

Mat4 engine.projection.getProjectorModelview(int num)

Returns the current projector's model-view matrix for the specified projection.

Arguments

  • int num - Projection number.

Return value

Projector's model-view matrix.

mat4 engine.projection.getProjectorProjection(int num)

Returns the current projector's projection matrix for the specified projection.

Arguments

  • int num - Projection number.

Return value

Projector's projection matrix.

float engine.projection.getResolutionUpscale()

Returns the current resolution upscale factor.

Return value

Resolution upscale factor.

Mat4 engine.projection.getViewerModelview(int num)

Returns the current viewer's model-view matrix for the specified projection.

Arguments

  • int num - Projection number.

Return value

Viewer's model-view matrix.

mat4 engine.projection.getViewerProjection(int num)

Returns the current viewer's projection matrix for the specified projection.

Arguments

  • int num - Projection number.

Return value

Viewer's projection matrix.

int engine.projection.isEnabled(int num)

Returns a value indicating if the specified AppProjection projection is enabled for viewport rendering.

Arguments

  • int num - Projection number.

Return value

1 if the projection is enabled for rendering; otherwise, 0.

int engine.projection.isPluginEnabled()

Returns a value indicating if the AppProjection plugin is enabled.

Return value

1 if the AppProjection plugin is enabled; otherwise, 0.

float engine.projection.getGamma()

Returns the current gamma correction value for projections.

Return value

Gamma correction value.

int engine.projection.getWidth()

Returns the number of projections set via video_width CLI option.

Return value

Number of projections.

void engine.projection.setGamma(float gamma)

Sets the gamma correction value for projections.

Arguments

  • float gamma - Gamma correction value.

void engine.projection.resetMesh(int num)

Resets the mesh for the specified projection.
Notice
Meshes are used for complex-shaped projection screens.

Arguments

  • int num - Projection number.

int engine.projection.restoreState(Stream stream)

Restores the state of the projections from a stream.

Arguments

  • Stream stream - Stream with saved state data of the projections.

Return value

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

int engine.projection.saveState(Stream stream)

Saves the state of the projections in a stream.

Arguments

  • Stream stream - Stream to save state data of the projections.

Return value

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

void engine.projection.setAngle(int angle)

Specifies the angle between projections, if there are more than one of them.

Arguments

  • int angle - Angles between surfaces on which the images are projected in degrees.

void engine.projection.setBorders(int num, Variable id)

Sets edge correction for the specified projection.

Arguments

  • int num - Projection number.
  • Variable id - Vector with correction values for four sides (left, right, top, bottom). The first value specifies area size (where 1 equals half of the screen) and the second power of blending.

void engine.projection.setColorBias(int num, vec4 bias)

Sets the color bias for the specified projection.

Arguments

  • int num - Projection number.
  • vec4 bias - Per-channel color bias.

void engine.projection.setColorScale(int num, vec4 scale)

Sets the color multiplier for the specified projection.

Arguments

  • int num - Projection number.
  • vec4 scale - Per-channel color scale.

void engine.projection.setEnabled(int num, int enable)

Enables the specified AppProjection projection for viewport rendering.

Arguments

  • int num - Projection number.
  • int enable - 1 to enable the projection for rendering; 0 to disable it.

void engine.projection.setLinearity(int num, Variable id)

Sets non-linear stretching ratio values for each side of the specified projection (left, right, top or bottom).

Arguments

  • int num - Projection number in range from 0 to the number of projections.
  • Variable id - Array with correction values for four sides.

void engine.projection.setMaterials(int num, string materials)

Sets postprocess materials to be applied to the specified projection.

Arguments

  • int num - Projection number.
  • string materials - Postprocess materials (comma-separated list).

void engine.projection.setModelview(int num, Mat4 modelview)

Sets the model-view matrix for the specified projection.

Arguments

  • int num - Projection number.
  • Mat4 modelview - Model-view matrix.

void engine.projection.setMultiplyImage(int num, Image image)

Sets the edge blending map for the specified projection.

Arguments

  • int num - Projection number.
  • Image image - Image with an edge blending map to be set.

void engine.projection.setMultiplyTexture(int num, Texture texture)

Sets the edge blending map for the specified projection.

Arguments

  • int num - Projection number.
  • Texture texture - Texture with an edge blending map to be set.

void engine.projection.setPluginEnabled(int enable)

Enables or disables the AppProjection plugin.
Notice
All distortions will be removed.

Arguments

  • int enable - 1 to enable the AppProjection plugin; 0 to disable it.

void engine.projection.setPrimary(int primary)

Specifies what projection to use as a primary one.

Arguments

  • int primary - Projection number.

void engine.projection.setProjection(int num, mat4 projection)

Sets the projection matrix for the specified projection.

Arguments

  • int num - Projection number.
  • mat4 projection - Projection matrix.

void engine.projection.setProjectorModelview(int num, Mat4 modelview)

Sets the projector's model-view matrix for the specified projection.

Arguments

  • int num - Projection number.
  • Mat4 modelview - Projector's model-view matrix.

void engine.projection.setProjectorProjection(int num, mat4 projection)

Sets the projector's projection matrix for the specified projection.

Arguments

  • int num - Projection number.
  • mat4 projection - Projector's projection matrix.

void engine.projection.setResolutionUpscale(float upscale)

Sets the resolution upscale factor.

Arguments

  • float upscale - Resolution upscale factor.

void engine.projection.setViewerModelview(int num, Mat4 modelview)

Sets the viewer's model-view matrix for the specified projection.

Arguments

  • int num - Projection number.
  • Mat4 modelview - Viewer's model-view matrix.

void engine.projection.setViewerProjection(int num, mat4 projection)

Sets the viewer's projection matrix for the specified projection.

Arguments

  • int num - Projection number.
  • mat4 projection - Viewer's projection matrix.

void engine.projection.setReflectionMask(int num, int mask)

Sets a bit mask for rendering reflections on the specified projection. Reflections are rendered in the viewport if masks of reflective materials match this one (one matching bit is enough).

Arguments

  • int num - Projection number.
  • int mask - Integer, each bit of which is a mask.

void engine.projection.setViewportMask(int num, int mask)

Sets a viewport bit mask for the specified projection. Object surfaces, materials, decals, lights and GUI objects will be rendered into this viewport only if their viewport mask matches this one (one matching bit is enough).

Arguments

  • int num - Projection number.
  • int mask - Integer, each bit of which is a mask.

void engine.projection.showSetupWindow()

Shows the setup window for the AppProjection plugin.
Last update: 2018-06-04
Build: ()