Table of Contents

This page provides a tutorial on creating an effervescent tablet simulation in Maya.

Overview


This is an Entry Level tutorial which requires no previous knowledge of Phoenix. A basic understanding of Maya 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.1 for Maya 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 Window → Settings and Preferences → Preferences.

On the Settings tab, set the Working Units to centimeter.


Glass Geometry


To generate the glass, find a suitable reference image and trace it with the CV Curve Tool.

Make sure to trace both the inner and outer layer of the glass.

 


 

With the generated curve selected, go to Surfaces → Revolve

 


 

As Phoenix can't use the generated NURBS surface directly, we need to convert it to polygons.
Select the generated surface and go to Modify → Convert → NURBS to Polygons (options).
Set the Tessellation method to Control points.

 


 

The resulting geometry is likely to be very low-res so consider subdividing it before using it for simulation.
Go to Mesh → Smooth (options) and set the Division Levels to 2.

 


 

It would be a good idea to save the curve and the NURBS surface that you created earlier in a group node which you can then hide.
Rename the glass to glass_geo_01.

 

Initial Fill Geometry


To generate the Initial Fill geometry, select the inner faces of the glass.

Tip: To easily select the inner faces, select a single ring on the bottom and use the Shift + .(dot) hotkey to grow the selection.

 


 

Go to Edit Mesh → Duplicate.

 


 

Use the Mesh → Fill Hole command to fill the top of the generated geometry. Phoenix can't use an open mesh as a source.

Be sure to reverse the normals of the geometry as it is very likely that they will be pointing inwards. To do so, go to Mesh Display → Reverse.

 


 

Clean up the scene by deleting the history on the polygon glass and the initial fill geometry, and unparenting them from the group node created by the Duplicate command.

Delete the history on the polygon objects by pressing Alt+Shift+D.

Rename the initial fill geometry to glass_initial_fill_01.

 


 

Select the glass_initial_fill_01 geometry and in the Attribute Editor, go to its Shape node tab.

Under Attributes → Phoenix FD → Phoenix FD Node Properties.

Enable Initial Liquid Fill on the Extra Phoenix FD Attributes tab. 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.

We use a simple polygon cylinder to represent the tablet.

Rename the tablet geometry to source_geo_01.

 


 

Make sure to give the tablet some motion.

The tablet in the scene 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 Attributes → Phoenix FD → Phoenix FD Node Properties → Extra Phoenix FD Attributes. As you can see the Solid option is enabled by default.

Go to frame 24, leave the Solid option enabled and Set Key. Then, go to frame 25, disable the Solid option and Set 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.


Rename the generated set to phx_source_set.
Add the source_geo_01 node to the phx_source_set.

 


 

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 Discharge value:

Frame 14: 0;
Frame 40: 1;
Frame 100: 1.5;
Frame 200: 1;
Frame 250: 0.5.

 

Set the Noise to 1.

This option varies the Discharge 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 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 Fluid Simulator that encompasses the glass and rename it to phx_simulator_01.


Rename the generated sets as well:

  • phx_sim_set;
  • phx_force_prv_set;
  • phx_light_set.

 


 

Go to the Liquid tab and select Enabled.

This is required, because the Simulator in Maya is able to generate both Fire/Smoke and Liquid simulations.

 


 

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. Working with a low Grid Resolution allows for much faster iteration and playback.


Set the Container Walls to Jammed Both for X and Z, and Jammed(-) for Y. 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 → Exclude List. This option 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 Simulation Set.

We take advantage of the Exclude 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, uncheck Exclude List and 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, the phx_sim_set works as an include list - in other words, we need to add any geometry or source that will be used in the simulation to that set.


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

 


 

Go to the Foam tab and select Enable Foam.

Maya will ask if you want a new Phoenix Particle Shader generated - choose Yes.

 


 

Rename the generated PhoenixFDPrtShader1 node to phx_foam_shader_bubbles_01.

Rename the generated phxParticle_set1 node to phx_bubbles_particle_set. Inside this set, rename the PG_phx.... node to pg_foam.

 


 

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 Maya 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 Render Cutter geometry. A Render Cutter geometry is a polygon geometry that will clip the rendering only to inside its volume.

Enable Use Render Cutter 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 Render 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.

Check Using Initial Liquid Fill with Containers for more information on setting up rendering of such scenes.

 


 

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 Reflection and Refraction 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 Reflection and Refraction Color to RGB (255, 255, 255), and the Refraction IOR to 1.4.

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.

 


 

Navigate to the Reflection - advanced rollout and set the Max depth to 5.

You can leave the Max depth parameter at its default value of 8 or switch it to a higher value. The Reflection Max depth specifies the number of times a ray can be reflected.

In this example scene, the Reflection Max depth is set to 5, as this value works good for the scene setup and we save on some render time.

 


 

Scroll to the Refraction - advanced rollout and set the Max depth to 10.

You can leave the Max depth parameter at its default setting of 8 or switch it to a higher value. The Refraction Max depth specifies the number of times a ray can be refracted.

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

 

Lighting and Camera


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

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

Set the Intensity multiplier to 0.7.

Set the Directional value to 0.8.

 


 

For this setup a standard Camera and Aim are used.

The Angle of View is set to 39.6.

The Focal Length is set to 50.

 

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

 

Rendering


Set the V-Ray Sampler type to Bucket.

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

Set the Threshold to 0.001.

Set the Render region division to 16.

 


 

Navigate to the GI tab and enable the Global Illumination.

Disable the Reflective 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 Engine to Light cache.

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 the Overrides tab of the V-Ray Render Settings and under 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 and enable Override Environment. When Override Environment is enabled, V-Ray overrides the default Maya environment and renders with the options selected below.

Plug a Ramp texture in the Background texture Map slot. this option sets the map to act as a background during rendering. 

Plug a Ramp texture in the GI texture Map slot. Sets the map to be used during Indirect Illumination(GI) calculation. The effect of changing the GI texture is similar to a skylight.

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

Check the Environment Overrides page for more information.

 


 

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

Type: Circular Ramp;

Interpolation: Exponential Up;

The first point has the U Wave set to 0, and the Selected Color is set to RGB (135, 202, 255).

 


 

The second point has the U Wave set to 0.8, and the Selected Color is set to RGB (21, 94, 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 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.