Unity 2019, 2020, 2021 and all rendering pipelines support. (2018 still supported but needs manual installation of required packages).
Heightfield-based realtime fluid simulation on CPU.
Mesh properties updated real-time to work with lighting
Scene hierarchy agnostic
Wave speed, damping and smoothing parameters. Substepping to avoid inestabilities
Simple interaction mode based on relative velocity for any shape or orientation of the surface
Advanced interaction mode based on occupancy of liquid volume for more advanced features on horizontal surfaces like Buoyancy and drifting (floating forces).
Arbitrary surface position and rotation, length and width
Areas can be fixed manually or automatically to ignore them and allow waves to "hit" on them
Quality code, fully documented API and C# source included. Assemblies and namespaces used everywhere.
Heavily multithreaded code written with Jobs and Burst, with very small CPU cost
Idle/rest status of surfaces to reduce computation to a minimum
Many example scenes and create menu shortcuts included
How to install, docs, tutorials, live demos
No breaking waves. (unless researchers or I come up with a good idea): This method is based on heighfields so that means there is only one height
per cell of surface. A breaking wave would have more than one height per cell.
Open borders are still not perfect. Even when you don't fix the borders of your surface, a percentage of the wave will be returned. I'm still working on it.
Mesh colliders are not supported. Since I have to create my own colliders for some operations, a mesh collider would be too slow for the current efficiency of the system.
Several surfaces can't be connected. The shape of the surface is rectangular and has a maximum resolution (56k vertices). This feature would allow us to be more creative but right now
the only way to approach this is to create a bigger surface, hide parts using your own transparent materials and fix cells that you don't want to simulate, making it more efficient.
In the velocity based interaction mode, small waves appear even when both interactors and surface are moving together: Relative movement between
a surface and an interactor is used to generate waves. Translating both toegether does not generate waves. However, if both are rotated together under
the same parent a little wave generation cannot be avoided. Sadly, this is due to the lack of precission of the calculation of the angular velocity for both objects.
A solution that would make this system less flexible would be to associate each interactor with each surface, and calculate the velocity of the interactor with
respect to the surface, but this will not be done unless you have a good reason to share with me.
To be notified on updates, please follow the asset on the unity assetstore, follow me on social media or my blog (twitter, linkedin, blog). For more frequent information, follow the official forum thread.
v2.1 Replaced the whole detection system to remove the aliasing around objects moving in the new Occupancy Based Interaction mode, increased efficiency 2x in some situations. Increased some required package versions. Removed multisampling and 2018 support (manual install required)
v2.0 Moved to Jobs and Burst. Up to 3X fps speedup. Added Occupancy Based Interaction Mode plus buoyancy and drifting. Added requirement of Burst, Jobs, Collections and Mathematics packages. New documentation page.
v1.1 Efficiency improvements. Added idle/rest status to reduce computation to a minimum (feature video)
v1.0 Initial features
Technical and Implementation Details
Jobs, Burst, Mathematics and Collections packages required. A detailed list in the Learning Portal
Quality code, full documented API to get gradients, heights, and some other data from the surface and interactors. More data will be available soon.
Full C# source included. Assemblies and namespaces used everywhere.
Heavily multithreaded code written with Jobs and Burst, with very small CPU cost.
Two-way coupling simulation: Waves affect objects and objects generate waves at the same time.
Mesh normals updated real-time to work with lighting
Possibility to enable substepping to avoid inestabilities
Arbitrary surface position and rotation, length and width. It works in local space
A file with the resolution and fixed cells is stored and can be shared between surfaces
Fixed Update simulation time depends on type of interaction chosen. It can go from 0.01ms to 4ms in the worst case scenario (many floating objects occupying the whole surface). Generally it stays between 0.2 and 1ms.
Support and Contact
If you need help, or you are interested in some new feature that is not in the tracker, please contact me directly at unitysupport (at) lidia-martinez.com