Skip to main content
Up and Coming
August 2, 2014

Changing Rift viewport and rendering cameras after the Rift

Our project has a requirement that we display content in the Rift, and different content to one or more additional displays connected to the same PC.

For previous versions of our project built with the older SDKs (0.2 and 0.3), we achieved this by creating a very large Unity player (eg, 1920x1080, for a 1080p viewport above the 1280x800 DK1 viewport). We used a script to reposition the draw rect for the left and right eye cameras, and our 3rd … nth cameras, and to make the window chromeless (“borderless fullscreen”).

The new DK2 0.40 SDK presents some problems for us -- it seems that we can’t easily resize/move the OVR eye ports around in the window or draw additional cameras. The OVRCameraController seems to cover any additional camera draw rectangles with a black mask. This is not ideal. Anyone have any thoughts on overcoming this limitation?
    This topic has been closed for replies.

    23 replies

    Up and Coming
    August 19, 2014
    We too have several demos and applications that require the Oculus Rift to be used along with several normal screens/cameras. I'm trying to integrate the DK2 into them but this is proving difficult. I've seen the suggestions on this thread, they seem very complex for what was so simple before. I would be very appreciative if the team looked into adding this functionality to the SDK.

    If I manage to get anything to work I'll share it on here in the meantime :)

    EDIT:
    In the end, I just used the old SDK (0.3.2), but got make sure you pause the oculus service in the config utility otherwise it will crash
    Up and Coming
    November 20, 2014
    Any updates to this in the latest Oculus Unity integration?
    New Participant
    March 10, 2015
    "Ttakala" wrote:
    We face similar problems as already described in this thread: We have created a VR toolkit for Unity, where the developer can configure various multi-display setups with any number of displays, by rendering all the display viewports side-by-side, resulting in a wide game window (Unity application, windowed-mode). With the Oculus Rift this scheme has worked when the Rift's display has extended the desktop, and the Unity game window has been moved by the user to the correct location in the desktop. With the current DK2 SDK it seems that there is no elegant way to do this. Writing native plugins is out of the question, because that would just complicate the developers' understanding how our multi-display scheme works in our VR toolkit (which also supports both Windows and OSX).

    For the next version of Oculus SDK, please consider our following requests, which only need to apply when DK2's display uses "Extended Mode":

    1. In the Update() method of OVRCameraController.cs you have the following invocation: OVR_SetViewport(0, 0, 1920, 1080). Please modify this to something like OVR_SetViewport(x, y, w, h), where the x, y, w, and h are public variables that can be modified from external C# scripts (we would prefer not to hack any of your OVR scripts, as each transition to a new Oculus SDK would require re-introducing the hacks). Also it seems that altering the first two arguments (x and y) do not have any effect currently, so please fix this so that we have full control of where to render the viewport in Unity's render window.

    2. Limit the region where the black mask is drawn (or screen is cleared), so that the areas around the viewport (defined with OVR_SetViewport(x, y, w, h)) are not affected. Currently our multi-display test configuration with Oculus DK2 and a 2D display is rendered incorrectly like this:


    We have a standard Unity camera rendering on the right side (which is incorrectly black in the above image), and therefore we should be getting this:


    So something in OVR code clears or masks the Unity framebuffer, and no matter what Camera.depth we set, the situation is not fixed.

    Interestingly, if I resize Unity's game window while its playing, the camera viewport on the right side comes through for every other frame or so.


    I have the same issue with 0.4.4. Can anyone help me?