- Main page : Particle samplers
The procedural turbulence sampler allows you to sample an infinite 3D noisy turbulence field. It is useful to fake fluid movement, like particles of smoke, sparks, or ashes, flowing through a turbulent medium.
Although its primary purpose is to simulate an incompressible vector field, it can also be used as a generic 3D noise.
The turbulence sampler will render a preview of the noise in the 'ParticleNode Editor' panel. This preview is a slice on the X/Y plane in the 3D noise. However, the synthesized noise is isotropic, so slices on other planes are equivalent.
- zoom in/out this preview by using the 'zoom' slider.
- change the field viewed by clicking on the drop-down on the left-side of the menu toolbar, next to the zoom slider. You can choose between 'Curl' and 'Potential'
- change the preview size by right-clicking in the particle node editor, you'll have the choice between 256*256 and 640*320:
for each sampler, the following is published to scripts:
float sample(float3 location); float sampleCurl(float3 location); float samplePotential(float3 location);
'sample' function redirects to either
'samplePotential', depending on the value of the
'DefaultSampledField' attribute. By default, it samples the curl.
NOTE: as the procedural turbulence samplers sample an infinite turbulence field, the input location can be any position in 3D space, without bounds.
However, note that extremely large positions (1.0e+8 and above), or extremely large scales, might lead to imprecisions in the sampled results.
Basic particle grid using the turbulence sampler, with a capsule billboarder stretched along the velocity vector to visualize the flow field:
|capsule billboarder||debug velocity visualization|
Here are the different interpolation modes (Linear, Cubic, Quintic), for each possible field (Curl, Potential, and FastFakeCurl (activated by checking the 'FastFakeFlow' checkbox)
Linear is the fastest, Quintic gives the smoothest movement when the sampler is used as a velocity field for particle movement, for example through the physics evolver.
between 'Curl' and 'FastFakeCurl', 'FastFakeCurl' is the fastest of the two, but gives the lowest quality turbulences.
Here are a few examples, tweaking some parameters:
|Octaves: 1||Octaves: 3||Octaves: 6|
This is one of the most expensive samplers. In order to maximize performance, there are a few things you should be aware of:
- The 'Octaves' parameter is what impacts performance most. it is DIRECTLY related to the amount of work the sampler needs to do.
- Double the number of octaves, it will double the time it takes to compute the turbulence.
- Generally, two octaves are sufficient for most cases. you might even get away with a single one for particles that don't live very long.
- However, the less octaves you have, the less varied the noise will be.
- The interpolation type affects performance, but a lot less than the octave count.
- Cubic should be enough for most uses. Use Quintinc if you want high-quality velocity fields and really smooth particle movement.
- Sampling the '
Potential' field instead of the '
Curl' field is significantly faster, but you won't be able to get a velocity field out of it.
FastFakeFlow' is faster than '
Curl', but the quality is so impaired that it probably isn't worth it.
- Using noise animation has a negligible impact on performance, you can use it whenever you like.