I had never done such things before, but I did some complex cellular automata. Sorry if this is too vague.
The main idea is to mark all particles that should “continue to fall” or “not move” and exclude from complex processing (with a special short / fast processor for the “falling” list - all you have to do is reset each pixel).
- The acceleration for non-moving particles - static particles (I will call them S-particles) - is that they do not move. Mark it for all non-moving areas (for example, the gravitational-immune "wall" or "bowl" that the user can make. Mark the particles above it S if they are stable, for example, for a liquid if it has S-particles, and on both sides, it doesn’t move.For something like sand, which forms piles, if it has S in each of the three spots under it, it creates a bunch, you will get nice 45-degree piles like this, I’m sure that you can change it to make some things steeper or less cool piles. e S from bottom to top.
- The acceleration of particles without a particle below them decreases - F-particles. Particles with an F particle below them are also F particles. Mark also from bottom to top.
- Particles without the F or S sign are complex , they can start to fall, stop falling or rolling, use the slow processor that you already have to deal with them, there should not be much.
In the end, you will have many many fast particles. Those in the heap / lakes and those who go down. The remaining particles are those located on the edge of the slopes, on top of lakes or in other difficult positions. There should not be nearly as many as fast particles.
Visually mark each kind of particle with a certain color, complex particles are bright red. Find cases where it is still slow, and see what other kinds of fast processors you should do. For example, you may find that creating a large number of piles of sand creates many red areas along the slopes, you may want to invest in accelerating “rolling zones” along the slopes of the piles.
Hope this makes sense. Remember to come back and edit as soon as you come up with something!
source share