   Making a fractal brush
  Hello!For my mapeditor i had a look at some other modern leveleditors. For example i found a nice thing in the starcraft II editor (yes, im in the beta). It is a special brush for texturing, as its previewed here:http://www.imagr.eu/up/4c02c15fde09d_texBrush1.jpgFrom the tooltip when i hover the button i suspect that it has something to do with fractals. Sadly i dont really know what that fractals should be or how i could implement something like that. Are there some algorithms especially for that?GreetingsPlerion   
  Ok, i managed it to get a first noise-brush that i can use to texture. It looks like:http://www.imagr.eu/up/4c02de179de25_noise.jpgThats basically not bad, but it has a problem. It should have bigger "clouds" like in the following picture:http://upload.wikimedia.org/wikipedia/commons/8/8b/PerlinNoise2d.pngI dont understand the algorithm so good yet, but i guess the problem is my "generator" which just produces random numbers.   private float Noise(float x, float y)   {  int n = (int)x + (int)y * 57;  n = (n<<13) ^ n;  return ( 1.0f - ( (n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0f);    }Is that the possible reason?[Edit]Its way better now:http://www.imagr.eu/up/4c02e24c2a317_noise.jpgBut still there are some sharp lines i would like to eliminate. Where do they come from? Im using a persistence of 1.0 / sqrt(2.0), 5 octaves and i am scaling the noise like that:double value = GetNoise(x, y, zoom);byte clr = (byte)((value * 128) + 128);clr = Math.Max((byte)50, Math.Min(clr, (byte)200));Greetings and thanksPlerion[Edited by - Plerion on May 30, 2010 4:31:48 PM];  You haven't stated explicitly but I assume the generator you are using now is a perlin (or value) noise since you are talking of persistence and octaves.The sharp edges probably come from GetNoise()-values beyond the [0..1] (*) interval (Check if that's the case) which then will wrap around in your final byte value. I suggest:- Use lesser octaves and/or a smaller persistence- Get your conversion to byte right: Clamp or normalize first, then convert.Hope that helps(*)Edit: Sorry, I misread. For the conversion (value * 128) + 128 to work the interval should be [-1..1), not [0..1]. Note the exclusive notation, so value must be < 1, otherwise you might get 128 + 128 = 256 which "is" again 0 in a byte.   ;  Thats right, clamping it to [0, 0.999] made that sharp lines disappear, now it looks exactly as it should!After the perlin generator i may also find another type of generator as in the picture above. Maybe someone has another idea of such a generator?   ;  Another algorithm that can create such noise (like the wikimedia picture you linked) is midpoint displacement.Additionally, you might also try and combine several generators, i.e. create two textures and combine them vie add, multiply etc.   ;Eric Chahi (Another World/Out Of This World) has returned to development, creating the ambitious From Dust for Ubisoft, and Brandon Sheffield sits down with him to find out the development concepts and techniques behind the impressive simulation that it offers.  View the full article