TomorrowTodayLabs / NewtonVR

A virtual reality interaction system for unity based on physics.
MIT License
787 stars 196 forks source link

Framerate-independent jitter when played from editor. #146

Open EUGD opened 7 years ago

EUGD commented 7 years ago

I think it's to do with tracked objects pose update rate, but I can't figure exactly how. There are multiple SteamVR_UpdatePoses running in the example scene, which seems like a bad idea, but disabling/removing all but one doesn't resolve it. There are also three cameras running in the scene, again seems like a bad idea and maybe related. These duplicate objects resolved themselves (still two cameras, Head and UI Camera) after changing editor versions a few times, but the jitter itself persists.

Edit: I should make it clearer, this is only when being run from the Editor. Building the scene and running from the game .exe works just fine.

Edit2: Discovered that the jitter seems to stop when the editor Game View is docked and maximized. I can toggle it on and off at will by maximizing/minimizing the Game View. The jitter persists if it's a detached window, even if maximized.

EUGD commented 7 years ago

Just discovered it's being caused by CollisionSoundController, simply being active in the scene. Really bizarre.

SmartCarrion commented 7 years ago

I think you are seeing performance related jitter. Having the editor scene view open takes a lot of resources, so covering that up gives you back a lot of performance. that is what happens when you 'maximize the game view'. Newton doesn't do well when performance drops below 90fps because of conflicts between fixedupdate and update.

EUGD commented 7 years ago

It's not an underspec PC (980ti, i7, 16GB RAM), profiler is reporting consistent 100+ FPS (nearer to 250), and it is reproducible in any scene (regardless of complexity) just by dropping in the CollisionSoundController manager. I am seeing it on a test scene Profiler is reporting near-1000 FPS on.

Unless there is some extremely specific bottleneck happening, I really don't think it's just a local performance problem.

zite commented 7 years ago

Thanks for the report EUGD. I've seen the editor take up weird resources in 5.5+. Can you try hitting the "maximize on play" button in the game view and see if that fixes the issue?