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 Shinyclef · Jan 17, 2015 at 10:43 AM · transparencytransparent shaderz-bufferz-depth

Is it possible to z-order triangles with transparency?

First question for me guys. I'll try to be a clear as possible.

This is a fairly classic z-ordering question. I've scanned through a few answers and read as much as I can about how z-ordering works but still I'm not sure if there is a practical solution to this problem.

In the screenshots presented below, all of the objects in the scene are part of one single object. This object has lots of blocks (think voxels) with RGBA png textures. As you can see, alpha is transparency, and the screenshots are taken using Unity's transparent vertex lit shader.

The first picture is taken looking through the dice from front to back. The second picture is taken looking from back to front. You can therefore see the draw order of the triangles clearly determines if things are drawn correctly.

I tried downloading the shader and using it with ZWrite On. This make objects that are drawn look correct, but not all objects behind an object are drawn. I believe this is part of the purpose of using the zbuffer in the first place?

Using a cutout shader as others have suggested works just fine, but I'm still looking for semi-transparency.

The question is, is there any way to achieve the following?

  • Semi Transparency.

  • Correct Z-Ordering within a single object.

  • Correct Z-Ordering between multiple objects.

Thanks.

Textures viewed from front. Textures viewed from back.

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 Glurth · Jan 17, 2015 at 06:30 PM 0
Share

The green die is on the upper-right side of the red-die in both pictures, yet the second picture is taken at 180 degrees, around the red die, from the other? That doesn't work in my brain, I must misunderstand. FYI: $$anonymous$$y transparent objects all seem to z-order properly, without any extra work. (even my INSIDE faces) Are you trying to do something special?

avatar image Shinyclef · Jan 18, 2015 at 12:28 AM 0
Share

Hi Glurth. The images are on a procedural meshe with many cube shapes. The inside faces of the cubes are not rendering. I'm using Transparent VertexLit shaders for this image. Therefore, you're always seeing the side of the cube face you, in both pictures.

avatar image Glurth · Jan 18, 2015 at 02:55 PM 0
Share

Oh, those 3 dice are just a texture- I thought they were actual 3d objects themselves. That also explains why they are so flat in places!

1 Reply

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

Answer by Owen-Reynolds · Jan 17, 2015 at 11:13 PM

I think if you set the correct renderQueu(?) (transparent?) Unity automatically zOrders for you.

And then, I'm pretty sure having a single model handle transparency within itself correctly -- that's well-known to be a mess requiring specific hacks to avoid (like chopping it into parts, or avoiding the bad angles.)

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 Shinyclef · Jan 18, 2015 at 12:30 AM 0
Share

That's what I feared. I'll leave this question open for a little longer in case anyone has any particular pearls of wisdom before I accept an answer.

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

27 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

Related Questions

can see inside object that is supposed to be fully opaque 0 Answers

Transparent shader decreases frame rate. Which material i should use for transparent object? 3 Answers

Rendering object that is partially obscured by another 1 Answer

Semi-Transparency, Sprites, and Sorting Groups [Unity 3D] 1 Answer

HDRP Lit Shader: How to disable Transparency "Blend preserve" through script? 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