Skip to main content
Up and Coming
August 13, 2014

Gray Display in Unity (Mac)

I have 2 projects where I am integrating the new SDK. Both had previous version of the SDK in them, which I have deleted (OVR and Plugins folders and the camera prefab which is all I used from the SDK in the scene). Using the 0.4.1 SDK on Mac I'm seeing the following when I import and then toss the camera prefab into my scene where it used to be.

Project #1
* If I don't turn off my 2d camera then I see that (in the past the OVR camera would take over so this wasn't needed)
* If I turn off or delete my 2d camera I get a gray screen. Selecting the OVRCameraController shows the same just flat gray in the preview so I presume I'm seeing that camera as I should, it's just that camera isn't getting the 2 eye cams...
* Selecting either eye shows the proper preview for each, implying that they are working fine, but not getting combined for the final output (hence the gray screen)

Project #2
* Doesn't have a 2d camera to disable or delete (purely a VR experiment)
* Sometimes I get the same gray screen (usually after trying the other project, which makes me guess it's somehow in the Oculus service/drivers/etc. rather than just unity since it will persist between launches of Unity and projects)
* One time I got the left eye working and the right eye got stuck displaying the health and safety dialog... can't reproduce
* Sometimes it works fine (mostly this)
* Sometimes when I get the gray screen if I turn the rift off and then back on it will being working (seems to be about 50% of the time I can fix it like this. This off/on approach has no effect on project 1)

Any thoughts? I've rebooted and replugged things etc. Didn't have issues in windows under 0.4.0 with a proper configuration (mirroring, etc.). Even when I get gray the demo scene in the config util works fine. It doesn't matter what screen the game view is on in unity so it doesn't appear to be hardware or Unity, or other drivers, seems localized to the Oculus mac SDK under some peculiar configuration in Project 1, which I have yet to figure out. Does the layer of the OVRCameraController play some roll by any chance?
    This topic has been closed for replies.

    23 replies

    New Participant
    September 26, 2014
    I see that there are a few different issues that seem to have been posted here, but I thought this still seemed to be the post that people were looking at for both. First off, I am running this on a MBP with 10.9.4. I am also running the latest version of unity pro as of now 4.5.4f1. I just got a dk1 from work to create a POC in unity and I used the bootcamp project to just test it out in. I loaded the project, removed the soldier, brought in the OVRPlayerController prefab and upon pressing play, I would see just a screen fading from black to dark gray in the Game window. In the OVRCameraController, if I selected the left or right camera, I would see a valid preview in each but the OVRCameraController would just show what I was seeing in the Game Panel...dark gray. I tried a few other projects and was getting the same thing.

    I went back to the bootcamp project and noticed that when the project is running, if I select the OVRCameraController in the Hierarchy, In the inspector there is Camera object that has its "Culling Mask" set to "Nothing". When I switch that to everything, it works as expected. The issue is that when I stop the game, that option disappears. Going to go see if I can see anything in the scripts, but I just wanted to post here in case it shed some more light on the issue.

    Dan

    ------ EDIT ------
    I'm not sure if the above stated is necessarily correct, however if it is a solution for anyone you can change the value in OVRCameraController's Start method of camera.cullingMask form 0 to -1. This will force "Everything" to display. With this said, there is also a comment above the code block that states "HACK: Use camera to force rendering of the left and right eyes." Because of this comment I am now wondering if this is really just a visual workaround for another issue. Will post back should I find anything else out.
    New Participant
    October 2, 2014
    Also having this issue, or what appears to be the same issue. To clarify, playing once works successfully. Any subsequent times fail to update the display. If It is set to "Maximize on Play," it will never maximize or display the scene view if it is in a tab. If it the scene view is visible (either detached or docked), it will simply never update.

    This is currently making it near impossible to work with. We are using SDK 4.2. This issue was not present in the 3.2 SDK.
    New Participant
    October 30, 2014
    Not sure if this will help, but I was suffering the same grey screen issue as described which was driving me nuts.

    My setup was different in that I have combined the DK2 with Leap and was getting consistency issues.

    I'm working on a Mac which has its own set of issues, but this grey screen issue when dragging the game view to the OR view was happening.

    After a lot of trial and error I noticed that the prefab LeapPassthroughOVRPlayerController > OVRCameraController > CameraLeft > 'HandController' was in red. So I deleted out the HandController and added the base one from the project.

    The project then worked. Though I find that consistency issues still occur, so by resetting the layout to default then reboot Unity fixes the issue.

    So do check your assets in your hierarchy to ensure all of your components are working correctly, if not then remove them and replace with base prefabs.

    Edit: After further testing last night, I can confirm that by resetting the Unity Layout to default, then drag the game view (don't hit play yet) to the Rift screens and keep in windowed mode. Then hit play, you should get the live feed back. Then expand view to full screen while play is active.

    You should then be able to stop play and then hit play again for the view to feed through to the Rift.