Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The instructions on this page guide you through the process of creating a thin smoke using Chaos Phoenix FD 4.10.

Overview

...

medium
UI Text Box
size
typeinfo

This is an Intermediate Level tutorial. Even though no previous knowledge of Phoenix FD is required to follow along, re-purposing the setup shown here to another shot may require a deeper understanding of the host platform's tools, and some modifications of the simulation settings.

Section
Column
width40%

Phoenix FD 4.10 offers a new feature called TexUVW that allows fluids to transport UVW information along with the moving fluid. Before that, mapping the fluid's color or opacity for rendering had the texture maps fixed in one place as the fluid flows through them. In this tutorial, we are going to use this new grid data for controlling the rendering opacity of smoke.

Although Phoenix FD already provides a Cigarette Smoke Quick Preset, it uses a particle-based method that requires a large number of particles small enough to produce smooth thin smoke. This could require a lot of memory and could be quite slow to simulate if you need to render it in high resolution. In this tutorial, we show you an alternative method. First, we simulate regular smoke (non-particle based) and then use a Noise texture to modulate the opacity of the smoke. In the end, we can have convincing thin, wispy, cigarette-type smoke results.

 

Anchor
assets
assets

This simulation requires Phoenix FD 4.10 Nightly Build from 11 March 2020 and V-Ray Next Official Release at the least. If you notice a major difference between the results shown here and the behavior of your setup, please send an email to support@chaosgroup.com.

The Download button below provides you with an archive containing the start and end scenes.

 

UI Button
sizelarge
icondownload
titleDownload Project Files
urlhttps://drive.google.com/uc?export=download&id=17LwE_EGASn7g7uLUNTiWlrDqQnNs0WRE

Column
width60%
HTML
<iframe width="720" height="480" src="https://www.youtube.com/embed/vgYtGOTUPrs?version=3&loop=1&playlist=vgYtGOTUPrs" frameborder="0" allowfullscreen></iframe>

...

Section
Column
width40%

Scale is crucial for the behavior of any simulation. The real-world size of the Simulator in units is important for the simulation dynamics. Large-scale simulations appear to move more slowly, while mid-to-small scale simulations have lots of vigorous movement. When you create your Simulator, you must check the Grid rollout where the real-world extents of the Simulator are shown. If the size of the Simulator in the scene cannot be changed, you can cheat the solver into working as if the scale is larger or smaller by changing the Scene Scale option in the Grid rollout.

The Phoenix FD solver is not affected by how you choose to view the Display Unit Scale - it is just a matter of convenience.

The thin smoke effect we're creating is about 1 meter in height so we choose to view the units as Centimeters.

Go to Customize → Units Setup and set Display Unit Scale to Metric Centimeters.

Also, set the System Units such that 1 Unit equals 1 Centimeter.

Column
width60%

...

Section
Column
width40%

The final scene consists of the following elements:

  1. Box geometry used for the smoke source.
  2. Phoenix FD Fire/Smoke Simulator.
  3. Phoenix FD Fire/Smoke Source emitting Smoke from the Box geometry.
  4. Target Directional Light for lighting.
  5. V-Ray Physical Camera for rendering.
  6. PHXTurbulence for disturbing the smoke motion.
Column
width60%

...

Section
Column
width40%

Create a Standard Primitives → Box. The box is used as an emission object for the smoke.

Set its Length / Width / Height to 3.0 cm / 32.0 cm / 3.0 cm.

Set its Length / Width / Height Segs to 1.

Position it to (X, Y, Z): (0, 0, 0). 

size
UI Text Box
mediumtypetip

We simulate an effect looking like cigarette smoke. The size of this box is larger than a regular cigarette. We deliberately make it bigger (but not extremely large) because a slightly larger scale simulation is less chaotic and slower moving than the real effect thus creating a better cinematic feel.

Column
width60%

...

Section
Column
width40%

Go to Create PanelLights Standard and add a Target Directional Light in the scene. Enable the Atmosphere Shadows option in the Shadow Parameters rollout.

Exact position of the light is (X, Y, Z): (0, -41, 300).

Exact position of the light target is (X, Y, Z): (0, 0, 0) (targeted at the box).

UI Text Box
sizemedium
typeinfo

To save you some time, both the light and the camera are already included in the "PhoenixFD_Thin_Smoke_Max2016_START.max" file.

Column
width60%

...

Section
Column
width40%

Add a Helpers → Phoenix FD → Fire/Smoke Source. The Fire/Smoke Source is a Phoenix FD helper node used to tell the Simulator which objects in the scene emit, how strong the emission is, etc.

Add the Box geometry to the Emitter Nodes list.

Set the Polygon ID to 2. This way smoke is emitted only from the faces with this polygon ID.

Column
width60%

...

Section
Column
width40%

Go to CreateGeometry PhoenixFD → FireSmokeSim.

The exact position of the Phoenix FD Simulator in the scene is (X, Y, Z): (0, 0, 0).

