IBL Water Shader

Introduction

This shader is for water areas such as Sea, Lakes, Ponds and Rivers etc.

Moving water effect is achieved by two scrolling normal maps, with a noise map which masks them out and also scrolls.

By default it uses screen space reflections to help improve specular reflections and a depth map in the alpha channel to simulate water behaving differently at different depths. It can work as a transparent material which allows light from terrain underneath or an opaque material which does not and has some colour information baked into the albedo.

Note that screenspace reflection surfaces are calculated at load time. If you assign the IBL Water shader using the material editor you will not get SSR reflections until you reload the environment.

The depth map is used to control the shore, shallow and deep areas which set the normal intensity, "seabed" visibility and water clarity which effects the roughness of the water reflections. Additionally the depth information can be remapped to opacity output via the Opacity Effects options.

If you don't want to use a depth map, the whole surface can be configured with a single static set of parameters with optional transparency.

SSR reflection intensity can be configured to be a static amount and to take into consideration distance and how clear the water is.

The background mapper used in the SSR reflections must be defined in the mapper definition. You can find out more about this on the Reflection Mappers page.

Beneath are the technical definitions.

Shader Name 

L2IBLWATER

Configuration

Please note UV_A, UV_B, UV_C or UV_D refers to as specified in the gTexture slot in 3ds Max. There is a full explanation of this here.

Albedo Map

Albedo colour map with an optional alpha channel which can be used for opacity or depth of the water.

  • UV: UV_A, UV_B, UV_C, UV_D or WorldPlanar
  • Alpha: Options for Albedo Alpha Channel: Disable, Opacity mask or Depth Map.
  • Opacity Effects: Only available when using a Depth Map. This allows you to set the opacity of the material dependent on the depth of the water.

Noise Map

Two channel Noise Map, where red channel masks out normal map A and green channel masks out normal map B.

  • UV: UV_A, UV_B, UV_C, UV_D or WorldPlanar

Normal Maps

  • UV: UV_A, UV_B, UV_C, UV_D or WorldPlanar

General Configuration

  • Use SSR: Whether to use SSR or not. If not just the assigned static mapper is used.
  • Transparent Specular: Increases the strength of specular based on set opacity. Only enable this when using Alpha Blend on this material.
  • Distance Blend: Use Distance to blend to different normal and noise uvw. Suitable for large bodies of water.
  • Vertex Color: Disable, AlbedoMultiply. AlbedoOverlay, AlbedoMultiply (Mask by Albedo Alpha), AlbedoOverlay (Mask by Albedo Alpha)
  • Vertex Alpha: Disable, FakeShadows

Parameters

Base_Material

The Base Material parameter section allows the setting of static values when the map for one of the following is disabled in the Shader Configuration.

  • AO
  • Specular
  • Opacity

UV_Scale

This dialogue allows the scaling of the selected UV for any maps present.

UV_Scroll

This dialogue allows the adjustment of how fast these maps scroll. This is available for Noise and Normal maps.

Material_Adjust

This section allows the adjustment of final output of the material. 

  • AlbedoTint
  • NormalIntensity: Adjust how strong the normal map is applied
  • NormalShadowInflunce: Adjust the amount of influence the normal map has on shadows cast onto this surface.
  • FarLight: This sets how much direct light is received outside of shadow cascades. This is useful for ensuring indoor areas remain in shadow in the distance.

WaterParams

This section is only available when not using a depth map.

  • FloorVisibility: Strength of Diffuse Occlusion
  • WaterClarity: How clear the specular reflections are

Shore/Shallow/Deep

This section is only available when using a depth map. There are three points in the depth map that you can configure, and they allow the water shader to transition from shore to deep sea with different strength of effects. By default a value of 0 in the depth map is for the shore, a value of 1 (or 255) is for the deepest part of the water simulated.

  • Depth: Depth map point
  • NormalIntensity: Intensity of normal effects
  • FloorVisibility: Strength of Diffuse Occlusion
  • WaterClarity: How clear the specular reflections are

SSR

When SSR is enabled we can configure to fade out SSR reflections based on how clear the water is or the distance to that point.

  • Constant: The minimum strength of SSR reflections.

  • WaterClarity: Multiplier based on Water Clarity
  • Distance: Multiplier based on distance from viewer.

Opacity

When opacity effects are enabled we can configure based on the depth map the opacity.

  • minDepth: Depth minimum clamp point
  • maxDepth: Depth maximum clamp point
  • minOpacity: Opacity at minimum point.
  • maxOpacity: Opacity at maximum point.

UvDistanceParams

When Distance Blend is enabled, we can use this to use different UVW in the distance in order to break up tiling when far away. This is applied to the normal maps and the noise map.

  • uvScale: How much to stretch the UV by a further distance
  • uvScroll: Adjustment to scroll speed
  • minDistance: Minimum distance before we start blending to alternative UV
  • length: Further distance until we use use the complete scalars on the original values.

Textures

NameTypeDefault File TypesDescription
albedoMapSRGB (Alpha linear)alb or albaAlbedo colour map with an optional alpha channel which can be used for opacity or depth of the water.
noiseMapLinearmxTwo channel Noise Map, where red channel masks out normal map A and green channel masks out normal map B.
normalMapALinearnm


normalMapBLinearnm