diff --git a/docs/parameterData.json b/docs/parameterData.json index 3911862da2..567ba1b3ea 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; } diff --git a/src/strands/strands_api.js b/src/strands/strands_api.js index 7d99a2e194..087da8a8eb 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); }