Sparse Fluid Simulation in DirectX Alex Dunn Dev. Tech. – NVIDIA

Slides:



Advertisements
Similar presentations
A Real Time Radiosity Architecture for Video Games
Advertisements

Advanced Virtual Texture Topics
Realistic Simulation and Rendering of Smoke CSE Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.
SE-292 High Performance Computing
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Photon Mapping on Programmable Graphics Hardware Timothy J. Purcell Mike Cammarano Pat Hanrahan Stanford University Craig Donner Henrik Wann Jensen University.
Simulation of Fluids using the Navier-Stokes Equations Kartik Ramakrishnan.
Exploration of bump, parallax, relief and displacement mapping
Render Cache John Tran CS851 - Interactive Ray Tracing February 5, 2003.
ABC HFG JKLW OPQR NTU VS YZ.
Dynamic Global Illumination from many Lights GDC 2012 by Wolfgang Engel, Igor Lobanchikov and Timothy Martin.
Lecture Objectives -Finish with modeling of PM -Discuss -Advance discretization -Specific class of problems -Discuss the CFD software.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Particle Systems Final Exam Study Guide Game Design Experience Professor Jim Whitehead March 16, 2009 Creative Commons Attribution 3.0 (Except copyrighted.
Adapted from: CULLIDE: Interactive Collision Detection Between Complex Models in Large Environments using Graphics Hardware Naga K. Govindaraju, Stephane.
Memory Efficient Acceleration Structures and Techniques for CPU-based Volume Raycasting of Large Data S. Grimm, S. Bruckner, A. Kanitsar and E. Gröller.
Combined Lagrangian-Eulerian Approach for Accurate Advection Toshiya HACHISUKA The University of Tokyo Introduction Grid-based fluid.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Fluid Simulation using CUDA Thomas Wambold CS680: GPU Program Optimization August 31, 2011.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
High Performance in Broad Reach Games Chas. Boyd
Voxelized Shadow Volumes Chris Wyman Department of Computer Science University of Iowa High Performance Graphics 2011.
Fluid Animation CSE 3541 Matt Boggus. Procedural approximations – Heightfield fluids Mathematical background – Navier-Stokes equation Computational models.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Procedural terrain on the GPU Chalmers University of Technology Advanced computer graphics – DAT205 David Sundelius Adam Scott.
1/45 A Fast Rendering Method for Clouds Illuminated by Lightning Taking into Account Multiple Scattering Yoshinori Dobashi (Hokkaido University) Yoshihiro.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Havok. ©Copyright 2006 Havok.com (or its licensors). All Rights Reserved. HavokFX Next Gen Physics on ATI GPUs Andrew Bowell – Senior Engineer Peter Kipfer.
Computer Graphics Graphics Hardware
A Fast Simulation Method Using Overlapping Grids for Interactions between Smoke and Rigid Objects Yoshinori Dobashi (Hokkaido University) Tsuyoshi Yamamoto.
Jonathan M Chye Technical Supervisor : Mr Matthew Bett 2010.
Matrices from HELL Paul Taylor Basic Required Matrices PROJECTION WORLD VIEW.
GPU-Accelerated Surface Denoising and Morphing with LBM Scheme Ye Zhao Kent State University, Ohio.
Pattern Based Procedural Textures Sylvain Lefebvre Fabrice Neyret iMAGIS - GRAVIR / IMAG - INRIA
Software for the Games Industry 9 November 2004 Fluid Gaming: Particle Methods for Fluid Mechanics and Visualisation Graham Wynn James Gray Richard West.
1 Real-time visualization of large detailed volumes on GPU Cyril Crassin, Fabrice Neyret, Sylvain Lefebvre INRIA Rhône-Alpes / Grenoble Universities Interactive.
Interactive Rendering With Coherent Ray Tracing Eurogaphics 2001 Wald, Slusallek, Benthin, Wagner Comp 238, UNC-CH, September 10, 2001 Joshua Stough.
Framebuffer Compression Using Dynamic Color Palettes (DCP) Ayub A. Gubran Tor M. Aamodt.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
WPH310. Free Phone! Windows Phone 7 as a Game Platform Free Tools to Build Great Games The Game Loop Input on Windows Phone 7 Building a Game with Your.
‘Fire’: The Procedural Method Investigation of Procedural Trees and Fire:
Introduction: Lattice Boltzmann Method for Non-fluid Applications Ye Zhao.
Efficient Streaming of 3D Scenes with Complex Geometry and Complex Lighting Romain Pacanowski and M. Raynaud X. Granier P. Reuter C. Schlick P. Poulin.
Point Sprites Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended.
Havok FX Physics on NVIDIA GPUs. Copyright © NVIDIA Corporation 2004 What is Effects Physics? Physics-based effects on a massive scale 10,000s of objects.
Graphics Interface 2009 The-Kiet Lu Kok-Lim Low Jianmin Zheng 1.
Houston, Wiebe & Batty. (2004) RLE Sparse Level Sets. RLE Sparse Level Sets Ben Houston Mark Wiebe Christopher Batty Fluids and Level Sets Session.
Course14 Dynamic Vision. Biological vision can cope with changing world Moving and changing objects Change illumination Change View-point.
Gamma Photon Transport on the GPU for PET László Szirmay-Kalos, Balázs Tóth, Milán Magdics, Dávid Légrády, Anton Penzov Budapest University of Technology.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
Interactive Terascale Particle Visualization Ellsworth, Green, Moran (NASA Ames Research Center)
CHC ++: Coherent Hierarchical Culling Revisited Oliver Mattausch, Jiří Bittner, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University.
1 LES of Turbulent Flows: Lecture 7 (ME EN ) Prof. Rob Stoll Department of Mechanical Engineering University of Utah Spring 2011.
UNC Chapel Hill David A. O’Brien Automatic Simplification of Particle System Dynamics David O’Brien Susan Fisher Ming C. Lin Department of Computer Science.
Martin Kruliš by Martin Kruliš (v1.0)1.
GPU Acceleration of Particle-In-Cell Methods B. M. Cowan, J. R. Cary, S. W. Sides Tech-X Corporation.
GVDB: Raytracing Sparse Voxel Database Structures on the GPU Rama Hoetzlein, NVIDIA High Performance Graphics 2016 Trinity College, Dublin.
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
Fluid Animation CSE 3541 By: Matt Boggus.
Chapter 2 Memory and process management
GPU-based iterative CT reconstruction
CUDA Interoperability with Graphical Environments
Bones Skeletal Unity-2D How & When
Graphics Processing Unit
Real-Time Ray Tracing Stefan Popov.
ATCM 6317 Procedural Animation
Procedural Animation Lecture 11: Fluid dynamics
How do multi streaming regions form and evolve?
Computer Graphics Lecture 15.
Presentation transcript:

Sparse Fluid Simulation in DirectX Alex Dunn Dev. Tech. – NVIDIA

Agenda ● We want more fluid in games ● Eulerian (grid based) fluid. ● Sparse Eulerian Fluid. ● Feature Level 11.3 Enhancements! ● (Not a talk on fluid dynamics)

Why Do We Need Fluid in Games? ● Replace particle kinematics! ● more realistic == better immersion ● Game mechanics? ● occlusion ● smoke grenades ● interaction ● Dispersion ● air ventilation systems ● poison, smoke ● Endless opportunities!

Eulerian Simulation #1 Inject Advect Pressure Vorticity Evolve 2x Velocity 2x Pressure 1x Vorticity My (simple) DX11.0 eulerian fluid simulation:

Eulerian Simulation #2 Inject Advect Pressure Vorticity Evolve  Add fluid to simulation  Move data at, XYZ  (XYZ+Velocity)  Calculate localized pressure  Calculates localized rotational flow  Tick Simulation

**(some imagination required)**

Too Many Volumes Spoil the… ● Fluid isn’t box shaped. ● clipping ● wastage ● Simulated separately. ● authoring ● GPU state ● volume-to-volume interaction ● Tricky to render.

Problem! ● N-order problem ● 64^3 = ~0.25m cells ● 128^3 = ~2m cells ● 256^3 = ~16m cells ● … ● Applies to: ● computational complexity ● memory requirements And that’s just 1 texture…

Bricks ● Split simulation space into groups of cells (each known as a brick). ● Simulate each brick independently.

Brick Map ● Need to track which bricks contain fluid ● Texture3D ● 1 voxel per brick ● 0  Unoccupied ● 1  Occupied ● Could also use packed binary grids [Gruen15], but this requires atomics 

● Initialise with emitter ● Expansion (unoccupied  occupied) ● if { V |x|y|z| > |D brick | } ● expand in that axis ● Reduction (occupied  unoccupied) ● inverse of Expansion ● handled automatically Tracking Bricks

Sparse Simulation Inject Advect Pressure Vorticity Evolve* Clear Tiles Fill List Reset all tiles to 0 (unoccupied) in brick map. Texture3D g_BrickMapRO; AppendStructredBuffer g_ListRW; if(g_BrickMapRO[idx] != 0) { g_ListRW.Append(idx); } Read value from brick map. Append brick coordinate to list if occupied. Read value from brick map. Append brick coordinate to list if occupied. *Includes expansion

Uncompressed Storage Allocate everything; forget about unoccupied cells  Pros: simulation is coherent in memory. works in DX11.0. Cons: no reduction in memory usage.

Compressed Storage Similar to, List Pros: good memory consumption. works in DX11.0. Cons: allocation strategies. indirect lookup. “software translation” filtering particularly costly Indirection Table Physical Memory

1 Brick = (4) 3 = 64

1 Brick = (1+4+1) 3 = 216 New problem; “6n 2 +12n + 8” problem. Can we do better?

Enter; Feature Level 11.3 ● Volume Tiled Resources (VTR)! ● Extends 2D functionality in FL11.2 ● Must check HW support: (DX11.3 != FL11.3) ID3D11Device3* pDevice3 = nullptr; pDevice->QueryInterface(&pDevice3); D3D11_FEATURE_DATA_D3D11_OPTIONS2 support; pDevice3->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS2, &support, sizeof(support)); m_UseTiledResources = support.TiledResourcesTier == D3D11_TILED_RESOURCES_TIER_3;

