FLOW


DOCUMENTATION

Thank you for using FLOW ❤️

If you haven't already, please consider writing a review. They really help me out!



How do I upgrade?

First, make sure you back up your project files.

Next, install the latest version.

If for some reason the latest updates breaks your project (e.g. errors in the console), then try deleting the root folder for this asset, and reinstalling it.

If it still doesn't work, then let me know what the errors are so I can fix it. You can then revert to your back up, and wait for a fix to be released.



What is FLOW?

Unlike traditional fluid simulations that use 3D particles, FLOW works using columns of fluid that extend out from the ground. This means large areas of your scene can be covered in fluid using very little data, which leads to incredible performance. However, this difference does mean there are some limitations:

Within each fluid simulation there is only one column per XZ location, and each column stores the ground height + fluid data (depth, color, etc). This means you cannot have fluid floating above the ground, or multiple layers. Another way to think of this is that the fluid simulation is a heightmap running on top of another heightmap (e.g. a terrain), so if the fluid scenario you have in mind couldn't be represented using a heightmap, then you wouldn't be able to directly simulate it using FLOW.

For example: You cannot have fluid flowing through pipes, because you can't represent a pipe using a heightmap. However, you could place a 3D pipe model in your scene that drains fluid from one side, and emits it from the other.

For example: You cannot have fluid fill up spherical containers, because you can't represent a sphere using a heightmap. However, you could fill up an inverted semi-circle. If you really need to fill up a sphere, then I recommend you place a disc inside your sphere and adjust its size based on the fluid height to match the sphere.

For example: You cannot have fluid spray out from a hose, because flying water cannot be represented using a depth value alone. However, FLOW does come with a simple particle system that allows you to emit particles that turn into fluid when they hit the ground or the fluid surface.

Most of these common limitations can be worked around. However, there are some hard limitations that will never be possible. For example, there is no possibility of using FLOW with a voxel terrain system. You can read more information about limitations HERE.



Getting Started


Step 1 - Create a Simulation

Before you can add fluid to your scene, you must tell FLOW where in your scene you want the fluids to appear.

METHOD 1 Create a new GameObject, and add the FlowSimulation component to it.
METHOD 2 Right click in your Hierarchy tab, and select: FLOW > Simulation
METHOD 3 From the menu bar, select: GameObject > FLOW > Simulation

You should now see the FlowSimulation component in your inspector tab.



Step 2 - Adjust the Simulation Boundary

Fluid can only appear within the boundary of a simulation. You can adjust this using the Size and Center settings.

You can also adjust the HeightMin/Max settings, which allow you specify the minimum and maximum ground height that your fluid can flow over. For example, if your scene has a terrain that has an altitude range of 0 meters to 500 meters, then you should set HeightMin to 0 or lower, and HeightMax to 500 or higher.

NOTE  You can see a preview of the simulation boundary size in the Scene tab.


Step 3 - Adjust GameObject Layers

Every object in your scene matching the HeightLayers setting will be converted into a heightmap using vertical (top down) raycasts. This heightmap is what the fluid simulation will flow over, so it's important you configure your scene layers so that it can be generated accurately.

For most projects, these layers should only include ground or wall objects. For example, you probably don't want your player character or collectible items to be considered 'ground' by the fluid simulation. Therefore, make sure these are on a different layer, or you can adjust the HeightLayers setting to exclude them.

To visualize what the simulations sees as ground, you can read the documentation HERE.



Step 4 - Adjust the Simulation Detail

The fluid is simulated using a grid of fluid columns. The distance between each column is controlled by the Separation setting, and then divided by the Resolution setting. You can use these to control the amount of columns in the whole simulation.

NOTE  The more columns your fluid uses, the slower it will be.
NOTE  Changing the simulation detail will change the way the fluid physics behaves.


Step 5 - Render the Fluid Surface

METHOD 1 Create a new child GameObject of your simulation, and add the FlowSurface component to it.
METHOD 2 Right click your fluid simulation GameObject in your Hierarchy tab, and select: FLOW > Surface
METHOD 3 Select your fluid simulation GameObject, and from the menu bar, select: GameObject > FLOW > Surface

You should now see the FlowSurface component in your inspector tab.

NOTE  This component will be pre-configured with the Surface material in the MeshRenderer component's Materials list. If you'd like to adjust the overall look of your fluid surface, then you can duplicate this material, adjust the settings, and replace its material.


Step 6 - Add Fluids!

The easiest way to add fluids to your fluid simulation is to add a modifier to your scene.

METHOD 1 Create a new GameObject, and add the FlowModifier component to it.
METHOD 2 Right click in your Hierarchy tab, and select: FLOW > Modifier
METHOD 3 From the menu bar, select: GameObject > FLOW > Modifier

You should now see the FlowModifier component in your inspector tab.

If you set the Mode setting to AddFluid, then you can drag and drop a fluid into the Fluid setting. You can find a selection of pre-made fluids in the FLOW/Examples/Fluids folder.

NOTE  If you want to create your own fluids then you can duplicate and modify an existing one, or add the FlowFluid component to your GameObject and drop it into the FlowModifier component's Fluid setting.

Your fluid should now appear in your scene!

If not, make sure the modifier is inside the boundary of your fluid. You can adjust its Size, and position it using the Transform component settings. You can see the boundary of both in the Scene tab when selected.




Do Fluids Work With Terrains and Custom Meshes?

Yes, fluids will automatically flow over and be blocked by terrains and any objects or meshes in your scene as long as they have colliders (e.g. MeshCollider).

This works by raycasting into the scene when the simulation starts, and then storing this height data with each fluid column.

You can control which objects appear using GameObject layers, and the FlowSimulation component's HeightLayers setting. The HeightMin/Max settings can also be used to control where the height cutoff is.

If the objects in your scene need to move then you can read the documentation HERE on how to make them automatically update the height data.

NOTE  If your objects move a lot or float then you should change their layer or exclude them from the FlowSimulation.HeightLayers setting.


How is the Simulation Size/Performance?

By default, the fluid simulation uses 1 fluid column per 1 meter, which looks really good for most desktop game scenarios. Based on these settings, an entry level desktop could simulate active fluids across a 1km² map without issue, with higher end desktops being able to go to 2km² or even 4km² (the limit depends on the GPU, which is usually 16km²).

For mobile devices it's recommended that you reduce the FlowSimulation component's Resolution setting (e.g. to 0.5 for half the fluid columns - double the performance). This will retain the same fluid simulation size, but make it less detailed and therefore make it run faster. Due to mobile devices having a smaller display size, this reduction in simulation detail usually isn't noticeable.

To improve the performance even more, all parts of the fluid simulation are implemented with GPU acceleration.



How Can I Read Fluid Data (e.g. Depth)?

Right click in the Hierarchy tab, and select: FLOW/Sample

You should now see the FlowSample component in your inspector tab.

You can place this object anywhere in your scene using the Transform component's position, and it will automatically update with the fluid data at that XZ point (Y/height is ignored).

Keep in mind this component works asynchronously, so the data won't be available immediately. This component's OnSampled event will get invoked after each sample.

Once sampled, from code you can access this component's properties like FluidDepth, FluidVelocity, etc.



Are Custom Shaders/Materials Supported?

The fluids simulated by FLOW are rendered on top of terrains and other objects, so it will automatically work with them.

One thing to keep in mind is that the fluid is made transparent using grab pass or opaque texture (depending on rendering pipeline), so it cannot render transparent objects through it.

For example, if your camera is above the surface looking through the fluid, all transparent objects that are underwater will be invisible/disappear.

One exception is the Wetness feature, which requires you to use a shader/material that is designed to render FLOW wetness. See the Wetness documentation for more information.



How Can I Add Custom Fluid Types?

METHOD 1 Create a new GameObject, and add the FlowFluid component to it.
METHOD 2 Duplicate and rename one of the example fluids in the FLOW/Examples/Fluids folder.

You should now see the FlowFluid component in your inspector tab.

Feel free to change the Color, Viscosity, and other settings to your liking.

You can then drag and drop this prefab/GameObject into the fluid setting of a component like FlowModifier or FlowEmitter.



How Can I Remove/Drain Fluid?

Right click in the Hierarchy tab, and select: FLOW/Modifier

You should now see the FlowModifier component in your inspector tab.

You can then change the Mode setting to RemoveFluid, and move it using the Transform component's position setting.

Feel free to change the Size, Shape, and other settings to your liking.



How Can I Make The Ground Look Wet?

If you'd like the fluid simulation to make the ground wet and gradually dry over time, then this feature is for you.


STEP 1 - Simulate Wetness

Select your FlowSimulation component, and enable the Wetness setting.



Step 2 - Add Wetness Component

Next, add the FlowWetness component to the object you want the wetness effect to apply to.

This component has the Renderers setting - each material in these renderers will be sent wetness data. This list will automatically be set when you add the component, so you may not need to worry about it.



STEP 3 - Enable Material Wetness

Finally, enable the Wetness setting in the material settings used for your object.

NOTE  This setting is only available if your material's shader implements FLOW wetness.


Custom Shaders

All materials that come with FLOW use shaders that implement the wetness feature. However, most other shaders will not support this.

All shaders that come with FLOW are built using the Better Shaders asset (not required).

If you have this asset, then you can simply stack the FLOW/Shaders/Wetness shader on top of your shader, and it will automatically support wetness.

If you don't have this asset, then you can look inside the code of this FLOW/Shaders/Wetness.surfshader file, and implement the equivalent yourself.

If neither of these options are suitable for you, then you must modify your materials to use the materials that come with FLOW (e.g. FLOW/Solid shader).




How Can I Render Underwater?

Underwater rendering is handled separately from the surface, to render it:

Right click your fluid simulation GameObject in the Hierarchy tab, and select: FLOW / Underwater

You should now see the FlowUnderwater component in your inspector tab.

Done!



How Can I Make Objects Float?

Any Rigidbody can be made to react to the fluid simulation with buoyancy and drag.


STEP 1 - Add Float Component

Select your Rigidbody GameObject, and add the FlowFloat component to it.



