You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
876 B
46 lines
876 B
// Colorful FX - Unity Asset |
|
// Copyright (c) 2015 - Thomas Hourdel |
|
// http://www.thomashourdel.com |
|
|
|
Shader "Hidden/Colorful/Gradient Ramp" |
|
{ |
|
Properties |
|
{ |
|
_MainTex ("Base (RGB)", 2D) = "white" {} |
|
_RampTex ("Ramp (RGB)", 2D) = "white" {} |
|
_Amount ("Amount", Range(0.0, 1.0)) = 1.0 |
|
} |
|
|
|
SubShader |
|
{ |
|
Pass |
|
{ |
|
ZTest Always Cull Off ZWrite Off |
|
Fog { Mode off } |
|
|
|
CGPROGRAM |
|
|
|
#pragma vertex vert_img |
|
#pragma fragment frag |
|
#pragma fragmentoption ARB_precision_hint_fastest |
|
#include "UnityCG.cginc" |
|
#include "./Colorful.cginc" |
|
|
|
sampler2D _MainTex; |
|
sampler2D _RampTex; |
|
half _Amount; |
|
|
|
half4 frag(v2f_img i) : SV_Target |
|
{ |
|
half4 color = tex2D(_MainTex, i.uv); |
|
half2 lum = luminance(color).rr; |
|
half4 result = tex2D(_RampTex, lum); |
|
return lerp(color, result, _Amount); |
|
} |
|
|
|
ENDCG |
|
} |
|
} |
|
|
|
FallBack off |
|
}
|
|
|