Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins

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
		

void engine.projection.clear ()

Sets the default values for options of each display (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.getHandles (int num, Variable id)

Gets positions of handles for the specified projection.

Arguments

  • int num - Projection number in range from 0 to the number of projections.
  • Variable id - Vector with position values for four corners' handles (top-left, top-right, bottom-left and bottom-right).

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.

void engine.projection.getModelview (int num)

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

Arguments

  • int num - Projection number.

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

Gets positions of corners for the specified projection.

Arguments

  • int num - Projection number in range from 0 to the number of projections.
  • Variable id - Vector with position values for four corners (top-left, top-right, bottom-left and bottom-right).

int engine.projection.getPrimary ()

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

Return value

Projection number.

void engine.projection.getProjection (int num)

Gets the current projection matrix used for the specified projection.

Arguments

  • int num - Projection number.

int engine.projection.getWidth ()

Returns the number of projections set via video_width CLI option.

Return value

Number of projections.

int engine.projection.isEnabled (int num)

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

Arguments

  • int num - Projection number.

Return value

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

int engine.projection.restoreState (Stream stream)

Restores the state of the displays from a stream.

Arguments

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

Return value

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

int engine.projection.saveState (Stream stream)

Saves the state of the displays in a stream.

Arguments

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

Return value

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

void engine.projection.setAngle (int angle)

Specifies 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.setGamma (float gamma)

Sets the gamma correction value for projections.

Arguments

  • float gamma - Gamma correction value.

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

Sets positions of handles for the specified projection.

Arguments

  • int num - Projection number.
  • Variable id - Vector with position values for four corners' handles (top-left, top-right, bottom-left and bottom-right).

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.setPoints (int num, Variable id)

Sets positions of corners for the specified projection.

Arguments

  • int num - Projection number.
  • Variable id - Vector with position values for four corners (top-left, top-right, bottom-left and bottom-right).

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.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.
Last update: 2017-07-03