Midpoint displacement will work provided that you feed in the right sort of values.
To get sharper peaks & valleys, you need to favor high & low numbers while suppressing mid-range numbers. For instance, assume some function rnd()
returns a uniform random number in the range [0-1]. Then (sin(rnd()*PI)+1)/2.0
would skew that result to favor values closer to 0 or 1. Other mathematical transformations that would work, this one happens to be easy to prototype in a spreadsheet. If you need to do this in real-time, you might want something faster than sin()
.
Also, I would only apply the above to the first set of values used by the midpoint displacement. On the "interior" of the algorithm, I'd use uniform noise. That being said, it's easy enough to try it both ways & see which suits you better.
One thing this solution won't do is pair up stalactites with stalagmites other than random chance. If that's a requirement, you should update the question accordingly.