I’m trying to make a shader which contains 3 textures, where each texture has its own color.
I’ve done research and written some code but I haven’t found a solution yet, so I’m looking for help.
This is what I’m trying to achieve:
As you can see, there are 3 textures on top of each other and 3 colors. The color C1 has be assigned to the texture T1 and so on. These textures have an alpha channel and the alpha channel has to be preserved. Each color must not affect the color of other textures.
This is the base code:
Shader "MultipleTexturesMultipleColors" {
Properties {
_C1 ("C1", Color) = (1,1,1,1)
_C2 ("C2", Color) = (1,1,1,1)
_C2 ("C3", Color) = (1,1,1,1)
_T1 ("T1", 2D) = "" {}
_T2 ("T2", 2D) = "" {}
_T3 ("T3", 2D) = "" {}
}
SubShader {
Pass {
Material {
Diffuse [_C1]
}
AlphaTest Greater 0.5
SetTexture [_T1] { combine texture }
SetTexture [_T2] { combine texture lerp (texture) previous }
SetTexture [_T3] { combine texture lerp (texture) previous }
}
}
}