pouët.net

Newb-Question: Animated Fractal- and Turbulent-Noise Shaders

category: code [glöplog]
 
Hi coders,

For years, I've been look with envy at all the tasty parameters of the fractal-noise-generator in Adobe After Effects:

- Recent tutorial at Video Copilot
- Church Motion Graphics (wow, there seems to be some soft of christian demoscene-like sub-culture. I esp. like how the guy is talking about the evolution-parameter)

I like how you can…
- Animate the evolution parameter.
- You can switch between different Fractal Types:
- Turbulent Smooth/Basic/Sharp
- Dynamic / Progressive / Twist
- Max (extremely cool)
- Smeary
- Rocky (very nice)

Can somebody help with with the following questions:

1. What the difference between Perlin-, Fractal-, and Turbulent-Noise? I roughly understand Perlin-noise. What's different here?

2. What does the "Fractal Type" setting do. Since AE offers the same selection for Fractal and Turbulent Noise, it seems to be some kind of post-thingy applied to the original algorithm.

3. Can a similar effect be achieved in realtime in good resolution (e.g. 1k^2 grayscale)?

thanks a lot,
tom
added on the 2014-11-14 18:53:55 by pixtur pixtur
perlin is a formula to generate 2d or 3d noise patterns.

turbulence is several blended layers of noise patterns (be it perlin or whatever) (with different values) to achieve a more realistic, layered noise effects, like with e.g. heightmaps for mountains.

fractal, dunno, i speculate it are noise patterns layered down using a fractal formula to get like interesting shapes in the noise (especially when the fractal gets animated, like in that sun flares video)? according to some googling: "knowing that a "fractal" is a shape which repeats a basic pattern at different scales, and "noise" is a bunch of random pixels, we can guess that "Fractal Noise" is a bunch of random pixels with a pattern that repeats itself at different scales. And that's pretty much what Fractal Noise is."
Yeah! This is roughly what I was thinking. But this doesn't help my poor non-math-brain to turn it into a shader... :-)
added on the 2014-11-14 19:21:41 by pixtur pixtur
Yeah, I have seen that shader. But I couldn't really figure what's going on there.
added on the 2014-11-15 10:49:24 by pixtur pixtur
what Maali said. iirc some fractal-noise was layers of noise upscaled and blended together using intensity levels in relation to the number of layers. for example 16x16 upscaled for example bilinear, the same with 32x32, 64x64, 128x128 too for example 256x256. then intensity level for each one is 1/5. animation works by blending to other noise-buffers and back if one wants seamless animation. the same works for seamless cloud-patterns.
added on the 2014-11-15 17:20:41 by rudi rudi
here's an old tutorial how explain how it works: http://freespace.virgin.net/hugo.elias/models/m_clouds.htm also has an exponential curve functions to make clouds look more realistic. its an old article, but it pretty much explains how to do it.
added on the 2014-11-15 17:23:13 by rudi rudi
Really? It's just cross-fading layers? But it looks like something is moving when the evolution-parameter is being changed. It just doesn't look like cross-fading. But maybe they are combining the cross-fading with some form of displacement...
added on the 2014-11-15 21:03:43 by pixtur pixtur
It's crossfading but per-octave; smaller octaves fade more frequent. Think of it as a slice of a 3D volume of Perkin noise.
added on the 2014-11-16 01:30:16 by Gargaj Gargaj
Its not just cross fading, its adding and subtracting or multiplying and dividing layers while having each layer at a different effective frequency. The same way that when you have sound waves or waves moving in water at different frequencies. Sometimes they will cancel each other out and sometimes they will add to each other.

Ok so perlin noise is pretty well known, its a specific smoothed noise function.

