Versions Compared

Key

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

This page provides a tutorial for simulating a liquid for a baked fragmented wine glass using Chaos Phoenix.

Overview

...

UI Text Box
typeinfo

This is an Entry Level tutorial which requires no previous knowledge of Phoenix. A basic understanding of 3ds Max would be helpful but is not a prerequisite for being able to follow along.

Section
Column
width40%

This tutorial will cover simulating a liquid burst for a baked fragmented wine glass using Phoenix FD and V-Ray for 3ds Max. After setting up the simulation, it will also The instructions on this page guide you through the process of setting up realistic glass and red wine materials.

UI Text Box
sizemedium
typeinfo

This is an Entry Level tutorial which requires no previous knowledge of Phoenix FD. A basic understanding of 3ds Max would be helpful but is not a prerequisite for being able to follow along.

Column
width5%
 
Column
width55%

Image Removed

 

Steps

Set Up the System Units

Scene Scale is crucial for the behavior of any simulation. The Phoenix FD solver is not affected by how you choose to view the scene units - what's important is the real-world size in units. Large-scale simulations appear to move more slowly, while a mid-to-small scale simulation has lots of vigorous movement.

Our subject here is a wine glass, so set the Display Unit Scale and System Unit Scale to Centimeters. These options can be found under Customize > Units Setup....

 

Section
Column
width10%

 

Column
width310px

Image Removed

 

Column
width280px

Image Removed

 

Column
width10%

 

 

In the scene, the glass height has been set to about 267 cm (150 in). The reason for the giant glass is that large scale scenes allow for slower movement. This works well with rigid-body simulations because we can fine-tune movements with greater ease. If the same simulation was conducted at a real-world scale, the glass fragments would travel much faster, making it difficult to capture the exact moment where the glass starts to break.

 

Image Removed

 

 

Depending on your scene's needs, you can adjust the glass height as seen here or use the Phoenix FD Scene Scale parameter in the Grid rollout when setting up the simulation.

 

Image Removed

 

Set Up the Scene

The glass geometry has already been simulated into keyed rigid body fragments. PFlow, Rayfire, or thinkingParticles can be used to create similar effects.

 

Section
Column
width25%

Image RemovedFrame 1

 

Column
width25%

Image RemovedFrame 2

 

Column
width25%

Image RemovedFrame 5

 

Column
width25%

Image RemovedFrame 10

 

 

Note the geometry must be a solid (water-tight). You can check it with 3dsMax STL Check modifier. Geometry with a hole or other errors might cause problems when simulating.

 

Section
Column
width10%

 

Column
width200px

Image Removed

Column
width200px

Image Removed

Column
width10%

 

 

Create a Phoenix FD Liquid Simulator and set grid dimensions so it encompasses the bowl of the glass. We will be using the adaptive grid so the simulator can expand.

 

Image Removed

 

 

In the image below, the blue geometry in the inside of the glass is used for the initial filled state of the liquid. For more information on creating this, see the Using Initial Liquid Fill with Containers tutorial. Right click to access its Phoenix FD Properties and make sure Initial Liquid Fill is enabled.

an exploding Wine Glass simulation. The main takeaway of this tutorial is an understanding of how Surface Tension and the Steps per Frame parameters affect the movement of the liquid. The explosive effect is achieved through the use of a native Max Wind Force, which is the main driver of the simulation. Additional velocities are sourced into the simulation from the baked Rigid Body simulation of the wine glass and the Phoenix Turbulence force.

 

This simulation requires Phoenix 4.20 Official Release and V-Ray 5, Update 2.3 Official Release for 3ds Max 2018 at least. You can download official Phoenix and V-Ray from https://download.chaos.com. If you notice a major difference between the results shown here and the behavior of your setup, please reach us using the Support Form.

 

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=1LYmyFfGrRKh7WSqGyynv39SRMviHMLnE

Column
width60%

Image Added

 

System Units Setup

...

Section
Column
width50%

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 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
width50%

Image Added

 

Scene Setup

...

Section
Column
width40%

