Dynamic Water Physics 2 [Released]

Thanks for that. It is exactly what happened. If you check my post history I have been replying to the forums at least four times a day but never got a single notification from this thread. But yes, since I have push notifications for email that is always the best bet.

Email is nwhcoding@gmail.com but the above one works too.

To get the character to work attach primitive shapes on it’s limbs and torso, this way it will be excellent performance wise and get around the skinned mesh limitation. It really is best for ragdolls (e.g. somebody drowned and is now floating) but swimming might be possible too as long you fake it a bit by applying external force. It is theoretically possible to make the character swim just by movement alone but I do not see it being easy to tune.

1 Like

Hi,

I am trying to get DWP2 to work with Crest URP, but my ship is not reacting to the waves. It just swings a little around the average water hight. The console reads “DWP2: Using Crest”, so the setup seems to be correct. I also played with the weight of the ship, but no effect.

1 Like

Crest developer and I are working on this right now. It seems to be an issue with water height reporting with the new Crest API. Expect an update in a few days.

1 Like

Update has just been submitted to the asset store (version 2.1.3). It should be approved and visible within 48 hours.

Changes:

  • Fixed Crest water height queries.
  • Improved performance when using Crest or Lux Water.
  • Crest and Lux demo scenes.
  • Moved documentation to http://www.dynamicwaterphysics.com.
3 Likes

Thank you for the Crest water height fix!
By the way, I would like to know how to make boat or any floating object slide down a big water slope (Crest wave bump)? For instance, you have a tall tsunami wave and a boat not moving on the front steep face:
currently: boat not moving and just remains at water height even with high pitch.
expected: the boat should start sliding downward.

Would it be possible to get the average normal of boat intersecting the water? Then simple trigonometry to add fake gravity force to move the boat at some angle → higher the pitch angle, faster the boat moves depending of the cross section (boat moves faster forward but not sideways)

Hello,
I have noticed that Crest has added velocity API that is identical to the height API, and DWP2 already has support for water velocities so integrating this into DWP2 will hopefully solve the problem and increase the quality of the interaction with water. I will add this in the next update, although I can not say for sure when it will be out.

1 Like

Dynamic Water Physics 2 now has Discord! NWH Coding

2 Likes

Dynamic Water Physics 2 is getting a larger update. The focus will be to improve usability (better editor, easier debugging, etc.) and I will be porting the input code from NWH Vehicle Physics 2 over to DWP2 since it is much better. There were a few requests to improve input so here it is. Check out the NVP2 docs to see what you can expect: Setup:Input [NWH Vehicle Physics 2 Documentation]

Also, I will be looking into R.A.M. integration and other issues that were discussed here and on Discord since the last update.

7 Likes

So does this mean that DWP2 and NVP2 will play nicely together and make switching from car to boat an easy process? :slight_smile:

No. :smile:
But should not take more than a few minutes to rig this up.

1 Like

Sounds good, when you get it done, please give us the details of how to do it.
Looking forward to it! :slight_smile:

v2.2 is getting a whole WaterDataProvider redesign. These will be MonoBehaviours in the future, with no preprocessor directives and tag juggling. Add a script to your water and press play. Really, the way it should have been from the start. To get around errors when the water script (such as Crest) is not present the unused water data providers will have .cs.txt extension so that they are still viewable but do not get compiled.

4 Likes

This will happen after all as I have unified the Camera code to work across assets and not be vehicle specific. All the NWH vehicles from now on will inherit form a base class Vehicle which holds common data to all types of vehicles. This will reduce the code duplication across assets by a lot.

1 Like

Excellent work!!
Very good news!
Thank you!

In the future NWH Vehicle Physics 2 and Dynamic Water Physics 2 (and a possible future asset) will share the same ‘common’ code. This includes cameras, parts of input (related to cameras and scene), first person controller, NUI (NWH’s editor drawing framework), vehicle changing and a few other scripts. This will remove code duplication between those assets and improve on development times for both. As a side bonus switching between cars and boats will work if those are in the same scene without any need for code modification.

3 Likes

Thanks so much!
You are making our lives easier :slight_smile:
Much appreciated!

In the future NWH Vehicle Physics 2 and Dynamic Water Physics 2 (and a possible future asset) will share the same ‘common’ code. This includes cameras, parts of input (related to cameras and scene), first person controller, NUI (NWH’s editor drawing framework), vehicle changing and a few other scripts. This will remove code duplication between those assets and improve on development times for both. As a side bonus switching between cars and boats will work if those are in the same scene without any need for code modification.

3 Likes

I have managed to improve the performance of DWP2 by as much as 300% over the past few days, amongst other things that I will list here when they are fully implemented. 2.2 should be a great update :slight_smile:
Not that the previous version was not already heavily optimized.

Photo of the profiler that I used to showcase DWP2 2.1 performance in the asset store:

Same scene, same number of triangles and with “High Resolution Water Queries” enabled at that in the upcoming version:

5 Likes

A small announcement: if you are using Crest make sure to enable Vsync in your project. There seems to be an issue when queries are sent to Crest at different rate than the graphics update which is a bug with Crest query system and was confirmed by Crest dev, Huw Bowles. So if FixedUpdate is running at 50Hz and Update at 300Hz/FPS Crest will have issue with returning queries and will sometimes take up to few seconds to return anything. Enabling Vsync mitigates this issue and is the only solution until the bug gets fixed in Crest.

On a more positive note DWP2 now supports water normal queries. In v2.2 Crest will therefore support water heights, water flow and water normals making the simulation more realistic when dealing with moving water, such as this whirlpool. White spheres are water positions, yellow lines water normals and red lines water velocities.

4 Likes