Question by
Jiri-P · Mar 11, 2016 at 01:53 PM ·
guishadersshader programmingshaderlabshader writing
How to affect Shader _Color by the Tint Color of Button (Through Shader)
Hi All,
I would like to ask, how to rewrite following simple luminance shader, to be able to affect its _Color by component tint color, eg. by button tint (image color and transition states colors) etc. The answer should be - the same way how eg. the builtin GUI/Text Shader does, but with that luminance effect. But I can not figure it out.
I would like to use that shader for UI grayscale sprites and make it to work with color tint transitions of button.
Here is the difference between 1. classic tint - 2. luminance tint - 3. only texture
And here is the luminance shader:
Shader "Custom/Luminosity"
{
Properties
{
_Color("Tint", Color) = (0.5, 0.5, 0.5, 1.0)
}
SubShader
{
Tags
{
"Queue" = "Transparent"
}
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
SetTexture[_MainTex]
{
constantColor[_Color]
combine texture * constant quad, texture * constant
}
}
}
}
shadercomparison.jpg
(27.9 kB)
Comment