Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arceryz/raylib-gpu-particles
Raylib 100% GPU particles example in 3D. Uses compute shaders and is fully documented. Millions of particles at 60 fps on a laptop.
https://github.com/arceryz/raylib-gpu-particles
c compute-shader example glsl gpu gpu-acceleration gui lorenz-attractor raygui raylib raylib-examples tutorial
Last synced: 2 months ago
JSON representation
Raylib 100% GPU particles example in 3D. Uses compute shaders and is fully documented. Millions of particles at 60 fps on a laptop.
- Host: GitHub
- URL: https://github.com/arceryz/raylib-gpu-particles
- Owner: arceryz
- License: mit
- Created: 2024-04-09T18:19:21.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-06-08T09:55:45.000Z (8 months ago)
- Last Synced: 2024-06-08T10:55:54.372Z (8 months ago)
- Topics: c, compute-shader, example, glsl, gpu, gpu-acceleration, gui, lorenz-attractor, raygui, raylib, raylib-examples, tutorial
- Language: C
- Homepage:
- Size: 23.4 MB
- Stars: 40
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Raylib GPU Particles
**This example creates a 3D particle system fully on the GPU**.
On a simple laptop (MSI Katana) you can draw 2 million particles per frame at 60 fps. The particles are rendered as triangles with direction and magnitude.
The code is **Highly** documented, you will absolutely understand! It uses Raylib, rlgl (lower level Raylib) and Raygui. You can learn GPU Instancing, particle billboarding and rotating to movement and compute shaders all in Raylib!
---
This example requires raylib to be compiled with `GRAPHIC_API=GRAPHICS_API_OPENGL_43`, otherwise you won't be able to use compute shaders.Features:
- **Highly** documented, you will absolutely understand!
- 100% GPU updated and drawn particles.
- `raylib.h` API.
- `rlgl.h` lower level API.
- `raygui.h` API for **fun** sliders and playing around.
- GPU Instancing example.
- Particle billboarding and rotating to movement example.
- Compute shader example.## Usage
There are four files in this project. The shaders should be placed under the /Shaders subdirectory. Make sure you have `raygui.h` in your source.- `main.c`
- `particle_compute.glsl`: Update the particles positions and velocity.
- `particle_vertex.glsl`: Convert triangles to particles by rotating, scaling, coloring and facing them to the camera.
- `particle_fragment.glsl`: Output color.The simulating parameters can be modified with sliders provided by RayGUI.