Kayle Gishen

Introduction

Using the parallel nature of n-body simulations we can take advantage of the GPU's large amount of cores. Applying Smoothed Particle Hydrodynamics to an n-body simulation replaces the simple gravity force with the internal and external forces fluids react under. Using imageStore and imageLoad we can remove the necessity of using a frame buffer to store values.

Mass Density Computation

The system is modeled using particles with equal mass and each particle has a force applied from all other particles. The Particles are setup as a VBO of size n. We then use the x-component of the vertex as the index into a 1D texture where all the positions are stored. A shader implementing the Mass Density kernel then runs over all the particles and stores their respective mass density in the alpha channel. By reusing the texture we can improve performance by not loading additional data and reducing memory operations.

Force Computation

The simulation accounts for Buoyancy, Pressure, and Viscosity. The resultant force acting on a particle is simply the sum of the internal and external forces divided by the mass density of the particle.

10k Particles

Simulating 10k particles the system achieves an average frame rate of 50 FPS.

16384 Particles

By increasing the amount of particles, the simulation is more convincing, however the frame rate decreases rapidly with a result of approximately 20 FPS.