Last active
January 13, 2017 16:41
-
-
Save midoruton/1afd1c08072502a67a665229c03ecf77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/NegaLinear" { | |
Properties{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_NegaOffs("NegaOffs",Range(-1,1))=1 | |
} | |
SubShader { | |
Pass { | |
CGPROGRAM | |
#include "UnityCG.cginc" | |
#pragma vertex vert_img | |
#pragma fragment frag | |
sampler2D _MainTex; | |
float _NegaOffs; | |
fixed4 frag(v2f_img i) : COLOR{ | |
fixed4 c = tex2D(_MainTex,i.uv); | |
float3 tex = float3(_NegaOffs,_NegaOffs,_NegaOffs)*(c.rgb-float3(0.5,0.5,0.5))+float3(0.5,0.5,0.5); | |
c.rgb = tex; | |
return c; | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment