Hi where I can get your water shader?
You find it on the asset store
http://u3d.as/A2R
Iâm seeing this effect when trying to use the material on a âwaterfallâ mesh (just a curved plane really). The darker blue hourglass appears to follow the focus point of the camera, and itâs translucent for what itâs worth. Modifying the Transparency value just increases/decreases the effect of this as well.
2019.3.11 + SRP + Deferred, think those are the only things Iâve got going on
EDIT: Seems to be an Editor Scene only thing, in Playmode + build Iâm not actually seeing it.
Iâm having an issue with the brightness of the Water (using the mobile version). The sceneâs lighting is for nighttime, and thereâs a tinted directional light in my scene. It seems to be making the water brighter than the land surrounding. Iâve tried setting the Lighting to Unlit, then Basic, and then tried setting the Shallow Color to black.
I attached a screenshot showing the issue.
Iâm having to use just the shallow color because the icebergs and glaciers were creating squares of âshallowâ water around them. My solution was to add a plane slightly under the water plane.
Any way for me to make the water a darker shade while keeping my lighting setup?
Hi, is there a alternative way for the DepthBuffer Script on the camera ? I notice some major performance issues on some mobile devices. (especially Huawei)
So far this Shader is a bliss to work with.
The water uses the depth buffer to measure how far away objects underneath it are, so itâs required for the depth and intersection effects to render correctly. On some devices, without it, the water would turn invisible. So Iâm afraid itâs a requirement.
The performance drawback in this case is that Unity does another pass on all objects, to get their depth. In Deferred rendering this is âfreeâ, but Forward rendering is better suited for mobile.
Iâm using a trimmed down version of the water shader, but some players are reporting that itâs drawing before the fog. On my machine it renders after the fog so this is only on certain platforms.
Tried changing the render queue of the water shader to be 3000+ and no effect. Do you have any suggestions?
I assume this is using a fog post processing effect? Transparent materials such as water do not contribute to the depth buffer, as such any depth-based effects like fog canât tell how far away the surface is and appear to ignore it. In this case, the fog effect should execute before transparant materials are rendered, and it will fog transparant materials purely on whatâs behind them. Still not ideal, but avoids them not being affected at all.
Just circling back on this in case you missed it. It might be something simple but I havenât coded many shaders so Iâm not sure where to look.
I have, apologies! Since the water is flat, it will be shaded uniformly. In your screenshot, some of the terrain surface is facing away from the light direction, so they are a darker shade.
Setting the Deep/Shallow colors to black, will in any case make the water black regardless of any direct or ambient light. So setting these colors to a darker tint will decrease the brightness of the water. If youâre using a fixed lighting setup, then using the Unlit lighting mode is viable, and you can tweak the colors to the point where youâre satisfied.
Hope that clarifies it!
Thatâs what I had tried, but this time I set Intersection to black as well and that did it (along with rotating the direction light a little bit). Icy water looks dark and imposing now. ![]()
Interestingly, I still found that directional lights (not moving) still affect the water shaderâs tint even when set to Unlit. That might be different from the fixed lighting you mentioned though.
Yes itâs deferred fog with the v2 postprocessing.
I canât find any way to customize the fog draw order. Itâs frustrating because it renders properly on most machines. I guess we just have to live with it?
I see, the built-in fog effect cannot be modified in this way. Itâs possible this behaviour is deferent between DirectX and OpenGL/Metal. Do you happen to know if this occurs only on Windows or Mac?
Seeing as the deferred fog and ânormal fogâ use pretty much the same technique. It may be possible to enable the normal fog anway. Transparent materials (such as water) render in Forward rendering. So this may be a way to still apply fog to them. Iâm not sure if the post processing stack forces fog to disable, if itâs using deferred fog. But worth a shot!
When running android build with forward rendering water is not rendering at all if depth buffer is not enabled. Tested with several devices. It renders fine in editor.
I can live without intersactions and depth and understand that these cannot work without depth buffer. But water should be rendering, just without these.
The depth buffer is also used to drive the waterâs transparency, without this it is perceived as infinitely shallow and thus becomes completely transparent. Because of this, it is required. There are few slight manual modifications you can make to the mobile shader file, that will convert it to an opaque material:
Replace line 44 with:
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" }
57 with:
#pragma surface surf StandardCustomLighting keepalpha noshadow nolightmap nodynlightmap nodirlightmap nometa noforwardadd vertex:vertexDataFunc
155 with:
float DepthTexture494 = 1;
You can remove the entire block of code above line 155 surrounded by âStylized Water custom depthâ comments at this point. After which youâll have to turn the intersection and depth effect parameters all the way down, or theyâll span over the water entirely.
Thanks! That made it work on mobile without depth buffer.
Is it possible to reflect the Skybox? This is especially viislbe in the Pond demo scene, where the mountains are not visible in the reflection.
Are there any workarounds?
When Planar Reflections are enabled, the skybox is always reflected (Even if âReflect Layersâ is set to âNothingâ).

An alternative means is to set the Lighting mode to âAdvancedâ and create a Reflection Probe that encompasses the water. The Glossiness and Metalicness parameters have to be turned way up before the water starts taking on reflective properties in this case.

@StaggartCreations Thank-you, that helps a lot!
I noticed that the Colors > Use Gradient checkbox does not work.
Me too, this has meanwhile been fixed in an upcoming update. By the looks of it, this was broken for a long time, but nobody including myself noticed ![]()

