Tue, 17 Jun 2025 19:00:20 +0200
use functions instead of Boolean logic
shader/rectangle_frag.glsl | file | annotate | diff | comparison | revisions |
--- a/shader/rectangle_frag.glsl Mon Jun 16 20:58:51 2025 +0200 +++ b/shader/rectangle_frag.glsl Tue Jun 17 19:00:20 2025 +0200 @@ -11,7 +11,7 @@ #ifdef FILL diffuse = color; #else - if (uvcoord.x < thickness || uvcoord.x >= size.x - thickness || uvcoord.y < thickness || uvcoord.y >= size.y-thickness) { + if (any(notEqual(1.0-step(thickness, uvcoord)+step(size-thickness, uvcoord), vec2(0.0)))) { diffuse = color; } else { discard;