Masking & Cutouts

Masking & Cutouts

KWS2 supports two main ways to create holes in the water surface — either visually in screen space (fast and simple using stencil buffer), or volumetric by modifying the actual water height (using Water Local Zones). These are typically used to exclude water inside boats, docks, underwater buildings, or terrain cavities.


1. Screen-Space Cutout (Mask Mesh)

This method hides water pixels under a special mesh, without affecting the physical water level. It’s ideal for small holes like boats or platforms.

How it works Pixels behind the mesh are discarded in the water shader (using stencil buffer). This is purely a screen-space effect — it visually hides water, but does not create a real volumetric gap.

How to use

  1. Create a mesh that defines the hole area (for example, the bottom shape of your boat).

  2. Assign a new material to it.

  3. Select one of the following shaders, depending on the active render pipeline:

    • KriptoFX/KWS2/WaterCutoutMask/Cutout_Builtin

    • KriptoFX/KWS2/WaterCutoutMask/Cutout_URP

    • KriptoFX/KWS2/WaterCutoutMask/Cutout_HDRP

  4. Place the mesh slightly below the water surface so that it fully overlaps the area you want to hide.

Notes

  • Works in screen space — the effect depends on the camera view.

  • Does not affect refraction, caustics, or underwater volume.

  • No additional performance cost (only the mask draw).


2. Volumetric Cutout (Water Level Override)

This mode physically lowers the water level within a defined volume, creating a real 3D cavity in the water surface. It’s perfect for docks, underwater structures with windows, or semi-enclosed areas.

How to use

  1. Create a Local Water Zone in the scene.

  2. Enable Override Height in the zone settings.

  3. Lower the zone height value to push the water surface down inside that volume.

The edges of the volume are rendered with smooth refraction and depth blending, making it appear like looking through glass walls.

Notes

  • Works in world space — the offset affects refraction, lighting, and caustics.

  • Currently supports only box-shaped volumes.

  • Higher GPU cost.


Last updated