Quantcast
Channel: Questions in topic: "renderqueue"
Viewing all articles
Browse latest Browse all 161

material.renderQueue depends on ZWrite?

$
0
0
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.

Viewing all articles
Browse latest Browse all 161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>