@tsparticles/fractal-noise 4.0.0-alpha.2 → 4.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/FractalNoise.js +2 -2
- package/cjs/FractalNoise.js +2 -2
- package/esm/FractalNoise.js +2 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.fractal.noise.js +13 -13
- package/tsparticles.fractal.noise.min.js +1 -2
- package/umd/FractalNoise.js +2 -2
- package/tsparticles.fractal.noise.min.js.LICENSE.txt +0 -1
package/browser/FractalNoise.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SmoothValueNoise } from "@tsparticles/smooth-value-noise";
|
|
2
2
|
export class FractalNoise {
|
|
3
|
+
_smoothValueNoise;
|
|
3
4
|
constructor() {
|
|
4
5
|
this._smoothValueNoise = new SmoothValueNoise();
|
|
5
6
|
}
|
|
@@ -26,8 +27,7 @@ export class FractalNoise {
|
|
|
26
27
|
noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
|
|
27
28
|
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
28
29
|
for (let i = 0; i < octaves; i++) {
|
|
29
|
-
total +=
|
|
30
|
-
this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
30
|
+
total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
31
31
|
maxValue += amplitude;
|
|
32
32
|
amplitude *= persistence;
|
|
33
33
|
frequency *= lacunarity;
|
package/cjs/FractalNoise.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SmoothValueNoise } from "@tsparticles/smooth-value-noise";
|
|
2
2
|
export class FractalNoise {
|
|
3
|
+
_smoothValueNoise;
|
|
3
4
|
constructor() {
|
|
4
5
|
this._smoothValueNoise = new SmoothValueNoise();
|
|
5
6
|
}
|
|
@@ -26,8 +27,7 @@ export class FractalNoise {
|
|
|
26
27
|
noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
|
|
27
28
|
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
28
29
|
for (let i = 0; i < octaves; i++) {
|
|
29
|
-
total +=
|
|
30
|
-
this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
30
|
+
total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
31
31
|
maxValue += amplitude;
|
|
32
32
|
amplitude *= persistence;
|
|
33
33
|
frequency *= lacunarity;
|
package/esm/FractalNoise.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SmoothValueNoise } from "@tsparticles/smooth-value-noise";
|
|
2
2
|
export class FractalNoise {
|
|
3
|
+
_smoothValueNoise;
|
|
3
4
|
constructor() {
|
|
4
5
|
this._smoothValueNoise = new SmoothValueNoise();
|
|
5
6
|
}
|
|
@@ -26,8 +27,7 @@ export class FractalNoise {
|
|
|
26
27
|
noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
|
|
27
28
|
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
28
29
|
for (let i = 0; i < octaves; i++) {
|
|
29
|
-
total +=
|
|
30
|
-
this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
30
|
+
total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
31
31
|
maxValue += amplitude;
|
|
32
32
|
amplitude *= persistence;
|
|
33
33
|
frequency *= lacunarity;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/fractal-noise",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.21",
|
|
4
4
|
"description": "tsParticles fractal noise library",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"module": "esm/index.js",
|
|
93
93
|
"types": "types/index.d.ts",
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@tsparticles/smooth-value-noise": "4.0.0-alpha.
|
|
95
|
+
"@tsparticles/smooth-value-noise": "4.0.0-alpha.21"
|
|
96
96
|
},
|
|
97
97
|
"exports": {
|
|
98
98
|
".": {
|