Тhe height of the wine glass is about 260 cm instead of the usual 18 - 25 cm.

Slower movement of the large scale fluid allows for easier fine-tuning of the liquid motion with respect to the glass shards. It also provides more control over the shape of the simulation. 

The Distance tool can be used to easily check the size of an object.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

The Rigid Body simulation with the shattered wineglass is baked and cached in Alembic. To import Alembic cache in Max, go to File → Import → Import Alembic.

Column
width60%

Image Added

 

 

Section
Column
width25%

Image AddedFrame 1

Column
width25%

Image AddedFrame 2

Column
width25%

Image AddedFrame 5

Column
width25%

Image AddedFrame 10

 

...

 

UI Text Box
typenote

Note that Phoenix works best with closed geometry. You may check it with 3dsMax STL Check modifier. Geometry with a hole or other errors might cause problems when simulating.

...

Section
Column
width10%

 

Column
width310px200px

Image Removed

 Image Added

Column
width280px200px

Image Removed

 Image Added

Column
width10%

 

 

This piece of geometry will not need to be rendered or displayed in the viewport. Access its Object Properties from the quad menu and enable Display as Box and disable Renderable.

 

Image Removed

 

Add the Wind Force

From the Create panel > Space Warps > Forces, create and place a standard 3ds Max Wind force at the center of the glass. Change its type to Spherical. This will cause the force to affect the liquid in all directions. Set the Strength to 4.

 

Section
Column
width10%

 

Column
width410px

Image Removed

 

Column
width180px

Image Removed

 

Column
width10%

 

 

Add a keyframe to the wind Strength to emulate the impact when the glass shatters.

 

Image Removed

 

 

With the help of the Wind force, the RigidBody of the glass will push the liquid to burst and scatter. You can control the interaction strength between the RigidBody and liquid by adjusting the Motion Velocity Effect. This can be accessed by right clicking the glass geometry and opening its Phoenix FD Properties. Higher values will cause the simulation to act as if the liquid is moving at a higher velocity, creating a bigger and more dramatic burst. For this tutorial, we will keep it at its default value of 1.0.

 

Image Removed

 

 

Adjust the Simulation Settings

Simulation requires a lot of hard drive capacity and CPU resources. The physical memory size is the main factor for determining the simulation grid's resolution. As a result, it's important to check how much physical memory is available on the system and determine the grid resolution from there.

The Phoenix Simulator's Simulation rollout provides information on the required RAM. If the machine's RAM is less than the required amount, the hard drive is used for virtual memory. Since hard disk access speeds are slower, the simulation calculation time can become quite long.

 

Image Removed

 

 

To work around this issue, it is best to set the simulation grid to a relatively low resolution while working. Once everything else is ready,  you can increase the resolution to production quality. In setting up the simulation, we should pay attention to the required RAM.

Note: Increasing the resolution of liquid sims can change the shape and behavior of the simulation. These side effects are not as apparent with fire/smoke sims. In addition, higher resolution simulations are not necessarily more realistic.

 

Image Removed

 

 

In the Output rollout, enable the Velocity channel in the Output Grid Channels section. This will allow the final mesh to include motion blur.

 

Image Removed

 

 

The quality of the liquid’s mesh depends on the Dynamics settings. For this tutorial, we will set the Steps per Frame to 12, Surface tension Strength to 0.05, and enable Wetting.

 

Image Removed

 

 

First, let's look at Steps per frame (SPF). SPF controls the iterations of the simulation on each frame. In general, the higher the value, the longer the simulation time, the lower the noise, and the smoother the liquid. Another advantage of a high SPF is that there are fewer chances of a fast-moving liquid penetrating the RigidBody. Note that higher values will not necessarily produce a more realistic liquid mesh.

The following examples show the simulation on frame 3 with different SPF values.

 

Section
Column
width25%

Image RemovedSteps per frame = 1

Column
width25%

Image RemovedSteps per frame = 5

 

Column
width25%

Image RemovedSteps per frame = 10

Column
width25%

Image RemovedSteps per frame = 15

 

