Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by Nicrom · Nov 07, 2017 at 09:04 AM · transparencytransparent shadertransparent texture

Transparent material render order problem

Hi. I an having some problems with rendering transparent objects. This is how the objects should be rendered, alt text but I get this. alt text

In the first image I use the Cutout Rendering mode of the Standard Shader while in the second Fade mode. So my question is how to I make the objects to be rendered correctly without using some sort of Cutout shader.

I tried to fix this by using sorting layers, changing the render Queue of the material, but it still not rendering correctly .

cutout.png (157.0 kB)
transparent.png (230.3 kB)
Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by adehoe · Nov 21, 2017 at 04:50 AM

did you try "LightMode"="ForwardBase" "RenderType"="Transparent" "Queue"="Transparent" AlphaToMask On

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 Nicrom · Nov 28, 2017 at 11:22 AM 0
Share

Hi. I tried, but this didn't work too.

avatar image
0

Answer by Tomer-Barkan · Nov 16, 2018 at 08:10 PM

The problem with Semi-Transparent (Fade), is that it doesn't write depth. It considers the material transparent, so it will still render stuff that are behind it.


In your example, it renders the laying plane first but it doesn't write the depth of each pixel, due to the fact that it wants to keep the depth of objects behind it (since it's transparent, objects behind it may still be relevant). Then it renders the standing plane and since it didn't save the depth of the laying one, it doesn't recognize that parts of the standing plane are actually behind the laying plane (the parts that are below it) - so it draws everything even the parts that were behind. You could easily see this in action by moving the standing plane a bit back, and suddenly it will appear fully behind the laying one.


The reason changing render queue and sorting layers doesn't help, is that it only changes which one is drawn first. It doesn't solve the core problem of transparent objects not hiding those behind them - and as such do not cull objects behind them. Cutout works because if the alpha value is above the threshold, it draws it fully opaque, and as such sets the depth value knowing that anything behind it will no longer be visible.

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 Tomer-Barkan · Nov 16, 2018 at 08:18 PM 0
Share

I can't think of any simple solution. You could split the planes to parts that are in front / behind, and then it will render them in the correct order according to distance from camera. That's what I would do if I had 2 sprites, and I wanted parts of one to be behind the second, and other parts to be in front.

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

120 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 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 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 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 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 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 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

Rendering order shifts with transparent cubes (3D perspective camera, Standard shader) 0 Answers

Can I use transparent shapes to cut out doors, windows, etc, in preexisting walls? 0 Answers

Alpha shader on a game object with multiple texture tiles 0 Answers

Leaves disappear in game mode 0 Answers

Problem rendering textured quads with transparent areas 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