Maya Fluids

Rendering Maya Fluids

Volumetrics are currently compatible with Maya's internal fluids and Fume FX. Further examples of customer work using Volumes can be found here.

 

There are some limitations when using them. Things to bear in mind when rendering Maya fluids:

  • When you render Maya volumes, by default it is using the lights set up on the fluid, not the lighting setup in the scene (for Maya software, while mental ray renders fine). 
  • Even when matching Maya's fluid attributes, there are some differences. First of all, because the volumes are 'physically based' in Arnold, we have to divide them by 4 * Pi (area of a unit sphere). This is required because the volume cannot scatter more light than the incoming light. Changing the exposure on a light (using linear decay both on the Maya fluid, and on the Maya volume) to 3.65 (that's approximately equal to a 4*Pi multiplication) resolves this.
  • Arnold uses area lights, and the Maya software does not, however mental ray does. It is not a good idea to compare Arnold renders with the Maya software render.
  • You will have to increase the Arnold light intensity by 4 * Pi when rendering with MtoA.
  • There will be some differences in the rendered image from Arnold. Neither mental ray nor Maya Software use multiple importance sampling, whilst Arnold does.
  • Currently, render flags (such as 'Primary Visibility') are not supported with fluids.
  • Currently, Atmosphere Volume does not compose against fluid volumes. This is because atmosphere's return a single flat result that is opacity mapped on top of whatever is in the background of the pixel. 
  • Light-linking does not currently work with Maya fluids.

A tutorial that covers working with Maya fluids can be found here.

Arnold fluid settings

 

Light Volume Samples

The "volume samples" parameter is similar to the light's "samples" parameter for surface shading but in the context of volumes. It controls the number of direct light samples for a ray intersecting a volume on a per-light basis, and as the "samples" parameter for surfaces, it is also a squared number.

Light volume samples

 

Close up of volume samples: 

 

Volume Indirect

Volume samples controls the number of sample rays that get fired to compute indirect lighting of the volume. Like the other sampling rate controls (AA, light samples, diffuse samples, etc), the number of actual samples is squared, so a setting of 3 fires 3x3=9 indirect rays. Setting it to 0 turns off indirect lighting of the volume (which is the default, as indirect lighting can be expensive). Note that indirect volume lighting is tied to the "GI_diffuse_depth" render option and that there must be at least 1 diffuse bounce for indirect lighting to be computed.

Volume Indirect samples in the Render Settings window

Below is another example with a point light inside the fluid. Notice the extra bounced light within the volume when Volume Indirect samples are set above zero.

 

Step Size

Step Size controls the rate at which the volume shader gets called. The value indicates the average distance between adjacent volume shader samples along a given ray, in world space units. Generally, you will want this setting to be as large as possible before visibly noticeable artifacts occur, and in the case of voxelized volumes no smaller than about half the size of your voxels (in world space). Low Step Sizes will increase render times. For example, when the step size is 0.1 and the volume is 10 units big in world space, there are approximately 100 primary samples and therefore the volume shader is called 100 times.

The step size has a fixed size, therefore, the larger the container the more steps will be taken and the longer it will take to render. Also, beware that if the step size is too small your render times will increase. If you cannot see the rendered Fluid, you may need to reduce the Step Size value.

 

Motion Blur

When using motion blur with fluids, ensure that the fluid is cached and that deformation motion blur is enabled both in the fluid and in the render settings. Use the Fluid's 'Velocity Scale' (in Contents Details) to control the amount of motion blur on the fluid.

No motion blur (left). Motion blur enabled (right). Click the images above to view the animations.


Phase Function Anisotropy

The anisotropy setting controls the "mean cosine" of any light that is scattered at a point within the volume. This is equivalent to the "g" or "eccentricity" parameter in the Henyey-Greenstein phase function. Valid values range from -0.99 (full back-scatter) to +0.99 (full forward-scatter), with 0 being isotropic scattering (the default). Volumes whose scattering consists of relatively large/opaque particles tend to be back-scattering, while volumes whose scattering consists of relatively small/transparent particles tend to be forward-scattering. For example, skin is highly forward scattering with a mean cosine of about 0.85. Increasing the Phase Function Anisotropy value causes light to appear more forward-scattered within the volume.

 

Maya Fluid Transparency Attribute

Maya's fluid transparency determines how much light can penetrate the fluid and can have a big influence on the overall appearance of the fluid. It controls the transparency of each voxel of the fluid. A value of all black means no transparency and a value of all white means full transparency.

Note that low transparency values may take longer to render.

 

Filter types

Specifies the filtering type when accessing the voxel grid values. "Closest" filtering is the cheapest in render time but may result in excessive blockiness in low-resolution grids. Higher-quality filtering will look smoother but take longer to render.

The results are analogous to how you would have 'closest', 'bilinear' and 'bicubic' filtering for 2D texture map magnification, but in 3D:


Custom Texture

It is possible to connect texture maps to the fluid's color, incandescence and opacity attributes (this functionality replaces the native 'Texture' attributes of Maya's fluids).

Ensure that 'Override Fluid Texture' is enabled and choose an attribute that you wish to connect the texture to - color, incandescence or opacity.

Coordinate Method

Defines how the texture coordinates are defined. "Fixed" sets the values to equal the object space coordinate system (0-1 for the volume in x,y and z). "Grid" uses a grid of points and interpolates for in-between values.

Note, that Texture Color is only compatible with textures that have 3D co-ordinates such as Ai Noise.

In the example below 'Texture Color' has been enabled and an Ai Noise texture has been connected to the 'Texture slot'. 

Ai Noise texture mapped to fluid's color and opacity texture attributes. Maya scene file here.

When dragging a texture onto the 'Texture' slot, ensure that it is connected properly, otherwise, it will not render. You should see the slot hi-lighted around the edges when dragging the texture map from the Hypershade window over it as per the above screenshot.

 

 

 

   

Further examples of Maya fluids

 
  • No labels