Next is the Surface Tension Strength, which controls the elasticity of the liquid surface. Higher values will prevent the liquid from breaking apart into droplets or tendrils. This parameter plays an important role in communicating the scale of small-scale liquid sims.

 

Section
Column
width5%

 

Column
width360px

Image Removed
Strength = 0.0

 

Column
width360px

Image Removed
Strength = 0.2

 

Column
width360px

Image Removed
Strength = 0.5

 

Column
width5%

 

 

The Wetting option enables wet and dry materials to interact together. This can affect the liquid's behavior depending on the simulation. Note that the wetting simulation produces a particle system called WetMap.

 

Section
Column
width10%

 

Column
width450px

Image Removed
Wetting disabled

Column
width450px

Image Removed
Wetting enabled

 

Column
width10%

 

 

To preview the liquid as a mesh, simply enable the Show Mesh option in the Preview rollout.

 

Image Removed

 

 

By default, Phoenix FD uses a grid-based method for creating the mesh rather than a particle-based one. As a result, the mesh may appear jagged in places. These artifacts can be reduced by adjusting the Smoothness parameter in the Rendering rollout.

 

Image Removed

 

 

Section
Column
width10%

 

Column
width460px

Image RemovedSmoothness = 0

 

Column
width460px

Image RemovedSmoothness = 100

 

Column
width10%

 

 

Phoenix also offers a particle-based method for creating the liquid mesh that can be enabled through the Use Liquid Particles option. The resulting mesh will become thinner depending on the specified Particle Size. We will leave Use Liquid Particles disabled for our scene.

 

Image RemovedUse Liquid Particles enabled

 

Create the Materials

For the materials in the scene, we will start with a standard VRayMtl.

To make a realistic glass material, set the Reflect and Refract colors to white (255, 255, 255). Set the RGlossiness to 0.95, the Fresnel IOR to 1.6, and the Refraction Max depth to 20. In addition, enable Abbe number to add a scattering effect to the glass.

 

Image Removed

 

 

The wine material is a bit more complex. The red wine itself has a special color while also being transparent but not completely translucent. This is where the Fog color comes into play. Have a look at some photos of red wine and sample colors until you get a nice result. Here, we'll be using a  Fog color of (166, 23, 20). The Fog multiplier can be used to fine-tune the strength of the fog. Here, we have the multiplier set to 0.005. In addition, the Fog bias allows you to control the color transition. A negative value will make the liquid appear thicker, so set this to -1.0.

For the other red wine material parameters, set the Reflect and Refract colors to white (255, 255, 255). Set RGlossiness to 0.95. Set the Reflect Fresnel IOR to 1.6 and the Refract IOR to 1.3. Note that deliberately setting different values for the Reflect IOR and Refract IOR will produce a more artistic look. Finally, set the Refract Max depth to 20, enable the Abbe number, and set the BRDF type to Phong.

 

Image Removed

 

 

Section
Column
width5%

 

Column
width360px

Image Removed
Fog Bias = 0.0

 

Column
width360px

Image Removed
Fog Bias = -0.5

 

Column
width360px

Image Removed
Fog Bias = -1.0

 

Column
width5%

 

 

Set Up the Lighting and Camera

A simple V-Ray Dome Light | VRayLight with a V-Ray Bitmap Texture | VRayHDRI is used to light the scene.

 

Image Removed

 

 

For the camera, we will be using a VRayPhysicalCamera. Since the framing will be a close-up, enable the camera Depth of Field and adjust the f-number. Here, we have it set to 1.2. In the Bokeh effects section, set the blades to 7, the rotation (deg) to 15.0, and the center bias to 1.0. This will add some imperfect details to the lens. In the Sampling section, enable the motion blur option as well.

 

Image Removed

 

 

Forces

...

Section
Column
width40%

Phoenix allows you to preview the forces in your scene which eliminates the process of constant tweaking and simulating. You can preview any Max native force as well as all the forces that ship with Phoenix.

To see the effect of a force on your container, enable Forces from the Preview tab of your Simulator. 

Note

