This page provides a tutorial on creating an effervescent tablet simulation in 3ds Max.

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 effervescent tablet simulation.

 

This simulation requires Phoenix 4.41 Nightly Build from 27 August 2021 and V-Ray 5, Update 1.3 for 3ds Max 2018 at least. You can download nightlies from https://nightlies.chaos.com or get the latest 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

 

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.

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.


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.

 


 

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.

Rename the glass to glass_geo_01.

 

Initial Fill Geometry


Create a simple Box with its LengthWidth and Height Segments set to 1.0. Adjust the box size to cover where you want the liquid to be. It should extend beyond the cup for complete coverage.

 


 

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 it 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. The purpose is to have the Glass geometry normals pointing towards the liquid volume, and the filled 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.

 


 

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

 

Tablet Geometry


You could use a 3rd party plugin to create a comprehensive RBD simulation of a tablet dissolving into smaller and smaller pieces as they travel upwards and use that.
In this example, we use a simple cylinder primitive to represent the tablet.

Rename the tablet geometry to source_geo_01.

 


 

Make sure to give the tablet some motion.

In this example, it is animated to swirl around inside the glass. Doing this may seem tedious and unnecessary but it is a very important piece of the puzzle. Without any motion coming from the source, your simulation will look uninteresting.

 


 

The tablet has an animated Solid option, so the geometry is a Solid object till frame 24 and then it becomes a Non-Solid object.

Select the tablet geometry and go to its Chaos Phoenix Properties. As you can see the Solid option is enabled by default.

Enable Auto Key and go to frame 25, disable the Solid option. Then, go to frame 24, enable the Solid option. Disable Auto Key.

 

Phoenix Simulation


Phoenix Source


Create a Phoenix Liquid Source and rename it to phx_source_01.

The Liquid Source is a Phoenix helper node used to tell the Simulator which objects in the scene will emit liquid, how strong the emission will be, etc.

Add the source_geo_01 geometry to the Emitter Nodes list.

 


 

Set the Emit Mode to Surface Force and disable Emit Liquid. We are not looking to add more fluid into the simulation. The Source is used to generate bubbles only.

 

Lets animate the Outgoing Velocity value: 

Frame 0: 0;
Frame 140;
Frame 401;
Frame 1001.5;
Frame 2001;
Frame 2500.5.


Set the Noise to 1.

This option varies the Outgoing Velocity across the surface or the volume of the emitting geometry or particle. The variation also changes over time. This is a shorthand for using an animated Noise texture in the Mask slot.


Enable Particles and set the Particles Type to Foam.
The amount of born Foam particles is animated in time so that the Foam is emitted only when the tablet geometry is underwater:


Frame 0: 0;
Frame 15: 0;
Frame 17: 9;
Frame 18: 12;
Frame 61: 10;
Frame 200: 6;
Frame 250: 0.

 

When the Motion Velocity checkbox is enabled, the moving tablet geometry will affect the velocity of the foam particles and make them follow the emitter. As we want this effect to be less pronounced we will lower its value.

Enable Motion Velocity and set its value to 0.2.

 

Phoenix Simulator


Create a Phoenix Liquid Simulator that encompasses the glass and rename it to phx_simulator_01.

 


 

Navigate to the Grid rollout and set the Scene Scale to 4. 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.


Set the Cell Size to 0.2 for now. Working with a low Grid Resolution allows for much faster iteration and playback.


Set the Container Walls to Jammed Both for X and Y, and Jammed(-) for Z. When the walls are set to Jammed Both, the simulation behaves as if there is a solid boundary in both directions and the liquid collides with the side walls of the Simulator. Setting the walls to Jammed(-), means that the simulation behaves as if there is a solid boundary in the negative direction. In our case, the liquid is colliding with the bottom and side walls of the Simulator and the liquid is not flowing right through the glass walls.


The scene uses a very low Grid Resolution - only 600K voxels, because the liquid does not need much detail and the main focus is on the Foam particles.

 


 

Go to the Scene Interaction rollout. This tab determines which objects will be ignored or processed by the simulation. If you have a large (complex) scene and you wish only certain objects to participate in the simulation, you can disable the Exclude List and add the objects in the Include List.

We take advantage of the Include List for better visibility in this example scene, but you can also use the default settings of the Scene Interaction rollout.

 

In the Scene Interaction tab, check Include List and uncheck Exclude Hidden Objects. This gives us full control over what goes into the Phoenix simulation and thus, if any issues arise, makes troubleshooting much easier.

Now that Exclude List is unchecked, we need to add any geometry or source that will be used in the simulation.

Add source_geo_01, phx_source_01, glass_initial_fill_01 and glass_geo_01 to the list.

 


 

Go to the Foam tab and select Enable Foam.

3ds Max will ask if you want a new Phoenix Particle Shader generated - choose Yes.

 


 

Set the Foam Amount to 0. The Foam generation will be handled by the Liquid Source, not the Simulator. This parameter is responsible for generating foam from turbulent liquids and we're not interested in doing that.

Set Half Life to 0. This parameter controls the total lifespan of the Foam. However, because our foam is generated inside the liquid, it won't die until it reaches the surface - which is exactly the desired behavior.

Set the Size to 0.09. Foam Variation Small is set to 8, while Variation Large is set to 0.7, so that the smallest bubbles would be much smaller than the Foam Size, while bigger bubbles would not be much larger or they would appear unnatural.

The Size Distribution is set as high as 400, so that there will be a very large number of small bubbles, but not many larger ones.

Set the B2B Interaction to 100. The Bubble-To-Bubble interaction helps the Foam particles stick together rather than behaving like individual points in space.

 Set the Rising Speed to 8. This option affects only the foam particles which are inside the liquid volume. This is the maximal speed of ascent of the average-sized bubbles. Bubbles larger than the Size parameter rise faster and smaller bubbles rise more slowly. If the Rising Speed is too high, foam particles will shoot past the liquid surface into the air.

Set the Surface Lock to 1. This allows you to control the behavior of the foam inside the liquid. If the Surface Lock is set to 1, the foam will be forced to float exactly at the liquid surface, regardless of any motion that may otherwise temporarily force it to sink into the water. Setting it to 0 disables this behavior and the values in-between act as a multiplier for the effect.

 


 

Go to the Dynamics rollout and 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.

 

Particle Shader Setup


The Particle Shader is used to shade particles such as splash and foam. Usually, it is targeted to the particles exported by the Simulator, but it can also shade any Particle System in 3ds Max as well.

Select the Phoenix Particle Shader and set the Mode to Bubbles. When using this mode, each particle will be shaded as a spherical, transparent, reflective foam bubble, which is exactly what we need in this setup.

Set the Color to RGB (233, 233, 233).

 


 

Enable the Volume Light Cache.

Set the Light Cache Speedup to 0.990.

In this example scene, the Volume Light Cache is used for speeding up the rendering process. 

You may experiment with the Light Cache Speedup value to see which value works best with your setup.

Check the Particle Shader page for more information about the Volume Light Cache option.

 


 

Go to the Bubbles/Cellular/Splashes tab:

- set Refraction Index to 1.2;
- set Bounces to 6;
- set Reflection Cut Off to 0.01;
- set Highlights Width to 0.5;
- set Highlights Strength to 1;
- set Pressure Variation to 5.

 

All of those can and should be modified to fit your needs. Lower Highlights Width values will produce glossy bubbles. The Highlights Strength controls the brightness of the reflection.

Disable the visibility of the Simulator and the glass geometry when working on a Particle Shader. It's much faster to render the Particle Systems on their own.
You can also disable the visibility of individual particle systems by hiding their Particle Shaders.

 


 

Go to the Simulator → Rendering rollout and 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. 

The Isosurface Level is deliberately set below the default 0.5 - down to 0.3 - so that the liquid volume would expand and would entirely intersect the glass geometry. This way the Render Cutter would clearly cut the liquid without any remaining air pockets between the liquid and the glass.

If you hit Render at this point, you might notice 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 polygon geometry that will clip the rendering only to inside its volume.

Enable Cutter Geometry and select the glass geometry. Nothing notable will happen in the Viewport but 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.

