Open asvarga opened 3 years ago
Two things worth noting:
TrailMap[int2(newPos)] = min(1, oldTrail + agent.speciesMask * trailWeight * deltaTime);
in Update
commute, so we don't have to worry about race conditions there.Diffuse
does exactly one write to DiffusedTrailMap
per pixel, so we don't have to do any other clears/copies.
Instead of
Update
both reading and writing fromTrailMap
, it now reads fromDiffusedTrailMap
and writes toTrailMap
. This seems to avoid concurrency issues because it fixes https://github.com/SebLague/Slime-Simulation/issues/2 (at least for me).