ディスタンスフィールドで円を描画
Shader "Test"
{
Properties{}
CGINCLUDE
#include "UnityCG.cginc"
float4 frag(v2f_img i) : SV_Target
{
float2 d = distance(float2(0.5, 0.5), i.uv);
float threshold = abs(sin(_Time.y))*0.5;
d = step(d, threshold);
return d.x;
}
ENDCG
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
ENDCG
}
}
}