Stylized Water 3 – Documentation

Stylized Water 3

Stylized Water 3
Version: 3.0.0
Review

3.1.Update guide #

Before updating, make obsolutely sure that the project is free of any compile errors. Automatic update processes will otherwise not run. You’d be left to figure out why things went broken.

Use of a version control system is rightly assumed, and otherwise strongly advisable for any Unity project. If not, backup your project before updating!

From Stylized Water 2 (v1.6.9+ only)

Using both assets simultaneously is not possible. However, there is a window of opportunity to upgrade a project’s water materials using SW2 to use SW3.

This guide is written for projects that have SW2’s shader and scripts in use. Deleting SW2 will cause these aspects to break, as the shader and scripts will go missing. This is unavoidable, but damage can be mitigated.

The easiest course of action is of course to delete SW2, then import SW3, and set up water again in your project as a clean break.

1. Import Stylized Water 3

From the Package Manager.

Stylized Water 3 uses completely new files and folders, so importing it will never overwrite anything in the StylizedWater2 folder. Otherwise SW3 content would import and merge with the SW2 folder, leaving you to guess what needs to be deleted afterwards.

Console messages

Multiple warnings along the lines of “Cannot add menu item <…> because a menu item with the same name already exists.”. Which are safe to ignore for now.

Error: Multiple scripted importers are targeting the extension ‘watermesh’ and have all been rejected.

This will break any water mesh asset, potentially turning some water bodies invisible. That’ll get fixed automatically by the end of this guide 😉

2. Install the upgrade tool

Before deleting SW2, you need to make sure that any materials using its shaders will now use the SW3 shader. Additionally, components need to be converted to their SW3 version, otherwise they’ll go missing.

An editor utility is available to help achieve this

DOWNLOAD (TODO)

Functionality Auto-upgradable
Materials*
Meshes
Scene components
Fog integrations
Wave animations
API changes
Prefab components
DWP2 integration

*Intersection foam settings (eg. enabled state) may appeared changed

Once imported into your project, options will appear under a new “Stylized Water 3 upgrader” menu. This tool:

  • Finds any materials in the project using the SW2 shader and switches it to the SW3 shader (most material parameters are transferable)
  • Looks for certain components in the scene, and swaps them out.

3. Fix broken water materials

Go to the Stylized Water 3 upgrader/Upgrade project materials menu option

For custom materials, you may have to make small adjustments. For example, materials that had Intersection Foam enabled will not appear to have it enabled.

Waves have been completely revised, so will have to be finetuned to your liking. A default Wave Profile will be assigned

4. Update custom scripts using an API

Code namespace have simply changed from sc.stylizedwater2.runtime to sc.stylizedwater3.runtime. Search for any references in your codebase and change them. Observe any errors that follow and correct them.

The Buoyancy API has changed drastically, in order to facilitate the modernized GPU-readback functionality. See the Height Query System page. The new “Align Transform to Water” component also serves as a fully commented scripting example for how to use this.

5. Update old components

Before deleting SW2, you need to make sure that any components aren’t going to go missing.  These need to be converted to their SW2 version

(Options will be grayed out if nothing can be done)

Not all parameters and values can be retained unfortunately! For example, water object references on a Planar Reflections component

Components added to prefabs must be converted manually.

6. Update scene prefabs

If you are actively using any of the included prefabs, such as water objects or particle effects. These are soon going to be deleted.

You can use the free Replace Selected tool to swap these prefabs out with their SW3 equivalent

7. Finally…

Delete the Stylized Water 2 folder 🙂

Yes No Suggest edit
Last updated on October 10, 2024
0 of 0 users found this section helpful
Suggest Edit