Hi
Can somebody help me with this shader?
I have two colors which I want to blend between using an alpha-texture. This works fine. Now I need to add support for a “blend-weight”. This should work as to shift the blending between the two colors to be only Color1 when Weight is 0 and only Color2 when Weight is 1, no matter what the texture says. When Weight is 0.5 it should be an even blend according to the texture as normal.
But what do I need to change?
Shader “ColorBlender” {
Properties {
_Color1 (“Color1”, Color) = (0,0,1,1)
_Color2 (“Color2”, Color) = (1,0,0,1)
_Weight (“Weight”, Range (0.0,1.0)) = 0.5
_MainTex (“Texture”, 2D) = “white” {}
}
SubShader {
Tags { “Queue” = “Transparent” }
Pass {
Lighting Off
Cull Off
Color [_Color1]
SetTexture [_MainTex]
{
ConstantColor [_Color2]
Combine constant Lerp(texture) primary
}
}
}
}