Forum Discussion

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

Upgrading Gear VR game from Unity 4 to Unity 5

Hello!

We're just finally getting around to upgrading our Gear VR game from Unity 4 to Unity 5 and I have some power management questions. I've been looking for upgrade documentation, but I haven't been able to find mention of how to deal with these changes.

In Unity 4 we needed to subscribe to the OVRManager.OnConfigureVrModeParms event to make the OVR_VrModeParms_SetAllowPowerSave(true) and OVR_TW_SetMinimumVsyncs(VSYNC_60FPS) calls through a [DllImport("OculusPlugin")].

How do we do this in Unity 5? Or are these now the default settings, so we no longer have anything to worry about? I noticed that the latest Power Management documentation mentions:

For Unity, you may enable or disable power save mode handling via OVR_VrModeParms_SetAllowPowerSave(). See Moonlight/OVRModeParms.cs for further details.
...But, though I can get powerSaving state, I cannot set it. (It seems like the documentation needs some clarification.)

As a side note, it seems that setting the CPU and GPU levels has been simplified through the OVRPlugin class. I assume that we no longer need to OVRPluginEvent.Issue(RenderEventType.ResetVrModeParms) when we change our CPU and GPU levels through the new OVRPlugin.cpuLevel and OVRPlugin.gpuLevel properties.

Thanks in advance!

Allen

2 Replies

Replies have been turned off for this discussion
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    In Unity 5, we do the equivalent OVR_VrModeParms_SetAllowPowerSave(true) and OVR_TW_SetMinimumVsyncs(VSYNC_60FPS) inside of Unity for you. Disabling power save and using VSYNC_30FPS and VSYNC_20FPS are not yet supported with U5. You no longer need to issue the ResetVrModeParms event at all or even use OVRPluginEvent.cs anymore.

    Although OVRPlugin.cpuLevel and gpuLevel work today, they are not officially supported and may break in the future. We will probably end up replacing them with equivalent properties in OVRManager (similar to OVRManager.batteryLevel|Temperature|Status), so the upgrade shouldn't be difficult.
  • Thanks for the quick reply and details! This sounds like it will work perfect for us, since those defaults are what we had been using previously anyway.