Stylized Water 2 [URP] ☑️ Desktop/Mobile/Consoles/VR

That’s a particular use case that’s been taken into account. On the water material, there’s also a “Disable depth texture” option that needs to be disabled if a depth texture is explicitly unavailable.

At which point, vertex colors may be used as an alternative way to denote depth and intersection information.

1 Like

Version 1.6.2 is now available!

The Roadmap page has been updated to reflect what may be expected with the Unity 6 release.

Added:

  • Intersection Foam distortion parameter, offsets the texture sample by the normals
  • Caustics chromance parameter, allows blending between grayscale- and RGB caustics

Fixed:

  • Translucency rendering not being applied with the correct strength for a 2nd+ point light.

Underwater Rendering 1.2.3

Added:

  • A warning to the Underwater Renderer UI if rendering was disabled by an external script.

Fixed:

  • Camera-space distortion not having any effect when using VR.

Hi @StaggartCreations !

I am looking at DynamicEffect_DirectionalRipples.

Is it possible to add an option to change the water colour where this effect is applied? Specifically, make the colour darker / lighter in a configurable manner?

This is what I would like to be able to achieve:

( localized areas of moving gusts on the water, that are darker and have more rippels than water around them )

Greg

I’m afraid not, effects can alter the water’s vertical displacement and normals, not color directly. The darker color in the real-world examples is attributed to small-scale waves, the wind gusts roughen up the water surface locally, which causes more of the (darker) hills to be reflected and more of the actual water color to show, self-shadowing from the sun/sky light also comes into play. At least, that’s my interpretation.

In the water shader, if reflections and normal maps are enabled, all of these factors also affect the water color. The wind gust effect attempts to add small ripples, which in turn translates to this (lighting only shown)
9707711--1386701--upload_2024-3-18_10-53-5.png

Finally had time to check out this asset. Noticed some issues though :slight_smile:

It looks like there is a problem with rendering billboards in the planar reflection. I am using Amplify Impostors to make billboards for distant trees and it seems like they are rendered with a darker color. Also when viewing from a distance they won’t account for fog?

Also, can I fade the edge intersection by distance? As you can see on the long range screenshot, you still see a bright white edge along the coastline.


9708197--1386815--upload_2024-3-18_14-48-43.png

What could be the problem here?

Hi @StaggartCreations , hope this finds you well! You’ve made a beautiful asset here.

I know in the asset description you mention that this asset won’t work with tile maps, so pardon this question.

I’m working on a 2.5d tiled game, ala Don’t Starve Shipwrecked:

In my quest to find a water shader that will work with a tilemap, I stumbled on a previous post of yours, where you mention it being possible with the original Stylized Water asset:

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

By chance is anything like this possible with Stylized Water 2? Using World Space UV’s & vertex paint, etc.

I’m not sure what’s causing the darker color on the imposters, it’s a non-standard shader so the root of the cause requires some digging.

The option to enable (default Unity) fog for the reflection render is there, but really only because it may work for some cases. Unity’s fog does not work correctly with oblique projections, such as in planar reflections. Large triangles tend to pose an issue, which might be the issue here.

Intersection foam can’t be distance faded I’m afraid, it’s currently “tightened” based on the viewing angle, so that when you look at a glancing angle it pulls inwards a bit. The white edge seems to be 1 pixel tall, so anti-aliasing may filter it out properly.

The disclaimer about tilemaps is more of a blanket statement. Projects using tilemaps are typically not 3D, so have no depth information. Water on the other hand requires this in the majority of use cases. So, a safeguard against unwelcome surprises :wink:

Using vertex colors is otherwise perfectly viable in this case. I’ve attached an FBX that has various water tiles, with vertex colors baked in for the intersection foam (like in that other post). There’s a section in the documentation dedicated to vertex colors here: https://staggart.xyz/unity/stylized-water-2/sws-2-docs/?section=vertex-colors-2

9716209–1388866–WaterTiles.zip (6.21 KB)

9723403--1390018--upload_2024-3-25_1-47-29.png

Funny thing when I set the impostor clipping to zero, you can see a difference between the reflection and the impostor which doesn’t make sense to me…

Shaders created using ASE (such as impostors) have a small difference between normal URP shaders, it’s due to an oversight specific to alpha-clipped materials, but may certainly be called a bug.

The output value of the alpha needs to be set to 1. A simply fix can be applied to the template shader here:
9723787--1390087--upload_2024-3-25_9-37-39.png

The alpha information is something that’s used in the planar reflection, so may create artefacts like this if its incorrect. Similar to something you see in [this post.]( https://discussions.unity.com/t/815355 page-5#post-7463173)

Hello Staggart.
I don’t know why, but the version number does not change from 1.6.1 to 1.6.2 in the package manager.

9724168--1390180--161.png

I can at least confirm that v1.6.2 is the version currently on the store. The Package Manager itself is Unity’s ballpark.

I solved the problem by opening the downloaded package file with notepad and manually changing the version from 1.6.1 to 1.6.2.
I’m using Unity 2023.2.15, and it seems like a Unity bug.

VR Meta Quest 2/3
Underwater Rendering for Stylized Water 2 (Extension) v1.2.3
Unity 2022.3.20f1

Hi,
Does Underwater Extension support Multiview, or only Multi Pass? For me, with Multiview it is rendered only in the left eye.

Multi-pass is an old VR rendering technique, that revolves around rendering the scene twice, so by all means using Multi view is recommended (this is the same as “Single Pass Instanced” on PC).

As a sanity check, I’ve created an empty project in Unity 2022.3.21f and set up the Oculus plugin for Android (all default settings). What I notice on a Quest3 is that the environment (except the water) is black in the right eye. I assume that is the case for you as well?

VR is a particular nuisance to develop for, as testing and debugging is slow, and often one version of Unity works while another doesn’t. Either due to a bug on their end, or a change in the API. Last time I checked, there were no issues shrug. So I’ll have to do some digging to find out what’s changed this time around :stuck_out_tongue:

Edit: Found the culprit, apparently there’s a new function parameter that specifies if render targets are used with VR or not. Fixed in version 1.2.4

It worked, great, thanks!

Another problem. Close to the surface, if you look up, space appears below and on the sides without underwater rendering.

9745609--1394545--photo_2024-04-02_18-50-49.jpg

Great! Thanks for letting me know.

That white-ish space, is that not just the skybox? As in, a space between the water surface and the terrain?

No, it’s as if the render of fog and water stops superimposing on these places. I don’t know how else to explain :slight_smile: This happens near the surface, below and above.

I’m sure this has been asked before, but will you ever support HDRP?

Would you mind sharing a screenshot or two, or a video? You can do screen captures and recordings from within the headset. That would give me a better idea as to what sort of issue you have in front of you :slight_smile:

The short answer would be no. This asset, specifically, is designed for URP at its core.

1 Like

Hello @StaggartCreations . We have a game that is procedurally generated, with maps for example 200x200 tiles (game is 3d however)

How could we make so we pick which tiles/positions have a water tile and what not? Only option is to have 1 water mesh/object per each water tile in our game, however with maps like 200x200, that makes 40,000 tiles if we want to cover entire map with it :slight_smile: Which just drops performance insanely.

Any ideas how to get this working similar to stylized water 1?

Just to add more info, we cannot just place 1 huge 200x200 scaled mesh on entire map, as some parts of map dont have water at all, some may have different type of water etc, so we need this to have per tile control. By tile we mean this 1x1 unity square