SlideShare a Scribd company logo
1 of 15
Real Time Visual Simulation of Smoke on the GPU By Muhammad S. Karim MSCS Student Department of Computer Science The University of New Mexico
Introduction & Motivation HORVATH, C., AND GEIGER, W. 2009. Directable, high-resolution simulation of fire on the GPU. ACM Trans. Graph. 28, 3, 1-8. Used in creating visual effects in “Harry Potter and the Half Blood Prince”. Uses a incompressible, inviscidNavier-stokes equations for fluid flow. Pursuing as part of an Individual Study project with Dr. Joe Kniss.
The Project and Goal Starting with an implantation of the following: FEDKIW, R., STAM, J., AND JANSEN H. W. 2001. Visual Simulation of Smoke. In proc. of ACM SIGGRAPH 2001. Based on: Stam, J. 1999. Stable Fluids. In SIGGRAPH 99. Goal is to pursue the real-time implementation using GPU specific vertex & fragment processing features. Images from [FEDKIEW 2001]
Equations of Fluid Flow Using incompressible and inviscid (leaving out the viscausity term) form of Navier-Stokes equations for fluid flow: u = Velocity p = Pressure f  = Force t  = Time Mass Conservation Momentum Conservation u=velocity, p=pressure, f=force ,[object Object]
Simulation Algorithm, inside a 3D grid:
Step 1: Add Forces (Buoyancy,Vorticity)
Step 2: Advect Velocity Field
Step 3: Solve for intermediate pressure term.
Step4: Project velocity field to make the field divergence free.
Step 5: Apply boundary conditions to Velocity & Pressure fields.
Step 6: Advect, Dissipate scalar fields (Density & Temperature),[object Object]
Simulation Algorithm Steps 1.b Add back Vorticity Confined Force to the velocity field: Curl(u) Shader + = Fvort u’(t) u(t)
Simulation Algorithm Steps 2. Advect Velocity field: (Semi-Lagrangian Advection) Move back along the vector back a timestep. Pick a vector by Tri-linear interpolating the 6 neighboring cells from the 3D texture. Set this computed value to the current cell.] Benefits: ‘Stable’ field, avoid “blow-ups”, GPU friendly. Shader u’(t) u(t)
Simulation Algorithm Steps 3. Compute field Pressure (for the next projection step): u(t) Solve for p Shader Shader Iterative Jacobi Solver Div(u) p(t) after N Jacobi Iterations (I use 30-40)
Simulation Algorithm Steps 4. Project Velocity field: Using Helmholtz-Hodge decomposition. (To ensure 0 divergence).  Any vector field u* can be uniquely decomposed as the following equation where u has 0 divergence: -  = Grad ( p(t) ) u(t) u (t+1)

More Related Content

What's hot

Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013
Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013
Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013Sunando Sengupta
 
Compute "Closeness" in Graphs using Apache Giraph.
Compute "Closeness" in Graphs using Apache Giraph.Compute "Closeness" in Graphs using Apache Giraph.
Compute "Closeness" in Graphs using Apache Giraph.Robert Metzger
 
Temporary Coherence 3D Animation
Temporary Coherence 3D AnimationTemporary Coherence 3D Animation
Temporary Coherence 3D AnimationAkshat Singh
 
Parallel implementation of geodesic distance transform with application in su...
Parallel implementation of geodesic distance transform with application in su...Parallel implementation of geodesic distance transform with application in su...
Parallel implementation of geodesic distance transform with application in su...Tuan Q. Pham
 
View-Dependent Texture Atlases (EG 2010)
View-Dependent Texture Atlases (EG 2010)View-Dependent Texture Atlases (EG 2010)
View-Dependent Texture Atlases (EG 2010)Matthias Trapp
 
Point cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihangPoint cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihangLihang Li
 
Coastal erosion management using image processing and Node Oriented Programming
Coastal erosion management using image processing and Node Oriented Programming Coastal erosion management using image processing and Node Oriented Programming
Coastal erosion management using image processing and Node Oriented Programming AbdAllah Aly
 
Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...
Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...
Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...inside-BigData.com
 
Signal proccessing(wavelet) on radio telescopic images
Signal proccessing(wavelet) on radio telescopic imagesSignal proccessing(wavelet) on radio telescopic images
Signal proccessing(wavelet) on radio telescopic imagesshantanu Chutiya begger
 
Graph Regularised Hashing
Graph Regularised HashingGraph Regularised Hashing
Graph Regularised HashingSean Moran
 
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)Tatsunori Taniai
 
