Skip to content

Instantly share code, notes, and snippets.

@keijiro
Created November 1, 2016 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keijiro/ad668fc2f48b2da140f81e2ba7fd9074 to your computer and use it in GitHub Desktop.
Save keijiro/ad668fc2f48b2da140f81e2ba7fd9074 to your computer and use it in GitHub Desktop.
fixed4 frag(v2f IN) : SV_Target
{
half2 uv = IN.texcoord.xy;
fixed4 c = tex2D(_MainTex, uv) * IN.color;
half a1 = atan2(uv.x - 0.5, 0.5 - uv.y);
half a2 = atan2(ddx(uv.y), ddx(uv.x));
c.rgb = max((a1 < a2) * c.r, c.g);
return c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment