Stylized Water 2 is now available
The original Stylized Water Shader asset released back in 2016, and has seen a number of updates, including a complete revamp in 2018. It was personally a great pleasure to see the shader pop up in games from time to time!
Ideas for improvements steadily rolled out over time. Yet many required major changes to structure and usability. This lead to the point of them never actually being realized. With the introduction of the Universal Render Pipeline, it could also no longer be used in projects that utilized URP. To make this work, it required the shader to be rebuild from the ground up.
While somewhat frustrating, this posed an obvious opportunity to start fresh, and create a new asset altogether. Stylized Water 2 is that sense a continuation of the original Stylized Water Shader, but by all means an evolution.
The most notable change in Stylized Water 2 is that it’s now built entirely for the URP. Next to being completely hand-written. Stepping away from node-based shader editors allowed for an even more efficient shader, that is more flexible when it comes to third-party integrations.
Custom shading model
Unity’s shading model is no longer directly used, but broken up into its various parts. The bounds of PBR shading could be overcome this way. Sun and environment reflections can be now controlled separately, rather than being bound to a single “smoothness” parameter. This allows for much greater artistic freedom.
Translucency shading, that simulates light passing through the water, is also incorporated for every light type. This is a great visual contributor, especially under low sun angles.
Parameteric waves
Waves are now created using an algorithmic method, rather then composed out of heightmap textures. Visually, this means waves can now affect the perceived curvature of the water surface, which in turn translates to lighting features such as reflections.
Another added benefit, is that the same calculations can be mirrored exactly in C#, which opened up the ability to implement buoyancy. The asset now includes a script that can have objects float on the water. Dynamic Water Physics 2 now includes an integration, which allows it to be used with Stylized Water 2.
Integrations
The shader incorporates integration for third-party fog solutions: Enviro, Azure Sky, Atmospheric Height Fog, SC Post Effects. As well as support for Curved World 2020
Improved shader effects
- Effects such as the color gradient and intersection foam are now completely stable, no matter the camera angle.
- Water surface can now receive shadows
- Low-poly/flat shading is added as a feature, making the shader particularly fitting for this kind of aesthetic
- Caustics projected under the water surface. In the real world, a complex optic effect, but incorporated into the shader as a fast and convincing effect
- Dedicated river mode, with slope-based foam
Comparison table
Feature | Stylized Water Shader | Stylized Water 2 | Note |
---|---|---|---|
Render pipeline | Built-in only | URP only | |
Shader authoring | Amplify Shader Editor | Hand-written | |
Lighting/unlit mode | √ | √ | |
Orthographic camera’s | √ | √ | |
Mobile support | √ | √ | SW2 uses a single shader that’s scalable |
VR support | √ | √ | |
Depth-based color | √ | √ | |
Intersection foam | √ | √ | SW2 has more options |
Surface foam | √ | √ | |
Refraction | √ | √ | SW1 does not support this on mobile |
Normal map | √ | √ | |
Wave animation | √ | √ | SW2 uses procedural waves, SW1 uses heightmaps |
UV- or world-space tiling | √ | √ | |
Planar reflections | √ | √ | SW2 supports multiple reflections |
Skybox reflections | √ | √ | Only when using Advanced shading in SW1, tied to “Smoothness” parameter |
Sun reflections | √ | √ | SW2 allows fine control |
Vertex color painting | √ | √ | |
Color gradient texture | √ | X | |
Underwater Rendering | X | √ | Available as a paid extension |
Shadow receiving | X | √ | |
Sparkles | X | √ | |
Animated caustics | X | √ | |
Translucency shading | X | √ | |
Buoyancy support | X | √ | |
Third-party fog support | X | √ | |
River mode | X | √ | |
Low poly shading | X | √ | |
Water grid component | X | √ | |
Water mesh utility | X | √ | |
Point lights | X | √ | SW1 supports up to 3 when using the Advanced shading mode |
Spot lights | X | √ | |
Curved World 2020 support | X | √ |
The Stylized Water Shader asset is not slated for deprecation, but has rather reached the end of its life. Bug fixes will still be made when necessary, as well as keeping it functional in future Unity versions.