Particle Simulator

CPU rendering of particles using SDL2


Overview

A real-time particle simulation rendered entirely on the CPU using SDL2. The system handles thousands of particles with basic physics interactions including gravity, and collision detection.

Technologies


Architecture

The simulator uses a simple entity-based design where each particle stores position, velocity, and lifetime. The main loop handles physics updates and rendering in separate passes to maintain consistent frame timing.


Technical Challenges


Visuals

Profiling before optimization:

KCachegrind before optimization

Profiling after optimization:

KCachegrind after optimization


Lessons Learned


Links

GitHub ยท


โ† Back to Projects