Zhang, YanciSolenthaler, BarbaraPajarola, RenatoHans-Christian Hege and David Laidlaw and Renato Pajarola and Oliver Staadt2014-01-292014-01-292008978-3-905674-12-51727-8376https://doi.org/10.2312/VG/VG-PBG08/137-146In this paper, we propose a novel GPU-friendly algorithm for the Smoothed Particle Hydrodynamics (SPH) simulation for weakly compressible fluids. The major goal of our algorithm is to implement a GPU-based SPH simulation that can simulate and render a large number of particles at interactive speed. Additionally, our algorithm exhibits the following three features. Firstly, our algorithm supports adaptive sampling of the fluids. Particles can be split into several sub-particles in geometrically complex regions to provide a more accurate simulation. At the same time, nearby particles deep inside the fluids are merged to a single particle to reduce the number of particles. Secondly, the fluids are visualized by directly computing the intersection between ray and an isosurface defined by the surface particles. A dynamic particle grouping algorithm and equation solver are employed to quickly find the ray-isosurface intersection. Thirdly, based on the observation that the SPH simulation is a naturally parallel algorithm, the whole SPH simulation, including the adaptive sampling of the fluids as well as surface particle rendering, is executed on the GPU to fully utilize the computational power and parallelism of modern graphics hardware. Our experimental data shows that we can simulate about 50K adaptively sampled particles, or up to 120K particles in the fixed sampling case at a rate of approximately 20 time steps per second.Categories and Subject Descriptors (according to ACM CCS): I.3.5 [Computational Geometry and Object Modeling]: Physically Based Modeling; I.3.3 [Picture/Image Generation]: Bitmap and Framebuffer Operations; I.3.7 [Three-Dimensional Graphics and Realism]: Color, shading, shadowing, and texture I.3.7 [Three-Dimensional Graphics and Realism]: AnimationAdaptive Sampling and Rendering of Fluids on the GPU