1 Shader "Hidden/Color Correction Effect" {
2 Properties {
3     _MainTex (
"Base (RGB)", 2D) = "white" {}
4     _RampTex (
"Base (RGB)", 2D) = "grayscaleRamp" {}
5 }
6
7 SubShader {
8     Pass {
9         ZTest Always Cull Off ZWrite Off
10
11 CGPROGRAM
12 #pragma vertex vert_img
13 #pragma fragment frag
14 #include
"UnityCG.cginc"
15
16 uniform sampler2D _MainTex;
17 uniform sampler2D _RampTex;
18
19 fixed4 frag (v2f_img i) : SV_Target
20 {
21     fixed4 orig = tex2D(_MainTex, i.uv);
22     
23     
fixed rr = tex2D(_RampTex, orig.rr).r;
24     
fixed gg = tex2D(_RampTex, orig.gg).g;
25     
fixed bb = tex2D(_RampTex, orig.bb).b;
26     
27     fixed4 color = fixed4(rr, gg, bb, orig.a);
28
29     
return color;
30 }
31 ENDCG
32
33     }
34 }
35
36 Fallback off
37
38 }


Gõ tìm kiếm nhanh...