-
Notifications
You must be signed in to change notification settings - Fork 190
Domain Attributes and Data Settings
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 as 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.
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.
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).
- 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.
- The FLIP Fluids sidebar helper menu contains command line tool operators to help you automatically launch a command line render:
Surface attributes are generated on the vertices of the fluid surface mesh. The options to generate surface attributes are located in the Domain > FLIP Fluid Surface > Geometry Attributes panel with the exception of the variable viscosity attribute which can be enabled in the Domain > FLIP Fluid World > Viscosity panel.
This set of attributes are based on and derived from the fluid velocity data within the simulation.
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 an 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. |
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 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 an 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 (vector math length node) can be helpful for determining areas where the liquid is in turbulent motion. |
Initialize Motion Blur operator | Refer to the FLIP Fluids sidebar > Geometry Node Tools documentation. |
This section enables generation of the color attribute as well as parameters to control how colors are blended/mixed within the simulator.
Related Documentation
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. |
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 color mixing/blending. If enabled, particles will absorb color attributes from nearby particles. If disabled, particles will hold a static color value that does not change. |
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. Changing this value from the default is not often needed. |
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. Changing this value from the default is not often needed. |
Mixing Mode | The method that color attributes are mixed/blended. RGB The RGB mode blends 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. Mixbox (recommended) The Mixbox mode blends colors by simulating the physically accurate mixing of colors to help you create vibrant multi-color simulations. This mode requires the FLIP Fluids Mixbox plugin to be installed. |
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 an 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. |
Lifetime Attributes | Generate fluid lifetime attributes for the fluid surface. This attribute allows the fluid to start with a lifetime value that counts down in seconds and once the lifetime reaches 0, the fluid is removed from the simulation. Each Inflow/Fluid object can be set to assign a starting lifetime to the generated fluid. After baking, the lifetime remaining values can be accessed in a Cycles Attribute Node or in Geometry Nodes with the the name flip_lifetime from the Fac output. |
Base Death Time | Base time in seconds at which the fluid is removed from the simulation. At the default of 0.0, fluid will be removed when their lifetime attribute counts down to 0.0. Increase or decrease this value to offset the base time of death. Increasing will result in fluid dying earlier. Decreasing will result in fluid dying later. |
Whitewater Proximity Attributes | Generate whitewater proximity attributes for the fluid surface. The attribute values represent how many foam, bubble, or spray particles are near the surface mesh and can be used in a material to shade parts of the surface that are near whitewater particles. After baking, the proximity attribute can be accessed in a Cycles Attribute Node or in Geometry Nodes with the names flip_foam_proximity, flip_bubble_proximity, and flip_spray_proximity from the Fac output. Notes: Since this attribute measures the number of local whitewater particles, the attribute values can be quite large and vary a large amount between resolutions. To get an idea for the range of values and how to map the range, scan the Blender Spreadsheet Editor for these attributes. There is not a separate proximity attribute for dust particles and dust particles are added to the flip_bubble_proximity attribute. |
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. This attribute can be used to identify fluid from different sources in a material or geometry node group. After baking, the ID values (integers) can be accessed in Blender using the name flip_source_id. If using in an Attribute Node, this attribute can be accessed from the Fac output. Warning: This attribute is not supported with sheeting effects or resolution upscaling features. |
Note: A viscosity attribute can also be generated by enabling the Variable Viscosity feature in the Domain > FLIP Fluid World > Viscosity settings. After enabling this feature, the attribute can be accessed with the name flip_viscosity.
- 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: Source ID.
- Surface attributes are not supported for the surface preview mesh. Only the final surface mesh can hold attribute data.
Fluid particle attributes are generated on the vertices of the fluid particle mesh. The options to generate fluid particle attributes are located in the Domain > FLIP Fluid Particles > Geometry Attributes panel.
The fluid particles contain the same set of attributes as the fluid surface: Velocity, Speed, Vorticity, Color, Age, Lifetime, Whitewater Proximity, and Source ID. For details on these attributes, refer to the Surface Attributes documentation above.
In addition to having the same attributes as the fluid surface, the fluid particles also have built-in attributes that are automatically loaded.
Fluid Particle ID | The fluid particle ID values can be accessed in Blender using the name flip_id. If using in an 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. |
Is Surface Particle | These attribute values can be accessed in Blender using the name flip_is_surface_particle and is true if the particle is near the fluid surface. If using in an Attribute Node, this attribute can be accessed from the Fac output. |
Is Boundary Particle | These attribute values can be accessed in Blender using the name flip_is_boundary_particle and is true if the particle is near the domain boundary. If using in an Attribute Node, this attribute can be accessed from the Fac output. |
Is Interior Particle | These attribute values can be accessed in Blender using the name flip_is_interior_particle and is true if the particle is within the interior of the fluid. If using in an Attribute Node, this attribute can be accessed from the Fac output. |
- The following fluid particle 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: Source ID.
Whitewater attributes are generated on the vertices of the whitewater meshes. The options to generate whitewater attributes are located in the Domain > FLIP Fluid Whitewater > Geometry Attributes panel.
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 an 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 an 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 an 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. |
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.
The Point Cloud object type will also make rendering many points much more efficient in terms of render speed and memory usage, and viewport performance compared to default whitewater particle instancing.
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/radius/materials 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.
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
- Overview of simulation attributes: 2021 - 2022 FLIP Fluids Addon Development Video (beginning at timestamp 7:06).
- FLIP Fluids: Installing and Using Mixbox Color Blending Features.
- Olav3D Tutorials: [3.2] Blender Tutorial: Mixing Paint Colors With FLIP Fluids.
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.
This guide will provide instructions for how to quickly set up your simulation for motion blur rendering. Watch the video guide on YouTube: How to Use Motion Blur in the FLIP Fluids Addon.
Setting up motion blur rendering is a bit more involved than just enabling motion blur in the render settings. Motion blur rendering requires a geometry node setup on the fluid surface, fluid particles, and whitewater particles, and will require a workaround for stable rendering due to an open bug in Blender (T88811 03-jun-2021). The FLIP Fluids addon contains tools to help you automatically set up motion blur rendering and for starting a stable render.
-
Open the FLIP Fluids addon preferences with Help > FLIP Fluids > FLIP Fluids Preferences and activate the Enable Developer Tools option. This option unhides hidden features that are affected by bugs that are outside of our control.
-
In the FLIP Fluids sidebar menu, activate the Initialize Motion Blur operator. This operator enables all options necessary for motion blur rendering and generates the geometry node groups on the fluid surface mesh and whitewater meshes if the whitewater feature is enabled.
-
Bake or Re-bake the simulation. Baking the simulation is necessary in order to generate the motion blur data.
-
To render without crashes, rendering from the command line is necessary. The FLIP Fluids sidebar menu contains command line tools to automatically launch a cmd render processes. Note: saving the Blend file will be necessary before using these operators for render setting changes to take effect.
Manually setting up the simulation for motion blur rendering involves:
- Enabling motion blur in the Cycles render settings.
- Enabling motion blur in the surface/whitewater mesh object settings.
- Enabling the domain surface and whitewater velocity attributes before baking.
- Adding a geometry node group to the fluid surface to transfer the FLIP Fluids velocity attribute to Blender's velocity attribute.
- Adding a geometry node group to the whitewater mesh objects to convert the meshes to Point Clouds and to transfer the FLIP Fluids velocity attribute to Blender's velocity attribute.
Refer to the Basic Surface and Whitewater Motion Blur example scene in the product downloads for details on how to set up your simulation for motion blur rendering.
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.