This is a basic core-profile compliant OpenGL particle sandbox I used to create various visual effects and learning 3D concepts.
The code itself is pretty simple and follows a templated data-oriented design. The ParticlesSystem class is type-bound to the particle structure. It also contains a renderer, dynamics and emitters and a particle pool. For each experiment that I want to make I create a new cmake library project that is built in the GemParticlesApp executable project and by passing the project name as an argument to the executable you can select which experiment you want to load.
Here are some highlights that I managed to create with this system. Please note that, at the time of taking those screenshots, I had an i5-3570k CPU and Geforce GTX 660 GPU.
Lit particles or particles with 200 dynamic CPU lights | 500000 CPU particles attracted toward a location with hot and cold colors | and some rain... (1 million CPU particles) |
---|---|---|
The project uses CMake files for portability and the Conan package manager to manage the dependencies so in order to launch the whole thing you have to
mkdir build && cd build
conan install ..
(NOTE: it's possible you have to run conan profile new default --detect
beforehand and set prefered compiler and architecture to 64 bits which is the architecture I've been using)cmake .. -G "MY PREFERED BUILD TOOL"
)./GemparticlesApp.exe lit_particles
)I'm using various external libraries in this project which are listed in the file conanfile.txt
I pretty much built this from scratch looking up efficient design patterns and tutorials. So you'll find a handful of utilities that I built to help me create stuff more easily. Most of them are named as modules.
And last but not least, some wrapper utilities I built around ImGui examples. This includes
If you want to create your own project using this "engine" or the project structure you can
init
, run
and terminate
functions in your project)