Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Zaffer · Mar 27, 2012 at 04:14 PM · shadertreestransparentbillboardqueue

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][1], [Support Forum][2]

I used a Transparent/Bumped shader to make river and lake water [see attached picture][3]. 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][4] 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 [1]: http://forum.unity3d.com/threads/129459-water-showing-over-billboard-trees [2]: http://forum.unity3d.com/threads/129381-water-over-billboard-trees-problem [3]: http://bitsong.com/forPosting/Unity/water_over_tree.html [4]: http://forum.unity3d.com/threads/77544-3.2-Water-over-billboard-trees
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image moichezmoi · Mar 27, 2012 at 04:38 PM 0
Share

Hi, You can find the sources of built-in shaders here.

avatar image Zaffer · Apr 26, 2012 at 09:23 PM 0
Share

Hi Cascho01, Glad my solution works but I can't help you with reworking the trees billboard-shader. I was hanging on by my mental fingernails just finding the built-in shaders and editing one of them. Anybody else?

avatar image amduartev · Sep 06, 2012 at 08:27 PM 0
Share

This solution no work in Water4! What solution for Water4?

4 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Zaffer · Mar 27, 2012 at 05:41 PM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image getyour411 · Sep 15, 2015 at 03:56 AM 0
Share

@Zaffer Surprised to find today in Unity 5.2 with older Trees going to billboard this still happens; thankful for this post which solved the problem.

avatar image
0

Answer by Cascho01 · Apr 26, 2012 at 05:35 PM

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?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by bojangles · Jan 05, 2017 at 09:59 AM

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;
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Darren_Therrien · Jan 20, 2018 at 05:55 PM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image getyour411 · Jan 20, 2018 at 06:52 PM 0
Share

Depending on your tree mesh complexity, LOD settings, tree counts and other game environment factors, that could impact performance.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity tree billboard depth buffer 0 Answers

Billboard trees - changing the render queue 0 Answers

Transparency shader that also writes to Camera Depth Texture 0 Answers

Changing Queue in shader has no effect 1 Answer

About shader! 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges