a10d225516 | 9 years ago | |
---|---|---|
.. | ||
1d-fbm.frag | 9 years ago | |
1d-fbm.png | 9 years ago | |
2d-fbm.frag | 9 years ago | |
2d-fbm.png | 9 years ago | |
README.md | 9 years ago | |
TITLE.md | 9 years ago | |
clouds.frag | 9 years ago | |
clouds.png | 9 years ago | |
index.php | 9 years ago | |
noise.frag | 9 years ago | |
noise.png | 9 years ago | |
notes.md | 9 years ago | |
ridge.frag | 9 years ago | |
ridge.png | 9 years ago | |
turbulence.frag | 9 years ago | |
turbulence.png | 9 years ago |
README.md
Fractal Brownian Motion
Noise tends to means different things for different people. Musicians will think it in disturbing sounds, communicators as interference and astrophysics as cosmic microwave background. In fact most of this concept have one things in common that bring as back to the begining of random. Waves and their properties. Audio or electromagnetical waves, fluctuation overtime of a signal. That change happens in amplitud and frequency. The ecuation for it looks like this:
- Try changing the values of the frequency and amplitud to understand how they behave.
- Using shaping functions try changing the amplitud overtime.
- Using shaping function try changing the frequency overtime.
By doing the last to excersize you have manage to "modulate" a sine wave, and you just create AM (amplitud modulated) and FM (frequency modulated) waves. Congratulations!
Another interesting property of waves is their ability to add up. Add the following lines to the previus example and pay atention how the frequencies and amplitudes change conform we add different waves.
- Progressively change the number of octaves to iterate from 1 to 2, 4, 8 and 10. See want happens.
- With over 4 octaves try changing the lacunarity value.
- Also with over 4 octaves change the gain value and see what happens.
Note how each in each octave the noise seams to have more detail. Also note the self similarity while more octaves are added.
The following code is an example of how fBm could be implemented on two dimensions.
- Reduce the numbers of octaves by changing the value on line 37
- Modify the lacunarity of the fBm on line 47
- Explore by changing the gain on line 48
This techniques is use commonly to construct procedural landscapes. The self similarity of the fBm is perfect for mountains, together with a close cassing known as turbulence. Esentially a fBm but constructed from the absolute value of a signed noise.
for (int i = 0; i < OCTAVES; i++) {
value += amplitud * abs(snoise(st));
st *= 2.;
amplitud *= .5;
}
Another member of this family is the ridge. Constructed similarly to the turbolence but with some extra calculations:
n = abs(n); // create creases
n = offset - n; // invert so creases are at top
n = n * n; // sharpen creases