- Home /
Shader queue tags not working...?
Hi,
So firstly, I'm very new to writing shaders, so yeah... Ok, I'm trying to make a sort of unlit shader which renders after everything else. I don't need it to display a texture, I just need it to be a solid colour. Here's what I've got so far:
Shader "Unlit/Colour Overlay" {
Properties {
_Color ("Color", Color) = (1,1,1)
}
SubShader {
Tags {"Queue"="Overlay"}
Color [_Color]
Pass {
}
}
}
Currently, this shader works all except the rendering order. I thought that line 7 would make it render after everything else, but it doesn't always. Out of the diffuse shader, the unlit texture shader, the transparent diffuse shader and a custom shader I made which is basically this except with "Geometry" instead of "Overlay", the only one which this shader would render after was the transparent one. For all the others, if I had an object between an object with this shader and the camera, it would cover it up.
What's confusing me is that I found a list in the manual of the order that these things should render in - it should go like this: Background Geometry AlphaTest Transparent Overlay
So in theory, if my shader's rendering after transparent, it should be rendering after geometry too.
I'm probably missing something very simple here, like I said I'm very new to writing shaders, but I just don't understand what's going wrong here. Anyone got any ideas what the problem could be?
Thanks
you might have the same issue I had, see here: http://answers.unity3d.com/questions/1021267/changing-queue-in-shader-has-no-effect.html#answer-1021472
Answer by Owen-Reynolds · Feb 07, 2015 at 05:09 AM
Sorting layers are for overlapping transparent objects. There's another AlphaTest/ZTest setting which can tell you to always draw it, even if behind a solid object (as long as nothing in front of it is on a higher sorting layer.)
Your answer
Follow this Question
Related Questions
Standard Shader Still Visible through Stencil Shader 0 Answers
Fake Volumetrics via custom bloom 0 Answers
URP Blit Render Feature not rendering in Single Pass Instanced VR 0 Answers
Converting c# function to shader. 0 Answers
HDRP DepthMask Possible? 0 Answers