Hi all,
Due to the need to maintain two separate physics simulations (planet vs stellar), I delved into multiscene physics. Unity - Manual: Multi-scene physics
The feature is excellent and behaves exactly as expected.
I’ve noticed that the total cost of using two physics scenes is higher than using a single scene with proper layer-based separation. From what I can tell, this seems to be because each physics scene is simulated sequentially.
e.g.: two physics scenes processed within a single frame
Is there any information from the Unity team @alexrvn on whether parallelizing independent physics scenes (e.g. running them concurrently on separate cores) is planned or even technically feasible within the current architecture?
Cheers,
Shaun
Hello!
So it is something we’ve been looking at in recent times especially with all the internal changes we’ve been doing to GameObject physics. Tho nothing is planned in terms of exposing a version of Physics.Simulate that returns a JobHandle.
Cheers,
Alex
That would be a pretty amazing feature.
With two separate physics scenes I am seeing ~1.7ms of frame time. With a single physics scene it is faster, coming in at ~1.2ms. I’m in an optimization phase where every fraction of a millisecond counts.
For this reason, I added a switch to toggle between multiscene physics and single scene physics. I can pass it via command line argument for benchmarking outside of the editor.
If you ever need benchmarking of these two scenarios with a fully realized game, please don’t hesitate to reach out.