1 / 34

HavokFX

HavokFX. Next Gen Physics on ATI GPUs. Andrew Bowell – Senior Engineer Peter Kipfer – Senior Engineer. Why use physics in games?. A brief history of the Havok SDK Havok 1 Large feature set; rigid bodies, cloth, rope, soft bodies, water, particles Havok 2

chaney
Download Presentation

HavokFX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HavokFX Next Gen Physics on ATI GPUs Andrew Bowell – Senior Engineer Peter Kipfer – Senior Engineer

  2. Why use physics in games? • A brief history of the Havok SDK • Havok 1 • Large feature set; rigid bodies, cloth, rope, soft bodies, water, particles • Havok 2 • Rigid body physics for the PS2 generation • Havok 3 • Ultra realistic physics • Havok 4 • Next-gen physics

  3. What is “next gen” physics? Gameplay physics Fx physics • Performance • Performance • Performance • Performance • Performance • Quality • Customization • Controllability

  4. What is FX physics? • Physics based effects on a massive scale • 1,000s to 10,000s of objects • Rigid bodies • Particles • Fluids • Cloth • and more to come • Running on PC and consoles (Xbox 360, PS3)

  5. Why use the GPU? • The GPU is a next-gen platform • Can be thought of as a 1000 multiprocessor machine • It is unbelievably fast when given the right task • Rendering, for example • Huge existing install base of graphics cards capable of running GPU physics

  6. Havok and ATI • Strong partnership • Working specifically on HavokFX in the run up to its showcase on ATI at Computex 2006 Best Innovation – Computex 2006 [Hexus]

  7. How does the GPU work? • GPUs are very powerful data parallel processors • 1000 simultaneous threads • Very high memory bandwidth • 1 cycle latency per instruction • Can execute up to 4 instructions per cycle • ATI X1900 XTX • 48 pixel processors • Over 350 GFLOPS • Issues • Normally only up to 16 float outputs in SM3.0 • Limited inputs too

  8. Demo Set 1

  9. Ballistic physics refresher course Collide Solve Collisions Integrate

  10. Find overlapping pairs Integrate

  11. Narrow phase collide

  12. Solve collisions

  13. Is physics a data parallel task? Collide Solve Collisions Integrate Anatomy of a clock tick

  14. Is physics a data parallel task? Integrate Step Body 1 Step Body 2 New Positions Position & Velocity Step Body 1000

  15. Is physics a data parallel task? Collide Solve Collisions Integrate Anatomy of a clock tick

  16. Is physics a data parallel task? Collide Collide Pair 1 Find pairs Collide Pair 2 Contacts New Positions Collide Pair 4000

  17. Is physics a data parallel task? Collide Solve Collisions Integrate Anatomy of a clock tick

  18. Is physics a data parallel task? Solve Collisions Body 1 5 1 Body 6 4 6 11 Body 4 New Velocities Contacts & Velocities Body 2 12 Body 7 3 7 2 10 9 8 Body 5 Body 8 Body 3

  19. Is physics a data parallel task? Solve Collisions Body 1 Body 6 Body 4 New Velocities Contacts & Velocities Body 2 Body 7 Body 5 Body 8 Body 3

  20. Solve link 1 Solve link 1 Solve link 1 Solve link 2 Solve link 2 Solve link 2 Solve link 1200 Solve link 1000 Solve link 800 Is physics a data parallel task? Solve Collisions New Velocities Contacts Batch 1 Batch 2 Batch 3

  21. Physics is a data parallel task Collide Solve Collisions Integrate 100% data parallel 80% data parallel 95% data parallel

  22. Havok Fx Features Overview • FX Rigid Bodies • Convex collision bodies • Simple stable stacking • FX Particles • Inelastic particle-particle collisions • Fluid effects • Cloth • Lightweight framework • Fully integrated with Havok 4.0 • Everything collides with everything else

  23. FX Particles • Particles are like simple rigid bodies • Much faster to simulate and render • One vertex per particle (point sprites) • Havok FX particle framework gives you • Particle-particle collisions • Particle-rigid body collisions • User-defined behaviours and emitters

  24. FX Behaviors and Emitters • Executed on GPU • Uses SM3.0, e.g. HLSL • Alter velocities and positions • Wind, gravity • Per object user data • for custom properties

  25. Integrated Toolchain • Leverages Havok physics exporters and tools pipeline

  26. Preview and Pipeline

  27. Simple behaviors GPU Memory CPU Memory Positions Velocities Readback from GPU Write back to GPU Modify on CPU

  28. Game play physics interaction Once per Simulation GPU Memory CPU Memory Collision Shapes Textures Collision shapes Once per Frame Positions Textures Rigid Bodies Velocities Textures Game play physics FX physics

  29. Demo Set 2

  30. Rendering and CrossFire • Rendering needs careful consideration! • Most renderers will not render 20K objects well • Must use custom / vendor techniques • Havok FX returns handle to vertex buffers • Current rigid body transforms • Current particle positions • Optionally other particle / body state useful for rendering • The future is multiple GPUs

  31. Dual and Triple GPU Physics Second (or third) GPU can be used for graphics or physics simulation, or share the primary card

  32. FX Rigid Bodies again • We said the GPU was fast…

  33. Future of Havok FX • Distributing physics across multiple GPUs • e.g. 2 GPUs for physics, 2 for rendering • Brittle fracture • Advanced smoke/cloud rendering • Volumetric shadowing • Advanced fluids • Smoothed particle hydrodynamics • Isosurface extraction using DirectX 10 Geometry Shader

  34. Last Slide

More Related