HomeWildfire Games

Replace SmoothElevationPainter 8/9 weights with 1, so that the elevation of a…

Description

Replace SmoothElevationPainter 8/9 weights with 1, so that the elevation of a heightmap grid vertex is exactly the average of the new elevation and the average of the existing elevation of the 9 vertices that are the current vertex or adjacent to it.
Doesn't change the result perceptibly while removing otherwise incomprehensible magic numbers from rP2519.
The equations are so similar that one might expect that the averaging was the intended algorithm.

Event Timeline

Besides that, the prior algorithm also weighted the vertices at the map border much more than vertices in the inside of the heightmap grid, see comment in https://code.wildfiregames.com/rP2519#23918

That the result of new weighting is indistinguishable is demonstrated on the Gear map for instance:

Before:

After: