Skip to content

Domain Attributes and Data Settings

Ryan Guy edited this page Sep 7, 2022 · 29 revisions

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

Introduction

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

A current bug in Blender can cause frequent render crashes or incorrected renders when using these attribute features. Since these features are affected by an issue that is outside of our control, these features will be hidden by default. Enable the developer tools option to unhide these features.

See the FLIP Fluids Preferences > Developer Tools documentation for affected features, a workaround to this bug, and how to enable these features.

Compatibility Notes

For the full FLIP Fluids addon attribute feature set, an installation of FLIP Fluids version 1.5.0 or later and 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 Compatibility Notes

  • Attribute rendering is currently supported in both the Cycles and Eevee renderer. However, motion blur rendering is only supported in the Cycles renderer. Attributes are not supported on volumetric materials.
  • Motion blur will not be visible in the viewport render mode and is only supported in full image or animation renders.
  • Attribute rendering for whitewater particles are only supported on Blender Point Cloud object types. See the Whitewater Point Clouds topic below for more information.
  • A current bug in Blender can cause frequent render crashes or incorrect renders when using attribute features. Rendering form the command line is necessary to fully prevent these issues. See the FLIP Fluids Preferences > Developer Tools documentation for affected features and a workaround to this bug.

Attribute Properties

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 Point Clouds

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. At the moment, only spherical points are supported when using point clouds.

Related Documentation

  • See the Attribute and Motion Blur Example Scenes for basic Blend file setups and how to use attributes on whitewater particles.
  • Whitewater Point Clouds can also be set up automatically with the Initialize Motion Blur operator operator in the FLIP Fluids Helper sidebar menu. If you do not wish to render with motion blur, you may disable velocity attribute, disable motion blur rendering, or set the motion blur scale to 0.

Particle scale and materials note: Once the whitewater meshes have been converted to point cloud objects, the geometry node group's particle scale or radius will override the FLIP Fluids whitewater particle scale settings and material settings. To change the whitewater particle scale/radius or materials, adjust the settings in the geometry node modifier or in the geometry node group.

whitewater_particle_scale

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.

Video Guides

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.

initialize_motion_blur

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.

Clone this wiki locally