Это видео недоступно.
Сожалеем об этом.
Unity Physics Stress Tests (vs Havok, PhysX, Box2D)
HTML-код
- Опубликовано: 26 ноя 2020
- Unity currently has four Physics backends (Unity Physics, Havok Physics, PhysX, and Box2D). This is a simple stress test project to explore performance differences among the four. For this test, Unity Physics is the most performant and stable.
Github repo for this project is at github.com/Dra...
Demo Specs:
Intel Core i7-7700K @ 4.20GHz; NVIDIA GeForce GTX 1080
Unity 2020.1.14f1
You should stress test multiple joints chains to see which is more stable, it is much more important.
Including the Box2D simulation is incorrect for this scene. As particles cannot move in 3rd direction they are stuck more, and the number of collision contacts is higher.
Box2D is notoriously slow when using so many continuous col-det objects. Should only be used for selected bodies. Using discrete would be much better. Also, the 3D ones are far more spatially separated so reduces the potential contacts whereas the 2D ones all form a single contact island because they are restricted to 2D and inevitably all end up colliding and/or producing lots of contacts. This synthetic test is quite skewed in that regard. I’ll be sure to check out the project though!
Yes, all continuous, the total time includes the sprite renderers which are not as quick unless batched, Unity.Physics is also running in the background still despite having nothing to do it's consuming time (affects all tests), 2D objects are very much all in contact with each other unlike the 3D tests. These might be good for comparing 3D but need to all use same renderers and keep contact counts about the same otherwise 2D is just doing a lot more work. This is the problem with synthetic tests like these.
Tested PhysX with 5000 items and at any one time it was around 300-500 contacts. The same for 2D means they are nearly all touching so produces around 36,000 to 40,000 contacts which it's all trying to solve using continuous collision detection.
@@melvmay Hi Melv! Thanks for all the feedbacks! So for the 2 issues: a) Unity.Physics running in the background and b) Box2D producing tons of contacts.
For a), I did not know Unity Physics could be still consuming much resources when all the entities are destroyed. Is there any way to turn it off somehow?
For b), Yes you are right, when all the circles fall down, they are "clustering" on the bottom due to the nature of being 2D. I should've made a version of the 3D sphere test constrained in Z=0 plane just for comparison/fairness to 2D.
@@dragonground6823 With regards to 3D physics I'm not sure. I think there's a way to disable systems or groups but I cannot recall from the top of my head. Also DOTS stuff has changed so much recently that it's likely changed.
How did they program to change physics middleware!?
You can change between Havok and Unity Physics with a dropdown, and Unity's physX is used if you don't use entity subscenes
Thanks for making this! I tested it on my Ryzen 3900X with 12 cores and the performance is worse than yours. Isn't the whole point of DOTS to enable multicore scaling?
On the GPU
@@Dahoon no, CPU
Guys, that about use Bullet Physics library?
So, Unity physics is the best one?
doesn't unity use physX?
Unity DOTS Physics doesn't use PhysX.
That's a really poor result for Unity2D. Suggests using 3D is the better option for 10x the performance minimum.
Yes, perhaps the biggest shocker to me as well.
Yeah, also the lack of threaded queries for Box2D is also a downer. There is also the Unity Tiny DOTS 2D Physics which should be much more performant. But it's limited in features and platform availability right now. Hope that will make it into the default runtime in some form in the future.