Simple 3D demo but performance problem


i making a 3D demo for oculus Rift Dk2.

The demo is simple and contain :

1 Terrain with some relief.
1 plane
1 Prefab OVR player controller (prefab control for oculus rift).
20 Cubes (they are trampolines and we can jump from one to another).
There are 2 javascript script :

  • one for jump and test collision with cube
  • one that move randomly some cubes

Sometimes, when i launch the demo, the framerate is OK at constant 60 FPS
Sometimes, the framerate is 30 FPS with lag with no explanation. (no programs are running behind)

I try the target.framerate at 75 (best settings for oculus) but the demo stay a 60 Fps in the best case.

The 3D is absolutely not complex and my script don’t do a lot of things…

My PC specs are good :
i7 4770
16 Go Ram
GTX 780

Have you an idea ?

thanks !

Try setting the target framerate to -1.

Application.targetFrameRate = -1;

It will try to render the application as fast as possible. If that doesn’t work then make sure that vSync is off: Project Settings → Quality → VSync Count : Don’t sync. You can try that with targetFrameRate at either -1 or 60, whichever looks better.

Find it !

I build my 3D VR Demo with Unity 4.5.3 and 4.5.4 after an update.

It seems there’s a problem with these versions. I try with Unity 4.5.2, and the framerate is perfect !