User Tools


Water Assets

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.

Flat Water Assets

FlatWaterDataProvider is 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.
  • Attach a Collider (e.g. SphereCollider) to the same object.
  • Tick Is Trigger and adjust the radius/size to cover the water area. Use near infinite to cover the whole level.
2020/07/16 13:50 · Aron Rescec

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.

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. Find the GameObject containing the OceanRenderer component.
  2. Attach CrestWaterDataProvider to the object.
  3. Attach SphereCollider to the object and tick Is Trigger (any collider can be used).
  4. Set the radius/size of the collider to cover the play area. This can be set to near infinite if the ocean is to cover the whole world.

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.
2020/07/16 13:41 · Aron Rescec

Lux Setup

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


Lux Water supports water heights.
WaterDataProvider should be attached to LuxWater_WaterVolume.

Setup

  • Rename [AssetName]WaterDataProvider.cs.txt to [AssetName]WaterDataProvider.cs.
  • Attach the [AssetName]WaterDataProvider to the GameObject containing the script used to render the water.
  • Attach a Collider (e.g. SphereCollider) to the same object.
  • Tick Is Trigger on the Collider and adjust the radius/size to cover the water area. Use near infinite to cover the whole level.
2021/11/01 10:40 · Aron Rescec
2020/07/16 13:41 · Aron Rescec

River Auto Material (R.A.M.)

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, meaning that the setup steps are the same.

Water Data Provider Setup

  • Rename RAMWaterDataProvider.cs.txt to RAMWaterDataProvider.cs.
  • Attach the RAMWaterDataProvider to the GameObject containing the script used to render the water.
  • Attach a Collider (e.g. SphereCollider) to the same object.
  • Tick Is Trigger on the Collider and adjust the radius/size to cover the water area. Use near infinite to cover the whole level.

Water Setup

  • Make sure that the RAM water 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.
2020/07/16 15:01 · Aron Rescec

CetoSetup

Ceto demo scene with DWP2.
Example Ceto setup.

WaterDataProvider should be attached to Ocean.

Setup

  • Rename [AssetName]WaterDataProvider.cs.txt to [AssetName]WaterDataProvider.cs.
  • Attach the [AssetName]WaterDataProvider to the GameObject containing the script used to render the water.
  • Attach a Collider (e.g. SphereCollider) to the same object.
  • Tick Is Trigger on the Collider and adjust the radius/size to cover the water area. Use near infinite to cover the whole level.
2021/11/01 10:40 · Aron Rescec
2020/07/16 15:38 · Aron Rescec

Ocean Nex Gen

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

  • Rename [AssetName]WaterDataProvider.cs.txt to [AssetName]WaterDataProvider.cs.
  • Attach the [AssetName]WaterDataProvider to the GameObject containing the script used to render the water.
  • Attach a Collider (e.g. SphereCollider) to the same object.
  • Tick Is Trigger on the Collider and adjust the radius/size to cover the water area. Use near infinite to cover the whole level.
2021/11/01 10:40 · Aron Rescec
2020/07/16 15:10 · Aron Rescec

Suimono

Suimono demo scene with DWP2 added.
Example Suimono setup.

Suimono supports water height queries only. WaterDataProvider should be attached to SuimonoModule.

Setup

  • Rename [AssetName]WaterDataProvider.cs.txt to [AssetName]WaterDataProvider.cs.
  • Attach the [AssetName]WaterDataProvider to the GameObject containing the script used to render the water.
  • Attach a Collider (e.g. SphereCollider) to the same object.
  • Tick Is Trigger on the Collider and adjust the radius/size to cover the water area. Use near infinite to cover the whole level.
2021/11/01 10:40 · Aron Rescec
2020/07/16 14:48 · Aron Rescec

Stylized Water 2

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.
  • Add a Collider (e.g. SphereCollider) to the same object and tick Is Trigger. Set the radius to cover the play area.
  • You will have to assign the water material you are using in the scene, since this script requires to know what kind of parameters are used for the waves.
2021/06/08 14:19 · Aron Rescec

KWS

KWS support is under development.

2021/07/12 10:42 · Aron Rescec