diff options
author | pommicket <pommicket@gmail.com> | 2023-08-27 20:21:58 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-27 20:22:41 -0400 |
commit | f790b4e1baa5dfe1296cf0887011583bee7afca8 (patch) | |
tree | a5cbcc3558f39bd3754dfceb9e4ba9f3d4dc0c28 /pugl.js | |
parent | 9e0ac08aa6d804fae327cd3ec4850aa0dcdbde6f (diff) |
minimum, maximum
Diffstat (limited to 'pugl.js')
-rw-r--r-- | pugl.js | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -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() { |