FluxyTarget

To create a target object, go to GameObject->3D Object->FLuXY->Target.
To add a target component to an existing object, go to Component->Physics->FluXY->Target.

Adding a target component to an object will allow it to splat density & velocity onto FluidContainers. This is done by casting a ray from the container's "Project From" transform (usually a camera) to the target, and modifying fluid state wherever the ray hits the container. If no "Project From" transform is provided, the casted ray will be parallel to the container's surface normal.

Container's "Project From" set to the camera.
Container's "Project From" set to none, projection is parallel to the container's normal.

Containers do not do much on their own other than contain fluid, so if you want any interesting behavior you will need to use some targets for the fluid to interact with. Which targets are splatted onto which containers is controlled by Target Providers.

The target inspector is organized into multiple foldable panels. Each one contains parameters pertaining to a specific aspect of the container. Now we will go over all parameters in each panel.

Splat Material

Material used to splat density and velocity into containers. Most of the time, you should leave this at its default value. If you've written custom shaders to splat targets, you can change the material used.

Timing

These parameters affect when/how often the target is splatted onto containers.

Rate over steps

Amount of splats performed per simulation step. These are interpolated over time, so very fast moving targets will benefit from more temporal samples.

Fast rotating target, 1 splat per step results in visible gaps in the path.
Fast rotating target, when using 4 splats per step all gaps disappear.

Rate over time

Amount of splats performed per second. Use this instead of "Rate over steps" if you want a consistent amount of splats per second regardless of framerate.

Rate over distance

Amount of splats performed per meter. Useful when you want a target to only splat into the container when moving.

Placement

These parameters control target position/rotation/scale.

Override Position

If enabled, allows you to set the target splat position directly. Otherwise, position is determined by projecting the target onto the container.

Position

Only available when "override position" is enabled. Splat position expressed in normalized coordinates, -0.5,-0.5 would be the container's bottom-left corner and 0.5,0.5 the upper-right corner.

Position randomness

Percentage of randomness applied to the splat position.

Override Rotation

If enabled, allows you to set the target splat rotation directly. Otherwise, rotation is determined by the target's transform rotation.

Rotation

Only available when "override rotation" is enabled. Rotation of the splat (in degrees).

Scale with distance

If enabled, the target splat size will depend on the distance from the target transform to the container's surface. This should be enabled if you're going for a pseudo-3D look by projecting targets from the camera onto a flat container.

Scale with transform

If enabled, the target splat size will be multiplied by the target's transform scale.

Scale

Scale of the splat. This is expressed as a percentage of the container's height, the target's aspect ratio is preserved.

Scale randomness

Percentage of randomness applied to the splat scale.

Using random position, rotation and scale.

Velocity

These parameters control how the target's velocity is splatted onto the container.

Velocity Weight

Amount of velocity splatted onto containers. The velocity texture's blue channel, the velocity scale values and this value are multiplied together to determine the amount of velocity splatted.

Velocity Texture

Velocity texture splatted by the target. The R and G channels encode the X, Y components of a velocity vector, 0.5 (or 128, if ranged 0-255) corresponding to 0 velocity, just like a flowmap or a normalmap. The B channel is interpreted as a velocity magnitude multipler.

Velocity texture applied to a target (top left corner) and the resulting simulation, in absence of external forces. Note how the X and Y letters generate upwards velocity, but the other letters do not.

Max Relative Velocity

Caps the maximum linear speed of this target relative to a container. This is useful to limit how much fluid is displaced by fast moving targets.

Max Relative Anguler Velocity

Caps the maximum angular speed of this target relative to a container. This is useful to limit how much fluid is displaced by fast moving targets.

Velocity Scale

Scales the target's velocity in each axis, expressed in the container's local space. This means the Z axis is parallel to the container's surface normal, X runs along its width, and Y along its height.

Targets with velocity scale set to 0,0,10: they only splat velocity onto the simulation when moving "into" or "out of" the container plane.

Angular Velocity Scale

Scales the target's angular velocity, expressed as rotation around the container's surface normal.

Force

Constant force applied by the target to the fluid in the container.

Left target has a force of 1,0,0, right one a force of -1,0,0. The result is two fluid jets opposing each other.

Torque

Constant torque (rotational force) applied by the target to the fluid in the container.

Density

These parameters control how the target's density is splatted onto the container.

Density Weight

Amount of density splatted onto containers. The density texture's alpha channel, the color's alpha value and this value are multiplied together to determine the amount of density splatted.

Density Texture

Density texture splatted by the target. You can think of this as the shape of the "brush" used to draw on the container. Both the amount of density and velocity splatted are modulated by the density texture's alpha channel.

Shape texture used.
Resulting simulation.

Src Blend

Source blending mode used when splatting density.

Dst Blend

Destination blending mode used when splatting density.

Blend Op

Blending operation used when splatting density.

The character's legs are using Src Blend "One", Dst Blend "One", Blend Op "Reverse Subtract". This will subtract the target's color from the container's, resulting in legs that "remove" fog when moving.

Color

Color tint applied when splatting density.

4 colored targets splatted onto a single container.

Noise

These parameters introduce random variations in velocity and density.

Noise texture

Texture to read random values from. R and G channels will be used to generate velocity noise, A channel used to generate density noise. B channel is reserved for future use.

Velocity noise

Intensity of curl noise added to the velocity splatted by this target.

Velocity noise offset

Speed at which the noise texture is displaced both horizontally and vertically. Introduces velocity noise variation.

Velocity noise tiling

Scales texture coordinates when sampling the noise texture, resulting in zoomed-in/out velocity noise.

Density noise

Intensity of amplitude noise added to the density splatted by this target.

Density noise offset

Speed at which the noise texture is displaced both horizontally and vertically. Introduces density noise variation.

Density noise tiling

Scales texture coordinates when sampling the noise texture, resulting in zoomed-in/out density noise.