Skip to content

Instantly share code, notes, and snippets.

@sansuke05
Last active December 10, 2018 08:50
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 sansuke05/2288be9bae771b0832d29085530df23d to your computer and use it in GitHub Desktop.
Save sansuke05/2288be9bae771b0832d29085530df23d to your computer and use it in GitHub Desktop.
Shader "Custom/Circle" {
Properties {
_MainTex("Main Texture", 2D) = "white" {}
_Color("Base Color", Color) = (0, 0, 0, 1)
}
SubShader {
Tags {
"RenderType" = "Opaque"
}
LOD 200
CGPROGRAM
#pragma surface surf Standard
#pragma target 3.0
struct Input {
float2 uv_MainTex;
};
fixed4 _Color;
void surf(Input IN, inout SurfaceOutputStandard o) {
fixed4 w = fixed4(1, 1, 1, 1);
float dist = distance( float2(0.5, 0.5), IN.uv_MainTex)*10;
float val = abs(sin(dist*3.0));
o.Albedo = val > 0.98 ? w : _Color ;
}
ENDCG
}
Fallback "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment