WaveMaker - Wave simulation asset Official Thread

THIS IS THE OFFICIAL DEVLOG THREAD OF WAVEMAKER ASSET. WATCH IT TO GET NOTIFIED OF NEW POSTS (top right on this very message)
There are also a YouTube channel that you can subscribe to, a bug tracker and find much more detailed feature list and info in the official website:
http://wavemaker.lidia-martinez.com


Hi all!
After a long time working on this, finally I release WaveMaker to the public.

https://www.youtube.com/watch?v=5-vAnfR-Plo

In case you have questions (what it is, what can I do with it, and what I shouldn't, etc) most of them are answered in the official website:

--> Find tutorials, more tests and videos, F.A.Q , detailed info, bug tracker and more in the Official website

--> Or you can directly visit the asset page (affiliated link, thanks!)

You can also send me suggestions over here or add them in the bug tracker, or send me an email. That way I will know what you need in your project and make it happen. Please let me know your thoughts!.

Since it took a while to get a validation, I also uploaded version 1.1, which includes a huge improvement on efficiency, even when it is still non-multithreaded and on CPU. I created a video so you can see what it means and detailed information about it in the profiler.


I also created a fast test using Unity Chan free model, with different resolutions and parameters. I'm working on a tutorial so that you can see how I did this, and how fast and easy it is to adapt your scene to use WaveMaker.

If you thought the UE5 demo released not long ago showed a "not very good looking" water simulation on the ground... well... you can now do something better with this asset :)


Thanks!

3 Likes

Hi everyone. I’ve been very busy during the quarantine working on new features for WaveMaker!

Here are all the tutorials available for V1.0 and V1.1. I’d love to have your feedback! It’s been viral in Reddit but I’d love to know what you think in the forums. I’ll make this the official news thread of WaveMaker too.

To test the simulation I followed the suggestion of a user to create a Double Slit Experiment . The goal of this experiement is to see that when waves from both sides collide they start neutralizing generating interesting patterns.

Check it out!


more about it :
https://en.wikipedia.org/wiki/Double-slit_experiment

Here's the experiment in real life!

https://www.youtube.com/watch?v=Iuv6hY6zsd0

This is the upcoming huge improvement on the asset : Buoyancy! (floating forces).

I had to give the option to use buoyancy instead of velocities as a new simulation mode.

You can choose the depth of the simulation, the strength, damping, etc, of the forces. This will be used for only horizontal surfaces that look like water.

https://www.youtube.com/watch?v=VztROBp564c

1 Like

Gradient calculation is an important mathematical tool for these kind of simulations to know more about the shape of the surface and apply more effects.

I'm using this to improve interaction between floating objects and waves coming from other objects, something that some users noticed that was missing.

https://www.youtube.com/watch?v=pRRLSGzqeqA

This is a WIP video of the upcoming v1.2 of WaveMaker, coming with the new Buoyancy model in case the velocity based model is not for you and you want to generate waves using objects and want the waves to affect the object (what is called Two Way Coupling).

This is a problem I'm solving right now that arises due to the discretization of the surface (grid - heightfield based). I wanted to keep it all in CPU and use Jobs and Burst to improve performance in the next version of WaveMaker (1.3), but I'll have to spend some time moving these calculations to a shader instead.

https://www.youtube.com/watch?v=gtNkq5rP6vc

Here comes another DevLog for version 1.2. Let me explain a little bit :

This is a preview video. v1.2 is taking a little long than expected due to the lack of efficiency while working on the very important Buoyancy (floating objects) feature, requested by many. In order to fix problems depicted in previous uploaded videos that you can watch in the previous posts, I had a massive increase of miliseconds use due to the use of Raymarching instead of raycasting, in order to soften the edges of the interaction of the objects and the surface and avoid the flickering you can see.

So I decided to, before than expected, move all code to multithreading - jobs - burst.
This is the result of the surface simulation, the heavy part of the code (no interaction and some features disabled for now). I chose 60x60 resolution in this example in order to compare it to the official v1.1/1.2 video, that shows an efficiency of around 1ms per surface (1.2 added the feature of sleeping surfaces, so, unless all of them are simulating, it will stay around that, as you can see in the Unity Chan integration video).

With this improvement, it returns 600 to 1200 fps, and taking around 0.1ms. That’s a huge 10x improvement of efficiency.

With maximum resolution (for now) 256x256 = maximum allowed mesh size 56k vertices, simulation takes around 5ms with version 1.1, which was way too much (also, way too much resolution). With this improvement, it takes 0.2ms, mainly the simulation part, so the improvement is extreme (x20) for big resolution surfaces, allowing scenes to use huge surfaces. And it will get better.

This had to be done. The only problem is that it adds a Jobs/Burst requirement to the package that had to come eventually and I will probably have to find a woraround to be able to let people use WebGL, hopefully I manage to get it working.

Thanks for following updates. Don’t forget the asset has an official website, some live demos to play with, a bug report app and a feature request app too. —> http://wavemaker.lidia-martinez.com

Wow!!! Que belleza! I neeed to try this! My game is water based and this is beautiful work! I need to get this. Any limitations? Will it work with “stylized water shader?” Actually it should since he posted this asset on his thread.

Thanks a lot. I'm glad you find it useful. I suggest you to watch this thread, because many updates will come up in the following weeks. Right now I'm working on buoyancy as you've seen in the previous posts.

I've been talking with the creator of that shader, he made a workaround and I think you will have to talk with him. He had to do some changes. I'm talking to several shader creators to adapt my asset, just because most of the water shaders are based on a flat plane. The wavemaker asset modifies the flat mesh itself, so any shader that uses normals will work. These shaders, on the other hand, generally don't use the plane normals, but instead generate their own.

Next good features would be to allow the mesh to store more information on the mesh so that shaders can work with it. I should make guides to adapt them to my asset. That's definitely something that I need to help people with.

Any chance you are still gifting this? I would love to evaluate it.

I’m not giving it away right now, but thanks for the offering. Sorry for that.

It’s fine. I will most likely buy this soon anyways. Looks great. I just need to make sure it’ll work.

Hi, is it support mobile devices? if it does what about the performance on mobile, thankss

Hi there! It supports mobile devices. It doesn’t use any GPU for now, and the current version doesn’t have any requirements or packages needed. About the performance, I’ve been working on v2.0 for a while now and I haven’t tested it that much or generated any reports. I can work on that a little bit and let you know what I found out. The new version is upcoming and I’m spending all time on that!

Just in case somebody is wondering about the same thing: The user wrote me in private and he used the asset and it worked fine for him. I’m still working on the new version so I will generate reports and a lot more resources after I finish that. :slight_smile:

1 Like

https://www.youtube.com/watch?v=QFtK4QXwDmQ
This is a massive update. It's so massive that I had to literally rewrite the whole asset from the ground up, took 6 months, stalling any other development or improvement, and made me call the upcoming version v2.

What changed?
Fist, It is now implemented nearly completely in Burst&Jobs, (multithreaded instead of single threaded in CPU).
Apart from improving efficiency a lot, it was needed in order to add buoyancy (floating forces) due to the amount of computation it required from the first tests. It is a simple but pretty realistic model, but depends a lot on the resolution of the surface and the properties you set. Needs a lot of testing.
Problems mentioned in the previous posts regarding unstable water around floating objects due to the "discretization of the surface" still happen, but that will be fixed in the next update now that I have multithreaded code and using raymarching or any other method like multisampling will allow for a smoother interaction.
Also, wave push effect mentioned by some users, not available in the velocity based simulation (previous) will be available in buoyancy based simulation.

Compatibility with the older version? The code has absolutely changed for the better, that it's why I moved to v2. If you used the API it will probable need to be updated a little but. Let me know when the time comes, and I will help you gladly. The previous simulation method, which is velocity based, will be restored and shown as an option in the settings instead of buoyancy based, which is the default method now.

When will v2 be available? It will come asap, I don't have an ETA since it took 6 months to do this and I lost track of everything else, but I'm restoring all to how it was, give the UI an upgrade, test and add everything that is left. But it will not take as much as it did. I would love to have this done in maximum a couple of months, probably less. I'll let you know.

Future versions plan. From now on efficiency improvements will come and it will get faster and better. There's only room for improvement here!. I had many bottlenecks that are still there and need more work (basically write physics engine methods myself instead of using Physx's ones, because they are too slow! ). Also, some of the small features asked by the users plus more examples to show how this asset works are seriously needed. So I'll be working on that soon.


I was asked in Reddit why I didn't upgrade to Compute Shaders instead of using Jobs&Burst, which would allow a more flexible surface of liquid, (bigger, more efficient).

The first reason is very critical:

  • There would be no two-way coupling : Objects floating would not affect the water and the water would not affect the object. If everything is calculated in the GPU, to affect Unity's physics system would require to get the information out of there, which means milliseconds wasted each frame. We don't have that luxury of miliseconds to spend. Compute shaders means EVERYTHING is done in the GPU. I would have to write a full physics engine on GPU to make this work and native physics could not be used.

Other reasons

  • Limitations on platforms of Compute Shaders. Some would be out of the game, which I don't really like.

  • Lack of time and resources.

Some other reasons I commented before:

"Yep. That would be another future update. But since compute shaders are not compatible with a lot of devices and platforms, I prefer to do this step by step and allow people to choose. The same way Obi simulation plugins, made in the company I founded, do. You have the choice of simple, burst, and compute.

I have some bottlenecks even for burst that I can't resolve because I'm using miltithreaded raycast functions made by unity instead of my own, because the results can't be used inside another job. Something else is that I will have to make my own RecalculateNormals() by hand instead of using the slow default method.

Some of the algorithms in fact are impossible to move to jobs right now, I would have to implement by hand most of the basic mathematical methods of physx in order to make most of the algorithms work in jobs, just because jobs don't allow the use of any UnityEngine methods, and add you can imagine, my time is limited. Constant updates are needed.

This one was a much needed cpu to miltithreaded upgrade, and the addition of buoyancy made it necessary. WebGL will not be supported probably now, and my live demos won't work, so I have to add a lot of code in order to let people choose both methods.

From now on, there's only room for improvement. It's pretty fast right now but it will get better and better."

1 Like

Oh wow. That looks stunning. Can’t wait to see how this turns out

This looks amazing! Very interested to see what v2 will be like to use.

I was curious about how this might work with non-square surfaces, such as curving rivers? My game has a lot of river stretches generated from splines. It would be amazing to have a current and collisions, even if 256 was the accuracy limit per length.

Good luck with the new version.

Sorry for taking this long to reply. That sounds like a great idea. It would have to be made out of patches… There’s no such functionality, as well as the “forced stream direction”. That sounds like a great suggestion and it’s pretty easy to do currently.

Let’s see if I can finish v2 these weeks.

Thanks for replying! I’m excited to see how this develops.