Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Pzenarch's avatar
Pzenarch
Honored Guest
12 years ago

Black background behind Oculus output

I'm using OVRManager.display.SetViewpoint in order to faciliate multi-monitor display (oculus rendering on the one side, monitor output rendering on the other), and it's working fine in Unity's OpenGL mode ... but using DX11 the Oculus viewport forces itself on top (which is fine) with a black background (which isn't). This black background covers the entire screen, not just the viewport, and it prevents any output being presented for the second screen (which is currently being done with 'GUI.DrawTexture').

I get the same behaviour in the unity editor up until I resize the 'Game' window while the game is running. After resizing it, the black background disappears. Once the background has gone (due to resizing), it doesn't reappear upon restarting the game.

Any idea how I can get this black background to disappear, or render a texture above it while using the DirectX rendering mode?

2 Replies

Replies have been turned off for this discussion
  • Sorry, but there's no way to make D3D11 clear a sub-rectangle if the render target. OVRDisplay.SetViewport is not really meant for clients to use. To render an additional viewport today, you'll have to either run multiple instances of your application with networking/shared memory or write a complicated rendering plugin that copies your texture to another window. Or you could use our 0.2.5c SDK and use Camera.rect. However, that will have several big drawbacks: (1) judder and/or tearing due to the different frequencies of the DK2 and your main monitor, (2) lower performance/quality due to lack of SDK distortion, and (3) requires your users to disable the Oculus service before launching.

    We've noticed that the main monitors often go black when running Unity apps in extended mode. We are still working on a fix, but this shouldn't occur in direct display mode. You can set that in the Oculus Configuration Utility. Alternatively, you could build your app for D3D9 by unchecking the "Use Direct3D 11" box in Player Settings.

    In the future, Unity will directly support VR and you may be able to control what shows up on the main monitor.
  • Thank you for the fast and detailed answer.

    Not what I was hoping I have to admit, but given that this is a fringe case with in-progress software, not unreasonable.