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 /
This question was closed Sep 03, 2014 at 10:55 AM by Josh Naylor for the following reason:

Too subjective and argumentative

avatar image
0
Question by GlennNZ · Sep 03, 2014 at 10:55 AM · shaderrenderqueuezwrite

material.renderQueue depends on ZWrite?

I would look to render certain objects in my world so that certain ones are always on top of others. This is so that I can solve some z-fighting issues (e.g. grass will always render on top of concrete, both of which are polygons at y=0) and so that some of my HUD-like icons that are rendered in 3D will always be on top of the game world.

I'm aware of GameObject.renderer.material.renderQueue, that I can set it in the shader with something like "Queue"="Geometry+1" and that it can't be changed at runtime.

What I don't understand is its relationship with the shader's ZWrite property.

From experimenting it seems that the use of ZWrite is all-or-nothing, meaning I have to set ZWrite Off for every single shader even if I only want to force one GameObject on top of the rest.

For example, lets say I have a world where every single object uses the default renderer queue value of 2000 (which is the "Geometry" value), but I have some HUD-like-icons that I want to always be on top. So I set the renderQueue of the HUD-like-icons to 2001 (Geometry+1) and turn the ZWrite to Off (or On, it doesn't matter) but it won't work at all until I go into the shaders being used by the world objects and set ZWrite to off in there as well.

Is this correct? I just seems a bit weird to me that I have to edit every shader to ZWrite Off just so that I can ensure one particular GameObject is on top of all the others.

Thanks.

Comment
Comments Locked · 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 Josh Naylor ♦♦ · Sep 03, 2014 at 10:55 AM 0
Share

Possibly a question for the forums.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Help converting stencil shader in HDRP 1 Answer

My Transparency Shader Is No Longer Working on Mobile? 0 Answers

How to Set Custom UI Image Material Render Order? 0 Answers

Render mesh in front of another mesh but not in general 2 Answers

ZWrite only for the object itself 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