Skip to content

Commit eaed51d

Browse files
Added default falloff to noiseDetail() in 2.x and updated validation
1 parent f8a43b0 commit eaed51d

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

docs/parameterData.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,11 +1485,14 @@
14851485
"noiseDetail": {
14861486
"overloads": [
14871487
[
1488-
"Number",
1488+
"Number"
1489+
],
1490+
[
1491+
"Number",
14891492
"Number"
14901493
]
1491-
]
1492-
},
1494+
]
1495+
},
14931496
"noiseSeed": {
14941497
"overloads": [
14951498
[

src/math/noise.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ function noise(p5, fn){
343343
*
344344
* @method noiseDetail
345345
* @param {Number} lod number of octaves to be used by the noise.
346-
* @param {Number} falloff falloff factor for each octave.
346+
* @param {Number} [falloff=0.5] falloff factor for each octave.
347347
*
348348
* @example
349349
* <div>
@@ -388,7 +388,7 @@ function noise(p5, fn){
388388
* </code>
389389
* </div>
390390
*/
391-
fn.noiseDetail = function(lod, falloff) {
391+
fn.noiseDetail = function(lod, falloff=0.5) {
392392
if (lod > 0) {
393393
perlin_octaves = lod;
394394
}

0 commit comments

Comments
 (0)