Skip to content

Domain Attributes and Data Settings

Ryan Guy edited this page Jun 24, 2022 · 13 revisions
Clone this wiki locally

This page documents the current simulation attributes that can be generated for the fluid surface and whitewater particles during simulation baking.

An attribute in the FLIP Fluids addon can be thought of an extra layer of data values that are attached to the vertices of the surface mesh, or attached to the whitewater particles. These attributes can then be accessed in Blender within a shader using the Attribute Node, or within Geometry nodes, or in other areas of Blender where attributes are supported.

Attributes allow for the creation of interesting effects. For example, you can shade the liquid based on fluid speed, use the velocity attribute for motion blur rendering, use the ID attribute to randomize whitewater particle size, use the lifetime attribute to fade out whitewater particles as they despawn, and much more.

Enabling Attribute Features

These features are currently considered unstable due to a bug in Blender that can cause frequent render crashes. To unhide these features from the UI, enable the Developer Tools option in the FLIP Fluids addon preferences menu.

After enabling the Developer Tools option, attribute options for the fluid surface can be found in the FLIP Fluids Surface panel and for whitewater, in the FLIP Fluid Whitewater panel.

Compatibility Notes

For the full FLIP Fluids addon attribute feature set, an installation of Blender 3.1 or later is required. Attributes can also be used in Blender 2.93 and Blender 3.0, but their applications are limited (only supported on liquid surface, motion blur for whitewater is not supported).

Render Stability

Currently, there is a bug in Blender which can cause frequent render crashes when using attribute features (reported here: T88811).

These render crashes can be fully prevented by rendering from the command line. The FLIP Fluids Helper Sidebar menu contains operators that can help you automatically set up or launch a command line render.

Render Compatibility

At the moment, only the Cycles render engine is supported. Attribute functionality for other renderers such as Eevee may be added in future Blender development.

Surface Attributes

Generate Velocity Attributes Generate fluid 3D vector velocity attributes for the fluid surface. After baking, the velocity vectors (in m/s) can be accessed in Blender using the name flip_velocity. If using in a Cycles Attribute Node, this attribute can be accessed from the Vector output. Export this attribute if motion blur rendering is required. If the 3D velocity direction is not needed, use the Generate Speed Attributes option instead.
Generate Speed Attributes Generate fluid speed attributes for the fluid surface. After baking, the speed values (in m/s) can be accessed in Blender using the name flip_speed. If using in a Cycles Attribute Node, this attribute can be accessed from the Fac output.
Generate Vorticity Attributes Generate fluid 3D vorticity vector attributes for the fluid surface. After baking, the vorticity vectors can be accessed in Blender using the name flip_vorticity. If using in a Cycles Attribute Node, this attribute can be accessed from the Vector output.
Fluid vorticity can be thought of as a measure of rotation, where the length of the vector is local rotation speed and the direction is the axis of rotation. The magnitude of vorticity can be helpful for determining areas where the liquid is in turbulent motion.
Generate Age Attributes Generate fluid age attributes for the fluid surface. After baking, the age values (in seconds) can be accessed in Blender using the name flip_age. If using in a Cycles Attribute Node, this attribute can be accessed from the Fac output. Fluid is spawned with an initial age of 0.0 and increases according to time within the simulation.
Age Attribute Smoothing Amount of smoothing when transferring the age attribute to the surface mesh. Higher values result in smoother attribute transitions at the cost of simulation performance. The smoothing value represents the search radius for nearby particles in number of voxels.
Generate Source ID Attributes Generate fluid source identifiers for the fluid surface. Each Inflow/Fluid object can be set to assign a source ID value to the generated fluid. After baking, the ID values (integers) can be accessed in Blender using the name flip_source_id. If using in a Cycles Attribute Node, this attribute can be accessed from the Fac output.
This feature is currently experimental/incomplete and applications may be limited. Useful for identifying liquid that spawns from different sources, but may not be useful for situations where the liquid mixes. This feature may be removed in future addon versions.
Surface Color Attributes and Color Attribute Mixing
Generate Color Attributes Generate fluid color attributes for the fluid surface. Each Inflow/Fluid object can be set to assign color to the generated fluid. After baking, the color values (RGB, each in range 0.0 - 1.0) can be accessed in Blender using the name flip_color. If using in a Cycles Attribute Node, this attribute can be accessed from the Color output.
This feature is currently experimental/incomplete and applications may be limited. Useful only for very basic varying color liquid effects. Best used when there are smooth transitions of color.
Color Attribute Smoothing Amount of smoothing when transferring the age attribute to the surface mesh. Higher values result in smoother attribute transitions at the cost of simulation performance. The smoothing value represents the search radius for nearby particles in number of voxels.
Enable Mixing Simulate basic color mixing. If enabled, particles will absorb color attributes from nearby particles. If disabled, particles will hold a static color value that does not change.
Notes: This feature mixes colors using RGB additive blending, which is not physically accurate. Due to this, colors may not mix accurately compared to real-life color mixing such as paints. For example, mixing blue and yellow paint results in a green tone, but with RGB additive mixing this results in a shade of grey. RGB mixing can still produce acceptable results if the selected colors are closer or next to each other on the color wheel, such as Red/Orange/Yellow or Blue/Light-Blue. Colors that are on opposite sides will not mix well and will average to the center of the wheel to result in a shade of grey.
We are looking at solutions for physically accurate color blending and this will arrive in a later update.
Mix Rate Controls how quickly particles will absorb color from nearby particles. Higher values will cause colors to mix and spread more quickly. Lower values will cause colors to mix and spread more slowly.
Mix Radius Radius in which a particle can absorb color from nearby particles. Increasing this value can result in smoother mixing transitions at the cost of simulation performance. This value is the search radius of nearby particles in number of voxels.