STEP 2 - Add Sample Point

Next you must add a sample point to the float - this lets the float know which part of your object is buoyant.

To add one, simply right click your float Rigidbody GameObject in the Hierarchy tab, and select: FLOW / Sample

You should now see the FlowSample component in your inspector tab.



STEP 3 - Adjust the Sample Point

Feel free to adjust the Radius and position of the sample point from the Transform component settings. While this sample point shape doesn't have to match your object, it should be somewhat similar.



OPTIONAL STEP - Add More Sample Points

If your object can't be well represented by just one sample point then feel free to repeat steps 2 & 3 as many times as you like in different locations and with different sizes.

NOTE  The more sample points you add, the lower the performance will be.


Angular Drag

If your object only has one sample point then you will want to increase the FlowFloat component's AngularDrag setting. This will slow the rotation of the object when it's in water.

This isn't necessary for objects with multiple points because the Drag setting will work independently on each sample point and give the same effect.



Torque

If you want your object to remain upright (e.g. a buoy), then you can increase this setting. You can also decrease it to negative to make it bi-directional.

A similar effect can be achieved using multiple sample points, but this torque setting makes it easier to set up and run faster.




How Can I Make Fluids React to Scene Changes?

By default, the fluid simulation bakes the scene height data at the start. This means it won't react to any scene modifications (e.g. moving a fluid blocking object).

To make it react to scene changes, you can add the FlowObject component to your GameObjects. This component has the Center and Radius settings, which you can adjust to encapsulate your object. You can see the gizmo preview in the Scene tab to see what this looks like.

Once configured, the fluid simulation will automatically update if this object moves, rotates, scales, or gets de/activated.

If you're performing modifications from code (e.g. terrain height changes), then you can manually call the FLOW.FlowSimulation.DirtyGroundAll method.

NOTE  To call this method you may need to add the FLOW assembly to the assembly definition file used by your code.


How Can I Detect When Fluid Appears Somewhere?


For a Single Point

Right click in the Hierarchy tab, and select: FLOW/Sample + Trigger

You should now see a new GameObject with the FlowSample and FlowTrigger components in your inspector tab.

You can then change the trigger Criteria setting and adjust the Transform.position.

The OnMet event will then be invoked when the criteria is met.



For a Specific Area

Right click in the Hierarchy tab, and select: FLOW/Sample Area + Trigger Area

You should now see a new GameObject with the FlowSampleArea and FlowTriggerArea components in your inspector tab.

You can then change the trigger Criteria setting and adjust the Transform.position.

The OnMet event will then be invoked when the criteria is met.




Why Does the Fluid Ignore My Object?

The fluid simulation flows over terrain and objects using a heightmap that is auto generated, and this height data is stored in each fluid column. This means there may be a discrepancy between what the fluid simulation thinks the ground looks like, and what the ground actually looks like in 3D.

To see what the fluid simulation thinks the ground looks like, you can add the DebugGround material to your FlowSurface component's MeshRenderer/Materials list.

For smooth shapes like a terrain, these heights usually line up well enough. However, for blocky objects like walls there will often be a difference, or they may be entirely missing from the ground data.

For example, if your simulation has a resolution of 1 fluid column per meter, and your wall is 0.5 meters wide, then it's possible for the wall to be placed between all fluid columns, and therefore be 'invisible' to the fluid simulation.

To fix this, you can:

METHOD 1 Adjust the position of your object until it appears in the simulation.
METHOD 2 Adjust the size of the collider to be wider, or increase the size of the object overall.
METHOD 3 Increase the FlowSimulation component's HeightRadius setting, for example to 0.5.
NOTE  If you perform these modifications in-game, then you need to add the FlowObject component to the GameObject you're moving. This component will update the simulation ground heights as you modify the object. See HERE for more information.


Surface Shader Settings

Sink - This allows you to control the world space distance the edges of the fluid surface sink below the surface. This setting can be used to make the fluid look like it's on top of the ground with surface tension.


WAVE

Normal (RGB) Foam (A) - This is the texture used to show the animated waves and foam. The wave normal map is packed into the RGB channels, and the foam texture is packed into the alpha channel.

Strength Min - This allows you to set the normal map strength when the fluid is calm.

Strength Max - This allows you to set the normal map strength when the fluid is turbulent.

Strength Scale - This allows you to control how quickly the normal map strength will increase with fluid movement. A high value means even small disturbances to the fluid surface will cause the normal map to appear.

Tiling - This allows you to control how many times the normal and foam textures are tiled across the fluid surface.

Animation Speed - This allows you to control how often the normal and foam textures cycle through their animation.



TRANSPARENCY

These settings allow you to make the fluid surface transparent.

NOTE  These techniques use grab pass or the opaque texture. Standard transparency is not suitable for fluid surfaces that can have many overlapping sections.
NOTE  If you're using URP, you must enable the Opaque Texture setting in your pipeline settings asset.

Mode = None - The fluid surface will be opaque.

Mode = Vertical - The fluid surface will be given the same transparency value as the underlying fluid.

This is the fastest transparency technique, but it's also the least accurate.

Mode = Depth - This mode works like Vertical, but the transparency will factor in the distance between the fluid surface and the camera depth texture behind it.

This technique provides much better results with good performance, but the depth value may not be accurate. For example, at the edge of a terrain where there is nothing behind it, or if your fluid spikes up high and the background is very distant with very little actual fluid there.

NOTE  If you're using the built-in render pipeline then you must add the CwDepthTextureMode component to your camera(s), and set the Mode to Depth or DepthNormals.
NOTE  If you're using URP, you must enable the Depth Texture setting in your pipeline settings asset.

Mode = March Fluid - This mode works like Vertical, but the transparency will factor in the optical depth through the fluid. With this technique, the optical depth will be calculated using ray marching of the fluid data. This means submerged objects that aren't part of the fluid's ground data will be ignored.

Mode = March Fluid And Depth - This mode works like March Fluid, but the ray marching will factor in the camera depth texture. This means submerged opaque objects will correctly appear.

NOTE  If you're using the built-in render pipeline then you must add the CwDepthTextureMode component to your camera(s), and set the Mode to Depth or DepthNormals.
NOTE  If you're using URP, you must enable the Depth Texture setting in your pipeline settings asset.

Range Max - This allows you to set the maximum distance through the fluid you can see when the fluid has 0 opacity.

Step - This allows you set the world space distance between each ray marched sample through the fluid volume to find the optical depth.

Max Steps - This allows you to limit the amount of steps performed in case you have performance issues.

Depth Scale - This allows you to set the rate at which the camera's depth texture fades out based on camera distance. This is necessary because depending on the camera distance and camera near clipping plane distance, the depth texture values lose too much precision to be used.

NOTE  This is only used with Mode = Depth and Mode = March Fluid And Depth.


STOCHASTIC

Enabled - If you enable this then the normal and foam textures will be stochastically sampled, which makes the texture tiling harder to notice.

Noise (A) - This allows you to set the noise texture used to perform the stochastic sampling.



FOAM

Brightness - This allows you to control the brightness of the foam texture.

Mode - This allows you to control how the foam blends with the underlying fluid surface.

Alpha = Smoothly alpha blend.

Cutout = Either 1 or 0 opacity, useful for more cartoon styles.



FACETED

Enabled - If you enable this then the fluid surface will have a low poly look.

Flat Amount - This allows you to control the strength of the low poly look.




Can I Request New Demo Scenes?

Yes, feel free to contact me using any of the methods listed in the FLOW/GUIDE asset.

I'm sure there are many use cases I haven't considered, and would love to make demo scenes of them if possible!



Known Issues / Limitations


Transparency

The fluid surface is made transparent using grab pass or the opaque texture depending on rendering pipeline, and the level of transparency is calculated using the depth buffer. Transparent objects don't write to the depth buffer, and won't appear in the opaque texture, therefore you will not be able to see them through the fluid. For example, if your camera is above the fluid surface and your transparent object is underwater, you will not be able to see it.

This is a limitation with transparent objects in general, though there are various ways to work around this issue.

Method 1 - Avoid Using Transparent Objects

This is the easiest and best solution when possible.

Method 2 - Use Cutout Transparency

This is also an easy solution that is suitable variety of objects. Unity's Standard shader for example can be set to RenderingMode = Cutout.

FLOW comes with the FLOW/Solid shader which is implements this.

Method 3 - Use Dithered Transparency

This is better than cutout transparency, and can look similar to real transparency when combined with a screen space AA technique like FXAA. However, most shaders don't support this, so you will have to modify them.

FLOW comes with the FLOW/Dither shader which implements this.

Method 4 - Render Semi-Transparent Areas Separately

This is a technique where the opaque parts of your object are rendered using cutout transparency, and the semi-transparent parts of your object are rendered using normal transparency.

This technique is suitable for objects that are mostly opaque with only semi-transparent areas around the edges. These semi-transparent areas will fail to render properly when mixed with the fluid surface though, so I don't recommend it.



Data Precision

The fluid data is stored using a collection of textures, where each pixel represents one fluid column. By default, important data like the fluid depth is stored using 32 bit floats, and less important data like the fluid color is stored using 8 bit bytes.

These defaults work well for most projects. However, if memory usage is a concern then you may want to switch from 32 bit floats to 16 bit floats. Conversely, if your project requires higher precision fluid mixing then you may want to increase from 8 bit bytes to 16 or 32 bit floats.

To adjust the precision of this data, you can modify the FlowSimulation component's Advanced / Precision___ settings. You can view the tooltip of each setting to see which fluid data is stored in that specific texture.



Fluid Viscosity Mixing

In real life, when you pour a low viscosity fluid like water on top of a highly viscous fluid like honey, the water will freely flow on top of it.

This is not possible to simulate in FLOW, because only one set of fluid data (e.g. depth, viscosity) is stored in each fluid column.

For example, if a column contains honey and water flows into it, the water will slowly mix into the honey and cause the overall viscosity to decrease. This results in the water appearing to stop or slow down as it hits the honey, and it gradually 'melting' as it fully mixes.



