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 Hans D. · Sep 24, 2013 at 02:12 AM · renderdepthqueue

Rendering order of objects in different depths not correct.

Hello, I'm having problems with rendering objects in the correct order according to depth. Right now I have a script that will instantiate "Card" objects, which are simple Quad meshes with a texture. The script calculates their position and Z-axis rotation to arrange them in a "card hand" pattern.

What's giving me problems is having the cards render in the correct order, in which the right-most card is at the back, and the left-most card is at the front. I tried to do this by making each card be 1 unity apart on the Z axis. However, this gives me the following result:

alt text

Only when I distance the cards by steps of 20 units in depth do I get the desired effect:

alt text

I was wondering why is it that separating the cards on steps of 1 unit in depth doesn't create the same effect on rendering order. The problem with separating them by 20 units is that the sizes of the two edge cards are too different. It also creates this "spiral" type of pattern, rather than a clean circular pattern. Is there any other solution for this?

Thanks!

unity 2013-09-23 19-30-12-06.jpg (12.1 kB)
unity 2013-09-23 19-34-34-31.jpg (10.8 kB)
Comment
Add comment · Show 2
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 Fattie · Sep 24, 2013 at 02:10 PM 0
Share

incidentally you are using ORTHOGRAPHIC camera correct?

avatar image Hans D. · Sep 24, 2013 at 05:32 PM 0
Share

I'm actually using a perspective camera, since the other objects on the scene are all 3D. It's only the cards which are 2D.

1 Reply

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

Answer by Hans D. · Sep 24, 2013 at 05:32 PM

Thanks for the input guys. After searching a little bit more I found my problem in this thread.

I'm using a perspective camera since other objects in the scene are all 3D, the only 2D objects are the cards. As recommended in that thread, what I did to solve it is set

 Camera.main.transparencySortMode = TransparencySortMode.Orthographic;

And set my card textures as transparent. That made them sort correctly by depth, producing the desired result. Thanks!

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

16 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

Related Questions

Queue Order and Billboarded Trees 0 Answers

render order/ multipass shaders (hidden surface shader path) 1 Answer

Render object through terrain 2 Answers

render object on top of everything with dynamic shadows (for mobile) 1 Answer

Render GUI-Component in front of another on same Object? 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