Versions Compared

Key

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

...

Section
Column
width40%

Requires Phoenix FD 3.11.01 Nightly Build ID 28305 and V-Ray 3.60.04 Official Release for 3ds Max 2015+. If you notice a major difference between the results shown here and the behavior of your setup, please send an email to support@chaosgroup.com.

In this tutorial, we guide you through the creation of a fusion effect resulting from the splash of two fluids - milk and chocolate. For this goal, we create two liquid emitters, one for each liquid type. By using a Blend Material, we set the appearance of the mixture.

The two liquids are simulated with different RGB each, and then the grid RGB channel is extracted via a Phoenix FD Grid Texture and used as a mask for the Blend Material. We use Surface Tension to keep the liquid particles packed together in a smooth mesh and only allow them to break up into larger droplets.

To make the liquid mesh look even smoother, as a real milky-looking liquid, we use the Phoenix FD smoothing tools found in the Input and Rendering rollouts of the Simulator.

The Download button below provides you with an archive containing the start and end scenes as a reference.

 

UI Button
sizelarge
icondownload
titleDownload Project Files
urlhttps://drive.google.com/uc?export=download&id=13JaGPso1bc6tv0xh0an3qYYWy1smItJu

Column
width60%

 

System Units

 

...

Section
Column
width40%

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 FD 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
width60%

...

Section
Column
width40%

For a better understanding of how the scene components work together, take a look at the Scene Setup image. This is how the finished scene will be laid out.

The two liquid emitters are positioned facing each other, with the Chocolate emitter on the left and the Milk emitter on the right.

Three lights are used in the scene:

A V-Ray Dome Light provides an overall diffuse illumination.

A V-Ray Rect Light is placed above the Phoenix FD Simulator and acts as the key.

A V-Ray Sphere Light provides backlighting for translucency.

A dark poly plane is positioned behind the Phoenix FD Simulator to serve as a background. 

Column
width60%


Simulation Setup

...

...

Section
Column
width40%

The liquid emitter geometries used in this tutorial are two 3ds Max Primitive Planes

If you'd like your setup to be identical to the provided scene files, here are the exact sizes and transformations of the planes:

Right plane:

Length / Width : 23 / 42cm
Translate: [ 0, 185, 0 ]
Rotate: [ -124,.5 , 11 , 0 ]

Left plane:

Length / Width : 23 / 42cm
Translate: [ 0, -185, 0 ]
Rotate: [ 57, -148, -3,.5 ]

 

Column
width60%

 

...

 

Section
Column
width40%

Add a Bend modifier to give the poly planes a slight curve. This will spread the emitted fluid in an arc rather than producing a dull, cubic shape.

Change the Bend Axis for both planes to X.

If you'd like your setup to be identical to the provided scene files, here are the Bend Angle values for the planes:

Right Plane: [ Bend Angle: -25 ]
Left Plane: [ Bend Angle: -34 ]

You may want to experiment with the Bend Angle parameter - different values will produce slightly different results.

Column
width60%

...

Section
Column
width40%

You can see from the Preview Animation above that the default behavior of the Phoenix FD Liquid Source is to emit liquid from the surface of the source geometry. Phoenix FD provides you with 2 ways to direct the discharge:

  1. Using Polygon / Face IDs to limit the emission to manually specified faces.
  2. Using Discharge Modifiers on the Liquid Source to limit the emission based on the position, orientation or animation speed of the faces.

In this tutorial, we use the simpler option 1.

 

Add an Edit Poly modifier and go into Face selection mode. Select the faces pointing towards the Origin and give them a unique material ID. By default, all faces have an ID of 1, so switching the ID to 2 for the selected faces should do the job.

The Phoenix FD Liquid Source in 3ds Max can use the polygon face IDs as a 'mask' - only the faces with a given ID will be used for emission.

Repeat this step for the other poly plane.

Column
width60%

...

Section
Column
width40%

Select both poly planes, Right-Mouse-Button click → Phoenix FD Properties...

Disable the Solid Object option under the properties window.

When the source geometry is solid and emitting in Surface mode, the velocity field calculation takes said geometry into account and it acts as an obstacle.

If you disable the Solid Object option, the fluid will not (indirectly, through the influence of the velocity field) interact with the source geometry at all.

Take a look at the Viewport Prevewis Previews below and note the behavior of the liquid near the source geometry when set to Solid.

Column
width60%

...

Section
Column
width40%

Here are the values for the Stucco Parameters rollout:

Size: 10
Thickness: 0,.14
Threshold: 0,.43

You may experiment with those - the emission pattern will be heavily affected.

Column
width60%

...

Section
Column
width40%