Realtime 3D Visualization without GPU
Realtime 3D Visualization without GPURealtime 3D Visualization without GPU
Realtime 3D Visualization without GPUTobias G
 
Garbage Box: 3D Reconstruction and 4D Deformation Measurement
Garbage Box: 3D Reconstruction and 4D Deformation MeasurementGarbage Box: 3D Reconstruction and 4D Deformation Measurement
Garbage Box: 3D Reconstruction and 4D Deformation MeasurementNational Cheng Kung University
 
LHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNsLHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNsHenry Schreiner
 
GoogleSky Status at Google
GoogleSky Status at GoogleGoogleSky Status at Google
GoogleSky Status at GoogleAlberto Conti
 
Lossless image compression via by lifting scheme
Lossless image compression via by lifting schemeLossless image compression via by lifting scheme
Lossless image compression via by lifting schemeSubhashini Subramanian
 
Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...
Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...
Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...CSCJournals
 
DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013
DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013
DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013Patrick Raymond
 
Evaluation of geometrical parameters of buildings from SAR images
Evaluation of geometrical parameters of buildings from SAR imagesEvaluation of geometrical parameters of buildings from SAR images
Evaluation of geometrical parameters of buildings from SAR imagesFederico Ariu
 

What's hot (20)

Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013
Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013
Urban 3D Semantic Modelling Using Stereo Vision, ICRA 2013
 
Compute "Closeness" in Graphs using Apache Giraph.
Compute "Closeness" in Graphs using Apache Giraph.Compute "Closeness" in Graphs using Apache Giraph.
Compute "Closeness" in Graphs using Apache Giraph.
 
Temporary Coherence 3D Animation
Temporary Coherence 3D AnimationTemporary Coherence 3D Animation
Temporary Coherence 3D Animation
 
Parallel implementation of geodesic distance transform with application in su...
Parallel implementation of geodesic distance transform with application in su...Parallel implementation of geodesic distance transform with application in su...
Parallel implementation of geodesic distance transform with application in su...
 
View-Dependent Texture Atlases (EG 2010)
View-Dependent Texture Atlases (EG 2010)View-Dependent Texture Atlases (EG 2010)
View-Dependent Texture Atlases (EG 2010)
 
Point cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihangPoint cloud mesh-investigation_report-lihang
Point cloud mesh-investigation_report-lihang
 
Coastal erosion management using image processing and Node Oriented Programming
Coastal erosion management using image processing and Node Oriented Programming Coastal erosion management using image processing and Node Oriented Programming
Coastal erosion management using image processing and Node Oriented Programming
 
Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...
Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...
Scratch to Supercomputers: Bottoms-up Build of Large-scale Computational Lens...
 
Signal proccessing(wavelet) on radio telescopic images
Signal proccessing(wavelet) on radio telescopic imagesSignal proccessing(wavelet) on radio telescopic images
Signal proccessing(wavelet) on radio telescopic images
 
Graph Regularised Hashing
Graph Regularised HashingGraph Regularised Hashing
Graph Regularised Hashing
 
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
 
Realtime 3D Visualization without GPU
Realtime 3D Visualization without GPURealtime 3D Visualization without GPU
Realtime 3D Visualization without GPU
 
Garbage Box: 3D Reconstruction and 4D Deformation Measurement
Garbage Box: 3D Reconstruction and 4D Deformation MeasurementGarbage Box: 3D Reconstruction and 4D Deformation Measurement
Garbage Box: 3D Reconstruction and 4D Deformation Measurement
 
workspace_analysis
workspace_analysisworkspace_analysis
workspace_analysis
 
LHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNsLHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNs
 
GoogleSky Status at Google
GoogleSky Status at GoogleGoogleSky Status at Google
GoogleSky Status at Google
 
Lossless image compression via by lifting scheme
Lossless image compression via by lifting schemeLossless image compression via by lifting scheme
Lossless image compression via by lifting scheme
 
Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...
Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...
Interferogram Filtering Using Gaussians Scale Mixtures in Steerable Wavelet D...
 
DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013
DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013
DimEye Corp Presents Revolutionary VLS (Video Laser Scan) at SS IMMR 2013
 
Evaluation of geometrical parameters of buildings from SAR images
Evaluation of geometrical parameters of buildings from SAR imagesEvaluation of geometrical parameters of buildings from SAR images
Evaluation of geometrical parameters of buildings from SAR images
 

Similar to Real-Time Visual Simulation of Smoke

Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...
Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...
Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...Tomohiro Fukuda
 
