Скриншот не прикладываю
Синтаксис:
Используется glsl
//mix 2 maincolors by mask
Shader "DiffuseColorMix" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_Color2 ("Main Color2", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_MixMask ("Mask (R)", 2D) = "black" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
sampler2D _MixMask;
float4 _Color;
float4 _Color2;
struct Input {
float2 uv_MainTex;
float2 uv_MixMask;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 tex = tex2D(_MainTex, IN.uv_MainTex);
half4 mask = tex2D(_MixMask, IN.uv_MixMask);
half4 c = lerp(_Color, _Color2, mask.r) * tex;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "VertexLit"
}
Shader "DiffuseColorMix" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_Color2 ("Main Color2", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_MixMask ("Mask (R)", 2D) = "black" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
sampler2D _MixMask;
float4 _Color;
float4 _Color2;
struct Input {
float2 uv_MainTex;
float2 uv_MixMask;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 tex = tex2D(_MainTex, IN.uv_MainTex);
half4 mask = tex2D(_MixMask, IN.uv_MixMask);
half4 c = lerp(_Color, _Color2, mask.r) * tex;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "VertexLit"
}