Here's the emission when modulated by the Stucco with an animated Offset parameter.

Column
width60%

Videoautoplayloop
0011_stucco_for_discharge_with_anim.mp4
1100%
2100%
3true
4false
5true


Mesh Smoothing Options

...

...

Section
Column
width40%

Enable Liquid Channel Smoothing from the Input rollout. This option applies a smoothing algorithm over the cache as its read back into the simulator for preview and rendering.

Column
width60%

...

Section
Column
width40%

Open the Rendering rollout of the Phoenix FD Simulator and set the Smoothness parameter to 100. This is yet another smoothing option dedicated especially to meshes, available to you to combat grid artifacts and produce a clean liquid surface.

Enable Use Liquid Particles and set the Particle Size to 0,.8. The Liquid Particles option allows the meshing algorithm to produce a surface with varying thickness. You can use the Particle Size parameter to control the thickness of the mesh.

Column
width60%

...

Section
Column
width40%

We are now ready to Start the simulation at the final Cell Size of 0,.64cm.

You may want to set the Preview rolloutRead Cache for Preview option to Disable During Sim - this will save some time as the CPU and Graphics card won't be bogged down by the smoothing operations over the cache files read by the simulator on each frame.

Column
width60%

...

V-Ray Blend Material Setup

...

...

Section
Column
width40%

Create a VRayBlendMtl and assign it to the Phoenix FD Simulator.

Then, create 2 more materials - a VRayFastSSS2 material and a VrayMtl.

Plug the VRayFastSSS2 into the Base slot of the Blend material.

Plug the VRayMtl into the Coat1 slot of the Blend material.

 

Here's how this setup is going to work: we use a Phoenix FD Grid Texture to read the RGB channel of the Simulator and use that as the blending factor between the 2 materials. The VrayFastSSS2 material will be revealed where the RGB channel is black, the VRayMtl will show where the RGB is white, and the RGB values in-between will produce a mix between the two.

Column
width60%

...

Section
Column
width40%

For the VRayMtl used for the chocolate, the following settings are used:

Diffuse: [ 24, 8, 3 ]

Reflection color: [ 110, 74, 57 ]
Reflection Glossiness: 0,.75
Reflection Max Depth: 10
Reflect on Back Side: Enabled

Refraction Color: [ 51, 16, 5 ]
Refraction Glossiness: 0,.75
Refraction Max Depth: 10
Dispersion Abberation: Enabled, with a value of 50.

Translucency is set to Hybrid Model - this setting is optional and can be omitted for shorter render times.

Column
width60%

...

Section
Column
width40%

Lastly, create a Phoenix FD Grid Texture and plug it into the Blend 1 slot of the VRayBlendMtl.

Set the Channel parameter to Channel RGB so the grid texture knows to read the RGB channel of the simulated cache files.

As previously stated, the logic here is fairly simple - the Base (milk) material will appear where the RGB channel is white, and the Coat (chocolate) material will appear where the RGB is black.

Column
width60%


Camera

...

...

Section
Column
width40%

The camera is placed right in front of the Phoenix FD Simulator. You can experiment with different angles.

Exposure Gain is set to Manual 100 ISO and the Shutter speed to 1/600 - this should give you a balanced exposition that you can easily tweak further in a compositing package or the V-Ray Frame Buffer.

Aperture is reduced to 1,.4 and Depth of Field is enabled. A small aperture in conjunction with Depth of Field produces a beautiful blooming effect of the highlights that are out of focus.

To further tweak this, the Aperture Shape is set to Bladed, with the Blades set to 7 and the Rotation to 15 degrees. Feel free to experiment with these settings and find something that suits your taste.

Column
width60%

 

Lighting 

 

...

Section
Column
width40%

The lighting in the scene is crucial for a good looking render. 

The key light in this scene is the V-Ray Plane light, placed above of the simulation grid.

The Length / Width values are: [ 230cm, 350cm ]

The Intensity Multiplier is set to 10 and the Invisible option is enabled under the Options rollout.

A VRaySoftbox texture is applied to modulate the light intensity. The parameters for it are provided in the next step of this tutorial.

Column
width60%

...

Section
Column
width40%

Finally, a VRay Sphere Light is used for backlighting. Recall that the milk is using a VRay FastSSS2 shader - the backlight will bring out the translucency and help produce more believable shading.

Column
width60%

Section
Column
width40%

.A regular poly plane is used as a backdrop for rendering. A default VRayMtl is assigned to it with the only change being the value of the Diffuse color - [ 10, 10, 10 ].

Column
width60%

...

Experiment with these parameters to find the best photorealistic look for your beautiful Chocolate Milk fusion.