Skip to content

Subash-A-A/particle-life-gpu

Repository files navigation

Particle Life GPU Simulator

This project, developed in Godot, simulates up to 100,000 particles interacting with each other using a GPU backend through compute shaders. It employs spatial binning to manage particle interactions efficiently, ensuring high performance even with a substantial number of particles.

Simulation Parameters

NUM_PARTICLES: Specifies the number of particles in the simulation
NUM_COLORS: Defines the number of different particle colors/types in the simulation
PARTICLE_SCALE: Sets the scale/size of the particles
UNIT_DISTANCE: The unit distance used in particle interaction calculations. Determines the range within which particles influence each other
FRICTION: The friction factor applied to particle velocities, affecting how quickly they slow down
MAX_VELOCITY: The maximum velocity a particle can attain
TIME_SCALE: Scales the simulation time step, affecting the speed of the simulation
FORCE_SCALE: Scales the force applied during particle interactions
interaction_forces: A 2D array where each element represents the interaction force between different particle colors/types
interaction_distances: A 2D array where each element represents the interaction distance between different particle colors/types

Tested on:

CPU: AMD Ryzen 5 4600H 3.00 GHz
RAM: 8 GB
GPU: Nvidia GTX 1650 Ti 4GB

Simulation FPS (tested with the above specifications):

10K particles --> 450 fps
25K particles --> 170 fps
50K particles --> 60 fps
100K particles --> 15 fps

Screenshots

Screenshot from 2024-07-02 17-48-40 Screenshot from 2024-07-02 18-47-57 Screenshot from 2024-07-03 12-59-41 Screenshot from 2024-07-03 13-02-03 Screenshot from 2024-07-03 20-57-37 Screenshot from 2024-07-04 11-34-37

About

Simple rules, complex behaviours

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published