Today I optimized my terrain deformation code to be 20x faster for paths and 3x ...
Rune Skovbo Johansen @runevision@mastodon.gamedev.place
Today I optimized my terrain deformation code to be 20x faster for paths and 3x faster for water streams.
Long ago this ran on GPU. I later moved it to CPU for some performance gains, but the inherited code still had grid cells as the outermost loop. I added early outs outside the bounds of a path, but those bounds can be quite big.
So today I swapped the inner and outer loops. Path bounds no longer used, instead each small path *segment* only iterates over the grid cells within its bounds.