If you haven't already, please consider writing a review. They really help me out!
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.
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.
Before you can add fluid to your scene, you must tell FLOW where in your scene you want the fluids to appear.
You should now see the FlowSimulation component in your inspector tab.
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.
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.
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.
You should now see the FlowSurface component in your inspector tab.
The easiest way to add fluids to your fluid simulation is to add a modifier to your scene.
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.
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.
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.
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.
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.
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.
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.
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.
If you'd like the fluid simulation to make the ground wet and gradually dry over time, then this feature is for you.
Select your FlowSimulation component, and enable the Wetness setting.
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.
Finally, enable the Wetness setting in the material settings used for your object.
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).
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!
Any Rigidbody can be made to react to the fluid simulation with buoyancy and drag.
Select your Rigidbody GameObject, and add the FlowFloat component to it.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
These settings allow you to make the fluid surface transparent.
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.
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.
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.
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.
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.
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.
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!
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.
This is the easiest and best solution when possible.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This is a list of the in-game example scenes and a description of what it shows.
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.
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.
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.
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.
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.
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.
This shows you how to continuously emit fluid. This is done using the FlowModifier component, and changing its Apply setting to Continuously.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This shows you how to combine multiple features and have a ship sail around an island, all with a low poly look.
This shows you how fluids can be added to a large 1km\xB2 terrain.
Here's a list of all my other assets, please check them out!
You can also view this list on my Asset Store page.
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+ is an extension to the popular Lean Touch asset, adding many more example scenes.
Lean Localization is a localization library that's designed to be as simple to use as possible for both designers, and programmers.
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.
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 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 allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI!
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+ is an extension to Lean Texture, adding many new types of texture modification tools!
Unlock a universe of visual possibilities with Modular Backgrounds. Simply drag and drop these graphics into the background of your scenes.
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 all your sprites with Paint in 2D. With incredible performance on mobile, WebGL, and much more!
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 allows you to add large scale interactive fluids to your scene - all highly optimized using GPU acceleration.
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!
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.
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).
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.
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.
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.
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.
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.
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.
Fixed demo scene errors with certain keyboard layouts.
Added FlowFloat.FluidDrag setting.
Added FlowModifierSpeed.Angle setting.
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.
Fixed particles disappearing if they fall outside of simulation boundary.
Added Save Load demo scene.
Added Save Load / To File demo scene.
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.
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.
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.
This component stores a volume of fluid that can then be filled and emptied via the FlowModifierContainer component.
The volume of fluid stored in this container.
The maximum volume of fluid that can be stored in this container.
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.
This gets invoked every time the Volume value is changed.
Float = Current Volume.
This gets invoked every time the Volume value is changed.
Float = Current Volume / Capacity clamped to 0..1.
This method will add fluid to the container.
This method will remove fluid from the container.
This method will add fluid to the container.
This method will add fluid to the container.
This component will scale the specified
The container this component will read.
The Transform this component will modify.
Should the Target's localPosition be modified?
Should the Target's localRotation be modified using Euler values?
Should the Target's localPosition be modified?
This component allows you to emit fluid particles into the scene.
This allows you to choose what type of fluid this component emits particles of.
This allows you to choose which fluid simulation the emitted particles will be added to.
None/null = The closest fluid will be used.
The minimum amount of fluid added to the simulation.
The maximum amount of fluid added to the simulation.
The minimum speed of the emitted particles in world space.
The maximum speed of the emitted particles in world space.
The minimum lifespan of the emitted particles in seconds.
The maximum lifespan of the emitted particles in seconds.
The particles will fire out in a spread from the forward direction by up to this many degrees.
The particles will emit in this direction in local space.
The time between each particle emission in seconds.
This allows you create a new GameObject with the FlowEmitter component attached.
This allows you create a new GameObject with the FlowEmitter component attached.
This component fades out the first material's Color.a to 0.
The time the fade out takes in seconds.
The maximum opacity that will be faded from.
This event is invoked when the fade out finishes.
This component allows you to make a Rigidbody float in a fluid.
This object's buoyancy will be calculated using these height samples.
The buoyancy of this object.
0 = Sinks.
1 = Neutral.
2 = Floats.
The positional drag of this object while underwater.
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.
The rotation drag of this object while underwater.
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.
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.
This will automatically reset the Samples list based on any child GameObjects that contain a FlowSample.
This component allows you to define fluid properties.
The color of this fluid.
The emission of this fluid.
The PBR smoothness of this fluid.
The PBR metallic of this fluid.
The viscosity of this fluid.
The first custom property of this fluid.
The second custom property of this fluid.
The third custom property of this fluid.
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.
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.
Based on the Send setting, this event will be invoked.
String = The .
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This method will convert the input arguments into a formatted string, and output it to the OnString event.
This component updates all fluids in the scene.
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.
This stores all activate and enabled FlowManager instances in the scene.
This component allows you to modify a small area of a fluid. For example, to add fluid, remove fluid, etc.
This allows you to set the size of the modifier boundary in local space.
The strength of this modifier will be multiplied by a channel of this texture specified by the ShapeChannel setting.
This allows you to choose which channel from the Shape texture will be used.
Should the modifier's boundary be centered, or start from the corner
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.
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.
This modifier will modify fluids above this height in local space.
This modifier will modify fluids below this height in local space.
When using one of the AddFluid modes, this allows you to specify the fluid properties that get added.
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.
When using Mode = AddForce, this allows you to specify the fluid properties that get added.
When using Mode = ChangeColor, this allows you to specify the target color.
When using Mode = ChangeESMV, this allows you to specify the target emission/smoothness/metallic/visosity.
When using Mode = ChangeColor, this allows you to specify which channels in the target color will be used.
The region modification strength will be multiplied by this amount.
After this component applies its changes to the scene, it will invoke this event.
Float = The strength of the modifier application.
If this modifier's mode is set to AddFluid or RemoveFluid, do you want to track how much this modifier adds or removes?
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).
This works like OnFluidDepthDelta, but the delta value will be the fluid volume in meters cubed.
This stores all activate and enabled FlowModifier instances in the scene.
This method will apply this region to all volumes in the scene using the specified Strength value.
This allows you create a new GameObject with the FlowModifier component attached.
This allows you create a new GameObject with the FlowModifier component attached.
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.
The container whose Volume must be greater than 1 for the sibling FlowModifier to be enabled.
This component will modify the sibling FlowModifier.Strength setting based on the speed this GameObject moves.
When this GameObject's speed matches this value, the FlowModifier.Strength will be set to the specified Strength value.
The FlowModifier.Strength will be set to this value when this GameObject's speed matches the SpeedMax value.
If the speed exceeds SpeedMax, should the calculations be clamped, as if the speed wasn't exceeded?
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).
This component marks the current GameObject as an object that can block.
The center of the object in local space.
The radius of the object in local space.
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.
This component allows you to invoke an event when this component gets disabled.
The event that will be invoked.
This component allows you to invoke an event when this component gets enabled.
The event that will be invoked.
This component allows you paint the specified fluid prefab under the mouse/finger as it drags across the screen.
The finger/mouse/key that must be pressed for the painting.
The modifier that will be applied to the fluid simulations.
If you need to display some sort of visual while this component is drawing, you can set it here.
The scene layers under the finger/mouse that this component will raycast. The spawned prefab will be placed there.
The maximum distance of the raycast.
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.
The fluid simulation this component will render particles for.
This allows you create a new GameObject with the FlowParticles component attached.
This allows you create a new GameObject with the FlowParticles component attached.
This component randomizes the settings of the specified FlowFluid component.
This component automatically activates when enabled, or when you manually call the Randomize method.
The fluid whose settings will be modified.
The possible colors.
The min/max emission value.
The min/max smoothness value.
The min/max metallic value.
The min/max viscosity value.
This method will immediately randomize the Target fluid settings.
This component samples the ground and fluid data at the current transform XZ position.
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.
This allows you to control the weight this sample gives to the FlowFloat component's buoyancy calculation.
The radius of this sample.
The fluid depth must be above this value for it to be considered to be there.
This event is invoked after the fluid has been sampled.
This event is invoked after the fluid has been sampled, if it has a depth of 0.
This stores all activate and enabled FlowSample instances in the scene.
This tells you the previously sampled ground height in world space.
This tells you the previously sampled wetness height in world space.
This tells you the previously sampled fluid depth in meters.
This tells you the previously sampled fluid surface normal in world space.
This tells you the previously sampled fluid velocity in world space.
This tells you the previously sampled fluid color.
This tells you the previously sampled fluid emission.
This tells you the previously sampled fluid smoothness.
This tells you the previously sampled fluid smoothness.
This tells you the previously sampled fluid viscosity.
This tells you the previously sampled fluid foam.
This tells you the previously sampled fluid's Custom1 value.
This tells you the previously sampled fluid's Custom2 value.
This tells you the previously sampled fluid's Custom3 value.
This tells you the previously sampled simulation 0..1 overlap.
This tells you if this component has sampled the scene.
This tells you the height of the fluid surface in world space.
This will clear any sampled data.
This allows you create a new GameObject with the FlowSample component attached.
This allows you create a new GameObject with the FlowParticles component attached.
This component samples an area of fluid and gives you information about it.
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.
This allows you to set the size of the modifier boundary in local space.
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.
This allows you to choose which channel from the Shape texture will be used.
Should the modifier's boundary be centered, or start from the corner
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.
The time between each fluid sample in seconds.
This tells you the previously sampled total fluid depth in meters.
This tells you the previously sampled fluid volume in meters cubed.
This tells you the previously sampled deepest fluid pixel coordinate.
This tells you the previously sampled deepest fluid depth in meters.
This tells you the previously sampled deepest ground position in world space.
This tells you the previously sampled deepest fluid surface position in world space.
This tells you if this component has sampled the scene.
This event is invoked after the fluid has been sampled.
This allows you create a new GameObject with the FlowSample component attached.
This allows you create a new GameObject with the FlowParticles component attached.
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.
The deepest sampled fluid depth must be at least this depth in meters for the events to invoke.
This event is invoked after the fluid has been sampled.
Vector3 = The position of the ground at the deepest sampled fluid depth.
This event is invoked after the fluid has been sampled.
Vector3 = The position of the fluid surface at the deepest sampled fluid depth.
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.
This event is invoked after the fluid has been sampled.
Float = The total volume in meters cubed.
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.
This allows you to specify all the possible fluid types you want this component to be able to detect.
Triggers allow you to fire an event when a specific fluid has been sampled by this component.
The maximum 0..1 difference in each RGBA channel value.
The maximum 0..1 difference in emission value.
The maximum 0..1 difference in smoothness value.
The maximum 0..1 difference in metallic value.
This allows you to control how important the color matching is relative to the other fluid properties.
This allows you to control how important the emission matching is relative to the other fluid properties.
This allows you to control how important the smoothness matching is relative to the other fluid properties.
This allows you to control how important the metallic matching is relative to the other fluid properties.
This event is invoked after the fluid has been sampled.
After OnSampledFluid is invoked, the newly sampled fluid will be stored here.
This component allows you to create a region where the fluid simulation occurs.
This allows you to set the size of the fluid simulation along the X and Z axes in local space.
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.
The amount of fluid columns used in the simulation will be multiplied by this, giving higher detail.
Should the fluid boundary be centered, or start from the corner at 0,0?
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?
If you disable this, then the simulation will stop/freeze in time.
Simulate ground wetness?
When the ground is dry, the water table will be this many meters below ground.
The wet areas of the scene will dry at this speed in meters per second.
This allows you to define which layers will be raycast to find the ground heights.
This allows you to specify the minimum ground height.
This allows you to specify the maximum ground height.
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.
0 = No radius.
1 = Radius matches column separation.
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.
The speed of the foam removal where 1 means it takes 1 second.
If you enable this then you will be able to spawn particles into this fluid simulation.
This allows you to set the maximum amount of particles that can be simulated.
The particles will be slowed down by this amount of atmospheric drag.
If you enable this then the fluid simulation will store up to three additional custom fluid properties.
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.
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.
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.
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.
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.
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.
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.
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.
By default, high viscosity fluids will stick to the ground. If you don't want this behavior then you can increase this value.
The gives you control over the rate of acceleration of a fluid column, where a higher value means it accelerates faster.
The gives you some control over the fluid simulation speed.
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.
The stores the column ground height and wet height.
This stores the column velocity.
This stores the column fluid depth.
This stores the column fluid red, green, blue, alpha.
This stores the column fluid emission, smoothness, metallic, viscosity.
This stores the column fluid foam, custom1, custom2, custom3.
This stores the particle velocity and age.
This stores the particle position and life.
This stores the particle fluid depth.
This stores the particle fluid red, green, blue, alpha.
This stores the particle fluid emission, smoothness, metallic, viscosity.
This stores the particle foam, custom1, custom2, custom3.
This tells you where the fluid begins in local space.
This tells you where the fluid ends in local space.
This tells you how many columns are used to simulate the fluid along the XZ axes.
This tells you the distance between each columns on the X and Z axes.
This stores all activate and enabled FlowSimulation instances in the scene.
This will update the ground heights for the whole fluid via raycast.
This allows you to add one particle to the fluid simulation.
This will update the ground heights for a specific region of the fluid via raycast.
This will find the closest simulation to the specified world point, if the current one doesn't exist.
This tells you the 0..1 percentage the specified 2D circle overlaps this simulation on the XZ axes.
This tells you if the specified 2D point overlaps this simulation on the XZ axes.
This allows you create a new GameObject with the FlowSimulation component attached.
This allows you create a new GameObject with the FlowSimulation component attached.
This component allows you to create a snapshot from a simulation, and later reset the simulation back to that state.
The simulation that will be snapshotted.
This allows you to set the filename used when saving and loading from file, where {0} is the simulation GameObject name.
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.
This method reverts the fluid data to the previously stored snapshot.
This method stores a persistent snapshot of the fluid data to this device.
This method reverts the fluid data to the previously stored snapshot.
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.
This method copies all fluid and particle data from the specified simulation into this class as raw data.
This method copies all raw fluid and particle data from this class into the specified simulation.
This component allows you to invoke an event when this component gets enabled.
The prefabs spawned by this component.
This event will be invoked when this splash is applied somewhere.
Float = Strength
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.
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.
The amount of particles that will be spawned when the splash strength is 0.
The amount of particles that will be spawned when the splash strength is 1.
This component adds a splash to the fluid simulation if the current object crosses the fluid surface.
The submersion value will be read from this sample point.
The splash effect that will be spawned when a splash occurs.
The splash effect size will be multiplied by this.
The splash effect strength will be multiplied by this.
The object's submersion value must change by this much for a splash to occur.
This disables the splash effect for some time, allowing you to use stronger strength values without having the object cause itself to splash forever.
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.
The simulation this component will render.
Should this component draw the outer edge/sides of the water?
This allows you create a new GameObject with the FlowSurface component attached.
This allows you create a new GameObject with the FlowSurface component attached.
This component applies continuous torque to the sibling Rigidbody component.
This allows you to specify a positional offset relative to the Target.
The frame of reference the torque will be applied in.
The force mode the torque will be applied using.
This component allows you to trigger an event when the specified FlowSample meets the criteria.
The trigger will be calculated using this sample.
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.
The world space depth.
Has the specified Criteria been met?
This event will be invoked when the criteria is met.
This event will be invoked when the criteria is no longer met.
This will automatically reset the Sample based on any child GameObjects that contain a FlowSample.
This will immediately update the trigger criteria.
This allows you create a new GameObject with the FlowTrigger component attached.
This allows you create a new GameObject with the FlowParticles component attached.
This component allows you to trigger an event when the specified FlowSampleArea meets the criteria.
The trigger will be calculated using this sample area.
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.
The minimum fluid volume in meters cubed.
The maximum fluid volume in meters cubed.
Has the specified Criteria been met?
This event will be invoked when the criteria is met.
This event will be invoked when the criteria is no longer met.
This will automatically reset the SampleArea based on any child GameObjects that contain a FlowSampleArea.
This will immediately update the trigger criteria.
This allows you create a new GameObject with the FlowTrigger component attached.
This allows you create a new GameObject with the FlowParticles component attached.
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.
The simulation this component will render.
The object that will view the underwater scene.
None/null = Main Camera.
The amount of tiles across the X and Z axis.
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.
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.
This allows you create a new GameObject with the FlowUnderwater component attached.
This allows you create a new GameObject with the FlowUnderwater component attached.
This component sends wetness data to all materials on the current GameObject.
The simulation whose data will be set on this GameObject's materials.
None/null = Use the closest simulation.
The wetness data will be applied to all materials in these renderers.
The wetness data will be applied to all these materials.
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 Make The Ground Look Wet?
How Can I Make Fluids React to Scene Changes?
How Can I Detect When Fluid Appears Somewhere?
Why Does the Fluid Ignore My Object?
Can I Request New Demo Scenes?