From eaed51d05de9356e81dc71026a3cfeb178c079aa Mon Sep 17 00:00:00 2001 From: shuklaaryan367-byte Date: Wed, 14 Jan 2026 13:22:26 +0530 Subject: [PATCH 1/2] Added default falloff to noiseDetail() in 2.x and updated validation --- docs/parameterData.json | 9 ++++++--- src/math/noise.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/parameterData.json b/docs/parameterData.json index 494f63f022..a7fba5bd7b 100644 --- a/docs/parameterData.json +++ b/docs/parameterData.json @@ -1485,11 +1485,14 @@ "noiseDetail": { "overloads": [ [ - "Number", + "Number" + ], + [ + "Number", "Number" ] - ] - }, + ] +}, "noiseSeed": { "overloads": [ [ diff --git a/src/math/noise.js b/src/math/noise.js index c5fa491730..3a9ee50cc8 100644 --- a/src/math/noise.js +++ b/src/math/noise.js @@ -343,7 +343,7 @@ function noise(p5, fn){ * * @method noiseDetail * @param {Number} lod number of octaves to be used by the noise. - * @param {Number} falloff falloff factor for each octave. + * @param {Number} [falloff=0.5] falloff factor for each octave. * * @example *
@@ -388,7 +388,7 @@ function noise(p5, fn){ * *
*/ - fn.noiseDetail = function(lod, falloff) { + fn.noiseDetail = function(lod, falloff=0.5) { if (lod > 0) { perlin_octaves = lod; } From 2de0bca828a456b73d6286cdabe3cfc4eb51160a Mon Sep 17 00:00:00 2001 From: shuklaaryan367-byte Date: Thu, 22 Jan 2026 14:35:06 +0530 Subject: [PATCH 2/2] Add default falloff handling to strands noiseDetail override --- src/strands/strands_api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strands/strands_api.js b/src/strands/strands_api.js index 90d9031cc8..cb8624e136 100644 --- a/src/strands/strands_api.js +++ b/src/strands/strands_api.js @@ -165,7 +165,7 @@ export function initGlobalStrandsAPI(p5, fn, strandsContext) { strandsContext._noiseOctaves = null; strandsContext._noiseAmpFalloff = null; - fn.noiseDetail = function (lod, falloff) { + fn.noiseDetail = function (lod, falloff = 0.5) { if (!strandsContext.active) { return originalNoiseDetail.apply(this, arguments); }