Work Samples
CV
About Me
Email Me!

Portfolio | Stefan Andersson

Work Samples
CV
About Me
Email Me!
The Basics

The Basics

While I got some help with the basics, I had to create my own temperature system. Temperature here is simply a float value passed from particle to particle that affects their behavior, allowing them to emulate solids, liquids and gasses.

The biggest annoyance working with SPH is that particles often tend to collapse into each other when the pressure gets too high, which meant I had to spend a lot of time tweaking settings just to try to avoid it, but never being able to solve it completely.

Optimizations

Optimizations

After making some serious optimizations, I was able to have huge amounts of particles. In this gif, I’ve simulated 131.072 particles at around 100FPS; at most I managed to push it to 262.144 particles at 60 FPS, but unfortunately Unity appeared to freeze if I increased the size of the grid any further.

Note that these .GIFs have been sped up a fair bit; To get good precision and avoid total collapse, a particle can only move a small distance per frame, which slows down the whole simulation even with good FPS, and I didn’t manage to find a good solution to this problem.

Final Result

Final Result

This is the final result and where I decided to stop. On the left is a block of ice and on the right is lukewarm water.

For this final version, I decided to render the bins that particles are grouped into for optimization purposes and use the amount per bin as the alpha, rather than rendering the particles directly. This reduces the apparent amount of particles on-screen as one bin can contain up to 16 particles, but it greatly improves the visuals at a lower cost than something like metaballs.

1 2 3
Previous Next
The Basics
Optimizations
Final Result
Back to Top
stf.andersson@gmail.com