top of page

GPGPU PARTICLE LIBRARY (GPL)

GPL

GPL

Watch Now

Description

GPL is a small library aimed to make GPU-accelerated particle systems easy to achieve in any OpenGL project.

Overview

GPL uses Nvidia Corporation’s CUDA API to create GPU-accelerated particle systems. With GPL, you can easy set up a particle system for use with any OpenGL renderer, and write behaviour program kernels to modify the behaviour of particles and customize particle system inputs.

Behaviour Programs

GPL particle systems need CUDA kernels in order to process particles on the GPU, these CUDA kernels are wrapped neatly in the GPL_BehaviourProgram class, where users can easily load kernels, attach CUDA C header files and compile the kernels for use in particle systems.

Templated Data Structures & Vertex Attributes

GPL uses templated data structures to define particle system inputs. These templated structures are optional, if they are not provided GPL will use a default structure containing some basic global and per-instance information. Custom data structures can be used by using the templated constructor for GPL_ParticleSystem, where T = Global structure and U = Per-Instance structure.

Drawing Particles with or without Custom Meshes

GPL can draw particles however the user wants. When drawing particles the user can use the Draw() or DrawSimple() functions during the correct render pass. The DrawSimple function will draw particles as simple points, whereas Draw() will draw 3D particles with custom meshes. Custom meshes can be provided using the SetMesh() function of the GPL_ParticleSystem class using the vertex & index buffer handles for the mesh, and the vertex format provided from a GPL_VertexAttributes object. When drawing particles, the user will need to bind a compatible shader program before drawing.

Creating Particle Systems

Particle systems are encapsulated within the GPL_ParticleSystem class, to create a particle system the resources explained above are required. The particle system must be constructed normally using a GPL_BehaviourProgram and particle count  before setting data values and calling Initialize(). Once initialized, the particle system can be updated and drawn like any realtime object. The user will also need to call GPL_ParticleSystem::Sync() to ensure the last frame kernel updates complete before continuing with the current frame.

Features: 

  • Create a GPU-accelerated particle system and customize inputs using templated data structures.

  • Accelerated using the Nvidia CUDA platform.

  • Create custom kernels for your particlesystems and load them using behaviour programs.

  • Allows complete customization of vertex attribues, meshes & shaders for drawing particles.

  • Draw particles using custom provided meshes, or draw as pixels.

Libraries & APIs

  • OpenGL

  • Nvidia CUDA Toolkit

  • GLFW 3 (Project Specific)

  • stb_image.h (STB Header Library) (Project Specific)

  • TinyObjLoader (Project Specific)

GitHub Repository

bottom of page