Sunday, November 10, 2013

Field Terrain Fractals

It occurs to me that treating fractals as fields that iterate from the previous and are solvable recursively for some subset so long as it doesn't diverge from the entire infinite field actually provides for not just a much better diamond squared fractal but rather for an infinite array of different types of fractals. There are basically only noise algorithms to do landscape like things, but if you take my algorithm and simply use it to recursively iterate the iterations within a limited scope you can produce a hell of a lot of different fractals.

Not to say they aren't useful, but most fractal iterations simply iterate and store the entire fractal in memory. To some extent that's not really needed. You could create a series of linear fractions say by starting by in infinite random field and then each iteration inserting the midpoint offset displacement just along the width. You'd get the 1d midpoint replacement fractal in infinite rows.  Or perhaps more useful you could apply say a box blur to a landscape, insert additional area with average random offset and repeat each iteration.

If (iteration == 5) {
     request sliver of the Iteration5 from iteration4 requested + 1 on each side,
     Apply a block blur (or frankly any convolution), and return the center bit that is accurately blurred.
}

You could likely produce pretty good landscape noise by inserting progressively less random additional points between all your current points and then applying a blur to all points. Even larger Gaussian blurs wouldn't be too difficult. In fact, there are some artifacts in diamond squared that cannot be fixed. Some points simply have different probability curves based on their location. If you always got the maximum possible random number every time, for a diamond squared field, you'll notice a *VERY* apparent pattern.


This typically blends into the noise and only matters for the standard deviation of the pattern. So long as they average at 0, it isn't very obvious (if you have run so that on average you deviate in some direction, it becomes apparent). It doesn't really have to be this way.

No comments: