Optimizing Performance in iOS Part2:Optimizing Physics Performance

Optimizing Physics Performance

Unity has the next-generation NVIDIA PhysX physics engine built-in. This allows for unique emergent behaviour. But you should not forget that iOS is an OS designed for mobile devices and has its own performance limits which can be very easily reached. The following are high level tips for how to tune physics to get optimal performance on the iOS:

  • Keep Fixed Timestep in Time manager high enough to save cpu cycles, but still low enough to run physics smoothly.
  • Set Maximum Allowed Timestep in Time manager to 8-10fps to cap the time spent on physics in the worst case scenario.
  • Use colliders with great care. Some of them (like mesh collider) are very expensive while some (like sphere collider) are quite cheap. This list enumerates colliders in order of growing performance penalty:
    • Sphere collider (cheap)
    • Box collider
    • Capsule collider
    • Mesh collider
    • Wheel collider (expensive)

The total amount of physics calculations depends on the number of non-sleeping rigid bodies and colliders in the scene and the complexity of the colliders. Try to minimize these numbers and track what impact it has on physics calculation time. Track these statistics with internal profiler.

转载于:https://www.cnblogs.com/pengyingh/articles/2340834.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值