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
1
Question by jamiller · May 21, 2012 at 10:40 AM · transparencysorting

Transparencies with overlapping bounding boxes (Glass Interior/Exterior)

Hello, I am using Unity to simulate some glass objects that sometimes have (transparent) liquids inside them as well.

Basically I have objects that are made of up three progressively smaller bounding boxes

  • Glass exterior (should be rendered last)

  • Liquid (rendered in the "middle")

  • Glass interior (should be rendered first)

Here is a simplified (just two layers, no liquid) example I made when trying to solve the problem:

http://69.73.181.152/~distorti/work/transp_problem/

The interior glass is made blue and exterior is yellow to make it more obvious when it renders incorrectly. Press TAB to change the view to other objects. Move around the view to see how it affects the sorting. Also notice the two cubes appear mostly correct from 2 sides (yellow outside) but from the opposite two sides they appear wrong (blue showing over yellow). The cylinder at the end just flips depending if your view is above or below it.

My problem is the sorting seems to change depending on what angle I view the objects. When my camera is below the center of the bounding box it "flips" and renders in the opposite order. I've tried many things to resolve it.

So I know the order they should be rendered in, because they are always viewed from the outside. I was hoping I could influence unity to prioritize by hierarchy, naming or bounding box size but so far no luck. I've tried:

  • Setting bounding boxes manually (I really had hope this would work): I tried to set the renderer's bounds to be progressively smaller in the order I want them to render in. Since they all overlap and have nearly the same center I figured this would make unity's sorting work, but it did not seem to have any effect. Perhaps I am setting it wrong? There seems to be multiple bounding boxes and ways to set them.

  • Setting render queues from script: this works on a single object, but the problem is I need these to sort with other objects like particles, other transparent objects, and the environment. It seems I would have to create scripts to detect and set the render queues on every transparent object in my scene based on the order from the viewer - seems like I would be asking for trouble and a lot of extra scripts evaluating every frame.
    • I've worked on Nintendo DS games and we had the option to set a render priority within a single model, but it wouldn't effect the sorting against other models - this would be the perfect solution for me, does Unity have this ability? The render queue seems to effect its priority overriding the entire scene.

  • Changing pivot locations, making all pivots the same - it seems the pivot doesn't matter, probably using the center of the bounding box.

I've done a lot searching for transparency sorting but seems most people's problem involves layers of objects, where mine is overlapping volumes. Anyone have any suggestions for me?

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 ChiangChu · Dec 11, 2012 at 03:01 PM 0
Share

could you post the shader of those objects in your example scene?

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Looking for a transparent shader 0 Answers

CustomAxis sort not working between objects placed at different layers rendered by multiple cameras 0 Answers

Issue using a single-mesh with multiple-seperate-components and alphaBlended transparency. 1 Answer

Transparent objects sorting 6 Answers

Sorting Issue with Alpha Blended and UI 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