summaryrefslogtreecommitdiff
path: root/pugl.js
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-27 20:21:58 -0400
committerpommicket <pommicket@gmail.com>2023-08-27 20:22:41 -0400
commitf790b4e1baa5dfe1296cf0887011583bee7afca8 (patch)
treea5cbcc3558f39bd3754dfceb9e4ba9f3d4dc0c28 /pugl.js
parent9e0ac08aa6d804fae327cd3ec4850aa0dcdbde6f (diff)
minimum, maximum
Diffstat (limited to 'pugl.js')
-rw-r--r--pugl.js28
1 files changed, 24 insertions, 4 deletions
diff --git a/pugl.js b/pugl.js
index 2448271..f1744dd 100644
--- a/pugl.js
+++ b/pugl.js
@@ -3,10 +3,6 @@
/*
TODO:
- guide
-- about dialog
-- widgets:
- - min
- - max
*/
const APP_ID = 'dh3YgVZQdX1Q';
@@ -911,6 +907,30 @@ float worley(vec3 p, vec3 freq) {
return sqrt(sqd);
}
`,
+ `
+//! .name: Minimum
+//! .description: minimum of two values
+//! .category: math
+//! .id: min
+` +
+ GLSL_FLOAT_TYPES.map(
+ (type) => `
+${type} _min(${type} x, ${type} y) {
+ return min(x, y);
+}`,
+ ).join('\n'),
+ `
+//! .name: Maximum
+//! .description: maximum of two values
+//! .category: math
+//! .id: max
+` +
+ GLSL_FLOAT_TYPES.map(
+ (type) => `
+${type} _max(${type} x, ${type} y) {
+ return max(x, y);
+}`,
+ ).join('\n'),
];
function auto_update_enabled() {