Versions Compared

Key

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

...

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%

The final scene consists of the following elements:

  1. AStandard Primitives -> Box used as the source geometry for the liquid. An animated Noise modifier is applied to the geometry to break up the emission.
  2. A set of rocks provided with the rocks.abc file.
  3. A Phoenix FD Liquid Source with the Box in its Emitter Nodes list. The Source is in Surface Force mode and Noise is enabled for extra randomization.
  4. Phoenix FD Liquid Simulator with some tweaks in the Grid, Dynamics and Rendering rollouts.
  5. Particle Tuner used to tweak the Viscosity of the liquid during the simulation.
  6. V-Ray Physical camera with minor tweaks for final rendering.
  7. A V-Ray Dome Light.
  8. V-Ray Plane used as an infinite ground surface.

Column
width60%

...

Section
Column
width40%

Set the Time Configuration ->  Animation Length to 150 so that the Time Slider goes from 0 to 150.

Column
width60%

...

Section
Column
width40%

Import the rocks.abc geometry by going to File -> Import -> Import...

We start off with pre-built geometry to save time setting up the scene. Feel free to use your own personal models.

UI Text Box
sizemedium
typeinfo

The size of the bounding box of the three rocks used in this example is:

X/Y/Z: [ 155/60/75 ].

Column
width60%

...

Section
Column
width40%

Let's add the geometry used to emit the lava.

Create a Geometry -> Standard Primitives -> Box.

Use the Move tool to place the box above the rocks. The exact transformation values are X/Y/Z: [ 73/3/137 ].

Set the Length/Width/Height to [ 38/33/5 ], and the Subdivisions along the Length/Width/Height to [ 5/5/1 ].

The subdivisions are needed later in this tutorial when a Noise modifier is added to the Box to randomize the emission pattern.

Column
width60%

...

Section
Column
width40%

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

Add the Box geometry to the Emitter Nodes list. For the time being leave all other options at their default values.

Column
width60%

...

Section
Column
width40%

Create a Geometry -> Phoenix FD -> Liquid Simulator.

Set the Grid -> Cell Size to 1.0cm. 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 Size of the Simulator is set to X/Y/Z: [ 80/80/150 ].

Set the Grid -> Container Walls -> Z: Jammed (-). When a Container Wall is Jammed, it acts as a solid wall against which the liquid will collide.

The exact Position of the Simulator in the scene is X/Y/Z: [ 75/2/0 ].

Column
width60%

...

Section
Column
width41%

Enable Phoenix FD Simulator -> Grid -> Adaptive Grid and Maximum Expansion. The red box in the screenshot to the right is a preview of the Maximum Bounds for the simulation. Adaptive Grid is a huge time saver - the initial grid is dynamically expanded to accommodate the movement of the liquid, cutting down on both processing time and memory. If you notice any clipping, increase the Extra Margin to a value of 5 - 10. This will add a few extra voxels at the borders during adaptation.

The Adaptive Grid Maximum Expansion settings are X: [ 200, 100 ], Y: [ 100,100 ] and Z: [ 0, 0 ].

Column
width59

...

Section
Column
width40%

Enable Phoenix FD Simulator -> Dynamics -> Wetting. When Wetting is enabled, Phoenix FD generates another set of particles called WetMap particles. Those particles are created at the point of contact between the liquid and the scene geometry and can be used to drive shaders (through a Phoenix FD Particle Texture) or specify where the liquid should try to adhere to. You can disable Wetting for a specific object in your scene from its Phoenix FD Per-Node Properties.

Set Sticky Liquid to 0.1. The lava will now try to adhere to the rocks.

Column
width60%

...

Section
Column
width40%

Reduce the Phoenix FD Simulator -> Grid -> Cell Size to 0.64 so the extra detail provided by the Noise texture can come through.

Column
width60%

...

Section
Column
width40%

Increase the Phoenix FD Simulator -> Dynamics -> Surface Tension to 0.05. Surface Tension helps keep the liquid together.

Column
width60%

...

Section
Column
width40%

Click the No Map under Phoenix FD Liquid Source -> Viscosity -> Map. Add a Noise texture from the pop-up menu.