Note that when Auto Range is Enabled, the Min and Max values of the incoming velocities are displayed. This could be incredibly useful when setting up the Magnitude of your forces or troubleshooting your simulation. If the Max value was along the lines of 5000, you would naturally expect your simulation to 'explode'. Take note of those values when tweaking the Force Fields.

 

The desired explosive effect of the liquid is achieved through a standard 3ds Max Wind Force combined with Phoenix Turbulence.

 

To create the Wind Force go to Create panel → Space Warps → Forces.

Depending on the placement, the look of the simulation will vary dramatically. Experiment to find a desirable result. In this tutorial the position of the force is at the center of the glass. The exact position of the Wind force in the scene is [ -58, 0, 195 ].

Change its type to Spherical. This will cause the force to affect the liquid in all directions.

Set the Strength to 30.0.

Column
width60%
Image Added

 

...

 

Section
Column
width40%

Animate the Wind Strength to emulate the impact when the glass shatters with the following keyframes:

Frame 0: set to 0;
Frame 1: set to 30;
Frame 4: set to 30;
Frame 5: set to 0.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

To create the Phoenix Turbulence go to Create panel → Helpers → Phoenix FD → PHXTurbulence

Set the Strength to 200.0.

Set the Size to 150.0.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

With the help of the Wind force, the glass will push the liquid to burst and scatter. You can control the interaction strength between the glass and the liquid by adjusting the Motion Velocity Effect, located in the Phoenix Per-Node Properties. Higher values will cause the simulation to act as if the liquid is moving at a higher velocity, creating a bigger and more dramatic burst. For this tutorial, we will set its value of 2.0.

Column
width60%

Image Added

 

Container Properties

...

Section
Column
width40%

Create a Phoenix Liquid Simulator and set grid dimensions, so it encompasses the bowl of the glass. 

Column
width60%

Image Added

 

...

 

In the image below, the blue geometry in the inside of the glass is used for the initial filled state of the liquid. For more information on creating this, see the Using Initial Liquid Fill with Containers tutorial. Right click to access its Chaos Phoenix Per-Node Properties and make sure Initial Liquid Fill is enabled.

 

Section
Column
width10%

 

Column
width310px

Image Added

Column
width280px

Image Added

Column
width10%

 

 

...

 

Section
Column
width40%

This piece of geometry will not need to be rendered or displayed in the viewport. Access its Object Properties from the quad menu and enable Display as Box and disable Renderable.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

The Simulator → Grid parameters are tweaked as follows:

The Scene Scale is set to 1.0.

The Cell Size is set to 1.0 cm.

The X/Y/Z Size of the Simulator is set to 110/110/140 as a starting point.

The Adaptive Grid is enabled. This tells Phoenix to track the Liquid and increase the size of the simulator when the particles get close to the boundary.

The Extra Margin is set to 5.

The Expand and Don't Shrink is disabled

Column
width60%

Image Added

Note

Increasing the resolution of the grid can sometimes alter the shape and behavior of the simulation. Remember that higher resolution does not necessarily mean more realistic simulations. It depends on the project. Sometimes the resolution is too high, and there are too many details, or the look is not what the director is asking for. You have to find a good balance.

 

...

 

Section
Column
width40%

In the Output rollout, enable the Velocity channel in the Output Grid Channels section. This will allow the final mesh to include Motion Blur.

In this tutorial will be shown how to set a simple expression with Particle Tuner, which will help optimizing the simulation process. For this setup the Age channel in the Output Particle Channels section must be enabled.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

The quality of the liquid’s mesh depends on the Dynamics settings. In this setup the Gravity is set to 0.8, the Steps Per Frame to 7, Surface Tension Strength to 0.05.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

First, let's look at Steps Per Frame (SPF)

UI Text Box
typetip

One of the most important parameters of the simulator, with significant impact on quality and performance. To understand how to use it, keep in mind that the simulation is a sequential process and happens step by step. It produces good results if each simulation step introduces small changes, but it's also a trade-off between performance and detail, as described below.

