gpu particle simulation for games - nvidia developer€¦ · will be seen in the game –layer...

20
gameworks.nvidia.com GPU Particle Simulation for Games NVIDIA APEX Engineering Manager David Sullins

Upload: others

Post on 24-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

GPU Particle Simulation for Games

NVIDIA APEX Engineering Manager

David Sullins

Page 2: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Introduction

• For years games use graphical particles to add visual effects

• For years games use physical simulation to create immersive interactive worlds

• Technologies like CUDA or DirectCompute allow general GPU computation

• Combine these to create GPU particle simulation engines

Page 3: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

GPU Particle Collision

• Simulate massive amounts of particles interacting with the game environment

– Debris from weapon impacts

– Sparks

• Non-interacting spheres

• Use Collision Normal to Orient Non-spherical Shapes

Page 4: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

GPU Particle Simulation

Page 5: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Fluid Simulation - SPH

• SPH = Smoothed Particle Hydrodynamics

• Simulate fluids such as liquids or gases

• Rendering

– Explicit surface rendering for fluids

– Sprite-based methods for smoke or fog

• Exmaples:

– Viscous liquids such as blood or goo

– Gases like smoke

Page 6: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Fluids Simulation Example

Page 7: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Position-based Fluids

• Stable for large timesteps, making it more

• Suitable for real-time simulation

• Supports surface tension

• Supports collision

• Similar uses to SPH

Page 8: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Position-based Fluids Example

Page 9: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence

• Grid-based fluid simulation

– Start by simulating turbulent flow of a fluid

– Add GPU particle simulation with collision

– Use the fluid simulation to apply forces to particles

– Result is particles that move in interesting ways, and react with the environment

Page 10: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Smoke Effects

• Turbulence simulation can enhance smoke effects

• Start by simulating turbulent fluid

• Add GPU simulated particles moving in the fluid

• Render as self-shadowed particles

• Move objects through the fluid to create a convincing smoke effect

• Enhance with PSM - Particle Shadow Mapping

Page 11: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

PSM Example

Page 12: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Examples

• Moving the fluid creates interesting motion on its own

Page 13: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Example

• Moving objects through the fluid stirs up vortices

Page 14: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Example

• Add built-in noise to have vortices from the beginning of simulation

Page 15: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Example

• Heat sources stir the fluid as well

Page 16: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence

• You can Layer other force fields

– Jets pushing through the fluid

– Attractive or repulsive forces

– Radial force fields

– Noise fields

Page 17: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence in Games

• Hawken, PlanetSide 2 …

Page 18: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Authoring

• We want to give the artist tools to: – See rendering of particles as it

will be seen in the game

– Layer multiple particle simulation objects to create the final effect

– Package all of these together to make an effect that can replicated throughout the game

– See the results of changes in real time

Page 19: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Turbulence Authoring

• Layer multiple particle simulation objects to create the final effect

– Particle simulation with collision

– Emitter to create the particles in the appropriate way

– Turbulence fluid simulation

– Other fields such as heat sources or noise fields

– Particle rendering options

Page 20: GPU Particle Simulation for Games - NVIDIA Developer€¦ · will be seen in the game –Layer multiple particle simulation objects to create the final effect –Package all of these

gameworks.nvidia.com

Q&A