PDA

View Full Version : Turbulence logic


rudinie
09-13-2007, 08:34 AM
Whenever i'm looking at an Alan McKay tutorial it seems so simple to get control over the turbulence in wind. It's not very hard to just start out with some numbers for turbulence, frequence and size and then by trial and error get to the best looking results. I wish however to actually understand what the numbers mean and i'm having a hard time. When i think "size" will control the size of the "waves", i'm confused because the higher i put the size, the smaller the "waves" get. What exactelly is the logic behind the numbers?

charleyc
09-13-2007, 09:15 PM
Think of it more like frequency. The higher the number, the more 'waves' in the same amount of time, thus, the smaller they will get.

BrandonD
09-13-2007, 10:40 PM
Believe me, it was a revelation to a degree for me to finally figure out how to use the Turbulence parameters in Wind (back in 1997). The problem is the default values have been terrible since day one. Some basic explanations:

Turbulence - the amplitude or strength of the noise
Frequency - the detail of the noise
Scale - the scale of the noise field

Think of it as a 3d Noise map that perturb particle positions as they move through it. In that case, the Turbulence parameter would be like the strength value of a map like say 10% Bump or 50% Bump (ie more or less perturbation). The Frequency is like the Levels on a Noise Map (sort of), where higher numbers give you more "jaggies" and low numbers give you long, wide, smooth variations. Finally the Scale parameter is just like the Scale parameter on a Noise Map. This is probably the most important parameter to start off with correctly and it's unintuitive because a Scale of 0.001 will give you huge distortions of particles while 1.0 will give you very tiny almost inperceptible distortions.

This is why a lot of people never could get their brain around it in the early days of MAX. You'd start dialing in numbers and nothing looked right at all. For me it took the release of the new defunt Outburst particle system to finally get my brain around it all.

The magical numbers I've been using for years as a default are:

Turb: 0.5
Freq: 0.15
Scale: 0.05

In most scenes this gives you an immediate feedback as to how the particles are perturbed. Next I start raising or lowering the Scale to match the scene better. Next I adjust the Turbulence (strength) so the particles are either really pushed around or only slightly, and finally I adjust the Freq to figure out how jaggy I want the motion to be.

I've written about this in detail all of the cigarette smoke tutorials I wrote for the MAX Tutorials guides over the years. One of the most common workflows I've used along those lines is to create two different Wind SWs: one large scale and one small scale. I rename them TurbSmall and TurbLarge because I like to separate them from the actual directional wind forces and name them according to what they actually do. Then I blend the two together, first to create large scale turbulence, then slowly feed in smaller scale turbulence with the second SW. This methodolgy has worked for me for close to 10 years, so much so that when I was at Blur I wrote a simple script that automatically created both with my own defaults and snapped them to the origin - one button click.

BrandonD
09-13-2007, 10:43 PM
Oh yeah, I should point out that a Displace SW using a series of masked Noise Maps is another useful method of introducing turbulence to particles ;)

SoLiTuDe
09-14-2007, 12:01 AM
This methodolgy has worked for me for close to 10 years, so much so that when I was at Blur I wrote a simple script that automatically created both with my own defaults and snapped them to the origin - one button click.

*Frantically searches the servers for this magical "wind" script* I've been meaning to do that same exact thing for a while now, but somehow I keep forgetting.

Great explanation... I've always thought of the frequency though as an animated phase value... The reference even says" Frequency—When set greater than 0.0, causes turbulence to vary periodically over time. " ..essentially adding more movement / detail... No idea really... all I know is it makes stuff look better =)

rudinie
09-14-2007, 07:16 PM
Thank you very much for the great in depth reply, i'll have to read it again to fully comprehend i think but i'm sure it will help me big time. Thanks again for taking the time to explain.
I love this community!

BrandonD
09-14-2007, 10:29 PM
Ik leefde in Maastricht, zodat u bent welkom. ;)

grury
09-17-2007, 08:06 AM
Sometime I create a simple flow with particles shooting up on a straight line from the pivot, then I add the wind SW, this way I can exacly see how the wind affects the particles scale wise, and adjust it to my liking.

Cheers

amckay
09-19-2007, 07:38 AM
yep - if I ever make it all look easy, it's because I work at a set scale, so all my settings I'll usually know what they're going to look like ahead of time, and that helps visually queing the look. So always work at a propper scale so you get predictable results. That and play with your settings so you're familiar with what they do and what they'll do to your fx.

