12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- Shader "SupGames/Shaders/Sharpen"
- {
- Properties
- {
- _MainTex("Base (RGB)", 2D) = "" {}
- }
- CGINCLUDE
- #include "UnityCG.cginc"
- struct appdata {
- half4 pos : POSITION;
- half2 uv : TEXCOORD0;
- };
- struct v2f
- {
- half4 pos : SV_POSITION;
- half2 uv : TEXCOORD0;
- half4 uv1 : TEXCOORD1;
- };
- uniform sampler2D _MainTex;
- uniform half _CentralFactor;
- uniform half _SideFactor;
- uniform half4 _MainTex_TexelSize;
- v2f vert(appdata v)
- {
- v2f o;
- o.pos = UnityObjectToClipPos(v.pos);
- o.uv = v.uv;
- o.uv1 = half4(v.uv - _MainTex_TexelSize.xy, v.uv + _MainTex_TexelSize.xy);
- return o;
- }
- half4 frag(v2f i) : SV_Target
- {
- half4 c = tex2D(_MainTex, i.uv) * _CentralFactor;
- c -= tex2D(_MainTex, i.uv1.xy) * _SideFactor;
- c -= tex2D(_MainTex, i.uv1.xw) * _SideFactor;
- c -= tex2D(_MainTex, i.uv1.zy) * _SideFactor;
- c -= tex2D(_MainTex, i.uv1.zw) * _SideFactor;
- return c;
- }
- ENDCG
- Subshader
- {
- Pass
- {
- ZTest Always Cull Off ZWrite Off
- Fog { Mode off }
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma fragmentoption ARB_precision_hint_fastest
- ENDCG
- }
- }
- Fallback off
- }
|