fluffy January 18, 2001, 06:34 PM 

"Multifractals" are very good for procedural terrain generation. That's an interesting way to generate regions for multifractals for procedural terrain and the like. What you should probably do is keep track of the two highest ones and use their relative heights as a blending value between the outputs of their respective generation functions. If you want to get really fancy, you could even just calculate a weighted average of all your generation functions, weighted by the height of their respective Perlin maps at that point. Then you can generate entire worlds with just a few values passed into the respective Perlin functions.
Sorry if this is even less coherent and understandable than I normally am, but I'm kinda distracted right now. Whee. Let me try explaining this a bit better through pseudocode:
// Generic class for individual fractal generation
class Fractal {
Fractal();
virtual float operator()(float x, float y) = 0;
};
class Perlin: public Fractal {
Perlin(blah blah blah);
float operator()(float x, float y) {
// blah blah
}
};
// Stuff associated with a perlin map
struct LandType {
Fractal heightfunc;
Material material;
etc.etc.
};
typedef map<Perlin, LandType> MultiFractal;
float Height(float x, float y, MultiFractal fractals)
{
// weighted average of the heights
float ht = 0, ttl = 0;
for (MultiFractal::iterator iter = fractals.begin();
iter != fractals.end(); iter++)
{
float wt = (*iter).first(x, y);
ht += (*iter).second.height(x, y)*wt;
ttl += wt;
}
return ht/ttl;
}
and so the structure you setup to get an overall height for that point on the world would just be a map which associates fractal generators with their respective Perlin map. Obviously it'd be most useful with stateless fractals where, given the same parameters and coordinates it'll always put out the same output.
Whee.
