Table of Contents

Supported Water Assets

WaterDataProvider scripts are interfaces between the 3rd party water assets and Dynamic Water Physics 2. They tell the WaterObject where the water is.

! Assembly Definitions !

Due to inclusion of assembly definitions into this asset with v2.4 an additional step is required when setting up 3rd party water assets. The asset either needs to be referenced inside NWH.DWP2.asmdef or all the .asmdef (assembly definition) files need to be removed from DWP2. If the 3rd party asset does not include an assembly definition file one should be added manually to the root of that asset, or the .asmdef files need to be removed from DWP2.

If removing .asmdef files make sure to tick Project Settings > Player > Allow 'unsafe' code. This code will not harm your device, it just allows unmanaged memory access (i.e. pointers) which are used for performance optimization inside DWP2.

Steps to reference a 3rd party asset inside Dynamic Water Physics 2:

Flat Water Data Provider

FlatWaterDataProvider can be used for all flat water systems.
It can even be used with wavy water systems if the waves have 0 amplitude to improve performance (sometimes drastically as the water heights are always queried with wavy water system, even if there are no waves).

Setup
  • Attach FlatWaterDataProvider to the GameObject representing the water.
  • WaterObjects will now float at the water transform.y position.
2023/05/14 16:42

Crest Water Data Provider

Screenshot of demo scene for DWP2 with Crest.


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

Crest supports water heights, normals and flows.

Crest Import
  1. Download and import Crest and Crest-Examples from here. For HDRP and URP version check Unity Asset Store.
  2. Open Crest-Examples ⇒ Main ⇒ Scenes ⇒ main scene.
  3. Remove the existing boat from the scene.
Adding a CrestWaterDataProvider
  1. Add DWP_CREST to Project Settings > Player > Scripting Define Symbols.
  2. Find the GameObject containing the OceanRenderer component.
  3. Attach CrestWaterDataProvider to the object.
Adding a WaterObject
  1. Drag Racer prefab into the scene.
  2. 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.
2023/05/14 16:42

LUX Water Data Provider

Lux Water demo scene with DWP2.
Example Lux Water setup.


Lux Water supports water heights.

Setup
  1. Add DWP_LUX to Project Settings > Player > Scripting Define Symbols.
  2. Attach WaterDataProvider to LuxWater_WaterVolume.
2023/05/14 16:42

RAM Water Data Provider

R.A.M. demo scene with DWP2 added.
Example River Auto Material setup.

RAMWaterDataProvider supports water heights, normals and flow and it inherits from RaycastWaterDataProvider.

Setup
  • Add DWP_RAM to Project Settings > Player > Scripting Define Symbols.
  • Set up the scene as if using flat water, minus FlatWaterDataProvider.
  • Add RAMWaterDataProvider to the scene. It does not have to be attached to any specific object.
  • Make sure that the RAM object has a MeshCollider attached. This is required for Raycasts to work.
  • Assign Water Layer to the River Auto Material water. Assign Object Layer to all the WaterObjects in the scene. This is an important step as the script will disable physical collisions between the two layers to prevent the WaterObjects from sitting on top of the mesh collider that R.A.M. uses instead of interacting with water.
  • R.A.M. setup is ready to go.
2023/05/14 16:42

Ceto Water Data Provider

Ceto demo scene with DWP2.
Example Ceto setup.
Setup
  1. Add DWP_CETO to Project Settings > Player > Scripting Define Symbols.
  2. Attach WaterDataProvider to Ocean.
2023/05/14 16:42

Ocean Next Gen Water Data Provider

Ocean Next Get demo scene with DWP2.
Ocean Next Gen example setup.

Ocean Next Gen is supported but has not been updated regularly for over two years. Crest and Ceto will be better options.

Setup
  1. Add DWP_OCEAN_NEXT_GEN to Project Settings > Player > Scripting Define Symbols.
  2. Attach OceanNextGenWaterDataProvider to Ocean.
2023/05/14 16:42

SUIMONO Water Data Provider

Suimono demo scene with DWP2 added.
Example Suimono setup.
Setup
  • Add DWP_SUIMONO to Project Settings > Player > Scripting Define Symbols.
  • Rename SuimonoWaterDataProvider.cs.txt to SuimonoWaterDataProvider.cs.
  • Add SuimonoWaterDataProvider to the object containing SuimonoModule script.
2023/05/14 16:42

Stylized Water Data Provider

Setup

Unlike other WaterDataProviders, the one for Stylized Water 2 is included with the Stylized Water 2 asset instead of DWP2.

  • Set up the scene as per quick start guide for flat water, minus FlatWaterDataProvider.
  • Go to Help → Stylized Water 2, and click the “Install integration” button. Wait until scripts have finished compiling.
  • Add StylizedWaterDataProvider to the object containing OceanRenderer script.
2023/05/14 16:42

KWS Water Data Provider

Setup
  • Update the KWS Water first as there was an API change recently.
  • Add KWS_asmdef to NWH.DWP2 assembly definition references.
  • Add DWP_KWS or DWP_KWS_HDRP (depending on version used) to Scripting Define Symbols under Project Settings ⇒ Player ⇒ OtherSettings.
  • Attach KWS Water Data Provider to the GameObject containing Water System (this game object is named Water in KWS demos).

2023/05/14 16:42

Multiple Assets / Water Types

Multiple water types can be used in the same scene at the same time. This is achieved through triggers (Colliders with isTrigger set to true) attached to the same GameObject as the WaterDataProvider in question.
By default these colliders are created automatically on Awake and are set to cover the whole world. However, it is possible to use a WaterDataProvider just for a small part of the scene - such as a lake.

If there are multiple trigger volumes they will act as a queue, meaning the one that the object last entered will be currently active.