Stylized Water 2 – Underwater Rendering docs

Stylized Water 2 - Underwater Rendering (Extension)

Stylized Water 2 - Underwater Rendering (Extension)
Author: jonathan
Version: 1.0.3
Dated: 17 May 2021

1.Getting Started #

Base asset

At this point you should already have the Stylized Water 2 asset installed. The Underwater extension will import directly into its folder. Without this installed first, you’ll be posed with at least one unsolvable console error.

Refunds will not be issued failing to acknowledge that this is an extension asset (mentioned on the store page 4 times). An alarming amount of users buy only the extension, without owning the water shader.

The minimum version requirement of the Stylized Water 2 base asset is v1.1.3.

Initial set up

Ensure the water mesh(es) in the scene have the “Water Object” component attached to them.

To enable underwater rendering in a scene, go to Window → Stylized Water 2 → Set up underwater renderer.

Assign the material that is used in the scene and set the water level to match the Y-position (in world-space!) of the water mesh. If there is only 1 water object in the scene, the water material and level will be automatically configured for you.

A notification with quick-fix button will be displayed if any other set up is required.

You’re now set! The waterline and underwater fog will automatically render once the bottom of the screen touches the water.

Further notes

For the best visual quality, ensure Refraction and Reflections are enabled on the water material

Vertex density

In order to prevent cracks between the waterline and the water surface. The water mesh requires a decent vertex count (eg. 4 vertices per unit).

Under the Advanced tab on the water material, you can enable Tessellation to ensure the vertex density is always high enough near the camera.

Fog and large worlds

It’s important to understand that the underwater fog is based on scene depth. If the terrain abruptly ends, showing a void/skybox, the fog will appear as 100% dense there.

Consider taking this into account and ensure the boundaries of your world does not have any holes. Most open world games have a stretch of land that goes beyond the playable area.

Controlling setting through volumes

On the Underwater Renderer component there is the “Use Volume Blending” option for the fog. When enabled, these settings are ignored, and will be controlled through volume profiles instead. If no volume has any underwater settings, the default values are used

Using volumes works just like any other volume component. For usage instructions, see the Unity manual.

Future work

For the time being, ironing out any possible bugs or usability issues have priority, since it’s a new asset.

Upcoming:

  • Directional caustics support for versions older than Unity 2020.2
  • Option to use fast directional caustics (by reconstructing the required depth normals texture from depth)
  • Disable rendering when in prefab edit mode
  • C# API to change the water material and level more easily (this could be used in conjunction with triggers)
  • Refraction masking for objects between the camera and water, when viewed from below
  • Boundary rendering. Injects a hidden sphere into the fog, to avoid the end of the game world being visible in the distance.

Wishlist:

  • Camera entry/exit effects: Water washing over the screen when moving out of the water. And/or splashes as it enters the water. This all needs to be scalable and based on how fast the camera hits the water.
Yes No Suggest edit
Last updated on October 4, 2021
2 of 2 users found this section helpful
Suggest Edit