Unite'14 Seattle: PhysX 3 in Unity 5.0

23
PhysX3 in Unity 5.0 Anthony Yakovlev Unity Technologies

Transcript of Unite'14 Seattle: PhysX 3 in Unity 5.0

PhysX3 in Unity 5.0Anthony Yakovlev Unity Technologies

AGENDA• Intro • Rigidbody component overview • Cloth overview • WheelCollider overview • The last slide

PhysX 3.3 brings us• SDK rewrite • Cleaner, better codebase • New subsystems: Vehicles, Cloth • Improved multithreading • (Some) compatibility issues

Rigidbody component• Adaptive force is disabled by default

8

Static,  dynamic  and  kinematic  bodies

Bodies• Static & kinematic bodies • primitive colliders • any mesh collider

• Dynamic bodies • primitive colliders • CONVEX mesh colliders

Static bodies• Moving static colliders is now basically free • has been one of the most often causes of

performance issues • static bodies are still cheaper than others

Triggers• Adding trigger restricts colliders: • primitive colliders • convex mesh colliders • e.g. no TerrainCollider

More about Rigidbody

•CCD  skeletons  are  generated  by  the  SDK  automatically  •no  64k  limitation  on  bodies  on  the  broadphase  on  desktop  targets

MeshCollider•scaling mesh colliders is basically free

SCALE by Steve Swink

Cloth

15

• Comes in place of SkinnedCloth & InteractiveCloth • Multithreaded • Designed with character clothing in mind

Cloth• Decoupled from the main physics update • Needs to register colliders cloth would react on • SphereCollider • CapsuleCollider • “conic capsule”

• Does not apply the forces back

17

WheelCollider• Powered by the all-new PhysX Vehicles SDK • Tyre forces now work! • Input real world data • New gizmo

18

Performance• Core SDK is organised in tasks • helps on multicore devices • especially on modern desktops

• Android NEON instruction set is supported • GPU cloth support is coming in 5.x • PhysX3 has faster algorithms: pruners, sleeping, queries !• http://physxinfo.com/news/11297/the-evolution-of-

physx-sdk-performance-wise/20

Performance insights• PhysX3 is 2x faster than PhysX2 on average • We’ve seen up to 10x performance boost for some cases

Stacks Spheres  vs.  mesh

Summary• Unity 5.0 physics is 2x faster than Unity 4.x • Multicore CPUs are now welcome • Unity 5.0 features fixes for long standing issues • The new WheelCollider can be used to simulate real-world

vehicles • The new Cloth component is designed with character

clothing in mind • PhysX3 is not 100% compatible with PhysX2, some tuning

might be required to get your old projects running

22

THANKS  FOR  COMING!

Anthony  Yakovlev  [email protected]  @AnthonyYakovlev

CATCH  ME  @  HANDS-­‐ON  LAB  AREA