@tsparticles/fractal-noise 4.0.0-beta.9 → 4.0.1
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/browser.js +3 -0
- package/browser/index.lazy.js +1 -0
- package/cjs/browser.js +3 -0
- package/cjs/index.lazy.js +1 -0
- package/esm/browser.js +3 -0
- package/esm/index.lazy.js +1 -0
- package/package.json +9 -2
- package/report.html +4949 -94
- package/tsparticles.fractal.noise.js +55 -132
- package/tsparticles.fractal.noise.min.js +1 -1
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +1 -0
|
@@ -1,132 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FractalNoise: () => (/* reexport safe */ _FractalNoise_js__WEBPACK_IMPORTED_MODULE_0__.FractalNoise)\n/* harmony export */ });\n/* harmony import */ var _FractalNoise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FractalNoise.js */ \"./dist/browser/FractalNoise.js\");\n\n\n\n//# sourceURL=webpack://@tsparticles/fractal-noise/./dist/browser/index.js?\n}");
|
|
58
|
-
|
|
59
|
-
/***/ }
|
|
60
|
-
|
|
61
|
-
/******/ });
|
|
62
|
-
/************************************************************************/
|
|
63
|
-
/******/ // The module cache
|
|
64
|
-
/******/ var __webpack_module_cache__ = {};
|
|
65
|
-
/******/
|
|
66
|
-
/******/ // The require function
|
|
67
|
-
/******/ function __webpack_require__(moduleId) {
|
|
68
|
-
/******/ // Check if module is in cache
|
|
69
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
70
|
-
/******/ if (cachedModule !== undefined) {
|
|
71
|
-
/******/ return cachedModule.exports;
|
|
72
|
-
/******/ }
|
|
73
|
-
/******/ // Create a new module (and put it into the cache)
|
|
74
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
75
|
-
/******/ // no module.id needed
|
|
76
|
-
/******/ // no module.loaded needed
|
|
77
|
-
/******/ exports: {}
|
|
78
|
-
/******/ };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // Execute the module function
|
|
81
|
-
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
82
|
-
/******/ delete __webpack_module_cache__[moduleId];
|
|
83
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
84
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
85
|
-
/******/ throw e;
|
|
86
|
-
/******/ }
|
|
87
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Return the exports of the module
|
|
90
|
-
/******/ return module.exports;
|
|
91
|
-
/******/ }
|
|
92
|
-
/******/
|
|
93
|
-
/************************************************************************/
|
|
94
|
-
/******/ /* webpack/runtime/define property getters */
|
|
95
|
-
/******/ (() => {
|
|
96
|
-
/******/ // define getter functions for harmony exports
|
|
97
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
98
|
-
/******/ for(var key in definition) {
|
|
99
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
100
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
101
|
-
/******/ }
|
|
102
|
-
/******/ }
|
|
103
|
-
/******/ };
|
|
104
|
-
/******/ })();
|
|
105
|
-
/******/
|
|
106
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
107
|
-
/******/ (() => {
|
|
108
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
109
|
-
/******/ })();
|
|
110
|
-
/******/
|
|
111
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
112
|
-
/******/ (() => {
|
|
113
|
-
/******/ // define __esModule on exports
|
|
114
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
115
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
116
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
117
|
-
/******/ }
|
|
118
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
119
|
-
/******/ };
|
|
120
|
-
/******/ })();
|
|
121
|
-
/******/
|
|
122
|
-
/************************************************************************/
|
|
123
|
-
/******/
|
|
124
|
-
/******/ // startup
|
|
125
|
-
/******/ // Load entry module and return exports
|
|
126
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
127
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
128
|
-
/******/
|
|
129
|
-
/******/ return __webpack_exports__;
|
|
130
|
-
/******/ })()
|
|
131
|
-
;
|
|
132
|
-
});
|
|
1
|
+
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
+
/* Utility v4.0.1 */
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/smooth-value-noise')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/smooth-value-noise'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.fractal = global.__tsParticlesInternals.fractal || {}, global.__tsParticlesInternals.fractal.noise = global.__tsParticlesInternals.fractal.noise || {}), global.__tsParticlesInternals.smooth.value.noise));
|
|
7
|
+
})(this, (function (exports, smoothValueNoise) { 'use strict';
|
|
8
|
+
|
|
9
|
+
class FractalNoise {
|
|
10
|
+
_smoothValueNoise;
|
|
11
|
+
constructor() {
|
|
12
|
+
this._smoothValueNoise = new smoothValueNoise.SmoothValueNoise();
|
|
13
|
+
}
|
|
14
|
+
noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2) {
|
|
15
|
+
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
16
|
+
for (let i = 0; i < octaves; i++) {
|
|
17
|
+
total += this._smoothValueNoise.noise2d(x * frequency, y * frequency) * amplitude;
|
|
18
|
+
maxValue += amplitude;
|
|
19
|
+
amplitude *= persistence;
|
|
20
|
+
frequency *= lacunarity;
|
|
21
|
+
}
|
|
22
|
+
return total / maxValue;
|
|
23
|
+
}
|
|
24
|
+
noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2) {
|
|
25
|
+
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
26
|
+
for (let i = 0; i < octaves; i++) {
|
|
27
|
+
total += this._smoothValueNoise.noise3d(x * frequency, y * frequency, z * frequency) * amplitude;
|
|
28
|
+
maxValue += amplitude;
|
|
29
|
+
amplitude *= persistence;
|
|
30
|
+
frequency *= lacunarity;
|
|
31
|
+
}
|
|
32
|
+
return total / maxValue;
|
|
33
|
+
}
|
|
34
|
+
noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2) {
|
|
35
|
+
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
36
|
+
for (let i = 0; i < octaves; i++) {
|
|
37
|
+
total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
38
|
+
maxValue += amplitude;
|
|
39
|
+
amplitude *= persistence;
|
|
40
|
+
frequency *= lacunarity;
|
|
41
|
+
}
|
|
42
|
+
return total / maxValue;
|
|
43
|
+
}
|
|
44
|
+
seed(seed) {
|
|
45
|
+
this._smoothValueNoise.seed(seed);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const globalObject = globalThis;
|
|
50
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
51
|
+
|
|
52
|
+
exports.FractalNoise = FractalNoise;
|
|
53
|
+
|
|
54
|
+
}));
|
|
55
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/smooth-value-noise")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/smooth-value-noise"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.fractal=s.__tsParticlesInternals.fractal||{},s.__tsParticlesInternals.fractal.noise=s.__tsParticlesInternals.fractal.noise||{}),s.__tsParticlesInternals.smooth.value.noise)}(this,function(s,t){"use strict";const e=globalThis;e.__tsParticlesInternals=e.__tsParticlesInternals??{},s.FractalNoise=class{_smoothValueNoise;constructor(){this._smoothValueNoise=new t.SmoothValueNoise}noise2d(s,t,e=5,n=.5,a=2){let l=0,r=1,i=1,_=0;for(let c=0;c<e;c++)l+=this._smoothValueNoise.noise2d(s*r,t*r)*i,_+=i,i*=n,r*=a;return l/_}noise3d(s,t,e,n=5,a=.5,l=2){let r=0,i=1,_=1,c=0;for(let o=0;o<n;o++)r+=this._smoothValueNoise.noise3d(s*i,t*i,e*i)*_,c+=_,_*=a,i*=l;return r/c}noise4d(s,t,e,n,a=5,l=.5,r=2){let i=0,_=1,c=1,o=0;for(let I=0;I<a;I++)i+=this._smoothValueNoise.noise4d(s*_,t*_,e*_,n*_)*c,o+=c,c*=l,_*=r;return i/o}seed(s){this._smoothValueNoise.seed(s)}}}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FractalNoise } from "./FractalNoise.js";
|