Синтаксис:
Используется glsl
Shader "ImageProc/ColorSaturation" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Sat("Sat", Float) = 0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
float _Sat;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
float Lum = dot(c, float3(0.2126, 0.7152, 0.0722));
half3 color = lerp(Lum.xxx, c, _Sat);
o.Albedo = color;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Sat("Sat", Float) = 0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
float _Sat;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
float Lum = dot(c, float3(0.2126, 0.7152, 0.0722));
half3 color = lerp(Lum.xxx, c, _Sat);
o.Albedo = color;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}