@tsparticles/fractal-noise 4.0.0-alpha.2 → 4.0.0-alpha.20
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-alpha.
|
|
7
|
+
* v4.0.0-alpha.20
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,13 +28,23 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
+
/***/ "@tsparticles/smooth-value-noise"
|
|
32
|
+
/*!*********************************************************************************************************************************************************************!*\
|
|
33
|
+
!*** external {"commonjs":"@tsparticles/smooth-value-noise","commonjs2":"@tsparticles/smooth-value-noise","amd":"@tsparticles/smooth-value-noise","root":"window"} ***!
|
|
34
|
+
\*********************************************************************************************************************************************************************/
|
|
35
|
+
(module) {
|
|
36
|
+
|
|
37
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_smooth_value_noise__;
|
|
38
|
+
|
|
39
|
+
/***/ },
|
|
40
|
+
|
|
31
41
|
/***/ "./dist/browser/FractalNoise.js"
|
|
32
42
|
/*!**************************************!*\
|
|
33
43
|
!*** ./dist/browser/FractalNoise.js ***!
|
|
34
44
|
\**************************************/
|
|
35
45
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
46
|
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FractalNoise: () => (/* binding */ FractalNoise)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_smooth_value_noise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/smooth-value-noise */ \"@tsparticles/smooth-value-noise\");\n\nclass FractalNoise {\n
|
|
47
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FractalNoise: () => (/* binding */ FractalNoise)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_smooth_value_noise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/smooth-value-noise */ \"@tsparticles/smooth-value-noise\");\n\nclass FractalNoise {\n _smoothValueNoise;\n constructor(){\n this._smoothValueNoise = new _tsparticles_smooth_value_noise__WEBPACK_IMPORTED_MODULE_0__.SmoothValueNoise();\n }\n noise2d(x, y, octaves = 5, persistence = 0.5, lacunarity = 2.0) {\n let total = 0, frequency = 1, amplitude = 1, maxValue = 0;\n for(let i = 0; i < octaves; i++){\n total += this._smoothValueNoise.noise2d(x * frequency, y * frequency) * amplitude;\n maxValue += amplitude;\n amplitude *= persistence;\n frequency *= lacunarity;\n }\n return total / maxValue;\n }\n noise3d(x, y, z, octaves = 5, persistence = 0.5, lacunarity = 2.0) {\n let total = 0, frequency = 1, amplitude = 1, maxValue = 0;\n for(let i = 0; i < octaves; i++){\n total += this._smoothValueNoise.noise3d(x * frequency, y * frequency, z * frequency) * amplitude;\n maxValue += amplitude;\n amplitude *= persistence;\n frequency *= lacunarity;\n }\n return total / maxValue;\n }\n noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {\n let total = 0, frequency = 1, amplitude = 1, maxValue = 0;\n for(let i = 0; i < octaves; i++){\n total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;\n maxValue += amplitude;\n amplitude *= persistence;\n frequency *= lacunarity;\n }\n return total / maxValue;\n }\n seed(seed) {\n this._smoothValueNoise.seed(seed);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/fractal-noise/./dist/browser/FractalNoise.js?\n}");
|
|
38
48
|
|
|
39
49
|
/***/ },
|
|
40
50
|
|
|
@@ -44,17 +54,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
44
54
|
\*******************************/
|
|
45
55
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
56
|
|
|
47
|
-
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//# sourceURL=webpack://@tsparticles/fractal-noise/./dist/browser/index.js?\n}");
|
|
48
|
-
|
|
49
|
-
/***/ },
|
|
50
|
-
|
|
51
|
-
/***/ "@tsparticles/smooth-value-noise"
|
|
52
|
-
/*!*********************************************************************************************************************************************************************!*\
|
|
53
|
-
!*** external {"commonjs":"@tsparticles/smooth-value-noise","commonjs2":"@tsparticles/smooth-value-noise","amd":"@tsparticles/smooth-value-noise","root":"window"} ***!
|
|
54
|
-
\*********************************************************************************************************************************************************************/
|
|
55
|
-
(module) {
|
|
56
|
-
|
|
57
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_smooth_value_noise__;
|
|
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
58
|
|
|
59
59
|
/***/ }
|
|
60
60
|
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("@tsparticles/smooth-value-noise"));else if("function"==typeof define&&define.amd)define(["@tsparticles/smooth-value-noise"],o);else{var t="object"==typeof exports?o(require("@tsparticles/smooth-value-noise")):o(e.window);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(e=>(()=>{var o={434(o){o.exports=e}},t={};function r(e){var s=t[e];if(void 0!==s)return s.exports;var i=t[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};r.r(s),r.d(s,{FractalNoise:()=>n});var i=r(434);class n{constructor(){this._smoothValueNoise=new i.SmoothValueNoise}noise2d(e,o,t=5,r=.5,s=2){let i=0,n=1,l=1,a=0;for(let u=0;u<t;u++)i+=this._smoothValueNoise.noise2d(e*n,o*n)*l,a+=l,l*=r,n*=s;return i/a}noise3d(e,o,t,r=5,s=.5,i=2){let n=0,l=1,a=1,u=0;for(let d=0;d<r;d++)n+=this._smoothValueNoise.noise3d(e*l,o*l,t*l)*a,u+=a,a*=s,l*=i;return n/u}noise4d(e,o,t,r,s=5,i=.5,n=2){let l=0,a=1,u=1,d=0;for(let p=0;p<s;p++)l+=this._smoothValueNoise.noise4d(e*a,o*a,t*a,r*a)*u,d+=u,u*=i,a*=n;return l/d}seed(e){this._smoothValueNoise.seed(e)}}return s})()));
|
|
1
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("@tsparticles/smooth-value-noise"));else if("function"==typeof define&&define.amd)define(["@tsparticles/smooth-value-noise"],o);else{var t="object"==typeof exports?o(require("@tsparticles/smooth-value-noise")):o(e.window);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,e=>(()=>{"use strict";var o={434(o){o.exports=e}},t={};function r(e){var s=t[e];if(void 0!==s)return s.exports;var i=t[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};r.r(s),r.d(s,{FractalNoise:()=>n});var i=r(434);class n{_smoothValueNoise;constructor(){this._smoothValueNoise=new i.SmoothValueNoise}noise2d(e,o,t=5,r=.5,s=2){let i=0,n=1,l=1,a=0;for(let u=0;u<t;u++)i+=this._smoothValueNoise.noise2d(e*n,o*n)*l,a+=l,l*=r,n*=s;return i/a}noise3d(e,o,t,r=5,s=.5,i=2){let n=0,l=1,a=1,u=0;for(let p=0;p<r;p++)n+=this._smoothValueNoise.noise3d(e*l,o*l,t*l)*a,u+=a,a*=s,l*=i;return n/u}noise4d(e,o,t,r,s=5,i=.5,n=2){let l=0,a=1,u=1,p=0;for(let d=0;d<s;d++)l+=this._smoothValueNoise.noise4d(e*a,o*a,t*a,r*a)*u,p+=u,u*=i,a*=n;return l/p}seed(e){this._smoothValueNoise.seed(e)}}return s})());
|
package/umd/FractalNoise.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
exports.FractalNoise = void 0;
|
|
13
13
|
const smooth_value_noise_1 = require("@tsparticles/smooth-value-noise");
|
|
14
14
|
class FractalNoise {
|
|
15
|
+
_smoothValueNoise;
|
|
15
16
|
constructor() {
|
|
16
17
|
this._smoothValueNoise = new smooth_value_noise_1.SmoothValueNoise();
|
|
17
18
|
}
|
|
@@ -38,8 +39,7 @@
|
|
|
38
39
|
noise4d(x, y, z, w, octaves = 5, persistence = 0.5, lacunarity = 2.0) {
|
|
39
40
|
let total = 0, frequency = 1, amplitude = 1, maxValue = 0;
|
|
40
41
|
for (let i = 0; i < octaves; i++) {
|
|
41
|
-
total +=
|
|
42
|
-
this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
42
|
+
total += this._smoothValueNoise.noise4d(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;
|
|
43
43
|
maxValue += amplitude;
|
|
44
44
|
amplitude *= persistence;
|
|
45
45
|
frequency *= lacunarity;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Fractal Noise v4.0.0-alpha.2 by Matteo Bruni */
|