Stylized Water Shader - Desktop/Mobile/VR [Built-in RP]

[Asset store] [Documentation]
[Video] [APK Demo] [Rate/Review]

Highly customizable to suit your art direction through various parameters. This package focuses on providing artistic freedom, rather than a realistic water simulation.

NEW Version 2.0!
• 3 new demo scenes
• Revamped desktop shader
• 4 water VFX assets
• New mobile shader (up to 37% faster)
• Orthographic camera support
• Lighting modes (Unlit/Basic/Advanced)
• Shadow transmission
• Vertex painting support
• Water particle effects
• UX improvements
• Reflection blurring
• Tiling reduction (Desktop)
• Color gradient feature
• Improved wave animations (Desktop)
• Custom heightmap option

Read all about the update here

The style can be customized through a set of built-in textures, as well as by adding your own. These are automatically packed into channels, making this package customizable and lightweight.

Also includes a mobile shader, features can be disabled to suit your performance target. Effects also feature an optimized mobile shader. Minimum requirement is OpenGL ES 3.0.

== Colors ==
The water can be colored from shallow to deep through color fields, or through an integrated gradient editor.

The material reacts to lighting conditions accordingly. Supports GI and Reflection Probes.

== Intersection ==
Objects intersecting with the water, such as shores and rocks automatically receive a foam effect. Features several techniques for achieving this effect, more details in documentation

== Mask rendering ==
Intersection and opacity can be denoted through the use of volumes, or dedicated meshes.

Features:
• Custom inspector, intuitive design
• Intersection effect with other objects
• Surface foam
• Orthographic camera support
• Advanced and Simple lighting modes
• Refraction (Desktop only)
• Planar reflections with blurring (Desktop only, excl VR)
• Shadow transmission from Directional Light
• Shallow wave animation (GPU)
• 8 built-in normal maps
• 7 built-in intersection textures
• 5 built-in wave heightmaps
• UV-based tiling or World-space (endless water)

Contents:
• Island, lake and pond example scenes
• Desktop shader
• Mobile shader
• 4 matching water particle effects (splashes and circles) including shader.

WARNING! Does not support:
• Buoyancy
• Lab Renderer
• Reflections in VR (SPR)
• Spherical water
• Scriptable Render Pipeline

As seen in:
The Trail
Shotgun Farmers
Re:Legend

Would you like me to see where you’re using it? Submit a game for the porfolio!

Changelog

v2.0.0
Deprecated desktop shaders have been removed. A package containing version 1.50 remains in the package.

Added:

  • 3 new demo/example scenes: Island, lake and pond.
  • 4 water VFX assets
  • New Mobile uber shader (up to ~37% faster)
  • Orthographic camera support
  • Lighting modes (Unlit/Basic/Advanced)
  • Vertex painting support for intersection and opacity
  • Support for Single-Pass Stereo rendering
  • Reflection blurring
  • Tiling deduction toggle (Desktop only)
  • Color gradient feature (Desktop only)
  • Additional waves layer toggle, for improved wave animations
  • Surface highlight and Intersection distortion parameters
  • Custom heightmap option

Changed:

  • Inspector UX improvements, sections now function as an accordion
  • Tiling is now separated for each feature (Normals/Waves/Intersection/Foam)
  • “Surface highlights” is now called “Foam” for clarity
  • Depth and Intersection maximum value ranges have been increased
  • Desktop shader no longer uses tessellation, for wider compatibility
  • Compressed textures option now automatically bakes textures when value is changed
  • Increased UV size of included meshes to be more in line with World-space tiling
  • Wave direction now also allows negative values
  • “Custom” toggles for intersection and waves is now a dropdown menu option

Removed:

  • Old demo scene and related assets
  • Mobile Advanced and Mobile Basic shaders

v1.50
Replaced Substance functionality, textures are now generated on the GPU.
Customization options have been retained, so the changes are purely internal.

Added:

  • Reflection Fresnel parameter
  • Toggle for hiding the material inspector

Fixed:

  • Normal Strength and Glossiness correlation

Removed:

  • Random seed functionality

v1.40
Changed:

  • Minimum supported Unity version is now 5.4
  • Beta shader is now incorperated into the package by default
  • Surface highlights can now also be darkened (useful for lava)

Fixed:

  • (Beta) Incorrect behaviour when Normal Strength is set to 0
  • Desktop shader not compiling on macOS

Removed:

  • (Beta) Default ASE shader inspector, as it throws a warning when ASE is not installed

v1.31
Fixed:

  • Streaking in refraction when camera is close to the water surface (desktop only)

v1.30
Beta shader:

  • Fixed flickering in reflection when using Occlusion Culling
  • Surface highlights will now appear to be affected by the waves
  • Improved intersection texture animation

Fixed:

  • Precision issues on mobile
  • Broken normal maps in Unity 5.6 on mobile platforms (editor only issue)

Added:

  • Help toggles, per options section, which show a description of the parameters
  • Shader variant dropdown menu
  • “Wide waves” wave animation
  • Toggle to hide the wireframe on versions older than Unity 5.5

Changed:

  • Rewritten inspector to make use of serialization
  • Substance outputs are now baked to texture files, per material instance
  • Material inspector is hidden when the StylizedWater component is used
  • Normal Strength and Wave Size are now a shader function
  • Improved “Billowed” heightmap
  • Improved wave animation in Mobile Advanced shader

v1.29
Beta shader:

  • Recompiled using latest version of ASE
  • Fixed colors blowing up with HDR cameras
  • Added a layer mask to the inspector for realtime reflections
  • Reflection is now less intense at certain viewing angles

v1.28
Beta shader:

  • Corrected transparency
  • Added shallow water color parameter (replaces Depth functionality)
  • “Depth” tab and “Depth darkness” parameter have been removed from the inspector
  • Intensified the Rim color by default, which can be toned down by the color’s alpha channel

v1.27
This version includes a separate unity package which contains a Beta shader. It’s targeted at desktop, mobile shaders will follow suit later. The minimum support version is Unity 5.4

It features:

  • Recreated in Amplify Shader Editor entirely
  • Realtime reflections
  • Skybox lighting
  • Reflection Probe support
  • Mask surface highlight by heightmap (wave foam)
  • Wave direction configuration
  • Improved texture crosspanning
  • Improved glossiness
  • Unlit mode

Fixed:

  • Corrected behaviour for Substance instances when reloading a scene

Changed:

  • Set prefabs on “Water” layer (default built-in layer)

v1.26
Added:

  • Option to use intersection texture for Surface highlights (desktop only)
  • Heightmap-based wave animation, you can pick between a Smooth, Sharp and Billowed style. Great for large bodies of water! (desktop only)

Changed:

  • Cleaned up Shader Forge node tree
  • Increased default Anisotropic Filtering value for normal and shader map
  • Surface highlights masks out the normal map to simulate thickness
  • Surface highlights are now also affected by overall Transparency, to ensure correct color values
  • Glossiness value can now be set higher, in case your normal map is faint and and you want to keep reflection details.

Fixed:

  • Missing Transparency parameter in inspector when using the Mobile Basic shader
  • Undo functionality not working correctly when the inspector does not have focus
  • Fallback shader on Mobile set to Unlit/Transparent, instead of referring to Legacy Shaders

v1.25
Added:

  • Cells + Cloudy wave types
  • Perlin intersection style

Changed:

  • Minor script improvements
  • Improved appearance of the different waves and intersection styles

v1.24
Changed:

  • Fixed depth banding artifact on some mobile GPU’s.

v1.23
Added:

  • Intersection distance parameter (as seen in GIF)
  • Prefabs
  • Square and Circle water mesh, high-poly and low-poly variant
  • Transparency parameter for Mobile Basic shader

Changed:

  • Set Substance to generate all outputs by default, to avoid empty textures

Removed:

  • Disabled shadow-casting in shader, as this is unwanted behaviour anyway

v1.22
Changed:

  • Set Substance to ‘Uncompressed’ by default for Mobile
  • Improved normal map blending
  • Restored light reflection to its former glory

v1.21
Added:

  • Shaders can now be modified using ShaderForge.
  • Unity 5.5 support
  • Demo scene with 30 free stylized models
  • Option to randomize seed in inspector

Changed:

  • Improved support for Substance material instances
  • Changing materials shows/hides the new parameters automatically
  • Wave vertex offset now follows the mesh’s normal direction, rather than offsetting in the world Y-axis (useful for curved surfaces)
  • Switched from glossiness to roughness type, for better results under low/no light conditions
  • Inspector GUI improvements
  • Substance will generate both texture maps regardless of “Generate all outputs” option

v1.2
Added:

  • Custom inspector component for ease of use
  • Fresnel color (alpha controls opacity)
  • New mobile shader variant “Basic”
  • Documentation now contains a parameter glossary

Changed:

  • Previous mobile shader is now called “Mobile Advanced”
  • Updated demo scene
  • Set Substance to ‘Uncompressed’ for Desktop
  • Mobile shader has been tweaked for performance

v1.15
Added:

  • Fresnel control
  • Multi-light support
  • Rim color alpha now controls intersection amount
  • Support for Unity 5.3.0 and up.

Changed:

  • Fresnel color is now derived from Ambient Light rather than Directional Light
  • UV/WorldSpace tiling values are more logical
  • Reflection intensity is now bound to the glossiness parameter
  • Depth control is more physically correct

v1.1
Added:

  • Surface highlights.

Removed:

  • Heightmap, since it was not used.

Changed:

  • Name of depth buffer script to avoid conflicts.

v1.0
Initial release

Feature requests:

  • Waves heightmap
  • Flow direction
  • Skybox lighting
  • Orthographic camera support
  • Realtime reflections
  • Filter objects subject to intersection effect
6 Likes

