- Home /
"Queue"="Transparent" not working (on iOS).
I have this simple shader here... Shader "MyShaders/Overlay" { Properties { _Color ("Main Color", Color) = (1,1,1,1) _MainTex ("Texture", 2D) = "white" {} }
Category {
Tags {"Queue"="Overlay" "RenderType"="Transparent"}
ZWrite Off
Alphatest Greater 0
Blend SrcAlpha OneMinusSrcAlpha
SubShader {
Material {
Diffuse [_Color]
Ambient [_Color]
}
Pass {
Cull Back
ColorMaterial AmbientAndDiffuse
Lighting Off
SetTexture [_MainTex] {
Combine texture * primary, texture * primary
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine previous * constant, previous * constant
}
}
}
}
}
...wich doesn't work as supposed to do.
I need it to render above everything in the scene, (and it should do it, since "Queue" is set up to "Overlay"), but I've the feeling that it's completely ignoring the "Queue" tag. No matter how I change it, it always renders like its queue is "Transparent". Other objects in the scene are all rendered in Geometry and Transparent queue, and their depth sorting is perfect. This is the only one not working.
Any suggestions? Did I write something wrong? Thanks!
Answer by Mortennobel · Aug 28, 2011 at 06:06 PM
Use
ZTest Always
See also this http://answers.unity3d.com/questions/50131/simple-shader-question.html
The "Queue" specifies the order of the rendering (but the rendering may still be skipped by the zbuffer test). Changing the render-queue is needed for performance tuning and making sure that transparent objects are rendered last (since they should never be overdrawn by an opaque object).
Fantastic, it's working exactly as I want. Thank you very much, and thanks also for the explanation. :)
Your answer
Follow this Question
Related Questions
What shader blending modes don't work on iOS? 1 Answer
VertexLit Hilight Shader - Flicker on iOS Problem 1 Answer
Weird iPad render bug 0 Answers
Glow and Bloom Effects on iPhone 3 Answers
Problems with depth buffer only pass on iPhone 8/8+ 0 Answers