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 /
avatar image
0
Question by BerenBotje · Jul 07, 2019 at 08:12 PM · renderingrenderqueuerendersettings

Should I concern myself with Render Queue since it's often made public in the inspector?

When I download shaders en scripts from the assets store I noticed that they contained quite often Public Render Queue's with a default value of 3000. I know that Render Queue's are telling Unity what to render first, so should I concern myself with that or in some situations? Why is the default value a lot of times 3000?

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

1 Reply

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

Answer by Bunny83 · Jul 07, 2019 at 08:34 PM

Well, the render queue is actually an integer which specifies the order in which the different materials are rendered. However there are well defined ranges which have a distinct meaning. Have a look at this page where the different render queue "groups" / ranges are explained:

 Background   = 1000
 Geometry     = 2000
 AlphaTest    = 2450
 Transparent  = 3000
 Overlay      = 4000

The important thing is the number 2500. All queues from 0 - 2500 are considered opaque. Everything above 2501+ is considered transparent. This has a major impact on how they are rendered.


Opaque geometry (everything with a renderqueue up to 2500) is rendered Front to Back. Transparent geometry is rendered Back to Front. Note that this only depends on the render queue, not on what the shader actually does. Transparent geometry has to be rendered back to front to get proper blending (See Painter's algorithm).


The reason why opaque geometriy is sorted the other way round is to avoid overdraw. Your GPU has a certain fillrate. If you draw opaque objects which are close to the camera first they will, thanks to the depth buffer, prevent any drawing in those screen areas where there might be more objects further away.


Note that Unity sorts the objects just on the pivot / origin positions fro mthe camera and not on a per triangle basis. Keep in mind that shaders like Transparancy cutout shaders are not actual transparent shaders. Since they do not need to perform any kind of blending they are actually rendered with the opaque objects. The fragment shader just either renders an opaque fragment or non at all (because it discards the fragment). That's why cutout shaders are way better for performance.

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 BerenBotje · Jul 08, 2019 at 04:35 PM 0
Share

Thank you for ur good explanation! So if I put a background(skybox) image in my scene is it the shader that contains the render queue order or is it the distance to the camera that will deter$$anonymous$$e the render order? Do u also know why Overlay is rendered lastly, shouldn't you make it render first with a depth buffer(if u have a HP bar then that area will never contain any opaque geometry?). @Bunny83 (I maybe have posted 2 same comments but I can see only one)

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

129 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

Related Questions

How do i change the Alphasorting Center to the Pivot in Meshrenderers? 0 Answers

What is the best way to render groups of flat planes using a shader 1 Answer

Extend screen space reflections in hdrp 0 Answers

How to change Render mode in URP at runtime? 1 Answer

Always render object behind everything (not multiple cameras) 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