Nice! 3 queries (priority order):

  • Artificial surface highlight based on wave (to mimic specular reflections)
  • Caustics (on underwater objects)
  • Underwater effect?

Good call! Although I think the last two points would be outside of the scope of this project. To my understanding people usually achieve caustics through the use of Projectors and an underwater camera effect through a camera shader.

I’d like to add the ability to use the intersection texture on the surface as well, but tiled larger, much like in Windwaker. It warrants some experimentation :slight_smile:

It looks really nice! Can you provide web or apk demo for testing?

Will do! My idea would be to expose the shader parameters in a UI, so you can try out all the things :wink:

Now available! Unity Asset Store - The Best Assets for Game Making

1 Like

Upcoming update (v1.1) will add surface highlight detail. Size and transparency are adjustable.

3 Likes

Just wanted to let you know this gif sold me on the asset. I’m getting it now and I look forward to this update. Thank you for sharing your work.

1 Like

If anyone is experiencing issues with Unity 5.5, some underlying shader changes were made, which prevents this shader from compiling.

However, I have a fixed version. If you’re set on using 5.5 and you’d like to use this shader in your project please contact me with your invoice number and I’ll sort it out for you!

The manual fix for compatibility with 5.5 will be included in the next manual update. Unfortunately, It’s pretty difficult to ensure compatibility with different versions of Unity, I’m currently looking for the lowest possible version it’s compatible with, since not everyone is on 5.4 yet.

Received some important feedback from several users, aiming to submit version 1.15 this week!

Added:

  • Fresnel control
  • Multi-light support
  • Rim color alpha now controls intersection amount
  • Support for Unity 5.3.0 and up.

Removed:

Changed:

  • Fresnel color is now derived from Ambient Light rather than Directional Light
  • UV/WorldSpace tiling values are more logical
  • Reflection intensity is now bound to the glossiness parameter
  • Shadermap is now assigned by default
    when resetting the shader
  • Depth control is more physically correct

New demo image:

Shader as seen in “The Night’s Willow”

2 Likes

Hi Jonathan, I just wanna say that you’ve done a great job with this water. It’s a great new to see that you’re still supporting and improve it with those new features and control options.

I’m working in a personal project and I’m pretty confident that your water will be the one that I’ll use in it.

Keep working hard!!

Thank you for your kind words! I appreciate it :slight_smile:

In the next update I’m aiming to add a custom inspector, so all the shader and substance parameters are in one place, and neatly organized. This update will introduce a slight price increase, because of the time investment and the added functionality.

I noticed I accidentally included my work-in-progress script for this in the last version. So all I can ask now is: please ignore it :>

Hey Jonny, I recently bought this shader and I’ve been using it for a project I’ve got going. It fits really well, love it, great job! :slight_smile:

Custom inspector sounds really cool as well, looking forward to it!

I’ve got one question/request. I have day/night cycle going and I make small real time changes to some of the properties to make the water fit better, but there’s this grey gradient effect ( fresnel ? ) that I can’t seem to change at all, pictured in the image below. Is there any chance you can expose the controls of it as a property, so I can either remove the effect during night or change the color of it?

Hi,

Please send me an email (contact info is on the asset store page) and I’ll fix you a modified shader with the fresnel color exposed (currently linked to the scene ambient color). I’ll include the fresnel color in the next update, where the alpha channel will control its opacity.

1 Like

A price increase is totally fair man, the new update sounds very interesting!

Making good progress on the custom inspector. Right now the undo function is too wonky for comfort :roll_eyes:

I’ve also added a toggle which allows you to use the intersection texture type (either the built-in or a custom provided map) as the surface highlight. When switched off this is derived from the normal map.

Did some experimenting with animating Substances, to see if I could move some of the texture cross-panning out of the shader. Which seems to be a huge performance bottleneck on mobile.

https://gfycat.com/TepidShrillCrayfish

The result is visually identical, but yields a 300% performance boost on mobile (tested with Oneplus One). Another benefit is that I can now utilize all of Substance’s functionality to replace certain shader operations.

If you’re interested in giving it a spin, contact me with your invoice number and I’ll sent it out as soon as I’ve ironed out the kinks :wink: Feedback is much appreciated at this point!

Hey there, awesome stuff with this water shader… I’m about to buy it but wanted to ask if you could share some vertical examples using this shaders, luje waterfakks as well as using this very shader on a sphere or other surface that it is not 100% flat.

If you’re worried about stretching, you can toggle world-space tiling

1 Like

Version 1.2 has been submitted for review! Documentation is now available online, as is an Android APK demo. Links are in the first post.

Added:

  • Custom inspector component for ease of use
  • Fresnel color (alpha controls opacity)
  • New mobile shader variant “Basic”
  • Documentation now contains a parameter glossary

Changed:

  • Previous mobile shader is now called “Mobile Advanced”
  • Updated demo scene
  • Set Substance to ‘Uncompressed’ for Desktop
  • Mobile shader has been tweaked for performance