Water
Use the Water Master Stack to render custom physically based water Material in the High Definition Render Pipeline (HDRP). The Water Master Stack approximately models a volumetric water medium, and includes properties to render effects such as caustics, scattering, and refraction.
Create a Water shader graph
To create a Water material in Shader Graph, use one of the following methods:
To create a new shader graph, go to Assets > Create > Shader Graph > HDRP and select Water Shader Graph.
To modify an existing shader graph:
- Open the shader graph in the Shader Editor.
- In Graph Settings, select the HDRP Target. If there isn't an HDRP Target, go to Active Targets select the Plus button, and select HDRP.
- In Material, select Water.
To duplicate the default shader graph HDRP uses for water surfaces in the Game Object > Water Surface menu:
- In the Project window, go to Packages > High Definition RP > Runtime > RenderPipelineResources > ShaderGraph.
- Copy the
Water.shadergraph
asset, then paste the copy into your Assets folder.
See Water Shader Graph nodes for more information.
Contexts
This Master Stack material type has its own set of Graph Settings. Because of the relationship between settings and Blocks, this has consequences on which Blocks are relevant to the Graph. This section contains information on the Blocks this Master Stack material type adds by default, and which Blocks set properties for this Master Stack material type's Graph Settings.
For more information about the relationship between Graph Settings and Blocks, see Contexts and Blocks.
Vertex Context
Default
When you create a new Water Master Stack, the Vertex Context contains the following Blocks by default. All the Blocks are mandatory. If you remove any of the Blocks, the water shader graph doesn't work.
Property | Description | Setting Dependency | Default Value |
---|---|---|---|
Position | The object space vertex position per vertex. | None | CoordinateSpace.Object |
Normal | The object space vertex normal per vertex. | None | CoordinateSpace.Object |
UV0 | Water properties packed into a UV coordinate set for the vertex context. | ||
UV1 | Water properties packed into a UV coordinate set for the vertex context. |
Fragment Context
Default
When you create a new Water Master Stack, the Fragment Context contains the following Blocks by default:
Property | Description | Setting Dependency | Default Value |
---|---|---|---|
Normal World Space | The normal, in world space, for the material. | Fragment Normal Space set to World | CoordinateSpace.World |
Low Frequency Normal | The low frequency normal of the water surface. This is the normal of the water surface without high frequency details such as ripples. See Water system simulation for more information. | None | 1.0 |
Tip Thickness | The thickness of the water in a wave tip. | None | 0 |
Base Color | The base color of the material. | None | Color.grey |
Caustics | The intensity of the caustics. | None | 1.0 |
Smoothness | The material's smoothness. Every light ray that hits a smooth surface bounces off at predictable and consistent angles. For a perfectly smooth surface that reflects light like a mirror, set this to a value of 1. Less smooth surfaces reflect light over a wider range of angles (because the light hits the bumps in the microsurface), so the reflections have less detail and spread across the surface in a more diffused pattern. | None | 0.5 |
Alpha | The Material's alpha value. This determines how transparent the material is. The expected range is 0 - 1. | None | 1.0 |
Foam | The combination of the amount of foam and a foam texture. | None | 0 |