The idea is to run the simulation headless first to determine stable particle positions and sample colors from the source image. Then the simulation is replayed with those colors applied from the start.
To make it fast: - dynamic physics shapes are converted to static ones once they settle - after a lifespan threshold, they become pure graphics objects - all graphics shapes are batched into a single pixmap, so rendering becomes a single draw call
This significantly reduces runtime cost while keeping the visual result.
I made a short video explaining the pipeline: https://www.youtube.com/watch?v=4pfAlYC9Ydw