Reply To: AR / VR Dual Monitors

Home Forums AR Sandbox Forum AR / VR Dual Monitors Reply To: AR / VR Dual Monitors

Oliver Kreylos

SARndbox version 2.0 and later have support for multiple monitors. Each display (projector, TV, monitor, …) must be connected to the host computer’s graphics card via its own display connector. For example, a projector is usually connected via an HDMI port, whereas a monitor may be connected via DisplayPort or DVI. It depends on the exact graphics card model and which plugs are used which of the two displays is considered the primary and which the secondary, but it doesn’t matter for the AR Sandbox. Worst case, the BIOS boot screen and the desktop’s login prompt may show up on the projector instead of the monitor.

After plugging in both displays and logging into a desktop session, open nvidia-settings either from a command line or by clicking the icon in the settings panel. Go to the “X Server Display Configuration” panel and look for your two displays in the “Layout” diagram. Depending on the phase of the moon, one of your displays might be disabled. To enable it, click on it or select its name from the drop-down menu below the layout diagram, and select “TwinView” or “X Screen 0” from the “Configuration” drop-down menu. Then check that the resolutions of both displays match their native resolutions (for example, 1024×768 for the projector and 1920×1080 for the monitor), drag the display boxes in the Layout diagram so that they are next to each other (ideally projector on the right), select the “Make this the primary display” check box for your monitor, and click on the “Apply” button. The screens will go dark momentarily, and then a confirmation dialog should appear on your monitor. You have 15 seconds to confirm the change before the monitor setup reverts to the initial state.

You should now have an extended desktop, with most icons and windows showing on your monitor, and the mouse cursor should move from the monitor to the projector when you move the mouse past the monitor’s right edge. This is the ideal setup for AR Sandbox multi-mode rendering.

In the AR Sandbox software, multi-mode rendering is enabled by telling Vrui to open multiple display windows, sending each window to its appropriate display, and telling SARndbox to display different content to each window.

The easiest way to set this up is to create a SARndbox-specific patch configuration file, as explained in AR Sandbox post-installation setup. To open a second window, insert the following in the “Desktop” section:

section Vrui
    section Desktop
        windowNames += (Window2)
        section Window2
            windowSize (800, 600)
            windowType Mono
            screenName Screen
            viewerName Viewer

Then run SARndbox with the following command line:

cd ~/src/SARndbox-2.3
./bin/SARndbox -uhm -fpv -wi 1 -uhm -uhs -rws

The “-wi 1” parameter tells SARndbox that the following rendering settings apply to the window with index 1 (the secondary). This will open two windows, and render the calibrated fixed-projector view in the first, and a free 3D view with dynamic hill shading and water rendered as a geometric 3D surface in the second.

The two windows will probably appear on the same display, and usually on the wrong one. To fix this, edit the patch configuration file again. If the Desktop section doesn’t already contain a “section Window”, create that now. Then insert into that section
outputName Foo
and run the sandbox again, appending -vruiVerbose to the command line:
./bin/SARndbox -uhm -fpv -wi 1 -uhm -uhs -rws -vruiVerbose

This will print a bunch of output to the terminal. Look for the section talking about display names. It should list two displays, with two names for each: a connector name such as HDMI-0 or DFP-1, and a display name such as “BenQ MX631ST.” You can use either one to configure the sandbox.

Go back to the configuration file, and set the appropriate output names in both window sections (Window and Window2). Send Window to your projector, and Window2 to your monitor. Run SARndbox again as before, and the windows should show up correctly.

The secondary window (on your monitor) has a navigable 3D view. You can rotate, pan, dolly, and zoom the view to get views from arbitrary points of view at arbitrary scales. See Using Vrui Applications in Vrui’s HTML documentation on how to navigate using the mouse.

You can show or hide a scale bar via Vrui’s system menu (right mouse button), or save views that you like to reload them at a later time, through the system menu’s “View” submenu.

Comments are closed.