Heightfield-based realtime fluid simulation on CPU.
Mesh properties updated real-time to work with lighting
Scene hierarchy agnostic
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.
Wave speed, damping and smoothing parameters. Substepping to avoid inestabilities
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
Buoyancy and drifting (floating forces)
Quality code, full 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 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.
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.
Noise and little waves are generated around floating objects moving slowly: This is due to aliasing on the surface. Since it is
based on occupancy of fluid volume, if a deep object enters a new grid cell, a little jump will happen. To smooth out the surface, use the smooth parameter of the wave
simulation parameters. To reduce noise, increase resolution or enable the cheaper Supersampling parameter that allows to throw X times more raycasts.
This problem will be reduced using more advanced methods in upcoming versions.
Colliders without interactors in the same layer are detected anyway when using Occupancy based interaction. Since I'm using Unity's feature to throw raycasts multithreaded,
objects in the same layer as the surface are detected. They will distrupt the actual detection of interactors, sometimes missing the detection of the correct ones.
So make sure "Num. Max of Overlapped Interactors" parameter takes care of those too and try to not introduce non-interactor colliders inside the volume. The parameter adds some extra hits underneath to avoid problems for now.
You can see the hits attaching the WaveMaker Debugger component to the surface and enabling the display of hitting rays in the settings.
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.
v1.0 Initial features
v1.1 Efficiency improvements. Added idle/rest status to reduce computation to a minimum (feature video)
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.
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