Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by cymaticorporation · Apr 01, 2016 at 06:30 AM · vrvirtualvirtual functions

VRSettings.supportedDevices not populating if None is the first SDK.

Using --- Unity3D 5.4.0.b10

  1. What happened

When you add all of the "Virtual Reality SDKs"

   Split,
   OpenVR
   Stereo
   Oculus
   None

If you have "None" at the very top of the list, VRSettings.supportedDevices is Null and will not populate with the list of devices.

where supportedDevices is a public var String[] array.

I figured that because it was looping through the list and looking for available devices to connect to, that maybe it was disabling VR entirely and thus not updating, but setting VRSettings.enabled = true; didn't seem to help either.

only way supportedDevices is populated, is if you change None, to a different entry (other than the first).

  1. How we can reproduce it using the example you attached

    (using Javascript)

       static var myDevice : String[];
         function Start() {
          
          myDevice = VR.VRSettings.supportedDevices;
         
          for (var i = 0; i < 4; i++) {
           Debug.Log(myDevice[i]);
          }
         
         }
    
    

I submitted this as a bug, just in case someone else is having a similar issue, just changing 'None' to any entry other than the 1st should resolve this. then if you need for the initial device to be None at startup,

 function Start() {
   VR.VRSettings.loadedDevice = VR.VRDeviceType.None;
 }
 

Also...

if the 1st (player setting) VR SDK is "None", the VRSettings.enabled will not enable.

if the 1st (player setting) VR SDK is "None", and deviceLoaded is changed to Split,
VRSettings.enable will not enable outside of a function.
VRSettings.enable will not enable in Start()
VRSettings.enable does enable in Update() but only after the 2nd Update() call.

Also, if you are in Editor and not in a build, and Stereo is before any other SDK entry,
it will not work, and stops looking for a new device to fall back on. In that event...
VRSettings.enable will not enable in any function.

If you get 2 Gray screens in split mode, (or a gray and a black screen),
try turning off --- "Single-Pass Stereo Rendering"

If you set VR.VRSettings.loadedDevice = VR.VRDeviceType.Split; or presumably
any other device, while VR.VRSettings.enabled = false; when it is enabled again,
it will cause the screen to flicker in split screen, and then resets back to the single screen.

Make sure you enable the VRSettings
before you change the device.

also, take note that there is a delay when enabling the VRSettings, i measured it
at about 3 onGUI calls, before it enables... then, it is safe to set the device.

For testing, I used this (javascript) :

 #pragma strict
 static var T_V : boolean = false;
 static var T_V2 : boolean = false;
 static var T_V3 : boolean = false;
 
 //VR.VRSettings.enabled = true;
 Debug.Log("- Init - VR Active? " + VR.VRSettings.enabled);
 
 function Start () {
 VR.VRSettings.enabled = true;
 Debug.Log("- Start - VR Active? " + VR.VRSettings.enabled);
 }
 
 function Update () {
 //VR.VRSettings.enabled = true;
 //Debug.Log("- Update- VR Active? " + VR.VRSettings.enabled);
 }
 
 function OnGUI() {
   T_V = GUI.Toggle(Rect(50, 50, 50, 50), T_V,"VR1"); 
   T_V2 = GUI.Toggle(Rect(150, 50, 50, 50), T_V2,"VR2"); 
   T_V3 = GUI.Toggle(Rect(250, 50, 50, 50), T_V3,"VR OFF"); 
 
  if (T_V) {
   //VR.VRSettings.showDeviceView = true;
   
   VR.VRSettings.enabled = false;
   VR.VRSettings.loadedDevice = VR.VRDeviceType.Split;
   VR.VRSettings.enabled = true;
   
   Debug.Log("-  VR1 - VR Active? " + VR.VRSettings.enabled);
   T_V = false;
  } 
  
  if (T_V2) {
   //VR.VRSettings.showDeviceView = true;
 
   VR.VRSettings.enabled = true;
   VR.VRSettings.loadedDevice = VR.VRDeviceType.Split;
 
   Debug.Log("- VR2 - VR Active? " + VR.VRSettings.enabled);
   T_V2 = false;
  }
 
  if (T_V3) {
   VR.VRSettings.loadedDevice = VR.VRDeviceType.None;
   T_V3 = false;
  }
  
  }

In the event you have an older graphics card / older VR software, and VR doesn't seem to be working in your Build, try running your program in dx9 with a preset vrmode:

 vrProgram.exe -force-d3d9 -vrmode Split
 vrProgram.exe -force-d3d9 -vrmode Stereo
 vrProgram.exe -force-d3d9 -vrmode Oculus
 vrProgram.exe -force-d3d9 -vrmode OpenVR

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

pre-prepare video in scene before its needed 0 Answers

How to use Left and Right camera feed from a stereoscopic camera? 0 Answers

user input 1 Answer

Double Screen Camera (VR , Cardboard vision) Same Camera Side by Side 0 Answers

How to stop seeing through a wall in VR? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges