带Wall插件的视频墙输出
您应该升级到
The Wall application is designed for rendering the Unigine world into the configurable number of windows. They can fit any display configuration and can be rendered both in the windowed and the full screen mode.Wall应用程序旨在将Unigine世界渲染到可配置数量的窗口中。 Wall监视器的数量不受限制。它们可以适合任何显示配置,并且可以在窗口模式和全屏模式下呈现。
The following display configurations are supported out of the box (only if monitors have identical resolutions):开箱即用地支持以下显示配置(仅当显示器具有相同的分辨率时):
- 1 monitor (1×1)1个显示器(1×1)
- 2 monitors in a column (1×2)一列中的2个监视器(1×2)
- 2 monitors in a row (2×1)连续2个监视器(2×1)
- 3 monitors in a row (3×1)连续3台显示器(3×1)
- 4 monitors in a row (4×1)连续4个监视器(4×1)
- 5 monitors in a row (5×1)连续5台显示器(5×1)
- 4 monitors (2×2)4台(2×2)
- 6 monitors (3×2)6台(3×2)
See Also也可以看看#
Launching Wall启动Wall#
In case you use one of these configurations, you only need to specify a plugin library (bin/plugins/Unigine/Surround/UnigineWall_*) with the usually required start-up arguments (such as rendering API, window size, etc.) in the launcher.如果您使用这些配置之一,则只需指定具有通常要求的插件库(bin/plugins/Unigine/Surround/UnigineWall_*)启动参数(例如渲染API,窗口大小等)在启动器中。
main_x64 -extern_plugin UnigineWall
- UNIGINE engine automatically detects the number of available monitors and if they fit any of the supported configurations, it automatically creates the appropriate number of windows with UNIGINE viewports.UNIGINE引擎自动检测可用监视器的数量,并且如果它们符合任何受支持的配置,它将自动使用UNIGINE视口自动创建适当数量的窗口。
- You can use 64-bit debug or release versions of the library. (The engine automatically loads the appropriate version of the library depending on the specified main application.)您可以使用该库的64位调试或发行版本。 (引擎会根据指定的主应用程序自动加载相应版本的库。)
It is not possible to use Wall with:不能将Wall用于:
- Multi-monitor plugins (Surround, Projection)多显示器插件(Surround, Projection)
- Panoramic rendering全景渲染
- Stereo 3D立体3D
2×2 configuration2×2配置
|
4×1 configuration4×1配置
|
How to Set the Number of Windows如何设置Windows数量#
If you want to set the number of Wall windows manually and use another supported configuration, you need to specify two specific start-up arguments in addition to the usually required ones:如果要手动设置Wall窗口的数量并使用其他受支持的配置,除了通常需要的参数外,还需要指定两个特定的启动参数:
- width — sets the number of monitors in a horizontal rowwidth —设置水平行中的监视器数
- height — sets the number of rows, i.e. how many monitors there are in a vertical columnheight —设置行数,即垂直列中有多少个监视器
For example, if you want to launch Wall in 6 windows (2 rows of monitors with 3 monitors in each row):例如,如果要在6个窗口中启动Wall(2行监视器,每行3个监视器):
main_x64 -width 3 -height 2 -extern_plugin UnigineWall
Do not forget to specify other required start-up arguments as well!不要忘记指定其他必填项启动参数也一样!
Customizing Wall自定义Wall#
Wall can be easily customized to support the desired configuration of monitors. You can create Wall that renders UNIGINE viewports into the arbitrary number of windows with custom viewing frustums (symmetric or asymmetric ones).可以轻松自定义Wall以支持所需的监视器配置。您可以创建Wall,以将UNIGINE视口渲染到任意数量的具有自定义查看视锥(对称或非对称视锥)的窗口中。
Wall CamerasWall相机#
Wall have one primary viewport, 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 model-view and projection matrices. Both the primary monitor and auxiliary ones can be enabled or disabled, if necessary.Wall具有一个主视口,而所有其他视口则呈现为辅助视口。默认情况下,主显示是用于单显示器配置的UNIGINE引擎视口。它使用引擎使用的Player矩阵查看场景。其他显示器是具有任意角度并面向所需方向的任意摄像机。每个显示器都有自己的模型视图和投影矩阵。如果需要,可以启用或禁用主监视器和辅助监视器。
- The primary display can be set to any monitor (for supported configurations it is already set).主要显示可以是放到任何监视器(对于支持的配置,已经设置)。
- Each display has its own model-view 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 (see the sample for more details).默认情况下,只有主要的一个具有接口(渲染系统GUI,编辑器小部件,线框或分析器)。但是,分开图形用户界面可以在所有监视器上绘制(请参阅样本更多细节)。
- All viewports have their own Viewport and Reflection mask to selectively render nodes and reflections from them.所有视口都有自己的视口反射遮罩可选择性地渲染节点和来自节点的反射。
Default Configurations默认配置#
For default configurations, the primary display is set to the following monitor:对于默认配置,主显示设置为以下监视器:
- For 1×1 configuration, the 1st (and only) display.对于1×1配置,显示第一个(也是唯一一个)。
- For 2×1 configuration, the 1st display.对于2×1配置,第一个显示。
- For 3×1 configuration, the 2nd display.对于3×1配置,第二个显示。
- For 4×1 configuration, the 2nd display.对于4×1配置,第二个显示。
- For 5×1 configuration, the 3rd display.对于5×1配置,则显示3。
- For 1×2 configuration, the 1st display in the column.对于1×2配置,该列中的第一个显示。
- For 2×2 configuration, the 1st display in the 1st row.对于2×2配置,第一行显示在第一行。
- For 3×2 configuration, the 2nd display in the 1st row.对于3×2配置,第二行显示在第一行。
How to Set Up Custom Cameras Configuration如何设置自定义相机配置#
Rendering of Wall viewports is controlled by wall.h script (located in <UnigineSDK>/data/core/scripts/system).Wall视口的渲染由wall.h脚本(位于<UnigineSDK>/data/core/scripts/system中)控制。
To implement a custom camera configuration, comment wall.h out in the unigine.usc system script and wrap your custom code around with #ifdef HAS_WALL ... #endif in the render() function of the system script.要实现自定义摄像机配置,请在unigine.usc系统脚本中注释掉wall.h,然后在系统脚本的render()函数中将您的自定义代码与#ifdef HAS_WALL ... #endif环绕在一起。
There are two possible setups depending on how the primary monitor is rendered. It can be drawn by:根据主要监视器的呈现方式,有两种可能的设置。可以通过以下方式得出:
- The default engine renderer (the same as when a usual one-window application is rendered).默认引擎渲染器(与呈现通常的单窗口应用程序时相同)。
- The Wall renderer itself (which is safer if you are going to use asymmetric frustum for the primary monitor and modify its modelview matrix).Wall渲染器本身(如果要对主监视器使用非对称视锥,并修改其模型视图矩阵,则更加安全)。
The following example demonstrates how to create a 3×1 monitor configuration and choose the renderer for the primary monitor.下面的示例演示如何创建3×1监视器配置以及如何为主监视器选择渲染器。
1. Using default engine renderer1.使用默认引擎渲染器#
The first variant is to render the primary monitor by the default engine renderer.第一种变体是通过默认引擎渲染器渲染主监视器。
-
In case the created configuration is not supported by default, set the primary monitor via Unigine::Plugins::Wall:setPrimary():如果默认情况下不支持创建的配置,请通过Unigine::Plugins::Wall:setPrimary()设置主监视器:
// The primary display is the 2nd one in a row and // it is positioned in the first line of monitors. Unigine::Plugins::Wall::get()->setPrimary(1, 0);
-
Enable all auxiliary monitors via Unigine::Plugins::Wall::setEnabled() (they are disabled by default). The primary one should be disabled, as it is drawn by the default engine renderer.通过Unigine::Plugins::Wall::setEnabled()启用所有辅助监视器(默认情况下禁用它们)。主菜单应被禁用,因为它是由默认引擎渲染器绘制的。
// Enable the 1st and the 3rd monitors in the first row. // The third argument of the function sets 'enabled' flag. Unigine::Plugins::Wall::get()->setEnabled(0, 0, 1); Unigine::Plugins::Wall::get()->setEnabled(2, 0, 1);
-
Set projection and model-view matrices for auxiliary monitors's cameras.设置辅助监视器的投影和模型视图矩阵。
// Settings for the 1st monitor CameraPtr camera0 = Wall::get()->getCamera(0, 0); camera0->setProjection(projection_0); camera0->setModelview(modelview_0); // Settings for the 3rd monitor CameraPtr camera2 = Wall::get()->getCamera(2, 0); camera2->setProjection(projection_2); camera2->setModelview(modelview_2);
2. Using Wall renderer2.使用Wall渲染器#
Another variant is to render the primary monitor by the Wall renderer. This variant can be used, for example, if you want to set up symmetric frustums for all monitors.另一个变体是通过Wall渲染器渲染主监视器。例如,如果要为所有监视器设置对称的视锥台,则可以使用此变体。
-
Disable rendering into the default UNIGINE viewport via Unigine::Render::setEnabled():通过Unigine::Render::setEnabled()禁用渲染到默认的UNIGINE视口:
Unigine::Render::setEnabled(0);
-
Enable all Wall monitors including the primary one. As a result, all three viewports will be rendered by Wall renderer itself:启用所有Wall监视器,包括主要的监视器。结果,所有三个视口将由Wall渲染器本身渲染:
// Enable all Wall monitors: Unigine::Plugins::Wall::get()->setEnabled(0, 0, 1); Unigine::Plugins::Wall::get()->setEnabled(1, 0, 1); Unigine::Plugins::Wall::get()->setEnabled(2, 0, 1);
-
Set model-view and projection matrices for all three monitors' cameras.设置所有三个监视器的模型视图和投影矩阵。
// Settings for the 1st monitor Unigine::Plugins::Wall::get()->setProjection(0, 0, projection_0); Unigine::Plugins::Wall::get()->setModelview(0, 0, modelview_0); // Settings for the 2nd (primary) monitor Unigine::Plugins::Wall::get()->setProjection(1, 0, projection_1); Unigine::Plugins::Wall::get()->setModelview(1, 0, modelview_1); // Settings for the 3rd monitor Unigine::Plugins::Wall::get()->setProjection(2, 0, projection_2); Unigine::Plugins::Wall::get()->setModelview(2, 0, modelview_2);