Skip to content

Particle accelleration with OpenGL 4.3, using the compute shader to calculate particle movement on graphics hardware.

License

Notifications You must be signed in to change notification settings

MauriceGit/Partikel_accelleration_on_GPU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particle-Simulation using the GPU via the OpenGL Compute-Shader

This particle simulation is more like a proof of concept for myself or others, to show and understand how compute shaders in OpenGL work. Using the knowledge I gathered from this project, more complex, fascinating and fast projects are possible, which use the power of the graphics hardware for computations.

The final result looks like that:

Particle-Simulation

Animation

Each particle has a life span in which it fades from red (new born) to blue (about dying). When a particle dies, it respawnes in its negated (x,y,z) position.

The movement itself is computed using an Euler integration method for each particle.

There are several global randomly moving attraction points. Particles are attracted and accelerated by these points.

Example screenshots:

Particle-Simulation Particle-Simulation Particle-Simulation

Install && Run

I tested an ran this simulation on a debian-based Linux OS (Ubuntu, Mint, ...). It should run on other machines as well but is not tested.

System Requirements

The following system attributes are required for running this simulation:

  • A graphics card supporting OpenGL version 4.3 (For the compute-shader!).

  • Unix-Libraries: xorg-dev and mesa-common-dev

Both GLEW (The OpenGL Extension Wrangler Library) and GLFW (Window-Manager) are now included locally, so no system wide installation is necessary!

For a system wide installation, further information is available under the following links:

Running

Compiling and running should work under windows. OSX is not supported as the available OpenGL version does not reach 4.3. In the root directory, execute:

  • cmake .

  • make

  • cd bin/

  • ./particleSim

While the simulation runs, you can move around (always looking to the center!) with your mouse (left-klick and move) and zoom in/out with your mouse (right click and move up/down).

More Screenshots

So, here are some more screenshots, because screenshots are awesome :)

Particle-Simulation Particle-Simulation Particle-Simulation Particle-Simulation Particle-Simulation Particle-Simulation Particle-Simulation Particle-Simulation Particle-Simulation

You can find some more screenshots in the screenshot-folder: More Screenshots :).