Advertisement
netgrind

Hole

Jul 10th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. Shader "Hole" {
  2.     Properties {
  3.         _MainTex ("Base (RGB)", 2D) = "white" {}
  4.         _LeftEye ("Left Eye",Vector) = (0,0,0,0)
  5.         _LeftOval("Left Eye Oval", float)= 1
  6.     }
  7.     Category {
  8.         Blend SrcAlpha OneMinusSrcAlpha
  9.         Tags {Queue = Transparent}
  10.         SubShader {
  11.             Pass{
  12.             CGPROGRAM
  13.             #pragma vertex vert_img
  14.             #pragma fragment frag  
  15.             #pragma target 3.0
  16.             #include "UnityCG.cginc"   
  17.                 sampler2D _MainTex;
  18.                 float4 _LeftEye;
  19.                 float _LeftOval;                   
  20.                                    
  21.                 float4 frag(v2f_img i) : COLOR {
  22.                     float4 c = tex2D (_MainTex, i.uv);//samples the texture
  23.                     c.a = clamp(distance(float2(i.uv.x,(_LeftEye.y-i.uv.y)*_LeftOval+i.uv.y), _LeftEye)*_LeftEye.z+_LeftEye.w,0,1);
  24.                     return c;
  25.                 }
  26.             ENDCG
  27.             }
  28.         }
  29.     }
  30.     FallBack "Diffuse"
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement