use functions instead of Boolean logic

Tue, 17 Jun 2025 19:00:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 17 Jun 2025 19:00:20 +0200
changeset 157
d6c2f028d8c9
parent 156
bd15eeaa88c0
child 158
f650994ec543

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;

mercurial