| The physics-based dynamics simulation and rendering of smoke is an interdisciplinary topic that spans computational fluid dynamics and computer graphics.The theoretical basis of its fluid dynamics calculation is the incompressible Navier-Stokes equation,and the theoretical basis of its shape rendering is radiative transmission theory.The flow of three-dimensional smoke is very complicated,and the density distribution inside the smoke volume is very uneven.Therefore,the difficulty in simulating smoke in real time is to efficiently maintain the incompressibility of the smoke fluid,accurately simulate the turbulence of the smoke and the radiational phenomenon inside the smoke volume,which are scattering and absorption.This article will first derive the incompressible Navier-Stokes governing equations based on the theory,and study the particle-based smoke simulation methods and grid-based simulation methods based on the non-conservative and conservation representations of the governing equations,mainly including their data structure,the method of solving the pressure,the method of calculating advection and other internal or external force terms.For the grid-based pressure solution,a parallel super-relaxation iteration method is studied in this paper.By setting appropriate relaxation factors,the convergence rate of the pressure Poisson equation can be greatly improved.Then,based on discussing and comparing the advantages and disadvantages of this particle method and grid method,a hybrid method for smoke simulation is studied.The hybrid method mixes particles and grids,allowing the particle system and the grid structure to handle pressure,advection,and various internal or external forces,respectively,and reduces the numerical viscous dissipation phenomenon caused by the Semi-Lagrangian advection.Next,this article will study the rendering method of smoke based on visible light and infrared,using the ray projection method to draw the smoke volume,and using the method of multiple passes to model the primary scattering of the light source.For the infrared model,the calculation method of equivalent emission cross section is also discussed.Finally,based on the above series of theories and methods,this article uses the Direct3D12 graphics API and compute shader to build a framework for the computation and rendering of the entire smoke,and implements a grid-based method and a hybrid method for the flow computation model,as well as infrared and visible light smoke.By using some technical and algorithmic optimization methods,the physical accuracy and visual authenticity of the simulation are improved while ensuring the real-time performance of the simulation results.Finally,simulation results of different models and different parameters will be compared,analyzed and evaluated. |