Customizing AppSurround

AppSurround can be customized to support any custom viewing frustums (symmetric or asymmetric ones) when rendering onto three monitors.

Notice

To prevent modifying camera settings from system script, specify the
-extern_define "PROJECTION_USER" definition in the project's launcher.

AppSurround Cameras

AppSurround have one primary viewport in the center, while all others are rendered as auxiliary ones. By default, the primary display is the Unigine engine viewport used for one-monitor configuration. It uses matrices of the Player used by the engine to view the scene. Other displays are arbitrary cameras with any perspective and facing whatever direction needed. Each display has its own modelview and projection matrices. Both the primary monitor and auxiliary ones can be enabled or disabled, if necessary.

The central monitor is a primary one. Two side monitor are auxiliary monitors that can be arbitrary cameras with any perspective and facing whatever direction needed.

Each display, including the primary one, has its own modelview and projection matrices.

By default, only a primary one has an interface (render system GUI, editor widgets, wireframe, or the profiler). However, separate GUIs can be drawn on all monitors.

All viewports have their own viewport and reflection mask to selectively render nodes and reflections from them.

How to Customize Cameras Configuration

Just like in case with AppWall, rendering of AppSurround viewports is controlled by wall.h script (found in <UnigineSDK>/data/core/scripts/system).

To implement a custom camera configuration, comment the wall.h out in the unigine.cpp system script and wrap your custom code around with
#ifdef HAS_APP_SURROUND ... #endif in the
render() function of the system script:

There are two possible setups depending on how the central monitor is rendered. It can be drawn by:

The default engine renderer (the same as when a usual one-monitor application is rendered).

The AppSurround renderer itself (which is safer if you are going to use asymmetric frustum for the central monitor and modify its modelview matrix).

Notice

Only one of two renderers should be enabled at the same time.

The following example demonstrates how to tweak cameras configuration and choose the renderer for the central monitor.

1. Using default engine renderer

The first variant is to render the central (primary) monitor by the default engine renderer.

Enable two side (auxiliary) monitors via engine.surround.setEnabled(). All AppSurround monitors are disabled by default. The central one should be disabled, as it is drawn by the default engine renderer.

Source code (UnigineScript)

// Enable the 1-st and the 3-rd monitors.
// The third argument of the function sets the "enabled" flag.
engine.surround.setEnabled(0,1);
engine.surround.setEnabled(2,1);