.nbody

alex hills

 

.summary

This project was entirely focused around making an nbody simulation on the GPU.

.process

First, we made a texture containing positions, and another texture containing the past positions of particles [p(t) and p(t-1)]. Then in another shader, we take the old positions of particles and put them into spatial bins based on their positions. These bins are later used to implement the barnes-hut algorithm on the gpu.

I made a sphere of particles (16,384) with the center particle having a much higher mass than the others, and an initial upward velocity. This caused fun patters, as you're about to see:

.pictures