Tiled Resources #1 Pros: only mapped memory is allocated in VRAM “hardware translation” logically a volume texture all samplers supported 1 Tile = 64KB (= 1 Brick) fast loads

Tiled Resources #2 Gotcha: Tile mappings must be updated from CPU 1 Tile = 64KB (= 1 Brick) BPPTile Dimensions 864x32x x32x x32x x16x x16x16

Latency Resistant Simulation #1 Naïve Approach: ● clamp velocity to V max ● CPU Read-back: ● occupied bricks. ● 2 frames of latency! ● extrapolate “probable” tiles.

Latency Resistant Simulation #2 Tight Approach: ● CPU Read-back: ● occupied bricks. ● max{|V|} within brick. ● 2 frames of latency! ● extrapolate “probable” tiles.

Latency Resistant Simulation #3 Sparse Eulerian Simulation Readback Brick List CPU Readback Ready? Yes Prediction Engine Emitter Bricks No UpdateTile Mappings CPU GPU

Demo

Performance #1 NOTE: Numbers captured on a GeForce GTX980

Performance #2 NOTE: Numbers captured on a GeForce GTX980

Scaling ● Speed ratio (1 Brick) = ● ~75% across grid resolutions. Time{Sparse} Time{Full}

Summary ● Fluid simulation in games is justified. ● Fluid is not box shaped! ● One volume is better than many small. ● Un/Compressed storage a viable fallback. ● VTRs great for fluid simulation. ● Other latency resistant algorithms with tiled resouces?

Questions? Alex Dunn - Thanks for attending.