Avoiding grid artifacts on the source surface

Light cache and dense smokes

Rendering with an external volumetric shader.

Displacement setup

Creating the illusion for bigger resolution

Max. transp. levels of V-Ray and pure geometry mode

Complex rendering and "Circular reference" message

Simulation in 2D

Noise/slice like artifacts

Fluid simulations in hollow objects

Settled liquids

Connecting two simulators in cascade way

Simulation and rendering of fine smoke without using a huge grid resolution

Initial fill up of liquids

Preview high resolution grids on Windows

Avoiding grid artifacts on the source surface

In some cases the cells of the grid are clearly visible over the surface of the geometry used as a source. To avoid this artifact the transparency diagram should be arranged do give zero opacity at the birth value of the source channel. The example below shows two images created with different transparency diagrams. The birth temperature of the fluid is 2000K.

 

Opacity is set to 0 at the birth point
Opacity is given a positive value at the birth point

 

Light cache and dense smokes

The light cache can cause clearly visible spots over the surface of dense smokes, so it is not recommended to be used in such cases.

 

Rendered with Light cache - On
Rendered with Light cache - Off


Rendering with an external volumetric shader

Phoenix FD is able to export its content as texture (see PhoenixFD Texture) and this makes it possible to use an external volumetric shader for the rendering, for example the V-Ray environment fog.

Simple setup for V-Ray environment fog (check out phx_simple_envfog.ma):



Displacement setup

To avoid waste of time for test rendering with different displacement settings, the shader can be switched temporary to solid mode, that is much faster than the usual volumetric mode and you will see much clearly the result.


Creating the illusion for bigger resolution

Even without fine details an image can look as if it has a lot of detail, if it has high sharpness and no pixelisation. This effect can be used to produce high resolution looking simulations with relatively coarse grids, using a properly adjusted transparency diagram.
The images below are made with the same simulation input and different transparency settings. The left one is made with simple smoke option, which gives the natural distribution of the smoke without any tricks. The second image uses a transparency diagram containing one peak near to the zero, that produces sharp smoke appearance.

 

Simple smoke
Peak transparency diagram

 

Max. transp. levels of V-Ray and pure geometry mode

Rendering in pure geometry mode causes high transparency level and you have to increase the Max. transp levels of V-Ray to a bigger value, given by the following formula: max transp level=grid size*100/step.

 

The image to the right illustrates an issue that occurs when the Max transp. levels is not high enough

 

 

 

 

 

 

 

 

 

 

 

 

Complex rendering and "Circular reference" message

In some cases when the rendering setup is complicated, the user will get an unexpected message stating "Circular dependency detected between {node1} and {node2}". This message appears when the object depends on itself. In most cases the dependency can be resolved in the Maya version of Phoenix FD. I.e., unlike in 3ds Max, the simulator can use it's own exported textures. One example of unresolvable dependency is when the displacement is using an exported texture from the same simulator. A solution to this problem is to turn on the "Skip Displacement" option of the texture.

 

Simulation in 2D

Phoenix FD has the ability to perform a 2D simulation, if one of the sizes is set to 1. To keep some features like the embedded gravity and pressure decay, it is recommended to keep the z direction active.


Noise/slice like artifacts

Despite the difference in appearance both of the mentioned artifacts have a common reason - too big value of the advancing step compared to the opacity gradient. Depending on the situation there are two ways to solve the problem: to decrease the advancing step or to decrease the transparency gradient. The first solution will increase the rendering time, the second one will decrease the sharpness of the resulting image.

 

Noise
Slices
Low gradient
Low advancing step

 

Fluid simulations in hollow objects

When simulating fluids in hollow objects one must make sure that the normals of the geometry are pointing inwards.

 

Settled liquids

The simulation of settled liquids is relatively hard for most liquid simulators as usually a residual rest flickering or persistent waves can be seen. PhoenixFD is able relatively easy to achieve settled liquids with perfectly flat surfaces. The most important parameter is the sharpness - set it to zero. If you need it bigger during the simulation, you can animate it, or better to switch on the "static surface correction" that will automatically decrease the sharpness when the velocity is low enough. It's also recommended that the option "Strong surface mode" is enabled. The second important parameter is the lower SPF limit. The practice shows that is good to be about two times bigger than the natural SPF value with advection step=2.


Connecting two simulators in a cascade setup

