In the field of computer graphics,simulating realistic fluids has always been a hot topic.As a common part in fluid simulation,fog exists widely in daily life.How to simulate irregular fog becomes the research focus in the field of fluid simulation.With the development of technology,fog effects can be applied to many fields such as game special effects,movie processing,aerospace and so on.Aiming at the problems of poor realism based on empirical model and difficult to real-time based on physical model,a fog effect hybrid algorithm is proposed to simulate multiple fog effects realistically on the basis of real-time.Firstly,a large-scale basic fog is simulated based on the empirical model.In view of the single problem of traditional empirical fog simulation,the visibility factor and temperature coefficient are introduced to improve the fog decay equation to further enrich the fog type;Then,it uses Fractal Brown motion to optimize Simplex noise to improve dynamic heterogeneous fog details,overcome the problems of traditional Perlin noise complexity and fog effect border regularity and realistically simulate large-scale basic fog.Secondly,the detailed fog based on the physical model uses Lagrangian and Euler hybrid calculations.After the vortex particles are physically modeled,and the octree structure is used to divide the grid space,effectively improving Computational efficiency;for the problem of complex velocity field integration,the space division structure converts vortex particle clusters into super particles to reduce overhead and ensure real-time simulation;for the problem of linear wind field regularity,the randomness of Simplex noise is established in the noisy wind field,the wind force is substituted into the external force item,which greatly improves the track of smoke particles and significantly enhances the realism of the fog effect.Then,the basic fog and the detailed fog are rendered separately.For the phenomenon that the traditional rendering fog has poor details,the Ray-Marching technology is used to calculate the atmospheric scattering to obtain the real fog color,and the ambient light and sunlight are optimized to generate the gradient fog effect.Scale-based fog;In the detail fog,a vortex particle combined with extended particle rendering method is proposed.The vortex particle is only numerically calculated,and the extended particle uses the Blinn-Phong lighting model and the Alpha hybrid algorithm to render the real smoke texture through threshold segmentation render Realistic detail fog;hybrid basic fog and detail fog use HDR and Bloom technology to simulate the real world hybrid fog.Finally,multiple sets of hybrid fog experiments are designed,developed on Unity3 D engine platform using C #,Unity Shader language,and verified on different operating system platforms.Through comparison of multiple experiments and data analysis,the hybrid fog effect algorithm render a variety of realistic fog effects in real-time to meet the needs of different simulation applications. |