diff options
-rw-r--r-- | fractiform.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fractiform.js b/fractiform.js index 2889f06..516b85e 100644 --- a/fractiform.js +++ b/fractiform.js @@ -7,7 +7,6 @@ TODO: - enable/disable auto-update - resolution - widgets: - - white noise - worley noise - perlin noise */ @@ -688,6 +687,23 @@ float dist(${type} x, ${type} y) { return distance(x, y); } float dot_prod(${type} x, ${type} y) { return dot(x, y); } `, ).join('\n'), + ` +//! .name: White noise +//! .description: Pure noise +//! .category: noise + +float wnoise(vec4 x) +{ + uint k = 134775813u; + uvec4 u = floatBitsToUint(x) * k; + u = ((u >> 8) ^ u.yzwx) * k; + u = ((u >> 8) ^ u.yzwx) * k; + u = ((u >> 8) ^ u.yzwx) * k; + return float(u >> 8) * (1.0 / 16777216.0); +} + + +`, ]; function auto_update_enabled() { |