Синтаксис:
Используется glsl
Shader "Sepia" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
float3 IntensityConverter = float3(0.299, 0.587, 0.114);
float Y = dot(IntensityConverter, c.rgb);
float3 sepiaConvert = float3(0.191, -0.054,-0.221);
c.rgb = float3(Y, Y, Y) + sepiaConvert;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
float3 IntensityConverter = float3(0.299, 0.587, 0.114);
float Y = dot(IntensityConverter, c.rgb);
float3 sepiaConvert = float3(0.191, -0.054,-0.221);
c.rgb = float3(Y, Y, Y) + sepiaConvert;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}