Increase the Viscosity parameter to 1.0. Usually a value of 1.0 is way too high but since the Noise texture has high-frequency detail, with most of the values in the texture much below 1.0, the final result will be significantly lower after the Viscosity is multiplied by the provided texture map.

Column
width60%

...

Section
Column
width40%

There are many stray particles flying all over the place as the lava collides with the rocks. Not only is this effect unnatural but it also drastically increases the simulation time by expanding the Adaptive Grid to its maximum extents.

Increase the Phoenix FD Simulator -> Dynamics -> Steps Per Frame to 2 to remedy this.

Increasing the Steps Per Frame will usually produce calmer fluids but will increase the simulation time. 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. You can find more information on Steps Per Frame here.

Column
width60%

...

Section
Column
width40%

Click the No Map under Phoenix FD Liquid Source -> RGB -> Map. Add a Noise texture from the pop-up menu.

 

At this point you should have three different Noise textures, added in the Texmaps' slots for Outgoing Velocity, RGB and Viscosity.

Column
width60%

...

Section
Column
width40%

Set Phoenix FD Simulator -> Dynamics rollout -> RGB Diffusion to 0.1.

The RGB Diffusion parameter controls how quickly the colors of particles are mixed over time during the simulation. When set to 0, each liquid particle carries its own color, and the color of each individual particle does not change when liquids are mixed. This means that if red and green liquids are mixed, a dotted red-green liquid will be produced instead of a yellow liquid. This parameter allows the colors of particles to change when the particles are in contact, thus achieving uniform color in the resulting mixed liquid. For more information, see the RGB Diffusion example.

Column
width60%

...

Section
Column
width40%

Add a Command Panel -> Cameras -> V-Ray -> VRayPhysicalCamera.

The exact position of the Camera is X/Y/Z: [ 2/318/108 ].

The exact position of the Camera Target is X/Y/Z: [ 16/11/44 ].

The Film Gate is set to 36.0.

The Focal Length is set to 40.0.

The Aperture -> Film speed (ISO) is set to 100.

The Aperture -> F-Number is set to 0.8.

The Aperture -> Shutter Speed is set to 1000.

Both Depth of Field and Motion Blur are Enabled.

Color & Exposure -> White Balance is set to D50.

Bokeh Effects -> Blades is Enabled, with a value of 7. Rotation is set to 15, with a Center Bias of 1.

UI Text Box
sizemedium
typeinfo

 The V-Ray Settings -> Rendering Output Width/Height is set to 960/540 for the example renders below.

Column
width60%

...

Section
Column
width40%

Add a Command Panel -> Lights -> V-Ray -> V-Ray Light.

Set the Light Type to Dome.

Set the Multiplier to 6.

Enable Options -> Invisible so the Dome Light is not visible in the rendered image but still provides illumination in the scene.

Column
width60%

...

Section
Column
width40%

Set the Rendering -> Environment -> Background Color to RGB [ 15, 16, 21 ].

Column
width60%

...

Section
Column
width40%

Add a V-Ray Infinite Plane by going to Geometry -> Standard Primitives -> V-Ray Infinite Plane.

To the right is a rendered image of the current setup plus the basic materials we will create in the next section.

Column
width60%

...

Section
Column
width40%

Create a Color Correction node and plug the gridRGB texture into the Map slot. Rename the Color Correction node to desaturateRGB.

Set the Color -> Saturation to -100.

Set the Lightness -> Contrast to 100.

Column
width60%

...

Section
Column
width40%

Create an Output node and plug the Color Correction texture into the Map slot. Rename the Output node to incOutputRGB.

Set Output -> Output Amount to 2.0. Doing so will essentially boost the contrast in the RGB values even further.

Column
width60%

...

Section
Column
width40%

Optionally, you may choose to enable some Simulator -> Rendering -> Mesh Smoothing options if your lava simulation looks too sharp/jagged.

The settings for the smoothed image to the right are Simulator -> Rendering ->Use Liquid Particles enabled, and a Smoothness of 5.

Column
width60%
Image slider
Panel

Lava No Smoothing

Panel

Lava With Smoothing

...