Simple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer VisionSimple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer VisionAnish Patel
 
A Review on Haze Removal Techniques
A Review on Haze Removal TechniquesA Review on Haze Removal Techniques
A Review on Haze Removal TechniquesIRJET Journal
 
Advanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalll
Advanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalllAdvanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalll
Advanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalllMuddassar Abbasi
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesDouglas Lanman
 
CT Scan Image reconstruction
CT Scan Image reconstructionCT Scan Image reconstruction
CT Scan Image reconstructionGunjan Patel
 
CT Image reconstruction
CT Image reconstructionCT Image reconstruction
CT Image reconstructionSantosh Ojha
 
Blind Beam-Hardening Correction from Poisson Measurements
Blind Beam-Hardening Correction from Poisson MeasurementsBlind Beam-Hardening Correction from Poisson Measurements
Blind Beam-Hardening Correction from Poisson MeasurementsAleksandar Dogandžić
 
Design of Linear Array Transducer Using Ultrasound Simulation Program Field-II
Design of Linear Array Transducer Using Ultrasound Simulation Program Field-IIDesign of Linear Array Transducer Using Ultrasound Simulation Program Field-II
Design of Linear Array Transducer Using Ultrasound Simulation Program Field-IIinventy
 
The fourier transform for satellite image compression
The fourier transform for satellite image compressionThe fourier transform for satellite image compression
The fourier transform for satellite image compressioncsandit
 
Visual Saliency: Learning to Detect Salient Objects
Visual Saliency: Learning to Detect Salient ObjectsVisual Saliency: Learning to Detect Salient Objects
Visual Saliency: Learning to Detect Salient ObjectsVicente Ordonez
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxParthDoshi66
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docxmercysuttle
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfParthDoshi66
 
Photoacoustic tomography based on the application of virtual detectors
Photoacoustic tomography based on the application of virtual detectorsPhotoacoustic tomography based on the application of virtual detectors
Photoacoustic tomography based on the application of virtual detectorsIAEME Publication
 

Similar to Real-Time Visual Simulation of Smoke (20)

Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...
Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...
Visual Environment by Semantic Segmentation Using Deep Learning: A Prototype ...
 
JGrass-Newage SWRB
JGrass-Newage SWRBJGrass-Newage SWRB
JGrass-Newage SWRB
 
Simple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer VisionSimple Pendulum Experiment and Automatic Survey Grading using Computer Vision
Simple Pendulum Experiment and Automatic Survey Grading using Computer Vision
 
A Review on Haze Removal Techniques
A Review on Haze Removal TechniquesA Review on Haze Removal Techniques
A Review on Haze Removal Techniques
 
Advanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalll
Advanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalllAdvanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalll
Advanced Image Reconstruction Algorithms in MRIfor ISMRMversion finalll
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
 
CT Scan Image reconstruction
CT Scan Image reconstructionCT Scan Image reconstruction
CT Scan Image reconstruction
 
CT Image reconstruction
CT Image reconstructionCT Image reconstruction
CT Image reconstruction
 
Blind Beam-Hardening Correction from Poisson Measurements
Blind Beam-Hardening Correction from Poisson MeasurementsBlind Beam-Hardening Correction from Poisson Measurements
Blind Beam-Hardening Correction from Poisson Measurements
 
Antenna
AntennaAntenna
Antenna
 
D04432528
D04432528D04432528
D04432528
 
Design of Linear Array Transducer Using Ultrasound Simulation Program Field-II
Design of Linear Array Transducer Using Ultrasound Simulation Program Field-IIDesign of Linear Array Transducer Using Ultrasound Simulation Program Field-II
Design of Linear Array Transducer Using Ultrasound Simulation Program Field-II
 
The fourier transform for satellite image compression
The fourier transform for satellite image compressionThe fourier transform for satellite image compression
The fourier transform for satellite image compression
 
Visual Saliency: Learning to Detect Salient Objects
Visual Saliency: Learning to Detect Salient ObjectsVisual Saliency: Learning to Detect Salient Objects
Visual Saliency: Learning to Detect Salient Objects
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docx
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdf
 
crowd counting.pptx
crowd counting.pptxcrowd counting.pptx
crowd counting.pptx
 
Photoacoustic tomography based on the application of virtual detectors
Photoacoustic tomography based on the application of virtual detectorsPhotoacoustic tomography based on the application of virtual detectors
Photoacoustic tomography based on the application of virtual detectors
 