There are many situations when the simulation area is narrow and its volume is not very large by itself, but for some reason its bounding box is a big one and requires a huge grid to cover it. A perfect example for such a situation is a waterfall - the upper area can be covered by a box, which is wide, but not very tall; the vertical area can be covered by a tall and not very wide box; but together they have to be covered by a box that is both wide and tall. A cascade connection of the simulators is suitable exactly for such a situation, because it allows to cover the simulation area with two simulators, each of them having a relatively small grid. This technique is not a core feature (there is no way to connect the cores), but the ability to put a phoenix simulator as a source for another one is used. When a phoenix object is used as source, the implicit surface determined by the effects channel and the surface level defines the geometry surface and the new born fluid will appear over it. The difference, compared the the usual geometry sources, is that we have the ability to set the velocity of the new born fluid to the same value that the fluid selected as source has in this point. As a result, the new born fluid will gracefully continue its movement and it will appear as if this is the same fluid. To avoid the additional speed added by the discharge parameter, set its value very low, for example 0.001. Do not make it zero, because the system will decide that this is not a source and will skip it. The technique can be used for gaseous simulations too, but with a small modification. You have to put the surface level to a very small value, thus making the source surface a box. To transfer the parameters of the gas from the first simulator to the second one, export the used channels as maps and put them in the map slots of the source helper. Run the source simulator first, and then the second one. As the simulation will usually be ran multiple times, to avoid backward interferences, add the second simulator in the exclude list of the source one. See phx_cascade.ma for example.

 

Simulation and rendering of fine smoke without using a huge grid resolution

A well known issue of grid simulations is the numerical dissipation - an undesired diffusion of the grid values caused by the advection. This makes the simulation of fine layered smoke very hard, despite the lack of turbulences. The usual solution is to simply use a huge grid, however this makes the whole simulation extremely slow. Actually, we do not need that resolution for the whole simulation — the low resolution velocity is pretty good — all that we need is just a dissipationless advection method for the smoke. A good solution for this problem is to use particles to represent the smoke and to drive them with a low resolution simulation. Phoenix FD has the tools making this possible - it can drag particles, and can render them as fog.

  1. Enable particle generation in the source, set the rate to about 10000.

  2. Select the particle type of the source to be "Drag"

  3. Perform the simulation. Note that the Velocity channel should be exported to avoid the slice-like artifacts near to the source, and, of course, for motion blur.

  4. Create a PhoenixFDFoam node

  5. Enable the "As fog if below" option, and use some big value, say 100 (by default, the particles are of size 1). The big value is needed to ensure that all the particles will be shaded in fog mode.

  6. Perform a test rendering and adjust the transparency and the size multiplier of the PhoenixFDFoam shader.

  7. Try to decrease the voxel size of the fog (fog resolution parameter) until the rendering becomes fine enough.

  8. Warning! One halving of the fog resolution results in an eightfold increase of the consumed memory! Save the scene before each attempt!

300k cells simulation rendered directly
300k cells simulation rendered via 10M particles

 

Initial fill up of liquids

A very common question about liquid simulations is how to start a simulation with a volume filled with liquid. Of course, there is an obvious way, by using a preliminary simulation, with a normal source, simulating until the volume is filled and the liquid is settled. However, this could be very slow - sometimes it can take longer than the "real" simulation itself. There are tree faster ways to do this, without the initial simulation, as described below:

 

Using brush mode source

  1. Create a geometry covering the volume that should be filled with the liquid.

  2. Exclude this geometry from the interaction, by adding it in the simulator's exclude list, or by just hiding it.

  3. Create a liquid source, and select "brush" for the If Not Solid option.

  4. Animate the discharge from 100 to 0 for the first two frames.

  5. Disable the velocity check box of the source helper

 

Using mapper object and VRay distance texture

  1. Create a geometry covering the volume that should be filled with liquid.

  2. Exclude this geometry from interaction, by adding it in the simulator's exclude list, or by just hiding it.

  3. Select this geometry in a VRay distance texture.

  4. Make the texture white in the geometry and black outside the geometry.

  5. Select this texture in a PhoenixFD Mapper node in the "map" slot, and select the liquid channel to be affected. Make sure that the "Initializer" check box is on.

 

Using Mel or Python script. Here is a simple python example:


import maya.cmds as cmds
from phxfd import *

def OnSimulationBegin(node, t, dt):
    sx = cmds.getAttr(node + '.xSize')
    sy = cmds.getAttr(node + '.ySize')
    sz = cmds.getAttr(node + '.zSize')
    for x in range(1, sx/2):
        for y in range(1, sy):
            for z in range(sz/4+1):
                setT((x, y, z), 1.0)

 

Preview high resolution grids on Windows

Present video cards can render grids that exceed their physical amount of memory, but this means swapping and rapid increase of the rendering time. This can cause Windows Vista and above to restart the driver and close the application. One solution is to Downsample the grid. The other is to increase the time Windows can wait for rendering. For more information see Timeout Detection and Recovery of GPUs through WDDM. Disabling the Aero interface can also free a good amount of memory.