gemini glow fixes + positioning for window view
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 28s
Rust / build (pull_request) Successful in 50s
Python / verify (pull_request) Successful in 1m38s
Rust / fmt (pull_request) Successful in 27s
Rust / clippy (pull_request) Successful in 53s
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 28s
Rust / build (pull_request) Successful in 50s
Python / verify (pull_request) Successful in 1m38s
Rust / fmt (pull_request) Successful in 27s
Rust / clippy (pull_request) Successful in 53s
This commit is contained in:
@@ -50,6 +50,18 @@ void main()
|
||||
float r = clamp(radius, 0.0, min(rectSize.x, rectSize.y) * 0.5);
|
||||
float d = sdRoundBox(p, rectSize * 0.5, r);
|
||||
|
||||
// ~1px antialiasing width
|
||||
float aa = max(fwidth(d), 0.75);
|
||||
|
||||
// Coverage of the shape: 1 inside, 0 outside, soft across the edge
|
||||
float inside = 1.0 - smoothstep(-aa, aa, d);
|
||||
|
||||
// Only skip work when clearly outside and there's no outer glow
|
||||
if (glowSize <= 0.0 && d > aa) {
|
||||
fragColor = vec4(0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
float ang = atan(p.y, p.x);
|
||||
float a2 = phase * TAU;
|
||||
float u = ang / TAU + 0.5 + phase;
|
||||
@@ -59,20 +71,28 @@ void main()
|
||||
float g = 0.0;
|
||||
if (d > 0.0) {
|
||||
float t = clamp(d / max(glowSize, 0.001), 0.0, 1.0);
|
||||
g = pow(1.0 - t, 3.0);
|
||||
g = (glowSize > 0.0) ? pow(1.0 - t, 3.0) : 0.0;
|
||||
} else if (innerGlow > 0.0) {
|
||||
g = exp(d / innerGlow * 3.0);
|
||||
float t = clamp(-d / innerGlow, 0.0, 1.0);
|
||||
g = pow(1.0 - t, 3.0);
|
||||
}
|
||||
|
||||
float pulse = 0.9 + 0.1 * sin(a2 * 2.0 + ang);
|
||||
g *= pulse;
|
||||
|
||||
// Line: inside only, with a soft inner edge AND a soft outer edge
|
||||
float line = 0.0;
|
||||
if (lineWidth > 0.0)
|
||||
line = 1.0 - smoothstep(0.0, lineWidth, abs(d));
|
||||
if (lineWidth > 0.0) {
|
||||
float inner = 1.0 - smoothstep(lineWidth - aa, lineWidth + aa, -d);
|
||||
line = inner * inside;
|
||||
}
|
||||
|
||||
float a = clamp(g * intensity + line * 0.9, 0.0, 1.0);
|
||||
|
||||
// Antialias the outer silhouette when there is no outer glow
|
||||
if (glowSize <= 0.0)
|
||||
a *= inside;
|
||||
|
||||
col = mix(col, vec3(1.0), line * 0.25);
|
||||
|
||||
a += (hash(gl_FragCoord.xy) - 0.5) / 255.0;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user