Open the Grid rollout and set the following values:

  • Cell Size: 1.0 cm;
  • Size (X, Y, Z): (46, 24, 11);
  • Container Walls → all Open;
  • Adaptive Grid: Smoke
    The Adaptive Grid algorithm allows the bounding box of the simulation to dynamically expand when needed. With a Threshold of 0.02, the Simulator expands when the cells near the walls of the simulation bounding box reach a Smoke value of 0.02 or greater.
  • Extra Margin: 5;
    The Extra Margin option is useful when the Adaptive Grid algorithm is unable to expand fast enough to accommodate quick movement in the simulation (e.g. an explosion). The Extra Margin attempts to remedy this by expanding the grid preemptively with the specified number of voxels on each side.
  • Enable Expand and Don't Shrink - this way the Adaptive grid will not contract back when there is very thin smoke at the borders of the grid.
  • Enable Max Expansion: X: (193, 151), Y: (98, 105), Z: (0, 189) to save memory and simulation time by limiting the Maximum Size of the simulation grid.
Column
width60%

...

Section
Column
width40%

We want to modulate the smoke opacity with Grid Texture UVW, so let's go to the Phoenix FD Simulator → Output rollout and enable the Texture UVW.

Column
width60%

...

Section
Column
width40%
size
UI Text Box
mediumtypeinfo

Under the Dynamics rollout of the Simulator, there is a Texture UVW section. Here you have four parameters to control how Phoenix FD deals with grid UVW data during simulation. In this special case, we don't need to change anything, so just leave them at their default values.

Column
width60%

...

Section
Column
width40%

Go to the Phoenix FD SimulatorSimulation rollout and disable the Stop Frame Timeline. Set the Stop Frame to 120. Press the Start button to simulate.

medium
UI Text Box
size
typetip

Though the animation length is set to 200, we can use an earlier Stop Frame to save some simulation time while iterating on the simulation setup.

Column
width60%

...

Section
Column
width40%

To enable the GPU Preview as seen in the video below, select the Phoenix FD Simulator → Preview rollout → GPU Preview → Enable in Viewport.

Column
width60%

...

Section
Column
width40%

Without re-running the simulation, here is the Viewport Preview showing the result of the simulation so far.

size
UI Text Box
mediumtypenote

If you don't see any smoke in the viewport, please make sure you have selected the correct viewport. By default, the Preview rollout's Active View Only option is enabled, so only the selected viewport shows the GPU preview.

Column
width60%
Align
aligncenter
HTML
<iframe width="640" height="360" src="https://www.youtube.com/embed/TmizkH94zj8?version=3&loop=1&playlist=TmizkH94zj8" frameborder="0" allowfullscreen></iframe>

...

Section
Column
width40%

Here is how the simulation looks so far.

Column
width60%
Align
aligncenter
HTML
<iframe width="640" height="360" src="https://www.youtube.com/embed/ctOfnJrNVCg?version=3&loop=1&playlist=ctOfnJrNVCg" frameborder="0" allowfullscreen></iframe>

 

Adding

...

Phoenix Turbulence for Smoke Swirls

...

Section
Column
width40%

Create Helpers Phoenix FD PHXTurbulence.

Position to (X, Y, Z): (0, 0, 0).

Set the Strength to 40.0 and the Size to 2600.0cm.

Reduce the Fractal Depth to 2.

The Turbulence is used to bring more swirls in the smoke. You can use the Preview rollout's Force preview in order to see what velocities the turbulence adds to the simulation. Note that you have to turn off the GPU preview in order to see the forces.

Then go to the Fire/Smoke Simulator and run the simulation again.

Column
width60%

...

Section
Column
width40%

To preview exactly how the TexUVW mapping looks like, go to the Simulator / Rendering rollout and click on the Volumetric Options. In the Smoke Opacity rollout change the Based on to Texture. Plug a Noise texture in the Texture slot.

medium
UI Text Box
size
typeinfo

You can set up the Noise texture from scratch, or you can find this texture in the "PhoenixFD_Thin_Smoke_Max2016_END.max" scene file, in the material editor. It is called "Noise_test".

Column
width60%

...

Section
Column
width40%

As shown, set the Noise Type to TurbulenceSize to 0.8.

Noise Threshold High to 0.7Low to 0.45.

Levels to 2.0.

For the Coordinates, set Source to Explicit Map Channel. By doing so, we can take advantage of Phoenix FD's grid Texture UVW. Also, set the UVW tiling to 2.0.

medium
UI Text Box
size
typenote

Be sure to change the texture coordinates from ObjectXYZ to Explicit Map Channel, otherwise, the Noise texture does not flow with the fluid using TexUVW, but instead is statically fixed in space.

Column
width60%

...

Section
Column
width40%

All of these Noise texture settings are for demonstration purposes, so we can clearly see how the growing smoke distorts the texture UVW and affects the applied Noise texture.

To alleviate grid artifacts during render time, set the Sampler Type to Spherical (found in the Rendering rollout).

size
UI Text Box
mediumtypetip

Here the Rendering Step % is set to 20. This parameter specifies the ray marching step of the camera rays as a percentage of the cell size. In this step we set the Noise texture to be in contrast, so it tends to render out a noisy image. Because of that, we have to lower the value of Step % to reduce the noise and be able to capture all of the fine details of the smoke. A larger step size skips over some texture details. For a less contrast Noise texture, you can increase the value of Step % to save rendering time.

medium
UI Text Box
size
typewarning

Smaller Step % could increase render time dramatically. The default value is 90% of the voxel size. You should lower this parameter only if you get unacceptably noisy images.

Column
width60%

...

Section
Column
width40%

Here's a rendered animation so far.

UI Text Box
sizemedium
typetip

Notice how the cloudy texture is stretched horizontally - the noise spots in it are wide and thin. This is because the initial Simulator size at frame 0 (before the adaptive grid starts expanding) is a wide box, and the noise is stretched over it. You can adjust the tiling of the texture in the material editor if you want to counter this.

UI Text Box
sizemedium
typeinfo

Note how the uniformly scattered white spots ("islands") get dragged as the smoke is floating up and are stretched into thin wisps. This effect is the product of fluid advection. This is a part of the look of the effect we are aiming at.

Column
width60%
Align
aligncenter
HTML
 <iframe width="640" height="360" src="https://www.youtube.com/embed/fxt3iZpy5nE?version=3&loop=1&playlist=fxt3iZpy5nE" frameborder="0" allowfullscreen></iframe>

...

Section
Column
width40%

Now you understand how this technique works and its possible side effects.

Let's adjust the final Noise texture for the texture slot of the Smoke Opacity. The settings for the texture are now optimized in order to minimize the unnatural look of suddenly appearing/disappearing islands of smoke.

Plug in a new Noise texture in the Texture slot.

size
UI Text Box
mediumtypeinfo

You can set up the Noise texture from scratch or you can find this texture in the "PhoenixFD_Thin_Smoke_Max2016_END.max" scene file, in the material editor. It is called "Noise_final".

 

As shown, set the Noise Type to Turbulence.

Size to 0.1.

Noise Threshold High to 0.8, Low to 0.32.

Levels to 5.0.

Keep the UVW Tiling to 1.0.

For the Coordinates, set Source to Explicit Map Channel. By doing so we can take advantage of Phoenix FD's grid Texture UVW.

Column
width60%

...

Section
Column
width40%
medium
UI Text Box
size
typeinfo

We increase Rendering Step % from 20 to 50 because the Noise texture we used here does not need such a small render step in order to capture the detail.

Column
width60%

...

Section
Column
width40%

To achieve a better swirling motion in the simulation, we can change the conservation mode and increase the Conservation Quality parameter under the Dynamics rollout. Set the Conservation Mode to PCG Symmetric, Quality to 50.

The PCG Symmetric conservation mode is ideal for smoke simulations or explosions because it tends to produce strong conservation which needs less conservation quality in order to look realistic. This method is also used for the Cigarette Smoke quick preset. So we choose this mode.

Go to the Fire/Smoke Simulator, and run the simulation again.

medium
UI Text Box
size
typewarning

Beware that increasing the Quality would make the simulation take longer time. You can adjust the value depending on your preferences.

Column
width60%

...

Section
Column
width40%

Now, in order to make our animation more interesting, we can animate the Time Scale. This section of the tutorial is optional – you may skip to the Rendering section below.

To create the bullet-time effect, open the Dynamics rollout of the Phoenix FD Simulator and animate the Time Scale parameter as follows:

Frame 0: 0.7
Frame 100: 0.7
Frame 130: 0.3
Frame 145: 0.3
Frame 164: 0.7

The Time Scale is a global multiplier for the dynamics of the Simulator. Reducing it uniformly scales down all sources of velocity in the simulation.

Column
width60%

...

Section
Column
width40%

Now we are ready for the final simulation. Go to the Phoenix FD SimulatorSimulation rollout and enable the Stop Frame Timeline. Press the Start to run the simulation.

Column
width60%

...

Section
Column
width40%

We have already finished this tutorial. But since Phoenix FD comes with a Cigarette Smoke Quick Preset, let's see the same settings as shown in this tutorial but using the quick preset.

The quick preset is a particle-based method, which emits a large amount of particles from Fire/Smoke source and renders with the help of the Particle Shader. Because of the nature of this method, you need lots of particles in the scene. Furthermore, the particle size has to be small enough to alleviate grainy look. See the rendered clip of the cigarette smoke quick preset simulation.

medium
UI Text Box
size
typeinfo

You can find the finished Particle-based scene in the Downloadable project file "PhoenixFD_Thin_Smoke_Particle_Max2016_END.max".

Column
width60%

 

Align
aligncenter
HTML
<iframe width="640" height="360" src="https://www.youtube.com/embed/rA-FQPHqb2M?version=3&loop=1&playlist=rA-FQPHqb2M" frameborder="0" allowfullscreen></iframe>

...