Rendering#

Injection Point#

By default, where Crest will render in the render pipeline is determined by the Surface Type on the material (either Opaque or Transparent). The Surface Type is set to Transparent by default, as opaque water is typically not required. Injection Point provides more options.

Before Transparency#

Preview

This feature is experimental, and it may have incompatibilities not listed here.

Overriding the injection point using Water Renderer ‣ Rendering ‣ Injection Point with Before Transparency will unlock more advanced rendering options, and can improve compatibility with other rendering features:

  • Available for other refractive objects (when Write Color is enabled)

  • Soft Particles support (when Write Depth is enabled)

  • Applying aquatic scattering correctly to transparent objects when underwater

Warning

Due to a limitation with Unity, when using this feature with BIRP, the water surface will not receiving lighting from additional lights, nor support advanced lighting features like light cookies.

Warning

Currently, this feature does not support MSAA when using HDRP.

Warning

Due to a bug with Unity, HDRP motion vectors are not compatible.

Integrate Water Volume (Shader Graph)#

Set the Injection Point to Before Transparent, which will render the underwater effect before the transparent pass. This will leave transparent objects without fog, which you can then use with our Shader Graph node Integrate Water Volume to conditionally apply underwater fog.

Additionally, this can exclude Unity’s own fog when underwater (for transparent and opaque).

Orthographic Projection#

Crest supports orthographic projection, but it might require some configuration to get a desired appearance.

Crest uses the camera’s position for the LOD system which can be awkward for orthographic which uses the size property on the camera. Use the Viewpoint property on the Water Renderer to override the camera’s position. Increasing the minimum scale (Water Renderer ‣ Level of Detail ‣ Scale) will help spread the detail out to make the water appear more uniform. Pick a minimum scale that looks best.

Adjusting the camera’s Y value is important in preventing a hard seam running across the surface. The camera’s height will need to be reasonable as per the size value.

Underwater only works with a positive near clip plane.

Motion Vectors#

Crest supports motion vectors which is often required for many rendering features like TAA, upscaling and even SSR.

These should be enabled by default, but to enable motion vector support:

Note

URP requires Unity 6. If you are using URP, and have upgraded from an earlier version of Unity to Unity 6, you will need to re-import the water Shader Graph from the package manager again for motion vectors to work.

Warning

Due to a bug in Unity, motion vectors for BIRP incurs an additional render pass of the water surface (on top of what is already required for motion vectors).

Post-Processing#

The water surface writes to the depth buffer, and supports copying the water from the depth buffer into the depth texture for post-processing effects like Depth of Field.

These should be enabled by default, but to enable depth write for post-processing:

  • On the water material, enable Surface Options ‣ Depth Write to set to Force Enabled

  • For BIRP and URP:

    • Enable Water Renderer ‣ Surface Renderer ‣ Write Depth. This will copy the depth buffer into the depth texture after the transparent pass (it could include more than just water)

Warning

Due to a limitation with Unity, when using this feature with BIRP, the water surface vertex shader needs to be rendered an additional time, thus incurring a more significant performance cost.

Soft Particles#

Soft particles use the scene depth to blend particles to avoid a hard cutoff where particles intersect with the scene. The water surface depth is not available when soft particles render, thus there will be a hard cutoff.

Preview

Please see the in-preview feature, Injection Point , for a proper solution to this problem.