Surface Attribute Limitations

  • The following surface attributes are not currently supported when using the sheeting effects feature: Source ID.
  • The following surface attributes are not currently supported when using the upscale simulation to a higher resolution feature: Age, Color, Source ID.
  • Surface attributes when the Surface > Particle Scale value is greater or less than the default value of 1.0 are not yet supported.
  • Surface attributes are not supported for the surface preview mesh. Only the final surface mesh can hold attribute data.

Whitewater Attributes

Generate Velocity Attributes Generate 3D vector velocity attributes for the whitewater particles. After baking, the velocity vectors (in m/s) can be accessed in Blender using the name flip_velocity. If using in a Cycles Attribute Node, this attribute can be accessed from the Vector output. Export this attribute if motion blur rendering is required. Not supported on instanced particles, only supported on point clouds.
Generate ID Attributes Generate stable ID attributes for the whitewater particles. After baking, the ID values can be accessed in Blender using the name flip_id. If using in a Cycles Attribute Node, this attribute can be accessed from the Fac output. Use where consistent particle attributes are needed between frames, such as for varying particle size or varying color. Not supported on instanced particles, only supported on point clouds.
Generate Lifetime Attributes Generate lifetime attributes for the whitewater particles. After baking, the lifetime values can be accessed in Blender using the name flip_lifetime. If using in a Cycles Attribute Node, this attribute can be accessed from the Fac output. The lifetime of a particle starts with a value determined by the whitewater simulator and counts down to 0.0. When the lifetime of a particle reaches 0.0, it will be removed from the simulation. Not supported on instanced particles, only supported on point clouds.

Whitewater Pointclouds

Attributes for whitewater particles are only supported with Blender Point Cloud objects, which are available in Blender 3.1 or later. The FLIP Fluids addon whitewater meshes can be converted to a point cloud using the Mesh to Points geometry node.

How to Use Attributes

Our Attribute and Motion Blur Example Scenes provide simple and quick demonstrations for how to use Blender's attribute features in applications such as motion blur rendering, attribute based shading, and for use in geometry nodes. The basic setups example scenes contains detailed notes.

For a video explanation of attributes, see our 2021 - 2022 FLIP Fluids Addon Development Video (beginning at timestamp 7:06).

Tips:

  • If you are new to attributes and geometry nodes in Blender, searching for a guide on how to use Blender's geometry nodes can help with understanding how attributes can be interacted with and used in Blender. Make sure to search for a guide that uses Blender 3.0 or later, as the geometry node workflow had some large changes since this version.
  • When using attributes in a shader, the following nodes can be useful:
    • Vector Math Node - Setting this node to compute the vector length will be useful to convert a 3D vector attribute to a scalar value (such as converting velocity to speed).
    • Map Range Node - Useful for mapping from one range of values to a [0.0 - 1.0] range of values. For example, you may want to converts a large range of speed values to a range between 0.0 and 1.0 to be input into another node.
    • Color Ramp Node - Useful for converting a range of [0.0 - 1.0] to a color gradient.
  • Blender's Spreadsheet Editor window can be useful for verifying that attributes are being correctly added to your object. When viewing attributes on the fluid surface make sure you are viewing the Mesh Vertex data. When viewing attributes on whitewater make sure you are viewing the Point Cloud data.

Motion Blur Rendering

By generating velocity attributes, the simulation can be rendered with motion blur. Refer to the Basic Surface and Whitewater Motion Blur example scene for details on how to set up your simulation for motion blur rendering.

Motion blur rendering can also be set up with the Initialize Motion Blur operator operator in the FLIP Fluids Helper sidebar menu.

Vortex Fluid Enhancements Shader

The Vortex Fluid Enhancements shader procedurally adds animated detail to the liquid, using the velocity attribute data of the fluid surface. The waves and ripples added by this shader move along with the flow of the liquid, forming realistic shapes and patterns that you would normally only get if the fluid resolution was much, much higher.

To use Vortex with the FLIP Fluids addon, simply connect the flip_velocity attribute from a Cycles Attribute Node to the Vortex Flow shader. Refer to the Vortex Documentation for details.

Vortex - Fluid Enhancements by Emiel Witting is available on the Blender Market.