Fluid Simulation Interaction

Each fluid simulation is unique and separate. If you place one simulation next to another, or one on top of another, fluid will not be able to flow between them.

This same limitation exists for particles. When a particle is spawned, it is assigned to one simulation. It is not possible to freely spawn a particle in space and have it automatically apply to the first simulation it hits.

A solution to remove these limitations may be implemented in the future, but it is a fairly difficult feature to implement so it isn't such a high priority.



Determinism

The fluid simulation is updated on the GPU using floats, and the way floating point calculations are implemented on the GPU differs between some devices. Therefore, even if you start the exact same fluid simulation with the exact same settings, you may get slightly different results on different devices. Over a long enough timespan, these differences may become significant. So for example, it might not be a good idea to make a puzzle game that uses FLOW fluids as a main gameplay element that requires a very precise configuration/solution to solve, because it may be impossible for some people to achieve what you see.



Simulation Behavior vs Resolution

The fluid simulation is split up into a uniform grid of fluid columns. Each tick, these columns are updated using neighbor data from the four cardinal directions. This means the maximum possible speed a fluid can move is one column per tick. This usually isn't something you need to think about, but it means that changing the fluid simulation resolution (i.e. the separation distance between each column) will change how the fluid behaves/looks. For example, if your game is designed for desktop and mobile devices then you may want to reduce the FlowSimulation component's Resolution setting on mobiles to keep good performance. However, this means the fluids will behave differently on mobile, and may appear to flow faster.

The only way to make the simulation behave similarly with differing resolutions is to slow down the flow rate as you decrease the resolution. However, FLOW currently doesn't implement a feature like this, but I plan to add it.



Fluid Ground Data

The fluid flows on top of a runtime generated heightmap (i.e. for every XZ point within the simulation, there is an associated Y height value for the ground). This means it is not possible to have the fluid fill up a shape like the inside of a sphere, because a sphere does not have only one Y height for each XZ point.

