AR / VR Dual Monitors

Home Forums AR Sandbox Forum AR / VR Dual Monitors

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #102790

    I have an external monitor already and would love to be able to do what Oliver does in this youtube video titled AR/VR Sandbox:
    Where should the external monitor(or VR Set-up) be plugged in?
    Do I need to get a hdmi splitter?
    Or should I get a dvi cord that plugs into GE GTX graphics card?

    Alsos, once the external monitor is working, how do you put yourself into 1 to 1 scale on the external monitor?

    Any help is greatly appreciated! Thanks!

    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.


    Dang! Thanks Oliver

    If my external monitor only has hdmi or vga.. Could I use a hdmi splitter or a dvi to vga adaptor?

    Oliver Kreylos

    A splitter wouldn’t work, as you couldn’t show different images on the two displays. But check your graphics card. Many have more than one HDMI output.

    If not, HDMI, DVI, and DisplayPort are all compatible video signal-wise. You can easily get cheap DVI-to-HDMI adapters or even DVI-to-HDMI cables, and while I don’t have any DisplayPort-to-HDMI adapters myself, those should be cheap and easy as well.

    Don’t use VGA if you can at all avoid it. Analog video signals introduce too many problems.


    My Graphics card had only one HDMI. I purchased a DVI to HDMI adapter.
    I got it to work with these instructions! Thanks so much
    Oh, and I used this to find my names of the Projector and Monitor
    $ xrandr

    Hopefully one day I will get a Occulus Rift to try out. Would google cardboard work for the time being?

    • This reply was modified 4 years, 7 months ago by ryanwildevans.

    Could someone explain how to do a 1:1 scale view for VR Mode?

    Oliver Kreylos

    You can zoom in or out by holding the left mouse button and “z” and moving the mouse up or down, or by rolling the mouse wheel. But read the full instructions I linked in my initial reply. You can tell whether you’re at 1:1 scale by bringing up the scale bar (right click, select “Vrui System Menu”->”Show Scale Bar”. You can also change scale by clicking on the left or right ends of the scale bar.

    Before scaling, bring the 3D surface point to which you want to zoom into the center of the screen by panning and/or dollying, so that the white crosshairs touch it. Otherwise, it will move away from you as you zoom in.

    Vrui does not work with the commercial Oculus Rift, or with Google Cardboard. It works with the HTC Vive, or with the Oculus Rift DK2.


    Hi Oliver, I couldn’t make it work, first the two screens shows in the monitor at the same time (and nothing in the projector), then, after the names modifications, in none. I’m using DVI to the monitor, could that be the problem? please help me !! 🙂


    I have gotten all of this to work as it should as well as the lava, snow, etc scripts. Is there a script to change the way these things look in the 3D render on the monitor? Currently I only see water on the monitor no matter what substance on the sand. It’s a minor detail at this point but I was just wondering.

    Oliver Kreylos

    Unfortunately, I never got around to implementing that. If you want to see shader effects on the secondary display, you will have to disable water surface rendering by leaving -rws off SArndbox’s command line.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Comments are closed.