Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fixed4 frag(v2f IN) : SV_Target
- {
- fixed4 c = tex2D (_MainTex, IN.texcoord);
- clip(c.a-1);
- // Get the neighbouring four pixels.
- fixed4 pixelUp = tex2D(_MainTex, IN.texcoord + fixed2(0, _MainTex_TexelSize.y));
- fixed4 pixelDown = tex2D(_MainTex, IN.texcoord - fixed2(0, _MainTex_TexelSize.y));
- fixed4 pixelRight = tex2D(_MainTex, IN.texcoord + fixed2(_MainTex_TexelSize.x, 0));
- fixed4 pixelLeft = tex2D(_MainTex, IN.texcoord - fixed2(_MainTex_TexelSize.x, 0));
- fixed noAlpha = pixelUp.a * pixelDown.a * pixelRight.a * pixelLeft.a;
- fixed anyAlpha = 1 - noAlpha;
- c = c * IN.color.a + IN.color;
- return c * noAlpha + _Outline * anyAlpha;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement