Computer fluid simulation and rendering are widely used in various fields such as TV special effects,physical simulation,and game production,mainly with offline methods.However,with the increasing support of parallel computing by graphics cards,offline fluid simulation and rendering methods have been optimized.Although they have small defects in accuracy,they can meet the requirements of real-time computation.Thus,they can be used for small-scale fluid simulation and rendering.The main issue currently is how to improve the realism of fluid simulation and rendering in real-time computation.In response to the universality and realism issues in existing simulation and rendering algorithms,we propose a particle-based real-time simulation and rendering algorithm.The algorithm consists of three parts: unified simulation framework module,signed distance field module and fluid rendering module.In the unified simulation framework module,fluid is simulated based on particle including viscosity calculation.The mixed Euler-Lagrange method is used to solve particle acceleration and update particle’s positions.Therefore,our work is able to simulate fluids of various viscosities.In the signed distance field module,we establish a signed distance field based on the particle’s position,which is used to simulate the fluids surface position.A time-based anti-aliasing algorithm is proposed to blur the signed distance field,which makes low-precision surface data suitable for fluid surface reconstruction.In the fluid rendering module,a two-way ray marching algorithm is proposed to reconstruct the depth,normal,and other information of the fluid surface.We use two passes of ray marching on the blurred signed distance field.Finally,the fluid is rendered based on the deferred rendering pipeline.The results compare the proposed method with existing simulation and rendering methods.In the simulation aspect,the proposed method is compared in terms of realism and computation time.In the rendering aspect,different blur and surface reconstruction methods are compared.The results show that the proposed algorithm can improve the realism of simulation and rendering in real-time computation. |