Turbulence or evolution is generally a distortion applied to the coordinates used to step through the perlin noise. So instead of smoothly stepping along X and Y (and also Z if it's 3d noise) with even steps, you apply some transformation to the coordinates to warp them. Often it is a variation of layered sin/cos modulation similar to the way a wave or plasma effect would be generated, or it can also be a variation on another smoothed noise. Sometimes this is controlled by time input and sometimes its just controlled by a variable parameter like your evolution slider.

Fractal is not always a specific function. Lots of software just uses the word fractal to describe anything that looks semi-random and cool. It is essentially just another way to warp or distort the existing noise function. A more literal fractal function would use the result from each iteration of noise to feedback into the calculation of the next interation to give a more complex and varied final result.
added on the 2014-11-16 01:36:34 by drift drift
@garg: that's a pretty good explanation. Didn't thought of a slice in a noise-volume. Sadly this sounds pretty expensive.
@drift: Interesting. I should be able to hack something together and compare the output to After Effects. Somehow I had hoped that their algorithm got published somewhere, though.
added on the 2014-11-16 09:53:24 by pixtur pixtur
I must confess I didn't look at your links and just gave information about generic ways to make noise based cloud/smoke type effects.

This link seems to give a good breakdown on how the after effects noise works.
added on the 2014-11-16 10:57:41 by drift drift
Quote:
Turbulence or evolution is generally a distortion applied to the coordinates used to step through the perlin noise. So instead of smoothly stepping along X and Y (and also Z if it's 3d noise) with even steps, you apply some transformation to the coordinates to warp them.

Reminds me of the water-like screen warp in old Haujobb demos, where they rendered the scene to a texture, put that on a screen covering grid mesh and messed with the coordinates. In general, you'd also apply some distance functions and atan2 to get some nice swirls. If you layer those functions nicely, you get something pretty neat looking. Better/more realistic turbulence would probably require some attractors/simulation and fake-physics, etc.
added on the 2014-11-16 11:03:46 by tomaes tomaes
@drift: thanks for the link. It's a great breakdown. Sadly it doesn't really go into detail with the evolution-parameter. But using block-interpolation and low complexity I should be able to reverse engineer that.

@tomaes: You mean "Liqued Wen"? Just watched it yesterday. actually, cynic should know what visualize did there. One first glance it looks like a traditional multi-sampled displacement to me.
added on the 2014-11-16 11:31:29 by pixtur pixtur
For some reason what Drift said
Quote:
Its not just cross fading, its adding and subtracting or multiplying and dividing layers while having each layer at a different effective frequency. The same way that when you have sound waves or waves moving in water at different frequencies. Sometimes they will cancel each other out and sometimes they will add to each other.


For some reason this also made me think of this portion of the Wikipedia blurb on Adams' Zone system . . . as it might be applied to create a more realistic illusion of depth/volume when you are using those multiple layers:

Quote:
Greater scene contrast can be accommodated by making one or more exposures of the same scene using different exposure settings and then combining those images. It often suffices to make two exposures, one for the shadows, and one for the highlights; the images are then overlapped and blended appropriately, so that the resulting composite represents a wider range of colors and tones.

http://en.wikipedia.org/wiki/Zone_System#Digital_photography

Not just for photography anymore, although in a way I guess it is also kind of like when you are making a song and you double some of the tracks in it slightly detuned. Although that's an aural illusion of volume, in the volumetric way not the loudness way.

Although maybe this is all silly obvious. But on the off chance it is helpful . . .
pixtur: It's kinda expensive if you wanna do it in a shader realtime, but for a demo you can also just precalc a volume during loading.
added on the 2014-11-16 15:23:29 by Gargaj Gargaj
Quote:
Sadly it doesn't really go into detail with the evolution-parameter.

I think "evolution" is just modifying the initial random values over time. How you do it is probably up to you and depends on how you generate them initially. If your random/noise function is discreet then it shouldn't be hard.
added on the 2014-11-16 15:31:25 by Gargaj Gargaj
Quote:
One first glance it looks like a traditional multi-sampled displacement to me.

Not sure what a "traditional multi-sampled displacement" is, but I think we roughly mean the same thing. Basically, a dynamically generated height/depth map that distorts orthogonally facing geometry. You do that a couple of times using different offsets and parameters (hence the multi-sampling?) and blend the results.
added on the 2014-11-16 19:25:45 by tomaes tomaes
Well, not really with geometry. But, I sometimes use it as a post-effect: Instead of having a single displacement-lookup, I sample 5-15 times with various displacement-intensities. Looks almost like oil brush-strokes. In "Liqued Wen" it looks like Visualize used 2-5 samples:

BB Image
added on the 2014-11-17 00:11:20 by pixtur pixtur
Ah, so you don't modify vertices, in your example. It looks like you just sample from the texture and then blend. But that's not displacement mapping, at least not the common definition. Or I'm using the term wrong. ;)

In the case of HJB demos, I think they use both. There are some visible grid-mesh based distortions, and then, for the smoother ones, your technique. Although I'm not sure you could do this fast enough on 2000ish computers with fixed pipeline GForces.
added on the 2014-11-17 11:49:39 by tomaes tomaes

login