20 lines
460 B
GLSL
20 lines
460 B
GLSL
#version 330 core
|
|
out vec4 FragColor;
|
|
|
|
varying vec2 val;
|
|
|
|
void main() {
|
|
float radius = 1.0f;
|
|
float radius2 = 0.5f;
|
|
float smoothing = 0.005f;
|
|
float dist = sqrt(dot(val,val));
|
|
|
|
if (dist > radius || dist < radius2) {
|
|
discard;
|
|
}
|
|
float sm = smoothstep(radius, radius - smoothing, dist);
|
|
float sm2 = smoothstep(radius2, radius2 + smoothing, dist);
|
|
float alpha = sm * sm2;
|
|
FragColor = vec4(1.0, 0.0, 0.0, alpha);
|
|
}
|