User Tools


Water Assets

Flat Water Assets

To use a flat water asset with Dynamic Water Physics 2 just drag it into the scene and tag it Water. Objects will now float at the height the water is at (transform.position.y).
Any flat water asset can be used - such as Standard Assets water, AQUAS, etc.

WaterObject float in standard assets water.

Wavy Water Assets

When using DWP2 with any non-flat water asset expect some overhead. If you need to simulate a large number of triangles, untick High Resolution Water Queries option on WaterObjectManager. This will reduce resolution somewhat but increase performance.

DWP2 supports water shaders with waves. Currently supported are Crest, Ocean Community Next Gen and Lux Water. To use them with DWP2 set them up as you would flat water (previous section) and then under Edit > Project Settings > Player > Scripting Define Symbols add one of the following:

  • DWP_CREST for Crest
  • DWP_OCEAN_NEXT_GEN for Ocean Community Next Gen
  • DWP_LUX for Lux Water
  • DWP_SUIMONO for SUIMONO
  • DWP_CETO for Ceto Ocean
Notes
  • Make sure that the object containing the relevant script (Ocean Renderer for Crest, Ocean for Ocean Community Next Gen) is tagged ‘Water’.
  • There must be a WaterObjectManager component present in the scene.
  • If the wavy water asset is not supported it is possible to add support for it by extending WaterDataProvider class IF the asset in question can provide water height at the given point. Alternatively, you could send an email to nwhcoding@gmail.com with the request.

Crest Setup

Screenshot of demo scene for DWP2 with Crest.


Dynamic Water Physics 2 is compatible with Crest v10 or newer. Older versions have different API.

Here are the steps needed to set up DWP2 with Crest:

  1. Download Crest and Crest-ExampleContent from git (link).
  2. Import both into Unity.
  3. Under Edit ⇒ Project Settings ⇒ Player ⇒ Scripting Define Symbols add DWP_CREST. If a symbol already exists just separate them using ;, e.g.: UNITY_POST_PROCESSING_STACK_V2;CROSS_PLATFORM_INPUT;DWP_CREST.
  4. Open Crest-Examples ⇒ Main ⇒ Scenes ⇒ main scene.
  5. Remove the existing boat from the scene.
  6. Select Ocean object and tag it Water.
  7. Add WaterObjectManager to any object in the scene and make sure Query Water Heights is ticked.
  8. Drag Racer prefab into the scene.
  9. Press play. The boat will now float and follow the waves properly. If this is not the case check that the console states DWP: Using Crest and there are no errors or warnings.
2020/04/28 13:03 · Aron Rescec

Lux Setup

Screenshot of demo scene for DWP2 with Lux Water.


Here are the steps needed to set up DWP2 with Lux Water:

  1. Download Lux Water from Unity Asset Store. Unlike Crest, Lux Water is a paid asset.
  2. Import Lux Water into Unity.
  3. Under Edit ⇒ Project Settings ⇒ Player ⇒ Scripting Define Symbols add DWP_LUX. If a symbol already exists just separate them using ;, e.g.: UNITY_POST_PROCESSING_STACK_V2;CROSS_PLATFORM_INPUT;DWP_LUX.
  4. Open LuxWater ⇒ Demos ⇒ Scenes ⇒ 12 LuxWater Infinite Ocean Demo
  5. Select OceanPlane_500x500_subdiv50 object (child of Ocean_5x5 and Skirt) and tag it Water. It is not important what the object is called, just that the object containing Lux Water_Water Volume script is tagged Water so that DWP2 can find it.
  6. Add WaterObjectManager to any object in the scene and make sure Query Water Heights is ticked.
  7. Drag Racer prefab into the scene.
  8. Press play. The boat will now float and follow the waves properly. If this is not the case check that the console states DWP: Using Lux and there are no errors or warnings.
2020/04/28 13:06 · Aron Rescec