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 /
avatar image
0
Question by wolga2 · Oct 20, 2013 at 07:29 PM · renderingplanevertex shadertransparent shader

Problem with transparent planes behind each other

Hi. I have planes with a transparent vertex shader to cutout some black shapes. In front of it, a little bit closer to the camera, is a rotating plane that should illustrate fog. It has also a transparent vertex shader, but the color is white gray. If i move with the player, sometimes the one whole black cutoutplane gets a brighter color than the others because of the 'fog' in front. Why is that? Is there a problem with rendering two tansparent planes behind one other?

Comment
Add comment · Show 1
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 Crystalline · Oct 20, 2013 at 08:45 PM 0
Share

Unity deffered rendering is known to do this sort of issues, but even other renderes do so. Try $$anonymous$$aking sure the planes are not static, so unity wont batch them(batching transparent objects are also a problem)

1 Reply

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

Answer by Owen-Reynolds · Oct 21, 2013 at 04:28 AM

"Is there a problem with rendering two t[r]ansparent planes behind one other?" Yes, if the system can't always tell which is in front of the other. For transparent objects, the draw order matters (if you draw the cutout after the fog, the solid parts aren't foggy.)

Suppose you have planes like this, where the O is the center (`transform.position`):

 ----large--- O ---plane-------
                 ---small-O-plane--

   C3               C2              C1

Unity (and probably everything) measures to object 000. The camera at C1 clearly thinks small is in front of large. At C2 it probably also does (since it uses Z-distance, not real distance,) but at C3 it thinks large is in front of small. So moving from C1 to C3 gives a "pop" as the draw order flips (nothing moves, but color changes.)

One fix is just to move them further apart. Or use more, smaller planes.

The "real" fix is to look at the RenderQueue in the shader. Copy the fog's particle shader and add the "+10" to the queue (the shader docs show how to do this.) Use that in the fog material, and now it will always go "over" regular stuff (even if it should be behind.)

Comment
Add comment · Show 2 · 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 alessandro_88 · Oct 21, 2013 at 12:52 PM 0
Share

I wrote in the shader Tags "Queue"="Transparent +10". I still can't belive it, it actually really works now! Thank you so much, you just made my day! :)

avatar image wolga2 · Oct 21, 2013 at 01:10 PM 0
Share

Seems, as you helped others as well :-) It's working with changing the RenderQueue! Thank you lots and lots and lots!!

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

18 People are following this question.

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

Related Questions

How can I hide a mesh renderer using another invisible mesh? 1 Answer

Transparency cutting opaque mesh 0 Answers

Aligning planes thin gap? c# 0 Answers

Standard shader's Fade rendering mode won't allow full opacity with a textured material 0 Answers

Refer from Shader to C# code? 1 Answer


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