Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: how to musgrave's ridged multifractal?

  1. #11


    (meanwhile... this is the statement i am still confused by..

    Ridged-multifractal noise does not use a persistence value. This is because the persistence values of the octaves are based on the values generated from from previous octaves, creating a feedback loop (or that's what it looks like after reading the code.)

    a line or two concreting the intent of this would be much appreciated

  2. #12


    perlin noise, 8 octaves, cosine interpolation, no smoothing
    (imo workable since it's fantasy mapping anyway)
    Click image for larger version. 

Name:	ground.jpg 
Views:	117 
Size:	140.4 KB 
ID:	43823

    square curve (n * n) to height field
    (imo better results crossfaded between this and previous)
    Click image for larger version. 

Name:	groundmap.jpg 
Views:	69 
Size:	72.4 KB 
ID:	43820

    rectified interpolation on each octave
    (lol no)
    Click image for larger version. 

Name:	groundoct1.jpg 
Views:	71 
Size:	84.2 KB 
ID:	43821

    rectified interpolation on octaves 3-8
    (for example)
    Click image for larger version. 

Name:	groundoct2.jpg 
Views:	75 
Size:	90.0 KB 
ID:	43822

    i expect i'll find a method to achieve preferable results (pondering shift and erosion models.. being fairly nescient about the geologic processes, i'm licensed to use elementary methods to model them). still, i'd like to find out how it's normally accomplished.

  3. #13
    Software Dev/Rep waldronate's Avatar
    Join Date
    Mar 2007
    The High Desert


    Important notice: I'm not a mathematician, nor do I play one in real life (I have to remind the folks at work about that a lot as well, do don't be offended).

    The basic monofractal fBm(x,y) noise uses a noise function that is repeatedly sampled over multiple octaves at (x*2^octave,y*2^octave) and scaled by 1/(2^octave) so that scaled copies of the noise function are added together. The noise function is what makes the whole fractal thing work. The classic description of the basic property of the noise function is "zero mean and unit variance", meaning that the noise goes from -1 to +1 and will average out to 0.

    In addition to the basic fBm function, Perlin also describes a turbulence function. The primary difference between the basic fBm and turbulence is the use of an absolute value returned from sampling the noise function.

    Musgrave takes the turbulence function further by using the previous noise function value as a further scaling factor to move the sampling point in addition to the basic 2^octave scaling. What this does is cause broad smooth areas to form where the noise function is large and rougher areas to form where the noise function is small. It's this variation in apparent fractal dimension over the result set that makes the results more typical of a multifractal than a monofractal (where the fractal dimension is uniform over the results).

    Musgrave's models also include a whole lot of other controls over the system (for example, instead of 2^octaves for scaling factors, the 2 can be controlled). Other models use similar methods, but different terms for the controlling parameters such as persistence.

  4. #14


    cheers for the reply waldronate. i took a moment to verify that it was you that brought me here.. lol

    i work in audio dsp as a facilitator. many of my peers are certainly more formally inclined than myself. the affinity for mathematics is not the most significant factor in modeling. some people have "golden ears" and some not so my awards are more for muddling through with my less quantifiable skill set - here's an audio demo of my recent water model, i hope it will illustrate a parallel between the disciplines.

    it's a simple parametric model that requires a blob of chewing gum and some cellotape to hold it together -

    when i saw this image from your wilbur tutorial, and seeing your disavowals of comprehensive tectonic knowledge, i did expect that you are one of the people whose capabilitity is a matter of "art" as much as anything -

    this is very good. brilliant, if you'll permit me to say so. i've spent a lot of time in airplanes. you have calibrated the process, which i am guessing is simple, like my water model, artistically.

    hopefully you will forgive me for assessing you.

    i am quite familiar with this station in a technical field - the perlin 'turbulence' is known as 'rectification' in audio, and probably something like "ya just flip them bitsy things there, by gum" in yorkshire. i have frittered away years of my life translating julius orion smith's documentation, for instance so "zero mean and unit variance" is trivial to me. that's my bread and butter, and i was able to perform the rectification around a mean without having to abandon my unsigned shorts, of course.

    so often, these techniques are extremely elementary when the exclusory vernacular is shed. i also realise the utility and other more subtle factors that weight its use


    given your experimentation with this venue, i expect you can confirm that my 'turbulence'/'rectification'/flipping half the waveform results are due to my use of cosine interpolation instead of bicubic. i would expect that long ago you probably used cosine interpolation for perlin noise as well.

    i'm not convinced that switching to bicubic, hermite, or improved interpolations would give me results like this -

    (from perlin's lecture )

    the somewhat ridgyness here seems more fortuitous/a result of selection. i'm sure improved interpolation would give a better result, but not like this -

    which looks like a typical example of the output of musgrave's ridged multifractan ttbomk
    Musgrave takes the turbulence function further by using the previous noise function value as a further scaling factor to move the sampling point in addition to the basic 2^octave scaling

    this could be something like...

    n1 = [-1,+1] = a sample of generic perlin noise
    nt = 1 - abs(n1) = rectified perlin noise octave with "pointy bits up" to produce a contour like waves, rarifying peaks, placing nt in the range [0,1]

    "scaling" could be something like..
    scale = ((n1 * .5) + .5) to give the range [0,1]

    output = nt * scale * scale which would certainly rarify peaks

    also - image processing is extremely new to me. i have occasionally happened across it in my own work, i am generally out of touch with estimating what someone knows based on their demonstrated knowledge. as said, i don't know where i'm going with this, i do hope that it's not to ask you annoying questions for the next six months......

    so... i expect you are familiar to some degree with allpass filters, which have a group delay/phase response (appellation depending on your discipline) effect and pass frequencies with different temporal effects..

    an elementary first order allpass may pass high frequencies immediately but delay low frequencies by 180 degrees... if you pass a waveform through an allpass, you'll have no audible difference but an effect that can be used for fine tuning....

    however..... knowing absolutely nothing about the effect of allpasses in 2d/image processing, i certainly believe that you could run a perlin noise terrain map through a very simple allpass and achieve a continental shift effect... this would pile up amplitude transitions towards one edge (pending a monodirectional allpass from left to right on the x-axis) so that mountains would build along the left edge of the landmasses.

    one could do nifty things like modulate the allpass coefficient by the sample, or.. get out that blob of chewing gum and cellotape i mentioned earlier. it's less about mathematic education and more about prolific creativity, and, equipped with a wide and potentiating vocabulary of transformations, a very crude person could indeed achieve very realistic simulations

    anyway.. do you remember how that scaling thingy works?
    Last edited by xoxos; 04-08-2012 at 07:23 PM.

  5. #15


    (i'll add that i am interested in your incise flow algorithm.. i have yet to attempt it, i'm assuming it's some combination of averaging filter with lookup table or similar nonlinearity)

  6. #16


    (and... again, i apologise for asking.. if anyone would care to direct me to good any good sources/tutorial sites for general graphic procedure.. eg. how to draw antialiased borders for my continents so i don't keep asking.. otherwise i'd head to first, and it tends to be a swamp........)

  7. #17
    Software Dev/Rep waldronate's Avatar
    Join Date
    Mar 2007
    The High Desert


    The image you provided is exactly Perlin's turbulence function (fractalsum(1-abs(noise(n,pos))) rather than the simpler fractal sum(noise(n,pos))) where n is the current octave number and pos is the input position to sample. Musgrave's RidgedMultifractal adds only an additional term that is more along the lines of fractalsum((1-abs(noise(n,pos))*(1-abs(noise(n-1,pos)))). That extra term makes for much broader basins and rougher mountain areas.

    The image you provided is most likely based on either a cubic interpolation or a quintic interpolation function ( for the quintic-based noise function and the justification for it over the basic cubic). The interpolant is the basis of the noise function; the character of the result depends to a large extent on the basic table used for random numbers and the interpolant between samples in that table. Some folks use an arbitrary image as the input to the noise function, while others dispense with the noise table entirely and generate the noise values directly from the sample coordinates themselves.

    Distorting the inputs before doing the inputs is described by Musgrave as "domain distortion" and a search on that term might be fruitful.

    The incise flow algorithm is a very simple one: a direction map is calculated for each point on the surface that shows the local "down" in altitude. Then that map is traversed and each pixel sends a counter up the gradient, adding one to each sample on the flow map. At the end of this operation, every point on the surface then contains a value that represents the number of cells that would contribute to the flow at that point. Applying a logarithm operator and a threshold operator to the flow map will generate "rivers" across the map.

    Antialiasing is also pretty simple: just sample the noise function multiple times at each displayed pixel, then use the average of those samples as your noise value. If you'd rather do coverage sampling, then the percentage of samples above sea level would represent your land opacity over ocean at that point. The same algorithms used by ray tracers and a lot of GPU renderers can be used here as well.

  8. #18


    simple solutions. musgrave's process is really then squaring [0,1] ranged samples, and as you gather from my prose, is likely to be expressed in yorkshirean consequently

    i absolutely dispensed with the fractal perlin. i generate each octave as a separate array in series, obviously the choice of doing so has no discernible effect on the outcome.. as of yet, anyway. (except for efficiency.. presuming the scale makes the size of the data immaterial as long as the lower octave are not repeated at an implemented scale, so that an array indexed by unsigned chars would produce faster processing).

    my guess for drawing borders is to weight adjacent pixels by 50% and corners by 25%, generate one layer from this and another run or two using similar filters.

    ftr i spent a bit of time running triangle waves through allpasses yesterday for gauging height field transformations.. this would of course move data eg. along x, i'd think two or three further steps would be necessary to contain it to the desired range and distribution. i'm sure there are simpler ways to achieve similar results.

    in audio dsp there is a repository for common algorithms at i've been searching for something similar for graphics. posted here for those with similar interests, my best find was - and a reference to the "graphics gems" books, which should at least provide enough vocabulary for interested parties to refine searches.

    thank you for your assistance, and enjoy the inspirational high desert

    (nb. i wonder if this site would benefit from the addition of a generative coders forum)
    Last edited by xoxos; 04-09-2012 at 04:59 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts