17 lines
492 B
Plaintext
17 lines
492 B
Plaintext
vec4 circle(in vec2 uv, in vec2 pos, float rad, in vec3 color) {
|
|
float d = length(pos - uv) - rad;
|
|
float t = clamp(d, 0.0, 1.0);
|
|
return vec4(color, t);
|
|
}
|
|
void fragment(){
|
|
vec2 uv = FRAGCOORD.xy;
|
|
vec2 res_xy = vec2(1.0/SCREEN_PIXEL_SIZE.x, 1.0/SCREEN_PIXEL_SIZE.y);
|
|
vec2 center = res_xy*0.5;
|
|
float radius = 0.05 * res_xy.y;
|
|
|
|
vec4 layer1 = vec4(vec3(0), 0.0);
|
|
|
|
vec4 layer2 = circle(uv, center, radius, vec3(0));
|
|
|
|
COLOR = mix(layer1, layer2, layer2.a);
|
|
} |