| In computer graphics,how to simulate natural scenes more realistically has always been a hot issue for scholars.In some areas,computer simulations of natural scenery play an extremely important role,saving a lot of economic resources,such as virtual reality,3D games,film production,military simulation and so on.Among them,regular objects such as tables,chairs and buildings are easy to simulate,but irregular objects such as smoke,fountains,water and flames in nature have higher simulation difficulty and lower timeliness.Therefore,how to improve the realism and real-time performance of irregular object simulation has become a research hotspot and difficulty in graphics in recent years.Based on this,this paper chooses flame as the irregular object of simulation research,and combines physical model and GPU acceleration technology to simulate flame.On the one hand,because flame is an important part of daily life,it can be seen everywhere,on the other hand,Because the flame is very representative,it is also widely used.The specific research contents of this paper are as follows:1.Based on the in-depth analysis of the physical properties of flame,the physical model of the flame is established based on the N-S(Navier-Stokes)equation.However,it is difficult to solve the model according to the general solution method.Therefore,the method adopted in this paper is to use the Helmholtz-Hodge decomposition theorem to decompose the NS equation into four parts: the advection term,the external force term,the projection term and the diffusion term,and then the four The terms are solved separately.In this paper,the MacCormack method is used to solve the advection term,which simplifies the calculation steps,solves the numerical diffusion problem well,and the calculation result is high.The Jacobi iteration method is used to solve the Poisson equation of the projection term and the solution process is placed on the GPU.Calculations are performed to improve simulation efficiency and consume less resources.Finally,through experimental comparison and analysis,this method can not only use the powerful computing performance of the GPU to ensure the realism of the flame,but also improve the computational efficiency.2.In this paper,two improvements have been made to the effect of flame simulation to improve the realism and real-time performance of flame simulation:(1)Combining Simplex noise and physics This paper establishes a wind model.The wind received by the flame during the simulation process is regarded as a wind model,and the current wind speed is the sum of the average wind speed and the random number.The random number is generated by the noise function Simplex(x)and the wind speed is calculated to generate the wind model..Through this wind model,a random wind field is continuously generated to randomly perturb the flame,and the flame will produce a tossing effect in the process of moving and burning,which conforms to the physical characteristics of the flame and achieves a more realistic dynamic simulation effect.(2)In the rendering process,the ray casting algorithm is improved,and a GPU-based ray casting algorithm is proposed.In order to solve the problem of large computational complexity of traditional ray casting algorithm,this paper optimizes the ray casting algorithm flow,reduces the number of sampling points,and makes full use of GPU hardware acceleration technology to improve the speed of mapping,calculating and traversing the flame model scene data.Quick drawing of the flame.Through experimental comparison and analysis,the proposed algorithm improves the simulation efficiency by 10%-14%compared with the traditional ray casting algorithm,greatly improves the rendering efficiency of flame simulation and meets the real-time requirements of flame simulation.Finally,this paper designs a fire simulation system.Through the experimental analysis of the realism and real-time of the system,it is verified that the proposed method can not only obtain more realistic simulation results,but also improve the simulation speed,and further improve the traditional flame simulation method. |