Developing in Unity 5.4 - I've found that physics calculations slow down relative to the frame rate, is this expected? There seems to be some other slowdown such as animation of texture sheets.
When using the Vive the framerate hiccups don't seem to mess with the physics but with Oculus things go all floaty when the framerate dips. Is there any way to prevent this or is it likely I'm doing something wrong?
Unity updates physics the same way for Rift and Vive. They occur at a fixed rate in simulation time. If your app is really performing poorly, we drop its framerate to 45Hz and use ASW to make it track at 90Hz. You can disable that with CTRL + Num 1 as a test.
You're correct, the app is dropping to 45 fps and when this happen the physics goes floaty. I've tried to disable ASW but not sure if I'm doing it correctly? Do I have to do CTRL + 1 (is it numpad1 or just 1?) in Oculus Home or in Unity? Is there any way to see that ASW is turned off? Should ASW affect physics in this way? When I throw an object up into the air if the framerate is at 45 fps it falls at half speed.
> Do I have to do CTRL + 1 (is it numpad1 or just 1?) in Oculus Home or in Unity?
CTRL + Numpad 1 should work from anywhere.
> Is there any way to see that ASW is turned off?
Not directly. It's being added for a future release. For now, you will have to keep a frame counter and infer that ASW is active when the frame rate is 45Hz.
> When I throw an object up into the air if the framerate is at 45 fps it falls at half speed.
Is this with a plain, non-kinematic Rigidbody? If so, it sounds like a bug in Unity. What is your fixed timestep size? If the rendering frame rate gets cut in half, Unity should run twice as many fixed updates (and physics updates) per render frame. So if you write a MonoBehaviour and implement the FixedUpdate function, it should run the same number of times per second.
Oops, that should read Time.maximumDeltaTime = Time.fixedDeltaTime * 2f; That way physics will know to integrate 22.2ms instead of 11.1. In theory, dropped frames shouldn't impact physics integration, but it may be in your case, which we would need to approach Unity about.
No difference on setting the timescale manually. Still getting slowdown physics. I'm running 5.4.1f1, could an update affect things? I'm pressing CTL + 1 but I'm not seeing any difference. Physics feels totally fine on Vive.
Thanks. I assume you are using Unity's "Oculus" VR device and not the OpenVR device. We'll take a look at the physics integration code and see what's causing this.