Pixel-Composer/shaders/sh_node_circle/sh_node_circle.fsh

21 lines
416 B
Plaintext
Raw Normal View History

2024-04-22 08:08:37 +02:00
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec4 color;
2024-05-31 09:18:09 +02:00
uniform float thickness;
uniform float antialias;
2024-04-22 08:08:37 +02:00
void main() {
float dist = abs(length(v_vTexcoord - .5) * 2. - 0.9);
float a;
2024-05-31 09:18:09 +02:00
vec4 c = vec4(0.);
float th = thickness == 0.? 0.05 : thickness;
float aa = antialias == 0.? 0.05 : antialias;
2024-04-22 08:08:37 +02:00
2024-05-31 09:18:09 +02:00
a = smoothstep(th + antialias, th, dist);
2024-04-22 08:08:37 +02:00
c = mix(c, color, a);
gl_FragColor = c;
}