WaterDataProvider scripts are interfaces between the 3rd party water assets and Dynamic Water Physics 2. They tell the WaterObject where the water is.
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:
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).
GameObjectrepresenting the water.
WaterObjects will now float at the water
Dynamic Water Physics 2 is compatible with Crest v10 or newer. Older versions have different API.
Crest supports water heights, normals and flows.
DWP_CRESTto Project Settings > Player > Scripting Define Symbols.
CrestWaterDataProviderto the object.
Racerprefab into the scene.
DWP: Using Crestand there are no errors or warnings.
DWP_LUXto Project Settings > Player > Scripting Define Symbols.
RAMWaterDataProvider supports water heights, normals and flow and it inherits from
DWP_RAMto Project Settings > Player > Scripting Define Symbols.
DWP_CETOto Project Settings > Player > Scripting Define Symbols.
Ocean Next Gen is supported but has not been updated regularly for over two years. Crest and Ceto will be better options.
DWP_OCEAN_NEXT_GENto Project Settings > Player > Scripting Define Symbols.
DWP_SUIMONOto Project Settings > Player > Scripting Define Symbols.
SuimonoWaterDataProviderto the object containing
WaterDataProviders, the one for Stylized Water 2 is included with the Stylized Water 2 asset instead of DWP2.
StylizedWaterDataProviderto the object containing OceanRenderer script.
Multiple water types can be used in the same scene at the same time. This is achieved through triggers (
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.
Colliderof any type (e.g.
SphereCollider) to the
Is Triggeron the collider.
WaterDataProviderto have the effect on.
If there are multiple trigger volumes they will act as a queue, meaning the one that the object last entered will be currently active.