For example let's take an object that is hitting the liquid surface with high speed. If at the first step the object is far away from the water and at the second step, the object is already deep under the water - the result won't look good. You have to introduce intermediate steps until the changes of each step get small enough. The Steps Per Frame option creates these steps within each frame. A value of 1 means that there are no intermediate steps and each step is exported into the cache file. A value of 2 means that there is one intermediate step, i.e. each second step is exported to the cache file while the intermediate steps are just calculated, but not exported.

Signs that the Steps Per Frame need to be increased are:

  • Liquid simulations have too many single liquid particles.
  • Liquid simulations are torn and chaotic.
  • Liquid simulations of streams have steps or other periodical artifacts.
  • Fire/Smoke simulations have artifacts that produce a grainy appearance.

More often than not, those issues will be caused by the simulation moving too quickly (e.g. the emission from the source is very strong or the objects in the scene are moving very fast). In such cases you should use a higher SPF.

Keep in mind that higher Steps Per Frame decreases the performance in a linear way, i.e. if you increase the SPF twice, your simulation will go twice as slow. However, the quality does not have a linear relation to the SPF. Each simulation step kills fine details, and thus for maximum detail it's best to use the lowest possible SPF that runs without any of the issues mentioned above. For additional information, please refer to Phoenix Explained.

Column
width60%
Image slider
Panel
borderStylenone

Image Added

Steps Per Frame = 1

Panel
borderStylenone

Image Added

Steps Per Frame = 15

 

...

 

Section
Column
width40%

Next is the Surface Tension Strength. This parameter plays an important role in small-scale liquid simulations because an accurate simulation of surface tension indicates the small scale to the audience. Lower Strength values will cause the liquid to easily break apart into individual liquid particles, while higher values will make it harder for the liquid surface to split and will hold the liquid particles together. 

Column
width60%
Image slider
Panel
borderStylenone
Image Added

Strength = 0.0

Panel
borderStylenone
Image Added

Strength = 0.2

Panel
borderStylenone
Image Added

Strength = 0.5

 

...

 

Section
Column
width40%

To preview the liquid as a mesh, simply enable the Show Mesh option in the Preview rollout. When enabled, shows the implicit surface as a mesh. This mode overrides the Voxel Preview mode.

Column
width60%
Image Added

 

...

 

Section
Column
width40%

By default, Phoenix uses a grid-based method for creating the mesh rather than a particle-based one. As a result, the mesh may appear jagged in places. These artifacts can be reduced by adjusting the Smoothness parameter in the Rendering rollout.

Column
width60%
Image Added

 

...

 

Section
Column
width40%

The example images show the simulation with different Smoothness values.

Column
width60%
Image slider
Panel
borderStylenone

Image Added

Smoothness = 0

Panel
borderStylenone

Image Added

Smoothness = 100

 

...

 

Section
Column
width40%

Phoenix also offers a particle-based method for creating the liquid mesh that can be enabled through the Use Liquid Particles option. The resulting mesh will become thinner depending on the specified Particle Size.

We will leave Use Liquid Particles disabled for our scene.

Column
width60%
Image slider
Panel
borderStylenone

Image Added

Particle Size = 0.2

Panel
borderStylenone

Image Added

Particle Size = 1.0

 

...

 

Section
Column
width40%

Wetting can be used to make liquids stick to the collision geometry in your scene. By default, all solid objects are affected but the option to disable the Wetting effect for a certain body can be found on the Phoenix Properties for that geometry. 

Enable Wetting. Set the Consumed Liquid to 0.1 and the Sticky Liquid to 0.

Column
width60%

Image Added

 

Particle Tuner

...

Section
Section
Column
width40%

The Particle Tuner uses expression operators to directly affect the particles of the Phoenix Simulator. It goes through all particles in the simulation and changes the values of these that pass a certain condition.

While creating turbulent liquid simulations it could happen that a particle or two are moving way too fast. In combination with the Adaptive grid this could lead to an increased simulation time.

In this tutorial the Particle Tuner is added for deleting the particles that are far away from the glass and are only increasing the simulator's Adaptive Grid size.