Thanks Brandon - that's a really good explanation of it all. One thing I've found with frequency is if you bump it past 2.0 things start to get wonky and jellow like in motion. Also introducing multiple turbulences is always good, like a big one that has smaller frequency and larger scale, and then one in the middle then one smaller with higher frequency and you can get some very intricate motion out of it.

That's pretty much all I can add in there - Grant Adam made betterwind which has a lot more controls in it which can be pretty useful too!

JohnnyRandom
09-19-2007, 04:51 PM
That's pretty much all I can add in there - Grant Adam made betterwind which has a lot more controls in it which can be pretty useful too!

Looks fantastic! I like the looks of the start/stop decay and xyz scales. Do you think he could recompile it for max9 32/64?

Bobo
09-20-2007, 06:36 AM
Here is a visualisation of Wind Turbulence:

http://www.scriptspot.com/bobo/stuff/cgtalk/turbulentwind/Wind_Turbulence.mov

Here is the Max 9 scene:

http://www.scriptspot.com/bobo/stuff/cgtalk/turbulentwind/WindTurbulence.zip

Basically, a Birth Script creates a grid of 20x20x20 particles.
A Script operator reads the speed of each particle caused by the Wind Force and orients/scales the particle to visualize the vector of the wind field at that point, then resets both speed and position to keep the particle where it was born.

You can enable the second particle system and watch it running through the field, or change the wind settings to see how the pattern changes.

It requires some caching as it isn't very fast (a Data Operator from Box #3 would do a better job, but not everybody has one)

SoLiTuDe
09-20-2007, 07:41 AM
Pretty cool, Bobo!

Let's not forget about: http://www.footools.com/3dsmax_plugins.html Force Viewer

Although with multipliers and such, bobo's way is more accurate to how your particles will react.

Bobo: can you post a box 3 version anyway? :)

Bobo
09-20-2007, 06:03 PM
Pretty cool, Bobo!

Let's not forget about: http://www.footools.com/3dsmax_plugins.html Force Viewer

Although with multipliers and such, bobo's way is more accurate to how your particles will react.

Bobo: can you post a box 3 version anyway? :)

I have only the Max 9 version of it.

It runs really fast and actually reveals a small bug in the scripted version - because the script was using Matrix from vector, the Z axis was specified but the X and Y were flipping around. The Box #3 version looks much smoother because I had to specify all 3 axes of the matrix.

Here is what I did:

*In the Birth Script, I added a line that enables the Script Vector channel and another that writes the initial position into it.

*In a Data Operator, created a Standard Output to write to the Particle TM. I used a Vector --> Matrix converter to create a matrix out of 4 vectors.

*A Standard Input reads from the Script Vector channel and writes to the (I4) of the Output to keep the particles at their original position.

*A Standard Input reads the Speed Vector, a function normalizes it and another Function calculates the Vector product (cross product) of it with a vector of 1,0,0. The result goes through a Normalize function into the (I2) input of the TM.

*The normalized result also goes to another Function where its Vector product with the Speed Vector is calculated and the result goes through a Normalize function into (I1) of the TM. Now we have the orientation of the particle to point at the speed direction.

*Inside the same Data Operator, the Speed Magnitude is multiplied by 3000 and sent to the Scale Z component to make the particle scale in the speed direction.

*A second Data Operator dumps the vector of 0,0,0 into the Speed channel to reset the value as we don't want the speed to accumulate, only show the last frame's value.

JohnnyRandom
09-20-2007, 08:37 PM
Nice visual aid, thanks Bobo!

Force viewer works really well but no worky in max64 :(

charleyc
09-21-2007, 01:54 AM
Very cool Bobo.
Here is something similar that doesn't use any scripting or Box3.

www.charleycarlat.com/Tests/PF_SpaceWarpView.zip (http://www.charleycarlat.com/Tests/PF_SpaceWarpView.zip)
R9 format

JohnnyRandom
11-07-2007, 02:58 AM
FYI

Betterwind
http://rpmanager.com/plugins/BetterWind.htm

Awesome! thanks-a-bunch Grant & Allan for max9 x32 & x64:thumbsup:

grury
11-07-2007, 09:50 AM
Awesome! Thanks for the link.

CGTalk Moderation
11-07-2007, 09:50 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.