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 Skirsch · Aug 30, 2021 at 06:28 PM · meshtransparency

Front of mesh is more transparent than back of mesh

I'm making a simple third person camera system, and I have it so when the camera gets close to the player mesh it becomes more and more transparent. However, it seems that the mesh doesn't become equally transparent all around, rather the front of the mesh is more transparent than the rest. This makes for a slightly jarring transition when switching from an opaque rendering mode to a transparent rendering mode. How can I make the transparent object equally transparent across the whole mesh so it can be a smooth transition?

This is what the start of the transition looks like.

alt text

000crate.png (132.7 kB)
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 New_Game_Ideas · Sep 05, 2021 at 03:30 PM 0
Share

I think transparency is because of the overlap of your objects. As much as I know there is no way of doing that.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Pangamini · Sep 05, 2021 at 08:31 PM

Transparent objects are tricky. For example, ovelapping surfaces have to be sorted from back to front in order to render properly (with a few exceptions). Unity does that on the renderer level, however it won't sort individual triangles. There are few things that could be considered in general:

  1. Split your mesh to several smaller, ideally convex meshes. That way unity can sort them, but the rendering becomes less efficient. For a small scene, this wouldn't be a big problem though.

  2. Use some commutative blending mode. See, the problem with ordering is that the result depends on the order in which objects are rendered, as they overlap. It's the same as if you were to change the order of math operations in an equation. In some few cases, the order doesn't matter. For example, multiplication or addition. Unfortunately, there is no way how to smoothly turn an opaque object into a transparent one like that.

  3. Probably what you will end up doing: Depth pre-pass. The trick is to make sure that the triangles you are rendering don't get rendered out of order. Since unity won't sort the triangles in a mesh, what you can do is to prevent them from being rendered. Your transparent material most likely has depth-write turned off (to avoid even worse results than what you have now). The trick is to render the mesh, but only writing to the depth buffer but not color. So nothing actually gets drawn. After, you render your transparent mesh with default depth test. In the final image, you will only see the closest surface of the transparent object, but you won't see itself through itself.

  4. Order independent transparency. I don't know much about this topic though, so I will leave it for you to study on your own

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

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

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

Standard shader - fade mode renders texture in wrong order 1 Answer

No culling in a transparent texture 0 Answers

Is it possible for transparent spheres to look like they're intersecting? 1 Answer

Transparent Mesh's edges not transparent 1 Answer

How to make mesh-render mode particles fade out? 2 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