Versions Compared

Key

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

This page provides a tutorial on creating a river simulation with Chaos Phoenix FD in 3ds Max.

Overview

...

medium
UI Text Box
size
typeinfo

This is an Advanced Level tutorial. The workflow for setting up the shot, and the Phoenix FD settings involved in the simulation are explained in detail. However, creating a production quality shot of a similar nature may require some tweaks to the lighting, materials and/or the Phoenix FD simulation.

Section
Column
width40%

Requires Phoenix FD 3.12.00 Official Release and V-Ray Next Official Release for 3ds Max 2015+. If you notice a major difference between the results shown here and the behaviour of your setup, please send an email to support@chaosgroup.com.

The instructions on this page guide you through the process of using Phoenix FD to create a simulation of a river flowing down a hill.

The Download button below provides you with an archive containing the scene file.

 

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

Column
width60%

Videoautoplayloop
0007_finalRender.mp4
1100%
2100%
3true
4false
5true

...

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.

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. A Phoenix FD Liquid Simulator tilted to follow the orientation of the scene geometry. Initial FIll Fill Up under the Dynamics rollout is enabled so waiting for the Liquid Source to fill the entire river bed geometry is not required.
  2. Scene geometry: geometry for the river bed, stones and vegetation.
  3. A Phoenix FD Liquid Source emitting from manually specified faces at the top of the river bed geometry.
  4. Two Phoenix FD Particle Shaders used for the Splash and Foam particles. The Splash particles are rendered as Points while the Foam is rendered as Bubbles.
  5. A V-Ray Sun&Sky setup for lighting the scene.
  6. A V-Ray Physical Camera for rendering.
Column
width60%

...

Section
Column
width40%

Set the Time Configuration → Animation Length to 250 so that the Time Slider goes from 0 to 250.

Import the riverBed.abc, riverRocks.abc and riverRoots.abc files to your scene by going to File → Import → Import...

We use the riverBed and riverRocks as collision geometry for the Phoenix FD Liquid simulation while the riverRoots are only used during rendering.

Column
width60%

...

Section
Column
width40%

Create a Phoenix FD Liquid Simulator and set the Grid → Cell Size to 1.953cm.

Set the Grid → Size X/Y/Z to 1109 / 334 / 167 respectively.

For this example, the Simulator is placed at the following coordinates:

Translate X/Y/Z: [ -3.817, -14.156, 258.781 ]
Rotate X/Y/Z: [ 0, 7.221, 0 ]

The simulation bounding box should now be wrapped around the riverBed geometry and slightly tilted to follow the direction of the stream.

medium
UI Text Box
size
typetip

We do this for the slight performance boost - keeping the Simulator straight provides no benefit - the simulation will be exactly the same but run faster when the bounding box is tilted and its vertical size (Grid → Size Z) reduced.

Column
width60%

...

Section
Column
width40%

Add the riverRoots geometry to the Simulator → Scene Interaction → Include/Exclude List using the Add button.

This will tell the Phoenix FD that the riverRoots geometry is to be ignored during the simulation.

UI Text Box
sizemedium
typewarning

