r/Simulated • u/Fit-Heat4806 • 1d ago
Research Simulation Optimized the hell out of it
In my previous posts you kept asking about the performance of my fluid based explosions and smoke system.
So here I am with an absurdly extreme benchmark. Turns out base version had trouble hitting 60 FPS so did some optimizations. In short:
- took bullets, sparks and other effects off of the world's sprite tree so the renderer doesn't have to sort them,
- smoke simulation ran multiple steps in a single frame so one slow frame had an impact on next frames. Now it runs at most one step per frame,
- the air is now solved only in a small window around smoke that is actually moving,
- halved number of particles for smoke clouds. Made then bigger and heavier. Tried to bring this number even lower but explosions started looking funny,
- a lot of caching