Transparent shader (water) showing over billboard trees

Hi,
I have cross-posted this question and will be glad to cross post any answers:
Shader Lab, Support Forum

I used a Transparent/Bumped shader to make river and lake water see attached picture. As you can see, the river/water shows through the tree in front of it, but only when the tree is billboarded. I found a thread with a similar question: Pro water showing over trees thread with a good answer by CodeMonkey. He recommends this:

You can fix the issue by changing the queue order for the water. Edit FX-Water3.shader and replace all instances of:
“Queue”=“Transparent”
to
“Queue”=“Transparent-200”

However, I can’t find an Edit button or way to edit the Transparent/Bumped Specular shader. Any suggestions? Thanks.

Zaffer

Thanks Moichezmoi,

I had totally forgotten about the built-in shaders. It worked like a charm. For those not familiar with how to do this, you download the built-in shaders, per the link above, unzip and pick out the one you want. In my case, it was Alpha-BumpSpec.shader equals Transparent/Bumped Specular. Then you put a copy of the shader you want in the Assets folder, and once you do that, you will be able to open it in MonoDevelop by clicking on its Open button in the Inspector.

Once open, you first have to rename it so it will show up in the Shader menu. To do this, change the line:

Shader "Transparent/Bumped Specular" to Shader "Custom/Transparent/Bumped Specular"

When that’s done, all you have to do is make the code change itself per CodeMonkey’s directions: original water over trees thread, change:

SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 400

to

SubShader { Tags {"Queue"="Transparent-200" "IgnoreProjector"="True" "RenderType"="Transparent"} LOD 400

Save those changes, apply your custom shader to your material (you will find it in the shader menu under Custom) and the water behaves itself and stays behind the trees.

I see that your solutions will work.
But I use different transparency-shaders for multiple materials.
In your case I have to make these changes to all my transparent shaders.

Wouldn´t it be smarter to change the trees billboard-shader queue only (to let´s say -99)?

I have tried this, but I get strange error messages from the editor when replacing the hidden original with the downloaded one from builtin_shaders.zip.

Any help on this?

Instead of creating a new shader, create an instance copy of the water material and set the renderQueue variable to a more appropriate number. 2005 worked for me (rendering water after terrain and trees)

waterHQ.GetComponent<MeshRenderer>().material.renderQueue = 2005;

Change the billboard start on your terrain to a higher number than the default until you notice the effect is gone. Simple answer I found for me.