Hey Everyone,
I am trying to making a shader that contains 2 textures and colors that support transparency. I want to use a coroutine to fade between the two textures as a transition effect. I looked over the documentation and the default shaders but I couldn’t come up with anything substantial. I was wondering if you guys can help me complete my code and tell me what is wrong with it.
Shader "Custom/UnlitTransparent" {
Properties {
_Color ("Main Color", Color) = (1,0.5,0.5,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_OtherColor ("Other Color", Color) = (1,0.5,0.5,1)
_OtherTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
//ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Lighting Off
Material {
Diffuse [_Color]
}
SetTexture [_MainTex] { combine texture }
}
Pass
{
Lighting Off
Blend DstAlpha OneMinusSrcAlpha
Material {
Diffuse [_OtherColor]
}
SetTexture [_OtherTex] {
combine texture lerp (texture) previous
}
}
}
}