Similarly, the fluid itself is stored using a single fluid depth value for each fluid column, so it's not possible to have fluid on top of another fluid unless they're in separate simulations (then they can't interact).

As long as you imagine the ground data as being a heightmap, and the fluid also being a heightmap, all the same limitations will apply to how the fluid could appear on the surface.



Spherical Planet Support (e.g. Space Graphics Toolkit)

While it's technically possible to implement this, it would require me to rewrite every feature with spherical calculations. This means it would require double the work to implement and support, but since only a small percentage of customers would use this, it wouldn't be worth it.



Voxel Terrains

The fluid flows on top of a runtime generated heightmap, and it's impossible to represent a voxel terrain using a heightmap. Therefore, there is no possible way to combine FLOW with voxel terrains.



Caves/Overhangs/Terrain Holes

The fluid flows on top of a runtime generated heightmap, and it's impossible to represent a these features using a heightmap. Therefore, there is no possible way to combine FLOW with these features.



Moving Containers (e.g. a Bucket)

You can move the fluid simulation with your container, and using the FlowModifier component you could apply force to the fluid to make it 'slosh' around. However, you wouldn't be able to freely rotate the container, and you wouldn't be able to pour fluid out. If you need these kinds of features then you should use a particle based fluid simulation like Obi Fluid.



Third Party Water/Ocean Assets

FLOW uses a custom shader to render the fluid surface. If you replace this shader/material with one from another asset, then the fluid will disappear. While it might be technically possible to combine the two shaders, it would require a lot of work and take up too much time to maintain.

While developing FLOW I experimented with mesh generation, which might allow for better compatibility with other water/ocean systems. However, the performance of this technique was unacceptable so I abandoned the idea.

Another thing to keep in mind is that most water/ocean assets rely on baked data and/or a flat water surface. These constraints allow them to easily implement many rendering features that are not possible to use with a fully dynamic fluid simulation like FLOW.




What Examples Are Included?

This is a list of the in-game example scenes and a description of what it shows.

Basic Setup

This shows you how to make a basic fluid scene filled with water. This is done by making a new GameObject with the FlowSimultation component - this will simulate any fluids you add to the scene. Next, make a new child GameObject with the FlowSurface component - this will render the fluid surface. You can then add a new GameObject anywhere in your scene with the FlowModifier component - this allows you to add/remove/etc fluid to the scene. In this scene this component''s Mode is set to AddFluid, and Fluid is set to Water. You can find more fluid types in the FLOW/Examples/Fluids folder.

Buttons

This shows you how to make UI buttons that can de/activate GameObjects that act as different tools. This is used in all the demo scenes to more easily show multiple effects. To use it, each child of the Tools GameObject has the FlowToolButtonBuilder component, which can automatically build a UI button that activates it.

Simulation Resolution

This shows you how the level of detail of the fluid simulation can be adjusted. By default the FlowSimulation component''s Size and Separation settings are used to control the detail, but you can also use the Resolution setting to quickly adjust this without changing the size. A value of 1 means standard detail based on the simulation . A value of 2 means there will be twice as many fluid columns used in the simulation, and therefore half the performance, and so on. Keep in mind the fluid physics will change slightly based on your resolution setting.

Fluid Types

This shows you how different types of fluid can be added to the simulation, and they will automatically mix together. This is done by changing the FlowModifier component''s Fluid setting. You can find more example fluids in the FLOW/Examples/Fluids folder, which you can drag and drop into this setting. You can also duplicate these and modify their settings to create your own, or add the FlowFluid component to your scene with custom settings and drag and drop that.

Custom Fluid

This shows you how to add custom fluid types to the scene, without using prefabs. This is done by adding the FlowFluid component to your scene, and customizing its settings. You can then drag and drop this component or its GameObject into the Fluid setting of your FlowModifier component.

Random Fluid

This shows you how to randomize the settings of a fluid emitted from a modifier. This is done by adding the FlowRandomizeFluid component to your scene, and setting its Target fluid to the fluid component you want it to modify. This component automatically activates when enabled, so it will randomize the fluid each time the modifier tool is activated.

Continuous Flow

This shows you how to continuously emit fluid. This is done using the FlowModifier component, and changing its Apply setting to Continuously.

Drain Fluid

This shows you how to remove fluid from the simulation. This is done by changing the FlowModifier component''s Mode setting to RemoveFluid. This will remove all fluid at the position of the modifier, within the specified Size.

Debug Ground

This shows you how to visualize what the fluid simulation thinks the ground looks like. This is done by adding the DebugGround material to the FlowSurface component''s MeshRenderer.Materials setting. The ground is generated using vertical raycasts that are stored in a heightmap, so there will usually be a difference between the simulation ground and the actual ground. Visualizing this difference allows you to optimize the position of your objects for maximum fluid simulation visual quality.

Too Thin

This shows you how to visualize what the fluid simulation thinks the ground looks like. This is done by adding the DebugGround material to the FlowSurface component''s MeshRenderer.Materials setting. The ground is generated using vertical raycasts that are stored in a heightmap, so there will usually be a difference between the simulation ground and the actual ground. Notice how the second wall is missed by the ground height generation, because it''s too thin.

Radius

This shows you how to make it so thin objects automatically get included in the ground height data. This is done by increasing the FlowSimulation component''s GroundRadius setting. Alternatively, you can adjust the position of the thin object so it lies on the sample points. Keep in mind the fluid flow may not align very well to thin vertical objects. For best visual results you may want to try to use thicker objects that are more tapered.

Trigger

This shows you how to detect when a certain amount of fluid has appeared at the specified location. This is done by making a new GameObject with the FlowTrigger component. You can then make a child GameObject with the FlowSample component. If the FlowTrigger component''s Criteria setting is set to FluidHeightAbovePosition, then the trigger will activate once the fluid rises above the sample''s Transform.postion.y. The OnMet and OnUnmet events can then be used to perform any custom action. In this example, they''re used to turn the object''s color from white to red.

Shared Sample

This shows you how multiple FlowTrigger components can use the FlowSample component. This can be used to perform different actions based on different fluid heights at the same location, and it gives better performance than using one sample per trigger, since each sample will return the same data.

Remove Blocker

This shows you how to remove a wall when the water level rises above a certain level. This is done by adding the FlowObject component to the wall, so it updates the ground height data when removed. A FlowTrigger is then placed in front of the top of the wall near its peak height, and its OnMet event is set to deactivate the wall GameObject.

Fluid

This shows you how to detect what kind of fluid is being sampled, based on a list of possible fluids you specify. This is done by adding the FlowSampleFluid component alongside the FlowSample component. You can drag and drop fluid components/prefabs into the Fluids list, and adjust the ___Threshold and ___Weight settings based on your requirements. The Triggers list can be used to perform a custom action when a specific fluid was detected.

Wetness

This shows you how fluid can make the ground wet, and gradually dry over time. This is done by enabling the FlowSimulation component''s Wetness setting, and adding the FlowWetness component to any GameObject you want the effect to apply to. Keep in mind these objects must use a material/shader that implements the FLOW wetness. The example shaders that come with FLOW have this feature if you enable the WETNESS setting. See the documentation for more information on how to implement this in your own shaders.

Underwater

This shows you how to render fluid even when the camera is underwater. This is done by making a new GameObject that is a child of the simulation. You can then add the FlowUnderwater component to it, and set its MeshRenderer.Materials list to use an underwater material. FLOW comes with the example Underwater material, which can be used.

Particle Emitter

This shows you how to emit particles that turn into fluid on impact. This is done by enabling the FlowSimulation component''s Particles setting, and making a new child GameObject with the FlowParticles component. You can then make a new GameObjects with the FlowEmitter component, and pick the Fluid you want it to emit.

Toggle Blocker

This shows you how to add and remove objects from the fluid simulation. This is done by adding the FlowObject component to them, and adjusting the Radius setting to encapsulate the whole object (see the Scene tab to verify). This component will automatically update the ground heights of the fluid simulation whenever the object changes.

Buoyancy

This shows you how to make physics objects float when they go underwater. This is done by adding the FlowFloat component alongside your Rigidbody component. You can then make a child GameObject with the FlowSample component to define where the float point is. You can adjust the Radius setting and the Transform.position to best fit your object. The FlowFloat component''s Buoyancy setting allows you to control how quickly the object floats to the surface.

Drag

This shows you how the FlowFloat component''s Drag setting can be used to slow an object down when it''s inside a fluid. This also means an object will accelerate if the fluid it''s inside is moving. This can be used in conjunction with the buoyancy to make the object move move smoothly.

Angular Drag

This shows you how the FlowFloat component''s AngularDrag setting can be used to slow an object''s rotation down when it''s inside a fluid. This can be used in conjunction with the buoyancy to make the object move move smoothly.

Torque

This shows you how the FlowFloat component''s Torque setting can be used to rotate an object upright while it''s in the water. This is useful for boats, buoys, and other simple objects you want to keep upright. Keep in mind you may need to use the AngularDrag setting to control the rotation.

Long Shapes

This shows you how to make long objects like capsules float. This is done by adding two FlowSample child GameObjects to the FlowFloat. One sample is used at the tip of the object, and one at the base.

Flat Shapes

This shows you how to make flat objects float. This is done by adding four FlowSample child GameObjects to the FlowFloat. Each sample is used at the corner of the object, allowing it to automatically float and rotate correctly to the fluid underneath.

Shape

This shows you how to add fluids in a custom shape. This is done using the FlowModifier component''s Shape setting. In this scene the shape is the FLOW asset logo, whose shape is stored in the alpha channel, so the shape''s channel setting is set to Alpha.

Dampen

This shows you how to stop or slow down fluid movement in a specific area. This is done using the FlowModifier component, with the Mode setting set to DampenForce. A Strength setting of 1 means the fluid will be completely stopped/frozen.

Add Fluid Below

This shows you how to add fluid below a certain point. This is done using the FlowModifier component with the Mode setting set to AddFluidBelow. This can be useful for initializing a scene with fluid that remains in a stable state, such as when applied to an island.

Paint Fluid

This shows you how to add/remove fluid under the mouse/finger. This is done using the FlowPaintScreen component, which allows you to select any FlowModifier in your scene or in a prefab. Keep in mind this component uses a physics raycast to calculate where to apply the modifier, so it won''t land on the fluid surface, only the ground underneath it.

Blood Pooling

This shows you how to emit blood particles that collect on the ground to form a pool of blood. This is done by using a FLOW/Particles shader/material that uses a solid circle texture so it looks like blood droplets. These particles emit a red fluid with a fairly low viscosity value of 0.5, which is low enough to quickly spread out, but high enough to still keep its shape.

Save Load

This shows you how to read and write fluid simulation data to a temporary buffer (erased when you switch scenes or close app). This is done using the FlowSnapshot component, whose SaveToTemp and LoadFromTemp methods can be called from UI buttons. This can also be done manually from code using the FlowSnapshot component or FlowSnapshotData class.

To File

This shows you how to read and write fluid simulation data to a local file. This is done using the FlowSnapshot component, whose SaveToFile and LoadFromFile methods can be called from UI buttons. This can also be done manually from code using the FlowSnapshot component or FlowSnapshotData class.

Ripple

This shows you how to make the water surface ripple when an object passes through the water surface. This is done by adding the FlowSplashSurface component to your floating object, and setting the SplashPrefab setting to the Ripple prefab. This prefab has the FlowSplash component, which applies all attached FlowModifier components to the splash location.

Splash

This shows you how the splash effect emit particles. This is done using the Ripple + Splash prefab, whose Prefabs setting contains the Splash Particles prefab. This prefab has a dormant particle system and the FlowSplashSpawnEmit component, which manually emits particles based on the strength of the splash. This component receives this information via its implementation of the ISplashSpawnHandler interface.

Sample Deepest Point

This shows you how to detect the deepest fluid depth within a specific region of the fluid simulation. This is done by making a new GameObject with the FlowSampleArea component, which will periodically read the underlying fluid simulation depth data. This component has size settings similar to modifiers. You can then add the FlowSampleAreaDeepest component alongside it. This component will invoke the OnDeepestGroundPosition and OnDeepestSurfacePosition events depending on what you need.

Sample Fluid Volume

This shows you how to detect the total volume of fluid within a specific area. This is done by making a new GameObject with the FlowSampleArea component, which will periodically read the underlying fluid simulation depth data. This component has size settings similar to modifiers. You can then add the FlowSampleAreaVolume component alongside it. This component will invoke the OnVolume event, which can be drawn to the screen, etc.

Container

This shows you how to make a modifier emit a specific volume of fluid over time, and then turn off. This is done by adding the FlowContainer component to your scene with the desired fluid Volume & capacity. You can then add the FlowModifierContainer component alongside your FlowModifier, and drag and drop your previously created container into the Container setting.

Overflow

This shows you how to make bigger waves than would normally be possible. This is done by enabling the FlowSimulation component's Physics Model / Overflow setting. This allows you to create FlowModifier components with Mode = AddForce, and very high Strength values. Normally the applied force is clamped to the fluid depth, but enabling this setting allows it to go much higher, which can create more impressive waves.

Island

This shows you how to combine multiple features and have a ship sail around an island, all with a low poly look.

Large

This shows you how fluids can be added to a large 1km\xB2 terrain.







Assets

Here's a list of all my other assets, please check them out!

You can also view this list on my Asset Store page.

Lean Touch

Lean Touch

Rapidly develop your game with consistent input across desktop & mobile using Lean Touch. This lightweight asset comes with many modular components, allowing you to customize them to your exact project needs!


Lean Touch+

Lean Touch+

Lean Touch+ is an extension to the popular Lean Touch asset, adding many more example scenes.


Lean Localization

Lean Localization

Lean Localization is a localization library that's designed to be as simple to use as possible for both designers, and programmers.


Lean Pool

Lean Pool

Quickly optimize the performance of your games using Lean Pool. Within minutes you can use this lightweight asset to preload, recycle, and limit the spawning of your prefabs.


Lean Transition

Lean Transition

Quickly polish your games using Lean Transition. This asset allows you to easily tween or animate almost anything in your game, making it transition smoothly.


Lean GUI

Lean GUI

Lean GUI is a colllection of components that extend Unity's GUI system, allowing you to rapidly enhance the user experience (UX) of your game's UI.


Lean GUI Shapes

Lean GUI Shapes

Lean GUI Shapes allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI!


Lean Texture

Lean Texture

Lean Texture allows you quickly modify textures in your project with a range of filters, pack them together into channels, and much more!


Lean Texture+

Lean Texture+

Lean Texture+ is an extension to Lean Texture, adding many new types of texture modification tools!


CW Spaceships - Build & Destroy

Spaceships - Build & Destroy

Build your dream spaceship, and then have fun destroying it!


Modular Backgrounds

Modular Backgrounds

Unlock a universe of visual possibilities with Modular Backgrounds. Simply drag and drop these graphics into the background of your scenes.


Paint in 3D

Paint in 3D

Paint all your objects using Paint in 3D - both in game, and in editor. All features are optimized with GPU accelerated texture painting, so you can enjoy consistent performance, even if you paint your objects one million times!


Paint in 2D

Paint in 2D

Paint all your sprites with Paint in 2D. With incredible performance on mobile, WebGL, and much more!


Paint in Editor

Paint in Editor

Paint in Editor unlocks the ability to paint objects in your scene - great for making small tweaks, or even creating entirely new texture sets!


FLOW

FLOW

FLOW allows you to add large scale interactive fluids to your scene - all highly optimized using GPU acceleration.


Destructible 2D

Destructible 2D

Unlock the full potential of your 2D games using Destructible 2D, this asset allows you to quickly convert all your boring solid sprites into fully destructible ones!


Space Graphics Toolkit

Space Graphics Toolkit

Quickly make the space scene of your dreams using Space Graphics Toolkit. This huge collection of space effects can be customized and combined in any way you like, allowing you to quickly make realistic or fantasy worlds. Each feature has been heavily optimized to run on almost any device and platform.


Space Graphics Planets

Space Graphics Planets

Enhance your space scenes using this large pack of high detail volumetric planets. These planets are finished using the powerful planet features from Space Graphics Toolkit (not required).


Volumetric Audio

Volumetric Audio

Unity sounds only emanate from a single point source. This is great for explosions and footsteps, but quite often you need something more advanced. Volumetric Audio is an easy to use package that allows you to define boxes, spheres, capsules, paths, or meshes that sounds can emanate from.






Versions

2.1.0

Updated CW/Common code to latest version.
Updated shaders to latest version.



2.0.5

Moved main build to Unity 2021.3.0f1.
Updated shaders to latest version.
Fixed FlowModifier component's ColorChannels setting.
Renamed FlowModifier component's ColorChannels setting to Channels.
Added Mode = Change ESMV setting to FlowModifier component.
Added Mode = Range Change ESMV setting to FlowModifier component.



2.0.4

Moved main build to Unity 2020.3.0f1.



2.0.3

Fixed Save Load / To File demo scene.
Fixed fluid snapshot save/load in gamma color space.
Fixed foam increasing opacity even when disabled.
Fixed RemoveFluid modifiers not being able to continuously remove all fluid.



2.0.2

Fixed FlowModifier.MonitorFluidDepth setting.
Added FlowContainer component.
Added FlowModifierContainer component.
Added Container demo scene.
Added FlowSimulation.SimulationOverflow setting.
Added Overflow demo scene.
Added CwRenderTextureManager for alternative RenderTexture creation code.
Removed GC Alloc from FlowWetness component.



2.0.1

Script assembly reload fix for materials.
Added FlowModifier.MonitorFluidDepth setting.
Added FlowModifier.OnFluidDepthDelta event.
Added Sample Deepest Point demo scene.
Added Sample Fluid Volume demo scene.
Improved FlowModifier scene view gizmos.
Removed FlowModifier.HeightMin/Max settings from existing modes.
Added new FlowModifier modes for HeightMin/Max range.



2.0.0

NOTE  This is a massive update. To update you must first back up your project, delete the root FLOW folder, then install the new version.

Changed folder structure to be inside Plugins/CW/FLOW.
Updated inspector code to support third party assets that implement nested inspectors.
Replaced FlowModifierSpeed.Angle setting with Rotation.
Improved "Island" demo scene ship wake.
Added FlowSimulation.PhysicsModel setting.
Added FlowSimulation.PhysicsModel / Instability setting.
Added FlowSimulation.PhysicsModel / Damping setting.
Added FlowSimulation.PhysicsModel / Spread setting.
Added FlowSimulation.PhysicsModel / Speed setting.
Replaced FlowDepthMode component with CwDepthTextureMode.



1.0.7

Fixed demo scene errors with certain keyboard layouts.
Added FlowFloat.FluidDrag setting.
Added FlowModifierSpeed.Angle setting.



1.0.6

Fixed shader errors when making WebGL builds.
Fixed shader warnings when making WebGL builds.



1.0.5

Increased FlowTrigger limit.
Added support for the Enviro asset.
Improved linear color space rendering.
Added Ripple demo scene.
Added Ripple / Splash demo scene.
Fixed transform gizmos not appearing in Unity 2021.2.
Fixed ship controls not working in newer versions of the new input system.



1.0.4

Fixed particles disappearing if they fall outside of simulation boundary.
Added Save Load demo scene.
Added Save Load / To File demo scene.



1.0.3

Fixed FLOW / Surface shader transparency breaking at far camera distances with low camera clip distance.
Added Blood Pooling demo scene.
Added Sink setting to FLOW / Surface shader.
Added WAVE / Strength Min setting to FLOW / Surface shader.
Added WAVE / Strength Max setting to FLOW / Surface shader.
Added WAVE / Strength Scale setting to FLOW / Surface shader.
Added TRANSPARENCY / Mode setting to FLOW / Surface shader.
Added TRANSPARENCY / Step setting to FLOW / Surface shader.
Added TRANSPARENCY / Max Steps setting to FLOW / Surface shader.
Added TRANSPARENCY / Depth Scale setting to FLOW / Surface shader.
Added TRANSPARENCY / Mode setting to FLOW / Underwater shader.
Added TRANSPARENCY / Step setting to FLOW / Underwater shader.
Added TRANSPARENCY / Max Steps setting to FLOW / Underwater shader.
Improved the smoothness of viscous fluid flow.
Improved fluid particle radius calculation.



1.0.2

Renamed FlowPaintModifier component to FlowPaintScreen.
Fixed Paint Fluid demo scene touch controls on mobile.
Added Viscosity reading to FlowSample component.
Added Custom1/2/3 settings to FlowFluid component.
Added Advanced / CustomData setting to FlowSimulation component.
Added Advanced / PrecisionA/B/C/D/E/F settings to FlowSimulation component.
Rewrote fluid data storage code to be more flexible and improve precision.
Improved particle simulation performance.



1.0.1

Added Trigger / Fluid demo scene.
Added Paint Fluid demo scene.
Added FlowSample.OnSampledNothing event.
Added FlowSampleFluid component.
Added FlowPaintModifier component.
Fixed gc alloc from FlowSurface component.
Fixed gc alloc from FlowParticles component.
Fixed gc alloc from FlowUnderwater component.



1.0.0

Initial Release.







Components

FlowContainer

This component stores a volume of fluid that can then be filled and emptied via the FlowModifierContainer component.


float
Volume

The volume of fluid stored in this container.



float
Capacity

The maximum volume of fluid that can be stored in this container.



bool
Clamp

Should the Volume be restricted to the 0..Capacity range?

The precise volume of fluid a modifier adds or removes isn't known ahead of time, so it can sometimes be beneficial to allow the Volume value to go slightly below or above the standard range.



FloatEvent
OnVolume

This gets invoked every time the Volume value is changed.

Float = Current Volume.



FloatEvent
OnVolume01

This gets invoked every time the Volume value is changed.

Float = Current Volume / Capacity clamped to 0..1.



void
AddVolume
FlowSimulation simulation, float delta

This method will add fluid to the container.



void
RemoveVolume
FlowSimulation simulation, float delta

This method will remove fluid from the container.



void
AddVolume
float delta

This method will add fluid to the container.



void
RemoveVolume
float delta

This method will add fluid to the container.




FlowContainerTransform

This component will scale the specified


FlowContainer
Container

The container this component will read.



Transform
Target

The Transform this component will modify.



bool
LocalPosition

Should the Target's localPosition be modified?



bool
LocalRotation

Should the Target's localRotation be modified using Euler values?



bool
LocalScale

Should the Target's localPosition be modified?




FlowCrop

This class allows you to crop part of a RenderTexture into a temporary RenderTexture.



FlowEmitter

This component allows you to emit fluid particles into the scene.


FlowFluid
Fluid

This allows you to choose what type of fluid this component emits particles of.



FlowSimulation
Simulation

This allows you to choose which fluid simulation the emitted particles will be added to.

None/null = The closest fluid will be used.



float
VolumeMin

The minimum amount of fluid added to the simulation.



float
VolumeMax

The maximum amount of fluid added to the simulation.



float
SpeedMin

The minimum speed of the emitted particles in world space.



float
SpeedMax

The maximum speed of the emitted particles in world space.



float
LifeMin

The minimum lifespan of the emitted particles in seconds.



float
LifeMax

The maximum lifespan of the emitted particles in seconds.



float
Spread

The particles will fire out in a spread from the forward direction by up to this many degrees.



Vector3
Direction

The particles will emit in this direction in local space.



float
Interval

The time between each particle emission in seconds.



static FlowEmitter
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowEmitter component attached.



static FlowEmitter
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowEmitter component attached.




FlowFadeOut

This component fades out the first material's Color.a to 0.


float
Duration

The time the fade out takes in seconds.



float
Opacity

The maximum opacity that will be faded from.



UnityEvent
OnFinished

This event is invoked when the fade out finishes.




FlowFloat

This component allows you to make a Rigidbody float in a fluid.


List<FlowSample>
Samples

This object's buoyancy will be calculated using these height samples.



float
Buoyancy

The buoyancy of this object.

0 = Sinks.

1 = Neutral.

2 = Floats.



float
Drag

The positional drag of this object while underwater.



float
FluidDrag

This allows you to control how much the fluid velocity is involved in the drag calculation. For most objects this should be set to 1, but if your object applies force to the fluid then you can end up with scenarios where the object causes itself to accelerate, so reducing this can counteract that.



float
AngularDrag

The rotation drag of this object while underwater.

NOTE  If you have multiple sample points then this setting may be unnecessary, because the sample points will work together to slow the object's rotation.


float
Torque

This setting tries to turn the object upwards when underwater. This is useful for boats, buoys, and other objects that should remain upright. Similar behavior can be achieved with many sample points, but that can be difficult to set up and have negative performance impact.



TorqueType
TorqueMode

This allows you to control how the Torque setting will apply.

WorldUp = Rotate to face up.

WorldUpBidirectional = Rotate to face up or down.

NormalUp = Rotate up to fluid surface.

NormalUpBidirectional = Rotate up or down to fluid surface.



void
ResetSamples

This will automatically reset the Samples list based on any child GameObjects that contain a FlowSample.




FlowFluid

This component allows you to define fluid properties.


Color
Color

The color of this fluid.



float
Emission

The emission of this fluid.



float
Smoothness

The PBR smoothness of this fluid.



float
Metallic

The PBR metallic of this fluid.



float
Viscosity

The viscosity of this fluid.



float
Custom1

The first custom property of this fluid.

NOTE  To use this, your FlowSimulation component's Advanced / CustomData setting must be set to One or Three.


float
Custom2

The second custom property of this fluid.

NOTE  To use this, your FlowSimulation component's Advanced / CustomData setting must be set to Three.


float
Custom3

The third custom property of this fluid.

NOTE  To use this, your FlowSimulation component's Advanced / CustomData setting must be set to Three.



FlowFormatString

This component allows you to convert values like ints and floats into formatted text that can be shown in the UI. To use this component, simply call one of the SetString methods, and it will output the formatted string to the OnString event, which can be connected to UI text, etc.


string
Format

The final text will use this string formatting, where {0} is the first value, {1} is the second, etc. Formatting uses standard string.Format style.



StringEvent
OnString

Based on the Send setting, this event will be invoked.

String = The .



void
SetString
string a

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
string a, string b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
int a

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
int a, int b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
float a

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
float a, float b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
Vector2 a

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
Vector2 a, Vector2 b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
Vector3 a

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
Vector3 a, Vector3 b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
Vector4 a

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
Vector4 a, Vector4 b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
float a, int b

This method will convert the input arguments into a formatted string, and output it to the OnString event.



void
SetString
int a, float b

This method will convert the input arguments into a formatted string, and output it to the OnString event.




FlowManager

This component updates all fluids in the scene.

NOTE  For FLOW to work, this component must exist in your scene somewhere.

UpdateType
UpdateMode

This allows you to control how often this simulation updates.

EveryFrame = All buffers will be updated every FixedUpdate.

EveryOtherFrame = All buffers will be updated every two FixedUpdate calls.



static LinkedList<FlowManager>
Instances

This stores all activate and enabled FlowManager instances in the scene.




FlowModifier

This component allows you to modify a small area of a fluid. For example, to add fluid, remove fluid, etc.


Vector3
Size

This allows you to set the size of the modifier boundary in local space.

NOTE  The Y value is ignored.


Texture
Shape

The strength of this modifier will be multiplied by a channel of this texture specified by the ShapeChannel setting.



FlowChannel
ShapeChannel

This allows you to choose which channel from the Shape texture will be used.



bool
Center

Should the modifier's boundary be centered, or start from the corner



ApplyType
Apply

How often should this component modify the underlying fluid?

Manually = You must manually call the ApplyNow method from code or inspector event.

Once = The modifier will apply on the first frame after it gets activated.

Continuously = This modifier will apply every time the underlying fluid updates.



ModeType
Mode

This allows you to choose how this component will modify the underlying fluid simulation.

AddFluid = Fluid will be added under and above this modifier's local XZ position.

AddFluidClip = Like AddFluid, but areas of the modifier that are underground will be ignored.

AddFluidClipInv = Like AddFluid, but areas of the modifier that are overground will be ignored.

RemoveFluid = Fluid will be removed under and above this modifier's local XZ position.

RemoveFluidClip = Like RemoveFluid, but areas of the modifier that are underground will be ignored.

RemoveFluidAbove = Like RemoveFluid, but the removal will stop once the fluid level reaches that of the modifier's Y position.

RemoveFluidAboveClip = Like RemoveFluidAbove, but areas of the modifier that are underground will be ignored.

AddForce = Fluid within the boundary of this modifier will be given force based on the specified normal map.

AddForceUniform = Fluid within the boundary of this modifier will be given forward (local +Z) force.

DampenForce = Fluid within the boundary of this modifier will have force removed from it. A Strength value of 1 will result in all force being removed.

AddFoam = Fluid within the boundary of this modifier will have foam added to it.

AddFoamMax = Like AddFoam, but the foam will only increase if the added amount is greater than the current amount.

RemoveFoam = Fluid within the boundary of this modifier will have foam removed from it.

ChangeColor = Fluid within the boundary of this modifier will have its color transition toward the specified color.

ChangeESMV = Fluid within the boundary of this modifier will have its Emission/Smoothness/Metallic/Viscosity transition toward the specified values.



float
HeightMin

This modifier will modify fluids above this height in local space.



float
HeightMax

This modifier will modify fluids below this height in local space.



FlowFluid
Fluid

When using one of the AddFluid modes, this allows you to specify the fluid properties that get added.



float
Angle

When using Mode = AddForce/Uniform, this allows you to specify the direction of the force relative to the forward direction of the modifier.

0 = Forward.

90 = Right.

180 = Back.

270 = Left.



Texture
Directions

When using Mode = AddForce, this allows you to specify the fluid properties that get added.



Color
Color

When using Mode = ChangeColor, this allows you to specify the target color.



Vector4
ESMV

When using Mode = ChangeESMV, this allows you to specify the target emission/smoothness/metallic/visosity.



bool4
Channels

When using Mode = ChangeColor, this allows you to specify which channels in the target color will be used.



float
Strength

The region modification strength will be multiplied by this amount.



FloatEvent
OnApplied

After this component applies its changes to the scene, it will invoke this event.

Float = The strength of the modifier application.



bool
MonitorFluidDepth

If this modifier's mode is set to AddFluid or RemoveFluid, do you want to track how much this modifier adds or removes?



SimulationFloatEvent
OnFluidDepthDelta

If this modifier's mode is set to AddFluid or RemoveFluid, this event tells you how much total fluid column depth was added or removed.

Float = Amount of fluid that was added (positive) or removed (negative).

NOTE  The MonitorFluidDepth setting must be enabled for this event to be invoked.


SimulationFloatEvent
OnFluidVolumeDelta

This works like OnFluidDepthDelta, but the delta value will be the fluid volume in meters cubed.



static LinkedList<FlowModifier>
Instances

This stores all activate and enabled FlowModifier instances in the scene.



void
ApplyNow

This method will apply this region to all volumes in the scene using the specified Strength value.



static FlowModifier
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowModifier component attached.



static FlowModifier
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowModifier component attached.




FlowModifierContainer

This component will either add or remove fluid from the specified Container based on the sibling FlowModifier component's Mode setting. If the container volume is too little or too much then the modifer will be disabled.


FlowContainer
Container

The container whose Volume must be greater than 1 for the sibling FlowModifier to be enabled.




FlowModifierSpeed

This component will modify the sibling FlowModifier.Strength setting based on the speed this GameObject moves.


float
SpeedMax

When this GameObject's speed matches this value, the FlowModifier.Strength will be set to the specified Strength value.



float
Strength

The FlowModifier.Strength will be set to this value when this GameObject's speed matches the SpeedMax value.



bool
Clamp

If the speed exceeds SpeedMax, should the calculations be clamped, as if the speed wasn't exceeded?



RotationType
Rotation

If the sibling FlowModifier uses Mode = AddForceUniform, should its Angle setting automatically be updated?

WorldDelta = The angle will be set to the world space movement of this object (should be used if this GameObject doesn't rotate).

LocalDelta = The angle will be set to the local space movement of this object (should be used if this GameObject does rotate).




FlowObject

This component marks the current GameObject as an object that can block.


Vector3
Center

The center of the object in local space.



float
Radius

The radius of the object in local space.



void
MarkAsDirty

If this object has been modified in a way that isn't normally detected (e.g. MeshCollider.sharedMesh changed), then you can manually call this method.




FlowOnDisable

This component allows you to invoke an event when this component gets disabled.


UnityEvent
Action

The event that will be invoked.




FlowOnEnable

This component allows you to invoke an event when this component gets enabled.


UnityEvent
Action

The event that will be invoked.




FlowPaintScreen

This component allows you paint the specified fluid prefab under the mouse/finger as it drags across the screen.


CwInputManager.Trigger
PaintControls

The finger/mouse/key that must be pressed for the painting.



FlowModifier
Modifier

The modifier that will be applied to the fluid simulations.



GameObject
Visual

If you need to display some sort of visual while this component is drawing, you can set it here.



LayerMask
Layers

The scene layers under the finger/mouse that this component will raycast. The spawned prefab will be placed there.



float
MaxDistance

The maximum distance of the raycast.




FlowParticles

This component can be added to a child GameObject of the FlowSimulation, and allows rendering of the fluid when the camera is above the surface.


FlowSimulation
Simulation

The fluid simulation this component will render particles for.



static FlowParticles
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowParticles component attached.



static FlowParticles
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowParticles component attached.




FlowRandomizeFluid

This component randomizes the settings of the specified FlowFluid component.

This component automatically activates when enabled, or when you manually call the Randomize method.


FlowFluid
Fluid

The fluid whose settings will be modified.



Gradient
Colors

The possible colors.



Vector2
Emission

The min/max emission value.



Vector2
Smoothness

The min/max smoothness value.



Vector2
Metallic

The min/max metallic value.



Vector2
Viscosity

The min/max viscosity value.



void
Randomize

This method will immediately randomize the Target fluid settings.




FlowReader

This class allows you to read pixels from RenderTextures asynchronously.



FlowReplace

This class allows you to replace part of a RenderTexture with another Texture.



FlowSample

This component samples the ground and fluid data at the current transform XZ position.

NOTE  This data will be sampled regardless of the Y position (height) even if this component is below the ground or above the water level.
NOTE  This data will be sampled asynchronously when made available.

FlowSimulation
Simulation

If you only want to sample data from a specific simulation, specify it here.

None/null = The closest simulation to this Transform will be sampled.



float
Strength

This allows you to control the weight this sample gives to the FlowFloat component's buoyancy calculation.



float
Radius

The radius of this sample.

NOTE  This is only used by the buoyancy feature.


float
Epsilon

The fluid depth must be above this value for it to be considered to be there.



FlowSampleEvent
OnSampled

This event is invoked after the fluid has been sampled.



FlowSampleEvent
OnSampledNothing

This event is invoked after the fluid has been sampled, if it has a depth of 0.



static LinkedList<FlowSample>
Instances

This stores all activate and enabled FlowSample instances in the scene.



float
GroundHeight

This tells you the previously sampled ground height in world space.



float
WetHeight

This tells you the previously sampled wetness height in world space.



float
FluidDepth

This tells you the previously sampled fluid depth in meters.



Vector3
FluidNormal

This tells you the previously sampled fluid surface normal in world space.



Vector3
FluidVelocity

This tells you the previously sampled fluid velocity in world space.



Color
FluidColor

This tells you the previously sampled fluid color.



float
FluidEmission

This tells you the previously sampled fluid emission.



float
FluidSmoothness

This tells you the previously sampled fluid smoothness.



float
FluidMetallic

This tells you the previously sampled fluid smoothness.



float
FluidViscosity

This tells you the previously sampled fluid viscosity.



float
FluidFoam

This tells you the previously sampled fluid foam.



float
FluidCustom1

This tells you the previously sampled fluid's Custom1 value.

NOTE  To use this, your FlowSimulation component's Advanced / CustomData setting must be set to One or Three.


float
FluidCustom2

This tells you the previously sampled fluid's Custom2 value.

NOTE  To use this, your FlowSimulation component's Advanced / CustomData setting must be set to Three.


float
FluidCustom3

This tells you the previously sampled fluid's Custom3 value.

NOTE  To use this, your FlowSimulation component's Advanced / CustomData setting must be set to Three.


float
Overlap

This tells you the previously sampled simulation 0..1 overlap.



bool
Sampled

This tells you if this component has sampled the scene.



float
FluidHeight

This tells you the height of the fluid surface in world space.



void
Clear

This will clear any sampled data.



static FlowSample
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowSample component attached.



static FlowSample
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowParticles component attached.




FlowSampleArea

This component samples an area of fluid and gives you information about it.


FlowSimulation
Simulation

If you only want to sample data from a specific simulation, specify it here.

None/null = The closest simulation to this Transform will be sampled.



Vector3
Size

This allows you to set the size of the modifier boundary in local space.

NOTE  The Y value is ignored.


Texture
Shape

By default all fluid within the sample area rect will be read, but this allows you to specify a texture that acts as a mask shape.



FlowChannel
ShapeChannel

This allows you to choose which channel from the Shape texture will be used.



bool
Center

Should the modifier's boundary be centered, or start from the corner



CheckType
Check

How often should this component check the underlying fluid?

Manually = You must manually call the CheckNow method from code or inspector event.

Once = The check will occur on the first frame after this component gets activated.

Continuously = The fluid will be checked every CheckInterval seconds.



float
CheckInterval

The time between each fluid sample in seconds.



float
TotalFluidDepth

This tells you the previously sampled total fluid depth in meters.



float
TotalFluidVolume

This tells you the previously sampled fluid volume in meters cubed.



Vector2Int
DeepestColumn

This tells you the previously sampled deepest fluid pixel coordinate.



float
DeepestFluidDepth

This tells you the previously sampled deepest fluid depth in meters.



Vector3
DeepestGroundPosition

This tells you the previously sampled deepest ground position in world space.



Vector3
DeepestFluidPosition

This tells you the previously sampled deepest fluid surface position in world space.



bool
Sampled

This tells you if this component has sampled the scene.



FlowSampleAreaEvent
OnSampled

This event is invoked after the fluid has been sampled.



static FlowSampleArea
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowSample component attached.



static FlowSampleArea
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowParticles component attached.




FlowSampleAreaDeepest

This component works alongside the LeanSample component and tells you what type of fluid has been sampled based on the specified list of potential fluids.


float
MinimumDepth

The deepest sampled fluid depth must be at least this depth in meters for the events to invoke.



Vector3Event
OnDeepestGroundPosition

This event is invoked after the fluid has been sampled.

Vector3 = The position of the ground at the deepest sampled fluid depth.



Vector3Event
OnDeepestSurfacePosition

This event is invoked after the fluid has been sampled.

Vector3 = The position of the fluid surface at the deepest sampled fluid depth.




FlowSampleAreaVolume

This component works alongside the LeanSample component and tells you what type of fluid has been sampled based on the specified list of potential fluids.


FloatEvent
OnVolume

This event is invoked after the fluid has been sampled.

Float = The total volume in meters cubed.




FlowSampleFluid

This component works alongside the LeanSample component and tells you what type of fluid has been sampled based on the specified list of potential fluids.


List<FlowFluid>
Fluids

This allows you to specify all the possible fluid types you want this component to be able to detect.



List<Trigger>
Triggers

Triggers allow you to fire an event when a specific fluid has been sampled by this component.



float
ColorThreshold

The maximum 0..1 difference in each RGBA channel value.



float
EmissionThreshold

The maximum 0..1 difference in emission value.



float
SmoothnessThreshold

The maximum 0..1 difference in smoothness value.



float
MetallicThreshold

The maximum 0..1 difference in metallic value.



float
ColorWeight

This allows you to control how important the color matching is relative to the other fluid properties.



float
EmissionWeight

This allows you to control how important the emission matching is relative to the other fluid properties.



float
SmoothnessWeight

This allows you to control how important the smoothness matching is relative to the other fluid properties.



float
MetallicWeight

This allows you to control how important the metallic matching is relative to the other fluid properties.



FlowFluidEvent
OnSampledFluid

This event is invoked after the fluid has been sampled.



FlowFluid
LastSampledFluid

After OnSampledFluid is invoked, the newly sampled fluid will be stored here.




FlowSimulation

This component allows you to create a region where the fluid simulation occurs.

NOTE  The FlowSurface component should be added on a child GameObject to render this fluid when the camera is above water.
NOTE  The FlowUnderwater component should be added on a child GameObject to render this fluid when the camera is under water.

Vector3
Size

This allows you to set the size of the fluid simulation along the X and Z axes in local space.

NOTE  The Y value is ignored.


float
Separation

This allows you to set the distance between each fluid column on the X and Z axes in local space. The lower you set this, the higher detail the simulation will be, and the lower the performance.



float
Resolution

The amount of fluid columns used in the simulation will be multiplied by this, giving higher detail.

NOTE  Increasing this will slow down performance.
NOTE  The way the fluid physics behave will slightly change when changing this value, so higher isn't necessarily better depending on the look you want.


bool
Center

Should the fluid boundary be centered, or start from the corner at 0,0?



bool
Stretch

If the Size setting isn't perfectly divisible by the Separation setting, should the separation automatically be adjusted so the fluid volume matches the size?



bool
Simulating

If you disable this, then the simulation will stop/freeze in time.



bool
Wetness

Simulate ground wetness?

NOTE  This requires the objects in your scene to use a shader/material that implements FLOW wetness. This can be done with the provided FLOW wetness shaders, manually implemented using a custom shader, or added on top using BetterShaders with the Wetness stacked shader that comes with FLOW.


float
TableDepth

When the ground is dry, the water table will be this many meters below ground.



float
DryRate

The wet areas of the scene will dry at this speed in meters per second.



LayerMask
HeightLayers

This allows you to define which layers will be raycast to find the ground heights.



float
HeightMin

This allows you to specify the minimum ground height.



float
HeightMax

This allows you to specify the maximum ground height.



float
HeightRadius

If you want the height sampling to have radius, specify it here. This is useful if your scene contains many thin objects that are normally missed by the ground height raycasts.

NOTE  The higher you set this, the higher the disparity between the fluid and ground rendering can become.

0 = No radius.

1 = Radius matches column separation.



float
Speed

When the surface is flowing, how fast should it be considered to be moving relative to the change in fluid level? This is used when calculating the buoyancy drag.



float
FoamClearRate

The speed of the foam removal where 1 means it takes 1 second.



bool
Particles

If you enable this then you will be able to spawn particles into this fluid simulation.



int
ParticleLimit

This allows you to set the maximum amount of particles that can be simulated.



float
ParticleDrag

The particles will be slowed down by this amount of atmospheric drag.



CustomDataType
CustomData

If you enable this then the fluid simulation will store up to three additional custom fluid properties.



FloatPrecision
PrecisionA

This allows you to control the precision of the fluid mixing of the A texture (ground height, wet height). This should normally be kept at full, but it can be lowered if runtime memory usage is a concern.

Half = 16 bits of precision.

Full = 32 bits of precision.



FloatPrecision
PrecisionB

This allows you to control the precision of the fluid mixing of the B texture (velocity). This should normally be kept at full, but it can be lowered if runtime memory usage is a concern.

Half = 16 bits of precision.

Full = 32 bits of precision.



FloatPrecision
PrecisionC

This allows you to control the precision of the fluid mixing of the C texture (depth). This should normally be kept at full, but it can be lowered if runtime memory usage is a concern.

Half = 16 bits of precision.

Full = 32 bits of precision.



Precision01
PrecisionD

This allows you to control the precision of the fluid mixing of the D texture (red, green, blue, alpha). If your game requires small columns of fluid to mix with large columns, and accurately store the mixed result then you can increase this.

Byte = 8 bits of precision.

Half = 16 bits of precision.

Full = 32 bits of precision.



Precision01
PrecisionE

This allows you to control the precision of the fluid mixing of the E texture (emission, smoothness, metallic, viscosity). If your game requires small columns of fluid to mix with large columns, and accurately store the mixed result then you can increase this.

Byte = 8 bits of precision.

Half = 16 bits of precision.

Full = 32 bits of precision.



Precision01
PrecisionF

This allows you to control the precision of the fluid mixing of the F texture (foam, custom1, custom2, custom3). If your game requires small columns of fluid to mix with large columns, and accurately store the mixed result then you can increase this.

Byte = 8 bits of precision.

Half = 16 bits of precision.

Full = 32 bits of precision.



PhysicsType
PhysicsModel

This allows you to change the physics model of the fluid simulation.

Standard = The water will flow downhill and settle.

Alive = The water will flow downhill and produce many waves that constantly appear.

Inverse Peaks = The water will flow downhill and collect toward the center of the body of water.

Simple = Water will only flow down and make simple waves/ripples, waves will not appear to have any inertia when going uphill.



float
PhysicsInstability

If you increase this setting then low viscosity waves will not be able to settle down, and will always have some instability that looks like waves.



float
PhysicsSpread

By default, high viscosity fluids will stick to the ground. If you don't want this behavior then you can increase this value.



float
PhysicsDamping

The gives you control over the rate of acceleration of a fluid column, where a higher value means it accelerates faster.



float
PhysicsSpeed

The gives you some control over the fluid simulation speed.

NOTE  This is a simple approximation.


bool
PhysicsOverflow

This allows the fluid flow rate to exceed the available fluid in the column. This can be combined with strong AddForce modifiers to make larger waves.

NOTE  Enabling this has a slight performance overhead.


RenderTexture
CurrentFlowDataA

The stores the column ground height and wet height.



RenderTexture
CurrentFlowDataB

This stores the column velocity.



RenderTexture
CurrentFlowDataC

This stores the column fluid depth.



RenderTexture
CurrentFlowDataD

This stores the column fluid red, green, blue, alpha.



RenderTexture
CurrentFlowDataE

This stores the column fluid emission, smoothness, metallic, viscosity.



RenderTexture
CurrentFlowDataF

This stores the column fluid foam, custom1, custom2, custom3.



RenderTexture
CurrentParticleDataA

This stores the particle velocity and age.



RenderTexture
CurrentParticleDataB

This stores the particle position and life.



RenderTexture
CurrentParticleDataC

This stores the particle fluid depth.



RenderTexture
CurrentParticleDataD

This stores the particle fluid red, green, blue, alpha.



RenderTexture
CurrentParticleDataE

This stores the particle fluid emission, smoothness, metallic, viscosity.



RenderTexture
CurrentParticleDataF

This stores the particle foam, custom1, custom2, custom3.



Vector3
ColumnMin

This tells you where the fluid begins in local space.



Vector3
ColumnMax

This tells you where the fluid ends in local space.



Vector3Int
ColumnCount

This tells you how many columns are used to simulate the fluid along the XZ axes.



Vector3
ColumnSeparation

This tells you the distance between each columns on the X and Z axes.



static LinkedList<FlowSimulation>
Instances

This stores all activate and enabled FlowSimulation instances in the scene.



void
UpdateGround

This will update the ground heights for the whole fluid via raycast.

NOTE  This method is slow.


void
AddParticle
FlowFluid fluid, float depth, Vector3 position, Vector3 velocity, float life, float foam = 0.0f

This allows you to add one particle to the fluid simulation.

NOTE  This fluid simulation must have the Particles setting enabled, and there must be a child FlowParticles component to render it.


void
DirtyGround
Vector3 worldCenter, float worldRadius

This will update the ground heights for a specific region of the fluid via raycast.



static FlowSimulation
FindSimulation
Vector3 worldPoint, FlowSimulation current = null

This will find the closest simulation to the specified world point, if the current one doesn't exist.



float
GetOverlapXZ
Vector3 worldPoint, float radius

This tells you the 0..1 percentage the specified 2D circle overlaps this simulation on the XZ axes.



bool
GetOverlapXZ
Vector3 worldPoint

This tells you if the specified 2D point overlaps this simulation on the XZ axes.



static FlowSimulation
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowSimulation component attached.



static FlowSimulation
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowSimulation component attached.




FlowSnapshot

This component allows you to create a snapshot from a simulation, and later reset the simulation back to that state.


FlowSimulation
Simulation

The simulation that will be snapshotted.



string
Title

This allows you to set the filename used when saving and loading from file, where {0} is the simulation GameObject name.



void
SaveToTemp

This method stores a temporary snapshot of the fluid data to this component. This will be erased when you close the app, change the scene, or otherwise cause this component to be destroyed.



void
LoadFromTemp

This method reverts the fluid data to the previously stored snapshot.



void
SaveToFile

This method stores a persistent snapshot of the fluid data to this device.

NOTE  Depending on your fluid simulation resolution this can be a lot of data, so it may not always be possible to save.
NOTE  Depending on your fluid simulation resolution this can be slow to call, because it must copy data from GPU to CPU memory.


void
LoadFromFile

This method reverts the fluid data to the previously stored snapshot.




FlowSnapshotData

This class stores a snapshot of a fluid simulation.

The snapshot can be stored in three different formats: Raw (RenderTexture), Readable (Texture2D), and Serializable (byte[]).

The fluid simulation itself is stored using RenderTextures, so the raw format is the fastest storage method to use. However, it's not possible to directly read/write RenderTextures, and they cannot be directly saved/loaded.

The readable data is stored using Texture2D, which you can directly read/write, but it cannot be directly saved/loaded.

The serializable data is stored using PNG encoded bytes, which you cannot directly read/write, but you can directly save/load them.


void
SimulationToRaw
FlowSimulation simulation

This method copies all fluid and particle data from the specified simulation into this class as raw data.



void
RawToSimulation
FlowSimulation simulation

This method copies all raw fluid and particle data from this class into the specified simulation.




FlowSplash

This component allows you to invoke an event when this component gets enabled.


List<GameObject>
Prefabs

The prefabs spawned by this component.

NOTE  These prefabs can have components that implement the ISplashSpawnHandler interface.


FloatEvent
OnSplash

This event will be invoked when this splash is applied somewhere.

Float = Strength



void
ClearCache

This component caches the FlowModifier components that it will apply to. If you add/remove modifiers then this method allows you to clear this cache.




FlowSplashSpawnEmit

This component can be attached to any prefab spawned by the FlowSplash component, and it will emit an amount of particles relative to the splash strength.


int
CountMin

The amount of particles that will be spawned when the splash strength is 0.



int
CountMax

The amount of particles that will be spawned when the splash strength is 1.




FlowSplashSurface

This component adds a splash to the fluid simulation if the current object crosses the fluid surface.


FlowSample
Sample

The submersion value will be read from this sample point.



FlowSplash
SplashPrefab

The splash effect that will be spawned when a splash occurs.



float
Scale

The splash effect size will be multiplied by this.



float
Strength

The splash effect strength will be multiplied by this.



float
Threshold

The object's submersion value must change by this much for a splash to occur.



float
Cooldown

This disables the splash effect for some time, allowing you to use stronger strength values without having the object cause itself to splash forever.




FlowSurface

This component can be added to a child GameObject of the FlowSimulation, and allows rendering of the fluid when the camera is above the surface.


FlowSimulation
Simulation

The simulation this component will render.



bool
Edge

Should this component draw the outer edge/sides of the water?



static FlowSurface
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowSurface component attached.



static FlowSurface
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowSurface component attached.




FlowTorque

This component applies continuous torque to the sibling Rigidbody component.


Vector3
Torque

This allows you to specify a positional offset relative to the Target.



Space
Space

The frame of reference the torque will be applied in.



ForceMode
ForceMode

The force mode the torque will be applied using.




FlowTrigger

This component allows you to trigger an event when the specified FlowSample meets the criteria.

NOTE  The trigger will not work properly if it's underground.
NOTE  If you only want the trigger to work once, you can disable this component via the OnMet event.

FlowSample
Sample

The trigger will be calculated using this sample.



CriteriaType
Criteria

The specified Sample must meet this criteria to trigger the event.

FluidDepthAbove = The fluid depth must be greater than the specified Depth value.

FluidDepthBelow = Inverse of FluidDepthAbove.

FluidHeightAbovePosition = The fluid height must be above this trigger's Transform.position.y.

FluidHeightBelowPosition = Inverse of FluidHeightAbovePosition.



float
Depth

The world space depth.



bool
Met

Has the specified Criteria been met?

NOTE  Manually changing this will not invoke any events.


UnityEvent
OnMet

This event will be invoked when the criteria is met.



UnityEvent
OnUnmet

This event will be invoked when the criteria is no longer met.



void
ResetSample

This will automatically reset the Sample based on any child GameObjects that contain a FlowSample.



void
UpdateCriteria

This will immediately update the trigger criteria.



static FlowTrigger
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowTrigger component attached.



static FlowTrigger
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowParticles component attached.




FlowTriggerArea

This component allows you to trigger an event when the specified FlowSampleArea meets the criteria.

NOTE  The trigger will not work properly if it's underground.
NOTE  If you only want the trigger to work once, you can disable this component via the OnMet event.

FlowSampleArea
SampleArea

The trigger will be calculated using this sample area.



CriteriaType
Criteria

The specified SampleArea must meet this criteria to trigger the event.

TotalFluidVolumeAbove = The total volume of fluid within the specified SampleArea must be greater than the specified VolumeMin value.

TotalFluidVolumeBelow = The total volume of fluid within the specified SampleArea must be greater than the specified VolumeMin value.

TotalFluidVolumeWithin = The fluid height must be above this trigger's Transform.position.y.



float
VolumeMin

The minimum fluid volume in meters cubed.



float
VolumeMax

The maximum fluid volume in meters cubed.



bool
Met

Has the specified Criteria been met?

NOTE  Manually changing this will not invoke any events.


UnityEvent
OnMet

This event will be invoked when the criteria is met.



UnityEvent
OnUnmet

This event will be invoked when the criteria is no longer met.



void
ResetSampleArea

This will automatically reset the SampleArea based on any child GameObjects that contain a FlowSampleArea.



void
UpdateCriteria

This will immediately update the trigger criteria.



static FlowTriggerArea
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowTrigger component attached.



static FlowTriggerArea
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowParticles component attached.




FlowUnderwater

This component can be added to a child GameObject of the FlowSimulation, and allows rendering of the fluid when the camera is above the surface.


FlowSimulation
Simulation

The simulation this component will render.



Transform
Observer

The object that will view the underwater scene.

None/null = Main Camera.



int
TileRadius

The amount of tiles across the X and Z axis.



float
GroundOffset

The underwater mesh will be offset from the ground by this distance in world space. This is used to avoid any clipping or flickering issues.



float
SurfaceOffset

The underwater mesh will be offset from the surface by this distance in world space. This is used to avoid any clipping or flickering issues.



static FlowUnderwater
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the FlowUnderwater component attached.



static FlowUnderwater
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the FlowUnderwater component attached.




FlowWetness

This component sends wetness data to all materials on the current GameObject.


FlowSimulation
Simulation

The simulation whose data will be set on this GameObject's materials.

None/null = Use the closest simulation.



List<Renderer>
Renderers

The wetness data will be applied to all materials in these renderers.



List<Terrain>
Terrains

The wetness data will be applied to all these materials.




ISplashSpawnHandler

This interface can be implemented by components attached to the prefabs spawned by the FlowSplash component, allowing them to change their behavior based on the splash force.



Index

Thank you for using FLOW ❤️

How do I upgrade?

What is FLOW?

Getting Started

Do Fluids Work With Terrains and Custom Meshes?

How is the Simulation Size/Performance?

How Can I Read Fluid Data (e.g. Depth)?

Are Custom Shaders/Materials Supported?

How Can I Add Custom Fluid Types?

How Can I Remove/Drain Fluid?

How Can I Make The Ground Look Wet?

How Can I Render Underwater?

How Can I Make Objects Float?

How Can I Make Fluids React to Scene Changes?

How Can I Detect When Fluid Appears Somewhere?

Why Does the Fluid Ignore My Object?

Surface Shader Settings

Can I Request New Demo Scenes?

Known Issues / Limitations

What Examples Are Included?



Assets

Lean Touch

Lean Touch+

Lean Localization

Lean Pool

Lean Transition

Lean GUI

Lean GUI Shapes

Lean Texture

Lean Texture+

Spaceships - Build & Destroy

Modular Backgrounds

Paint in 3D

Paint in 2D

Paint in Editor

FLOW

Destructible 2D

Space Graphics Toolkit

Space Graphics Planets

Volumetric Audio



Versions

2.1.0

2.0.5

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

1.0.7

1.0.6

1.0.5

1.0.4

1.0.3

1.0.2

1.0.1

1.0.0



Components

FlowContainer

FlowContainerTransform

FlowCrop

FlowEmitter

FlowFadeOut

FlowFloat

FlowFluid

FlowFormatString

FlowManager

FlowModifier

FlowModifierContainer

FlowModifierSpeed

FlowObject

FlowOnDisable

FlowOnEnable

FlowPaintScreen

FlowParticles

FlowRandomizeFluid

FlowReader

FlowReplace

FlowSample

FlowSampleArea

FlowSampleAreaDeepest

FlowSampleAreaVolume

FlowSampleFluid

FlowSimulation

FlowSnapshot

FlowSnapshotData

FlowSplash

FlowSplashSpawnEmit

FlowSplashSurface

FlowSurface

FlowTorque

FlowTrigger

FlowTriggerArea

FlowUnderwater

FlowWetness

ISplashSpawnHandler