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

Overview


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.

The instructions on this page guide you through the process of setting up 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.

 

Download Project Files

 

System Units Setup


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.

 

Scene Setup


Т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.

 


 

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.

 

 

Frame 1

Frame 2

Frame 5

Frame 10

 


 

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.

 

 

 

Forces


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 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.

 


 

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.

 


 

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.

 


 

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.

 

Container Properties


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

 


 

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.

 

 

 

 


 

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.

 


 

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

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.

 


 

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.

 


 

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.

 


 

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

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.

Steps Per Frame = 1

Steps Per Frame = 15

 


 

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. 

Strength = 0.0

Strength = 0.2

Strength = 0.5

 


 

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.

 


 

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.

 


 

The example images show the simulation with different Smoothness values.

Smoothness = 0

Smoothness = 100

 


 

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.

Particle Size = 0.2

Particle Size = 1.0

 


 

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.

 

Particle Tuner


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.

 

 

 

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.

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


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.


Wine Material


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.

 

Lighting and Camera


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].

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.

 

 

 


 

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 ].

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

 


 

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.

 

Render Settings


The Image Sampler Type is set to Bucket.

The Max subdivs are set to 4.

The Bucked width is set to 16.0.

 


 

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.

 


 

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.

 

Final Results


 

 

Table of Contents