Oc2423022305
Oc2423022305Oc2423022305
Oc2423022305
 

Real-Time Visual Simulation of Smoke

  • 1. Real Time Visual Simulation of Smoke on the GPU By Muhammad S. Karim MSCS Student Department of Computer Science The University of New Mexico
  • 2. Introduction & Motivation HORVATH, C., AND GEIGER, W. 2009. Directable, high-resolution simulation of fire on the GPU. ACM Trans. Graph. 28, 3, 1-8. Used in creating visual effects in “Harry Potter and the Half Blood Prince”. Uses a incompressible, inviscidNavier-stokes equations for fluid flow. Pursuing as part of an Individual Study project with Dr. Joe Kniss.
  • 3. The Project and Goal Starting with an implantation of the following: FEDKIW, R., STAM, J., AND JANSEN H. W. 2001. Visual Simulation of Smoke. In proc. of ACM SIGGRAPH 2001. Based on: Stam, J. 1999. Stable Fluids. In SIGGRAPH 99. Goal is to pursue the real-time implementation using GPU specific vertex & fragment processing features. Images from [FEDKIEW 2001]
  • 4.
  • 6. Step 1: Add Forces (Buoyancy,Vorticity)
  • 7. Step 2: Advect Velocity Field
  • 8. Step 3: Solve for intermediate pressure term.
  • 9. Step4: Project velocity field to make the field divergence free.
  • 10. Step 5: Apply boundary conditions to Velocity & Pressure fields.
  • 11.
  • 12. Simulation Algorithm Steps 1.b Add back Vorticity Confined Force to the velocity field: Curl(u) Shader + = Fvort u’(t) u(t)
  • 13. Simulation Algorithm Steps 2. Advect Velocity field: (Semi-Lagrangian Advection) Move back along the vector back a timestep. Pick a vector by Tri-linear interpolating the 6 neighboring cells from the 3D texture. Set this computed value to the current cell.] Benefits: ‘Stable’ field, avoid “blow-ups”, GPU friendly. Shader u’(t) u(t)
  • 14. Simulation Algorithm Steps 3. Compute field Pressure (for the next projection step): u(t) Solve for p Shader Shader Iterative Jacobi Solver Div(u) p(t) after N Jacobi Iterations (I use 30-40)
  • 15. Simulation Algorithm Steps 4. Project Velocity field: Using Helmholtz-Hodge decomposition. (To ensure 0 divergence). Any vector field u* can be uniquely decomposed as the following equation where u has 0 divergence: - = Grad ( p(t) ) u(t) u (t+1)
  • 16. Simulation Algorithm Steps 5. Apply boundary conditions: Based on ‘fixed-grid’, fluid confined to the grid. a. Velocity goes to zero on the boundary (no-slip condition). b. Pressure derivative goes to zero on the boundary. (Neumann pressure condition). Draw 4 lines along the boundary on each slice of the 3D texture GPU Implementation Draw a quad on the front (z=0) and another on the back (z=slices-1) of the 3D texture
  • 17. Simulation Algorithm Steps 6. Advectthe scalar fields (Density & Temperature) Similar to velocity field advection. Dissipate the scalar fields based on time. Shader ρ(t) Shader u(t) T(t)
  • 18. Volume Rendering a. Slice the grid region from the viewer’s point-of-view. b. Render each slice from front-to-back order. c. Use the “under” operator to composite (blend) the slices to make the final images of the smoke region. I used the polygon slicing algorithm implemented in a vertex shader exactly described in: Ref “Real-time Volume Graphics” – Engel et. al. Ch-3.5. Demonstration from my program showing 2 slices
  • 19. Volume Rendering (more…) Implemented volumetric shadows using the Half-Angle Slicing technique by Kniss et al. 2003. Ref: Kniss, J., S. Premo e, C. Hansen, P. Shirley, and A. McPherson. 2003. "A Model for Volume Lighting and Modeling." IEEE Transactions on Visualization and Computer Graphics 9(2), pp. 150–162. Using a 2D light buffer to accumulate opacity at each slice, the use as a shadow map
  • 20. Some Results Self-shadowing the smoke volume produces more realism. Smoke volume transparency is computed based on the smoke density values computed in the grid. No self-showing inside the volume With self-showing inside the volume
  • 21. Closing Remarks and Demo I used 64 x 64 x 64 grids in the Demo, higher resolution provides finer details. I also used a fixed grid, will possibly explore techniques to move the fluid out of the box. Practical and possible to use in real-time applications with mid-high end GPUs.