The Particle Tuner expression tree is created as follows:

 

  • If the Distance to the "frag_mesh" mesh is Greater Than 110 and If the Age is Greater Than 0.200.
  • Then Delete Particle.

Column
width60%

Image Added

 

 

Section
Column
width50%

Image Added 

Column
width50%

Image Added

UI Text Box
typenote

When using the Age channel as a condition in the Particle Tuner - make sure that the Age checkbox for the affected particle group is enabled in the Output rollout of the simulator.

UI Text Box
typenote

It is very important to pick the correct mesh for the distance expression. In this case "frag_mesh" mesh should be selected, because this is the existing one in the scene after the 2nd frame of the animation.

 

Materials

...

Glass Material

...

Section
Column
width40%

To create a realistic glass material:

Set the Diffuse color to RGB [ 0, 0, 0 ].

Set the Reflect and Refract colors to RGB [ 255, 255, 255 ].

Set the IOR to 1.6.

Set the Refraction and Reflection Max depth to 8.

Column
width60%

Image Added


Wine Material

...

Section
Column
width40%

To create a realistic red wine material:

Set the Diffuse color to RGB [ 0, 0, 0 ].

Set the Reflect and Refract colors to RGB [ 255, 255, 255 ].

Set the Glossiness to 0.55.

Set the IOR to 1.3.

Set the Reflection and Refraction Max depth to 8.

Set the Fog color to RGB [ 125, 23, 20 ].

Set the Fog Depth to 25.

Column
width60%

Image Added

 

Lighting and Camera

...

Section
Column
width40%

The source of illumination in the scene is a single V-Ray Dome Light.

Select the V-Ray Dome Light and enable Map.

Press on the Cosmos icon in the V-Ray toolbar. In the HDRIs section  → Studio  → choose Studio 001. Press the green arrow to Import the HDR map. Chaos Cosmos will plug the selected HDR map in the Texture slot.

The exact position of the V-Ray Light is XYZ: [4500, 0, 0].

UI Text Box
typeinfo

Starting with V-Ray 5, the VRayHDRI map is renamed to VRayBitmap.

Set the Multiplier to 1.

Make the Dome Light Invisible in the rendered image from the Options tab.

 

 

Column
width60%

Image Added

 

...

 

Section
Column
width40%

For this setup a VRayPhysicalCamera is used.

 

The Film Gate is set to 36.0.

The Focal Length is set to 40.0.

The Film Speed (ISO) is set to 100.

The F-Number is set to 2.0.

The Shutter Speed is set to 200.

The Depth of field is enabled.

The Exposure is enabled and the Temperature is set to 6100 K.

 

In this tutorial the exact position of the Camera is [ -425, -750, 200 ]

and of the Camera Target is [ -16, -65, 187 ].

UI Text Box
typetip

The final scene contains a second camera that can be used for closer shots.

Column
width60%

Image AddedImage AddedImage AddedImage AddedImage Added

 

...

 

Section
Column
width40%

In the Bokeh effects section, set the Blades to 7, the Rotation (deg) to 15.0, and the center bias to 1.0. This will add some imperfect details to the lens.

Column
width60%

Image Added

 

Render Settings

...

Section
Column
width40%

The Image Sampler Type is set to Bucket.

The Max subdivs are set to 4.

The Bucked width is set to 16.0.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

A V-Ray Denoiser Render Element is added to the final image. The Denoiser takes an existing render and applies a denoising operation to it after the image is completely rendered in order to remove the noise in the image.

For this tutorial the Default settings of the element are used.

Column
width60%

Image Added

 

...

 

Section
Column
width40%

The V-Ray Physical Camera offers additional exposure controls, but you can also fine-tune renders using the V-Ray Frame Buffer.

...

 In this case the Curves setting is used to add more contrast to the image.

Column
width60%

Image Added

 

Final Results

...

Section
Column
width50%

Image Added

 

 

Column
width50%

Image Added

 

Image Removed

 

From here, the scene is set up for working on look development, setting up the final composition, and rendering the final image.

 

Image Removed

 

...