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.
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
CPU: AMD Ryzen 5 4600H 3.00 GHz
RAM: 8 GB
GPU: Nvidia GTX 1650 Ti 4GB
10K particles --> 450 fps
25K particles --> 170 fps
50K particles --> 60 fps
100K particles --> 15 fps