This page provides a tutorial for using the Initial Liquid Fill setting and manually creating a liquid simulation inside a glass container.

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 will guide you in creating an Initial Fill geometry and modifying a liquid simulation so that it can be contained inside of a wine glass or similar container. This includes adjusting the simulation so the liquid interacts and renders with the container appropriately.


This tutorial is created using Phoenix 4.41 Official Release and V-Ray 5, Update 1.3 Official Release for 3ds Max 2018. 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 scene files.


Download Project Files


Creating a Glass Geometry


To create the glass geometry, we will use the Lathe modifier. Start by creating a Line and drawing the profile curve in an Orthographic view.

Make sure the starting and end vertices are positioned on the revolving axis.




Next, add the Lathe modifier by selecting it from the Modifier List. This will create the cup geometry.


It would be a good idea to save the Line that you created earlier, this way you can easily go and readjust the glass model if you need to make any changes.




Add a STL Check from the Modifier List.

Enable the Check option and view the Status to ensure the model is watertight and free from errors.




Finally, smooth out the glass geometry using the TurboSmooth modifier.

You will be left with a Solid geometry.

Rename the wine glass to glass_geo_01.


Create the Initial Fill Geometry


Create a simple Box with its LengthWidth and Height Segs set to 1.0 and place it so the bottom face is below the bowl area of the glass.

The top face will be the top of the liquid.

Make sure the side faces extend beyond the walls of the wine glass.




With the box selected, go to the Geometry category of the Create panel and select Compound Objects → ProBoolean.




In the Parameters rollout, set Operation to Subtraction.

In the Pick Boolean rollout, set the type to Copy, then click the Start Picking button and select the glass geometry.




In the Modify panel, right click the ProBoolean modifier and convert it to an Editable Poly.




Switch the Selection to Element. Select the part of the box outside the glass and delete it.




You will be left with solid geometry which can be used for liquid in the glass.

Rename the initial fill geometry to glass_initial_fill_01.




If the Boolean operation did not perform as shown on the picture, you may need to Flip Normals for the glass. To do so, add a Normal modifier from the Modifier List.

The purpose is to have the glass geometry normals pointing towards the liquid volume, and the glass_initial_fill_01 geometry normals should point outwards towards the glass.

If you need any additional helper geometries for the process, make sure they are excluded from the simulation from the Scene Interaction rollout.




You may want to increase the Scale of the initial fill geometry, so that its outside border stays between the glass geometry walls. We are doing this, because the initial fill geometry and the glass geometry have to intersect in order to get better results with the Render Cutter.

To do so, add a Push modifier with a Push Value of about 0.3 cm.


Phoenix Initial Fill


With the filled geometry selected, right click and select Object Properties.

In the Display Properties, enable Display as Box. In the Rendering Control section, disable Renderable, then select OK.

This way we can use the filled geometry in the simulation, but it won't be rendered in the final picture.




With the filled geometry object selected, right click and select Chaos Phoenix Properties.

Enable Initial Liquid Fill. This will fill the geometry with liquid at the very beginning of the simulation.


Phoenix Fluid Simulator


Create a Phoenix Liquid Simulator that encompasses the fill object.




The Simulator → Grid parameters are tweaked as follows:

The Scene Scale is set to 25.0. When working with small scale water simulations, it's often hard to control the tiny jittering that tends to occur near collision objects without increasing the Steps Per Frame to prohibitively high values. Therefore, it's faster and easier to simply increase the Scene Scale a little. If your scene setup requires lower Scene Scale, you can compensate this by increasing the Steps Per Frame at the expense of increased simulation time.

The Cell Size is set to 0.15 cm. The lower the Cell Size is, the more detailed the simulation will be but the longer it will take to complete. We start off with a reasonably small value so we can iterate quickly over different parameter variations.

The X/Y/Z Size of the Simulator is set to 190/190/170.

Increasing the Grid 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 you want. You have to find a good balance.




In the Dynamics rollout, set the Steps Per Frame to 12. Higher Steps Per Frame values will result in a smoother liquid at the cost of increased simulation times.

In general, you should try to keep this as low as possible without compromising on the quality of your simulation.




Start the simulation and let it run for 20 or so frames, and check the results.




This method can be very helpful when used with a tilted object.


Potential Issues


Here is a short list of common issues that might keep the process in this tutorial from turning out to be a success.

1.  If the Initial Fill object is hidden, then nothing will be sourced into the simulation. Unhide the object or allow the Simulator to use Hidden Objects (disabled by default).




2. If the normals on the Initial Fill geometry are reversed, the fluid may appear outside the glass instead of on the inside. You may need to use a Normal modifier to Flip Normals for the initial fill geometry.




3.  If there are holes in the Initial Fill geometry, try resolving by using Cap Holes modifier.


Liquid Rendering


Use the Render button to generate an image of the scene. 

Notice the noise present on the surface of the liquid. 




To resolve such issues, Phoenix provides you with the option to use the glass geometry as a Cutter Geometry. A Cutter Geometry is a piece of polygon geometry that will clip the rendering only to inside its volume.

Open the Rendering rollout, enable Cutter Geometry and select the glass geometry.

In the Rendering tab of the Simulator, the Cutter Geometry field will be populated by the name of the object that you chose as a cutter.

Geometry normals will affect how the Cutter Geometry behaves. When simulating fluids in hollow objects, make sure that the normals point inwards.




Press Render again.

Notice that the liquid only appears between the walls of the glass. As mentioned earlier, when the Cutter is enabled, the rendering will occur only inside the volume of the Cutter object geometry.




To resolve this, select the Invert Cutter option from the Rendering tab of the Simulator.




Press Render

By default, the Render Mode is set to Mesh which may produce artifacts in the rendered image when used together with a Render Cutter.

Usually, when using a Render Cutter for a liquid pouring into a glass or liquids, contained into another refractive object, you may need to set the Render Mode to Isosurface.  




Select the Simulator and go to the Rendering rollout.

Set the Render Mode to Isosurface. This will create a procedural isosurface without polygons at render time using the Isosurface Level option. Note that this method requires V-Ray.

Compared to the Mesh Mode, the Isosurface is always smooth but it will take longer to render. In case you use Mesh Mode and your mesh is too jagged and edgy, and smoothing it out is too slow or impossible, this means you should switch to Isosurface Mode instead.




And here is the final render with applied wine material, taken from the V-Ray Material Library.

Table of Contents