Using open geometry or geometry with no thickness (such as the poly planes used for the riverRoots' leaves in this example) can give you unpredictable simulation results. Making sure that your geometry is clean is crucial for a smooth workflow. Phoenix FD (and many simulation packages in general) use a volumetric representation of your mesh for the simulation. The process of creating this volumetric representation is called voxelization. The algorithms responsible for voxelizing the geometry can fail when using open (with holes) or planar (no thickness) geometry.

Column
width60%

...

Section
Column
width40%

Create a Phoenix FD Liquid Source and add the riverBed geometry to the Emitter Nodes list using the Add button.

Set the Outgoing Velocity to 100cm.

Column
width60%

...

Section
Column
width40%

Here's a preview of the simulation in its current state.

The entire riverBed geometry is emitting liquid into the Simulator. Instead, we want liquid to be emitted into the simulation only at the very start of the river.

We can accomplish this by giving the Phoenix FD Liquid Source a set of faces specified by us to use for the emission. The Polygon ID parameter at the bottom of the options panel for the Source can be used for this.

Column
width60%

Videoautoplayloop
0001_addSim_addSource.mp4
1100%
2100%
3true
4false
5true

...

Section
Column
width40%

Select the Phoenix FD Liquid Source and set the Polygon ID parameter to 2.

The Source will now only emit from faces that share this ID.

Column
width60%

...

Section
Column
width40%

For a realistic interaction between the scene geometry and the liquid, Phoenix FD provides you with the option to simulate the effect of Wetting.

Wetting is handled by a set of secondary WetMap Particles which are calculated along with the Liquid, Foam, Splashes, etc.

WetMap particles are created where the Liquid particles interact with the scene geometry.

You can use the WetMap Particles through a Phoenix FD Particle Texture to generate a Black&White Texture Map which can be used as a mask for a Blend Material.

The preview of WetMap Particles can be Enabled/Disabled from the Phoenix FD Simulator → Preview rollout → Particle Preview options.

Column
width60%

...

Section
Column
width40%

To enable the simulation of WetMap Particles, enable Wetting from the Simulator → Dynamics rollout.

Wetting is a simulation, not a render-time option - changing any of the values below requires a re-run of the simulation.

Run the simulation for 30 or so frames.

medium
UI Text Box
size
typeinfo

Phoenix FD Simulator → Dynamics → Initial Fill Up is Disabled for clarity. The only source of liquid is the polygons on the riverBed geometry.

Column
width60%

...

Section
Column
width40%

Assign a V-Ray Blend Material to the riverBed geometry.

Plug two V-Ray materials to the Base and Coat 1 inputs of the Blend material. Set the Diffuse colors of those V-Ray materials to Red and Yellow respectively.

Finally, plug a Phoenix FD Particle Texture to the Blend 1 input of the Blend material. Click the None button below the Source Particle System option and select the Phoenix FD Simulator. When prompted to pick a particle system, select the Particles [ WetMap ] of [ PhoenixFDLiquid001 ] entry in the list.

Finally, set the Particle Area Radius to 5cm. This option controls the size of the white dots generated by each WetMap particle.

Column
width60%

...

Section
Column
width40%

We are now ready to start setting up the Splash and Foam parameters for the Phoenix FD Simulator.

Open the Splash/Mist rollout and select the Enable checkbox. 

Choose Yes when asked if you'd like a Phoenix FD Particle Shader generated for the Splash particles. This will automatically set up the link between the splash particle group, the Particle Shader, and the Liquid Simulator.

Set the Splash to Mist option 0 to completely disable the generation of Mist. Mist particles are produced by the splitting the Splash particles as they fly through the air.

Set the Foam on Hit → Foam Amount option to 0.8.

medium
UI Text Box
size
typeinfo

In this tutorial, the Foam is generated by the Splash particles. Splash particles, on the other hand, are born when the liquid surface is turbulent. Therefore, when the liquid collides with the river stones and starts twisting around them, Splash particles will be born which will produce Foam for you.

We don't use directly give birth to Foam particles using the Foam rollout → Foam Amount option because it relies on the Speed of the liquid. Since the river is flowing down at a relatively constant rate, this will produce Foam all over the place rather than in those specific areas where the liquid flow is disturbed.

If you'd like to learn more about the different secondary particle effects and how they interact with the simulation, you can check the FLIP Particles Life Cycle diagram.

Column
width60%

...

Section
Column
width40%

Here's a preview of the final simulation:

We focus on the water material for the liquid, the Phoenix FD Particle Shader settings and an example V-Ray Blend Material setup using a Wetmap for the river stones.

Column
width60%

Videoautoplayloop
0006_finalSim.mp4
1100%
2100%
3true
4false
5true

...

Section
Column
width40%

Here's a rendered image of the River Bed, River Stones and River Roots geometry.

The Phoenix FD Simulator and the two Particle Shaders for the Foam and Splashes are hidden to speed up the look-dev process.

Column
width60%

...

Section
Column
width40%

Assign a V-Ray Material to the riverStones geometry and plug a Phoenix FD Particle Texture in the Diffuse slot.

Click the 'None' button under Source Particle System and select the Particles [ WetMap ] of [ PhoenixFDLiquid001 ] node in the Scene Explorer.

Set the Particle Area Radius to 5cm to avoid noise artifacts in the generated black&white texture.

Hit render - only the stones which interact with the liquid should now render white.

size
UI Text Box
mediumtypetip

Even if the Phoenix FD Simulator is hidden, the Particle Texture can access the WetMap particle group and use it at render time.

Column
width60%

...

Section
Column
width40%

Unhide the Phoenix FD Simulator and assign a new V-Ray material to it. Rename the material to mat_water.

Set the Reflect and Refract colors to RGB [ 255, 255, 255 ] and the IOR (Index of Refraction) to 1.33. This is the physically-accurate IOR of water - you can use a search engine to look up the IOR of other materials in case your setup is different.

Set the Fog color to RGB [ 246, 251, 251 ] with a Fog multiplier of 0.2. We use the Fog color to tint the water. In the real world, water is tinted because of the microscopic particulates it carries which refract the incoming light. Using the Fog options is an efficient way to emulate this without significantly increasing the render time.

Column
width60%

...

Section
Column
width40%

Here are the settings for the Phoenix FD Particle Shader used for the Splash particles:

Mode is set to Points, with a Size Multiplier of 2.0 to give the particles more volume. Feel free to experiment with the other Modes as well but keep in my this may increase your render times.

To speed up Bucket rendering, the Light Cache Speedup is set to 0.99.

Column
width60%

...

Section
Column
width40%

For the Phoenix FD Particle Shader used for the Foam, the following settings are used:

The Mode is set to Bubbles, with a Light Cache Speedup of 0.99.

Under the Particle Shader → Cellular/Bubbles/Splash rollout, the Refractive Index for the bubbles is set to 1.3.

Column
width60%

...