Unity – Water Scenes

Improved water visuals are available in Unity via new capabilities in the HDRP render pipeline under Unity 2022.2 and Unity 2023.1. There is a package of several sample scenes available that can be included in a project as a basis for customisation, and also a complete “WaterScenes” Unity project with Island, River and Pool scenes

Unity WaterScenes - The Island Unity WaterScenes - The Island

WaterScenes – The Island

This scene use an infinite water surface to simulate the ocean. In addition, this scene uses water deformers and foam generators to improve the visual around the shoreline. There are also examples of how to use custom render textures to generate water deformers.

In play mode a 3rd Person controller is used to visit the island. Keybord controls:

    W/Z or up arrow: forward
    S or down arrow: backward
    A/Q or left arrow: left
    D or right arrow: right
    Space: jump
    A game pad can be used too.

WaterScenes – The River

This scene use instanced quads for the water surface in addition to a current map to simulate the flow. In play mode there are 2 fix cameras. TAB key is used to switch between them.

Unity WaterScenes - The Pool Unity WaterScenes - The River

WaterScenes – The Pool

This scene demonstrate the pool parameters and how to use custom render textures for water deformers. In play mode a 3rd Person controller is used.

Resources

Documentation: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@16.0/manual/WaterSystem.html

Quick Start: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@16.0/manual/WaterSystem-use.html

Blog Post: https://blog.unity.com/engine-platform/new-hdrp-water-system-in-2022-lts-and-2023-1

WaterScenes: test package with Island, River and Pool scenes – https://github.com/Unity-Technologies/WaterScenes

High Definition Render Pipeline Package – Samples – Water Samples

HDRP Package Water Samples - Glacier HDRP Package Water Samples - Pool

Unity Water Samples - Glacier - project SettingsThe package contains a number of sample scenarios to act as the basis for your own projects… Glacier, Island, Pool and Waterline ( with the camera set at water level as the waves lap up and down). The Glacier sample is the most complex and needs a number of Project Settings to be enables. A helpful guide appears on the editor screen to point you at the settings required to be enabled,

Supercar Imported in Unity WaterScenes

My Supercar model in FBX form along with a Textures folder was imported to the Unity project Assets. The model asset “Materials” tab was amended to to extract the textures from the FMX model to ensure the model materials could be edited. Most needed adjustment or to enable transparency (cockpit glass, etc).

Supercar in Unity WaterScenes Supercar in Unity WaterScenes
Supercar in Unity WaterScenes

Unity Water Project from Scratch

Unity Water Project from Scratch - Editor Unity Water Project from Scratch - Runtime

  1. Using Unity 2023.1* or later create a new project with the HDRP (Core) template.
  2. Using the Quick Start guidance set up the “Project Settings” necessary to ensure the Unity Water features work. These are under Quality > HDRP > Rendering and Graphics > HDRP Global Settings > Frame Settings. You might add the settings to allow Foam and Water Exclusion at the same time as they may be useful later.
    Project Settings for Water - Quality Project Settings for Water - Graphics
  3. Add a Water Surface – e.g. Ocean and make any adjustments to customise that.
  4. Add in your own 3D content. I usually starter initially with a simple platform (extended cube) sat above the waves in the centre of the scene (0,0,0) for testing.
  5. You might to experiment with adding in a “Water Excluder” to avoid waves appearing through platforms, boats or land areas. See this guide. Set the exclusion zone area using a mesh that is the same as the area to be excluded.

Other Users’ Experience

@BinaryLunar produced this example video…

This entry was posted in 3D and tagged , . Bookmark the permalink.