As mentioned earlier, the Cutter clips the liquid such that only the parts of it inside the volume of the Cutter Geometry are considered at render time, so you may notice that the liquid only appears between the walls of the glass.

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

 


 

The Particle Shader has the glass mesh set as Glass Geometry so that bubbles touching the glass walls would be rendered correctly.

 

Materials


Water


For the water material applied over the Simulator, set the Diffuse Color to RGB (0, 0, 0).

Set the Reflect and Refract Color to RGB (255, 255, 255), and the Refraction IOR to 1.33.

Enable Affect Shadows - without this option, the bubbles will appear black in the rendered image.

 

Glass


For the Glass itself, set the Diffuse Color to RGB (0, 0, 0).

Set the Reflect and Refract Color to RGB (255, 255, 255), and the Refraction IOR to 1.4.

Set the Reflect Max depth to 5. This value specifies the number of times a ray can be reflected. In this example scene, the Reflect Max depth is set to 5, as this value works good for the scene setup and we save on some render time, but you can leave the Max depth parameter at its default value of 8 or switch it to a higher value.

Set the Refract Max depth to 10. This value specifies the number of times a ray can be refracted. You can leave the Max depth parameter at its default value of 8 or switch it to a higher value.

Glass and liquid materials look better with higher Max depth values, but keep in mind that higher values will increase the render time.

Enable Affect Shadows.

You may experiment with the Refraction Glossiness value to create blurred refractions if that is the style you're trying to recreate.

 

Lighting and Camera


Create a standard V-Ray Plane Light and position it above the glass geometry.

The exact position of the light in the scene is [ X: 0, Y: 0, Z: 55 ] and the rotation is [ X: 5, Y: 0, Z: 0 ].

Set the Multiplier to 0.7.

Set the Directional value to 0.8.

 


 

For this setup a V-Ray Тarget Camera is used.

The Lens is set to 50.0.

The FOV is set to 39.6.

 

The exact position of the Camera is [ 0, -62, 16 ] and of the Camera Target is [ 0, 5, 7 ].

 

Rendering


Set the V-Ray Sampler type to Bucket.

Set the Min subdivs to 1 and the Max subdivs to 6.

Set the Noise threshold to 0.001.

Set the Bucked width to 16.

 


 

Navigate to the GI tab and enable the Global Illumination.

Disable the Reflective GI caustics. In this example scene, the Reflective GI caustics don't have much of an effect on the final rendering, but disabling the option makes the render a bit faster.

Set the Light cache Subdivs to 500. The Subdivs are decreased to 500, because this value works good for the scene setup and we save on some render time.

 


 

To enable the Motion Blur, go to VRay → Camera, select Motion blur.

The Duration (frames) and the Interval center are set to 0.5 in the example scene, but you can experiment with the value in order to achieve the desired look.

 


 

Scroll to the Environment tab.

The Environment section in V-Ray render parameters is where you can specify a color and a texture map to be used during GI and reflection/refraction calculations. If you don't specify a color/map then the background color and map specified in the 3ds Max Environment dialog will be used by default.

Plug a Gradient Ramp texture in the GI texture Map slot. This allows you to override the 3ds Max Environment settings for indirect illumination calculations. The effect of changing the GI environment is similar to a skylight.

Plug a Gradient Ramp texture in the Reflection/refraction and Refraction environment texture Map slots. This group allows you to override the 3ds Max Environment settings when reflections and refractions are calculated.

Check the Environment Settings page for more information.

 


 

The Gradient Ramp texture in this example scene is set as follows:

Coordinates: Environ → Screen.

Gradient Type Parameters:

Gradient Type: Radial;

Interpolation: Ease In.

The first point color is set to RGB (170, 215, 255).

The second point color is set to RGB (20, 92, 255).

 

V-Ray Frame Buffer


For the final render, some corrections are made in the V-Ray Frame Buffer.

Create Hue/Saturation Layer and set the Hue to -4.0 and the Saturation to 0.1.

Create Curves Layer and set the points to the following positions:

  • first point to (0.004, 0.017);
  • second point to (0.984, 1).

Feel free to use other values for the post effects depending on your preferences.

 


 

And here is the final animation.

Table of Contents