[Unity3D]BoxCollider、SphereCollider、CapsuleCollider的性能对比

今天想到碰撞体,便随手查了一下性能,发现一篇不错的帖子就翻译过来了。以下是译文:


我决定放一些测试数据上来。
Well I decided to post some results from some testing.

所有测试均完成于INTEL二核的3GH处理器,无渲染部分,仅仅是物理部分。
All tests were done on an intel core2duo 3ghz imac with no rendering, just physics.

静态碰撞体几乎没有什么性能开销,高达6万多个不同的碰撞体对性能的影响在一帧之内(<3ms)几乎可以让人忽略不算。
Static colliders seem to have such a minimal impact on performance, Upto 60,000 and beyond of all different colliders were causing no noticable effect on the frame time (<3ms)

所以我尝试去测试动态碰撞体,这会更加有挑战性。
So I tried testing dynamic colliders instead, much more challenging.

要记住这只是物理部分,你的渲染部分的瓶颈只能达到2500个独立模型物体。
Remember this is just physics, your renderer would bottleneck way before reaching 2500 individual objects.


动态测试数据:

Dynamic Tests:
500 Colliders
Capsule 2.1ms
Box 2.6ms
Sphere 2ms

1000 Colliders
Capsule 5.6ms
Box 5.8ms
Sphere 2.9ms

1500 Colliders
Capsule 16.1ms
Box 20.5ms
Sphere 4.8ms

2500 Colliders
Capsule 453-481ms
Box 490-520ms
Sphere 190-233ms


看到了吧?通过这些数据,我们能发现,capsule collider性能要稍稍优越于 box collider ,但是sphere collider的性能明显要甩掉所有人九条街。
So there you have it, across the board capsule actually beats box but not by a huge amount, and sphere obviously kicks everyones ass.

原帖子地址:
http://forum.unity3d.com/threads/34254-Capsule-vs-Box-Colliders

转载自:
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值