   [fixed] Heightmap manipulation, smoothing
  I have a heightmap that i've generated from noise. I then correct an arbitrary number of the height samples to align them to various geometry.I'm curious how to smooth the neighboring height values to meet the new values.I played with a few ideas off the bat and this one has the best results so far.Sorry if my attempts at psuedo code turned out confusing.void CreateAffectAndLevelMap(){  HeightMap heights = RandomMap();  const map<Height, displacement> affected = MakeArbitrayHeightChanges(heights);  foreach (Height h in heights)  {    pair<Height, distance> nearest;    //FindClosest returns the height which is nearest in the horizontal plane    if (Kernel(h, kernelSize).FindClosestIn(affected, threshold, nearest))    { float influence = Min(1 - (distance / threshold), 1.0f); influence *= influence; //square fall off h += affected[nearest.Height].displacement * influence);    }  }}Latest Shot: http://i41.tinypic.com/mcpytu.pngFixed edge falloff issue, threshold was larger than min kernel radius. Now i just gotta figure out the rippling. It appears to be some kind of aliasing, like maybe i'm using ints on accident..Here are some screen shots. The first shows the random generated map. The second and third are after the height adjustments and leveling have been applied.Edit: here's a better shot of the artifact in a more worse case scenario. The rippling effect is strange, it must just be a mistake on my part, and i aught to be able to take care of the edge..http://i41.tinypic.com/qoar8j.pngIt's not a bad first attempt but the results are noisy. Close to the road you can see ripples in the heights of the terrain.I'm sure there's a couple tweaks i could make to make my algorithm look good. But i'm wondering what other approaches to this problem would look like?I like the fact that my algorithm could smooth the terrain to any arbitary height changes, rather than constrained to smoothing to a spline or something. But i won't turn down any suggestions.I'd considering using gaussian blur passes like in blooming. But I dont want an additive effect near the affected heights, i want a targeted interpolated effect.I'm also curious, what are the defacto height map modification tools? I've implemented a heightmap editor before and had simple raising and lowering. But could someone give me a list of tools that a height map designer could not live without?Thanks.Fixed: The remaining issue, the rippling, was caused by modulating the displacement. Since the displacement was actually a step function in most cases, it caused a step output in the mesh. I switched to Lerp(origHeight, closestAffectedHeight, 1-dist/thresh) and everything is smooth.. sorta :) it's still made of triangles after all.[Edited by - bzroom on June 30, 2009 10:30:49 PM]