Author
Edited
Apr 6, 2026 9:24 PM
The idea is to create a Shader that models certain particle behavior, as if each pixel contains a particle and each neighbouring pixel interacts with that particle.
Pipeline will be one feedback shader that contains the particle information and updates it. Then a second shader will interpret the output of the first shader and transform it into a pretty image.
We start off by having a few rules.
- Every pixel can only contain one particle or no particle at all
- A particle has the following properties:
- Mass (also density, type)
- Speed
- Direction (of movement)
- Position (within the pixel)
- Every frame call updates the pixel and the particle it contains, taking the neighbouring pixels into account
- When two pixels collide, they bounce off of each other, in general, but if the force is great enough, small particles will merge while large particles will split
- Use momentum and impulse formulas to calculate the collisions
- Speed cannot be greater than the width of a pixel (harsh limitation? Higher frame rate? Render and then speed up? Compute by taking even further neighbouring pixels?)