babylonjs-procedural-textures 6.9.0 → 6.11.0

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.
Files changed (62) hide show
  1. package/babylon.brickProceduralTexture.js +113 -100
  2. package/babylon.brickProceduralTexture.js.map +1 -1
  3. package/babylon.brickProceduralTexture.min.js +1 -1
  4. package/babylon.brickProceduralTexture.min.js.map +1 -1
  5. package/babylon.cloudProceduralTexture.js +111 -100
  6. package/babylon.cloudProceduralTexture.js.map +1 -1
  7. package/babylon.cloudProceduralTexture.min.js +1 -1
  8. package/babylon.cloudProceduralTexture.min.js.map +1 -1
  9. package/babylon.fireProceduralTexture.js +130 -146
  10. package/babylon.fireProceduralTexture.js.map +1 -1
  11. package/babylon.fireProceduralTexture.min.js +1 -1
  12. package/babylon.fireProceduralTexture.min.js.map +1 -1
  13. package/babylon.grassProceduralTexture.js +87 -70
  14. package/babylon.grassProceduralTexture.js.map +1 -1
  15. package/babylon.grassProceduralTexture.min.js +1 -1
  16. package/babylon.grassProceduralTexture.min.js.map +1 -1
  17. package/babylon.marbleProceduralTexture.js +100 -100
  18. package/babylon.marbleProceduralTexture.js.map +1 -1
  19. package/babylon.marbleProceduralTexture.min.js +1 -1
  20. package/babylon.marbleProceduralTexture.min.js.map +1 -1
  21. package/babylon.normalMapProceduralTexture.js +79 -63
  22. package/babylon.normalMapProceduralTexture.js.map +1 -1
  23. package/babylon.normalMapProceduralTexture.min.js +1 -1
  24. package/babylon.normalMapProceduralTexture.min.js.map +1 -1
  25. package/babylon.perlinNoiseProceduralTexture.js +115 -61
  26. package/babylon.perlinNoiseProceduralTexture.js.map +1 -1
  27. package/babylon.perlinNoiseProceduralTexture.min.js +1 -1
  28. package/babylon.perlinNoiseProceduralTexture.min.js.map +1 -1
  29. package/babylon.roadProceduralTexture.js +77 -55
  30. package/babylon.roadProceduralTexture.js.map +1 -1
  31. package/babylon.roadProceduralTexture.min.js +1 -1
  32. package/babylon.roadProceduralTexture.min.js.map +1 -1
  33. package/babylon.starfieldProceduralTexture.js +197 -210
  34. package/babylon.starfieldProceduralTexture.js.map +1 -1
  35. package/babylon.starfieldProceduralTexture.min.js +1 -1
  36. package/babylon.starfieldProceduralTexture.min.js.map +1 -1
  37. package/babylon.woodProceduralTexture.js +87 -70
  38. package/babylon.woodProceduralTexture.js.map +1 -1
  39. package/babylon.woodProceduralTexture.min.js +1 -1
  40. package/babylon.woodProceduralTexture.min.js.map +1 -1
  41. package/babylonjs.proceduralTextures.d.ts +20 -20
  42. package/babylonjs.proceduralTextures.js +826 -905
  43. package/babylonjs.proceduralTextures.js.map +1 -1
  44. package/babylonjs.proceduralTextures.min.js +1 -1
  45. package/babylonjs.proceduralTextures.min.js.map +1 -1
  46. package/babylonjs.proceduralTextures.module.d.ts +64 -64
  47. package/config.json +1 -1
  48. package/package.json +2 -2
  49. package/src/brick.ts +3 -14
  50. package/src/cloud.ts +3 -14
  51. package/src/fire.ts +3 -14
  52. package/src/grass.ts +3 -14
  53. package/src/index.ts +1 -1
  54. package/src/marble.ts +3 -14
  55. package/src/normalMap.ts +3 -14
  56. package/src/perlinNoise.ts +3 -14
  57. package/src/road.ts +3 -14
  58. package/src/starfield.ts +3 -14
  59. package/src/wood.ts +3 -14
  60. package/tsconfig.build.json +2 -1
  61. package/tsconfig.json +2 -1
  62. package/webpack.config.js +4 -0
@@ -12,9 +12,9 @@ return /******/ (() => { // webpackBootstrap
12
12
  /******/ "use strict";
13
13
  /******/ var __webpack_modules__ = ({
14
14
 
15
- /***/ "../../../lts/proceduralTextures/dist/grass/grassProceduralTexture.fragment.js":
15
+ /***/ "../../../dev/proceduralTextures/dist/grass/grassProceduralTexture.fragment.js":
16
16
  /*!*************************************************************************************!*\
17
- !*** ../../../lts/proceduralTextures/dist/grass/grassProceduralTexture.fragment.js ***!
17
+ !*** ../../../dev/proceduralTextures/dist/grass/grassProceduralTexture.fragment.js ***!
18
18
  \*************************************************************************************/
19
19
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20
20
 
@@ -26,19 +26,28 @@ __webpack_require__.r(__webpack_exports__);
26
26
  /* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
27
27
  // Do not edit.
28
28
 
29
- var name = "grassProceduralTexturePixelShader";
30
- var shader = "precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
29
+ const name = "grassProceduralTexturePixelShader";
30
+ const shader = `precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}
31
+ float noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}
32
+ float fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}
33
+ return total;}
34
+ #define CUSTOM_FRAGMENT_DEFINITIONS
35
+ void main(void) {
36
+ #define CUSTOM_FRAGMENT_MAIN_BEGIN
37
+ vec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);
38
+ #define CUSTOM_FRAGMENT_MAIN_END
39
+ }`;
31
40
  // Sideeffect
32
41
  core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
33
42
  /** @internal */
34
- var grassProceduralTexturePixelShader = { name: name, shader: shader };
43
+ const grassProceduralTexturePixelShader = { name, shader };
35
44
 
36
45
 
37
46
  /***/ }),
38
47
 
39
- /***/ "../../../lts/proceduralTextures/dist/grass/grassProceduralTexture.js":
48
+ /***/ "../../../dev/proceduralTextures/dist/grass/grassProceduralTexture.js":
40
49
  /*!****************************************************************************!*\
41
- !*** ../../../lts/proceduralTextures/dist/grass/grassProceduralTexture.js ***!
50
+ !*** ../../../dev/proceduralTextures/dist/grass/grassProceduralTexture.js ***!
42
51
  \****************************************************************************/
43
52
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
44
53
 
@@ -49,64 +58,53 @@ __webpack_require__.r(__webpack_exports__);
49
58
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.mjs");
50
59
  /* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/decorators");
51
60
  /* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__);
52
- /* harmony import */ var _grassProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grassProceduralTexture.fragment */ "../../../lts/proceduralTextures/dist/grass/grassProceduralTexture.fragment.js");
61
+ /* harmony import */ var _grassProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./grassProceduralTexture.fragment */ "../../../dev/proceduralTextures/dist/grass/grassProceduralTexture.fragment.js");
53
62
 
54
63
 
55
64
 
56
65
 
57
66
 
58
67
 
59
- var GrassProceduralTexture = /** @class */ (function (_super) {
60
- (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(GrassProceduralTexture, _super);
61
- function GrassProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
62
- if (scene === void 0) { scene = null; }
63
- var _this = _super.call(this, name, size, "grassProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
64
- _this._groundColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(1, 1, 1);
65
- _this._grassColors = [new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(0.29, 0.38, 0.02), new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(0.36, 0.49, 0.09), new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(0.51, 0.6, 0.28)];
66
- _this.updateShaderUniforms();
67
- return _this;
68
+ class GrassProceduralTexture extends core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.ProceduralTexture {
69
+ constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
70
+ super(name, size, "grassProceduralTexture", scene, fallbackTexture, generateMipMaps);
71
+ this._groundColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(1, 1, 1);
72
+ this._grassColors = [new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(0.29, 0.38, 0.02), new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(0.36, 0.49, 0.09), new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3(0.51, 0.6, 0.28)];
73
+ this.updateShaderUniforms();
68
74
  }
69
- GrassProceduralTexture.prototype.updateShaderUniforms = function () {
75
+ updateShaderUniforms() {
70
76
  this.setColor3("herb1Color", this._grassColors[0]);
71
77
  this.setColor3("herb2Color", this._grassColors[1]);
72
78
  this.setColor3("herb3Color", this._grassColors[2]);
73
79
  this.setColor3("groundColor", this._groundColor);
74
- };
75
- Object.defineProperty(GrassProceduralTexture.prototype, "grassColors", {
76
- get: function () {
77
- return this._grassColors;
78
- },
79
- set: function (value) {
80
- this._grassColors = value;
81
- this.updateShaderUniforms();
82
- },
83
- enumerable: false,
84
- configurable: true
85
- });
86
- Object.defineProperty(GrassProceduralTexture.prototype, "groundColor", {
87
- get: function () {
88
- return this._groundColor;
89
- },
90
- set: function (value) {
91
- this._groundColor = value;
92
- this.updateShaderUniforms();
93
- },
94
- enumerable: false,
95
- configurable: true
96
- });
80
+ }
81
+ get grassColors() {
82
+ return this._grassColors;
83
+ }
84
+ set grassColors(value) {
85
+ this._grassColors = value;
86
+ this.updateShaderUniforms();
87
+ }
88
+ get groundColor() {
89
+ return this._groundColor;
90
+ }
91
+ set groundColor(value) {
92
+ this._groundColor = value;
93
+ this.updateShaderUniforms();
94
+ }
97
95
  /**
98
96
  * Serializes this grass procedural texture
99
97
  * @returns a serialized grass procedural texture object
100
98
  */
101
- GrassProceduralTexture.prototype.serialize = function () {
102
- var serializationObject = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
99
+ serialize() {
100
+ const serializationObject = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.SerializationHelper.Serialize(this, super.serialize());
103
101
  serializationObject.customType = "BABYLON.GrassProceduralTexture";
104
102
  serializationObject.grassColors = [];
105
- for (var i = 0; i < this._grassColors.length; i++) {
103
+ for (let i = 0; i < this._grassColors.length; i++) {
106
104
  serializationObject.grassColors.push(this._grassColors[i].asArray());
107
105
  }
108
106
  return serializationObject;
109
- };
107
+ }
110
108
  /**
111
109
  * Creates a Grass Procedural Texture from parsed grass procedural texture data
112
110
  * @param parsedTexture defines parsed texture data
@@ -114,28 +112,27 @@ var GrassProceduralTexture = /** @class */ (function (_super) {
114
112
  * @param rootUrl defines the root URL containing grass procedural texture information
115
113
  * @returns a parsed Grass Procedural Texture
116
114
  */
117
- GrassProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
118
- var texture = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.SerializationHelper.Parse(function () { return new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
119
- var colors = [];
120
- for (var i = 0; i < parsedTexture.grassColors.length; i++) {
115
+ static Parse(parsedTexture, scene, rootUrl) {
116
+ const texture = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.SerializationHelper.Parse(() => new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
117
+ const colors = [];
118
+ for (let i = 0; i < parsedTexture.grassColors.length; i++) {
121
119
  colors.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.Color3.FromArray(parsedTexture.grassColors[i]));
122
120
  }
123
121
  texture.grassColors = colors;
124
122
  return texture;
125
- };
126
- (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
127
- (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serializeAsColor3)()
128
- ], GrassProceduralTexture.prototype, "groundColor", null);
129
- return GrassProceduralTexture;
130
- }(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.ProceduralTexture));
123
+ }
124
+ }
125
+ (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
126
+ (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serializeAsColor3)()
127
+ ], GrassProceduralTexture.prototype, "groundColor", null);
131
128
  (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.RegisterClass)("BABYLON.GrassProceduralTexture", GrassProceduralTexture);
132
129
 
133
130
 
134
131
  /***/ }),
135
132
 
136
- /***/ "../../../lts/proceduralTextures/dist/grass/index.js":
133
+ /***/ "../../../dev/proceduralTextures/dist/grass/index.js":
137
134
  /*!***********************************************************!*\
138
- !*** ../../../lts/proceduralTextures/dist/grass/index.js ***!
135
+ !*** ../../../dev/proceduralTextures/dist/grass/index.js ***!
139
136
  \***********************************************************/
140
137
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
141
138
 
@@ -143,7 +140,35 @@ __webpack_require__.r(__webpack_exports__);
143
140
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
144
141
  /* harmony export */ GrassProceduralTexture: () => (/* reexport safe */ _grassProceduralTexture__WEBPACK_IMPORTED_MODULE_0__.GrassProceduralTexture)
145
142
  /* harmony export */ });
146
- /* harmony import */ var _grassProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grassProceduralTexture */ "../../../lts/proceduralTextures/dist/grass/grassProceduralTexture.js");
143
+ /* harmony import */ var _grassProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grassProceduralTexture */ "../../../dev/proceduralTextures/dist/grass/grassProceduralTexture.js");
144
+
145
+
146
+
147
+ /***/ }),
148
+
149
+ /***/ "../../../lts/proceduralTextures/dist/legacy/legacy-grass.js":
150
+ /*!*******************************************************************!*\
151
+ !*** ../../../lts/proceduralTextures/dist/legacy/legacy-grass.js ***!
152
+ \*******************************************************************/
153
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
154
+
155
+ __webpack_require__.r(__webpack_exports__);
156
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
157
+ /* harmony export */ GrassProceduralTexture: () => (/* reexport safe */ procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__.GrassProceduralTexture)
158
+ /* harmony export */ });
159
+ /* harmony import */ var procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! procedural-textures/grass/index */ "../../../dev/proceduralTextures/dist/grass/index.js");
160
+ /* eslint-disable import/no-internal-modules */
161
+
162
+ /**
163
+ * This is the entry point for the UMD module.
164
+ * The entry point for a future ESM package should be index.ts
165
+ */
166
+ var globalObject = typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : undefined;
167
+ if (typeof globalObject !== "undefined") {
168
+ for (var key in procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__) {
169
+ globalObject.BABYLON[key] = procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__[key];
170
+ }
171
+ }
147
172
 
148
173
 
149
174
 
@@ -611,22 +636,14 @@ var __webpack_exports__ = {};
611
636
  \**********************/
612
637
  __webpack_require__.r(__webpack_exports__);
613
638
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
614
- /* harmony export */ GrassProceduralTexture: () => (/* reexport safe */ procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__.GrassProceduralTexture)
639
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
640
+ /* harmony export */ proceduralTexture: () => (/* reexport module object */ _lts_procedural_textures_legacy_legacy_grass__WEBPACK_IMPORTED_MODULE_0__)
615
641
  /* harmony export */ });
616
- /* harmony import */ var procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! procedural-textures/grass/index */ "../../../lts/proceduralTextures/dist/grass/index.js");
642
+ /* harmony import */ var _lts_procedural_textures_legacy_legacy_grass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lts/procedural-textures/legacy/legacy-grass */ "../../../lts/proceduralTextures/dist/legacy/legacy-grass.js");
617
643
  /* eslint-disable import/no-internal-modules */
618
644
 
619
- /**
620
- * This is the entry point for the UMD module.
621
- * The entry point for a future ESM package should be index.ts
622
- */
623
- const globalObject = typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : undefined;
624
- if (typeof globalObject !== "undefined") {
625
- for (const key in procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__) {
626
- globalObject.BABYLON[key] = procedural_textures_grass_index__WEBPACK_IMPORTED_MODULE_0__[key];
627
- }
628
- }
629
645
 
646
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_lts_procedural_textures_legacy_legacy_grass__WEBPACK_IMPORTED_MODULE_0__);
630
647
 
631
648
  })();
632
649
 
@@ -1 +1 @@
1
- {"version":3,"file":"babylon.grassProceduralTexture.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;ACVA,eAAe;AACwC;AAEvD,IAAM,IAAI,GAAG,mCAAmC,CAAC;AACjD,IAAM,MAAM,GAAG,y7BASb,CAAC;AACH,aAAa;AACb,iEAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AACT,IAAM,iCAAiC,GAAG,EAAE,IAAI,QAAE,MAAM,UAAE,CAAC;;;;;;;;;;;;;;;;;;;;ACjBY;AAC/B;AAE2C;AAEtC;AAGT;AAEpC;IAAqC,iFAAiB;IAIzD,gCAAY,IAAY,EAAE,IAAY,EAAE,KAA6B,EAAE,eAAyB,EAAE,eAAyB;QAAnF,oCAA6B;QAArE,YACI,kBAAM,IAAI,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,eAAe,EAAE,eAAe,CAAC,SAKvF;QARO,kBAAY,GAAG,IAAI,wDAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;Q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;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;UChUF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNA,+CAA+C;AACsB;AAErE;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,qBAAM,KAAK,WAAW,CAAC,CAAC,CAAC,qBAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IACrC,KAAK,MAAM,GAAG,IAAI,4DAAiB,EAAE;QAC3B,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,4DAAkB,CAAC,GAAG,CAAC,CAAC;KACpE;CACJ;AAE+C","sources":["webpack://PROCEDURALTEXTURES/webpack/universalModuleDefinition","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/grass/grassProceduralTexture.fragment.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/grass/grassProceduralTexture.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/grass/index.ts","webpack://PROCEDURALTEXTURES/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://PROCEDURALTEXTURES/../../../../node_modules/tslib/tslib.es6.mjs","webpack://PROCEDURALTEXTURES/webpack/bootstrap","webpack://PROCEDURALTEXTURES/webpack/runtime/compat get default export","webpack://PROCEDURALTEXTURES/webpack/runtime/define property getters","webpack://PROCEDURALTEXTURES/webpack/runtime/global","webpack://PROCEDURALTEXTURES/webpack/runtime/hasOwnProperty shorthand","webpack://PROCEDURALTEXTURES/webpack/runtime/make namespace object","webpack://PROCEDURALTEXTURES/./src/grass.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-procedural-textures\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-procedural-textures\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"PROCEDURALTEXTURES\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE_core_Misc_decorators__) => {\nreturn ","// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"grassProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const grassProceduralTexturePixelShader = { name, shader };\n","import { serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./grassProceduralTexture.fragment\";\r\n\r\nexport class GrassProceduralTexture extends ProceduralTexture {\r\n private _grassColors: Color3[];\r\n private _groundColor = new Color3(1, 1, 1);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"grassProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n\r\n this._grassColors = [new Color3(0.29, 0.38, 0.02), new Color3(0.36, 0.49, 0.09), new Color3(0.51, 0.6, 0.28)];\r\n\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"herb1Color\", this._grassColors[0]);\r\n this.setColor3(\"herb2Color\", this._grassColors[1]);\r\n this.setColor3(\"herb3Color\", this._grassColors[2]);\r\n this.setColor3(\"groundColor\", this._groundColor);\r\n }\r\n\r\n public get grassColors(): Color3[] {\r\n return this._grassColors;\r\n }\r\n\r\n public set grassColors(value: Color3[]) {\r\n this._grassColors = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get groundColor(): Color3 {\r\n return this._groundColor;\r\n }\r\n\r\n public set groundColor(value: Color3) {\r\n this._groundColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this grass procedural texture\r\n * @returns a serialized grass procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.GrassProceduralTexture\";\r\n\r\n serializationObject.grassColors = [];\r\n for (let i = 0; i < this._grassColors.length; i++) {\r\n serializationObject.grassColors.push(this._grassColors[i].asArray());\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Grass Procedural Texture from parsed grass procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing grass procedural texture information\r\n * @returns a parsed Grass Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n const colors: Color3[] = [];\r\n for (let i = 0; i < parsedTexture.grassColors.length; i++) {\r\n colors.push(Color3.FromArray(parsedTexture.grassColors[i]));\r\n }\r\n\r\n texture.grassColors = colors;\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GrassProceduralTexture\", GrassProceduralTexture);\r\n","export * from \"./grassProceduralTexture\";\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE_core_Misc_decorators__;","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"procedural-textures/grass/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n for (const key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"procedural-textures/grass/index\";\r\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"babylon.grassProceduralTexture.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;ACVA,eAAe;AACwC;AAEvD,MAAM,IAAI,GAAG,mCAAmC,CAAC;AACjD,MAAM,MAAM,GAAG;;;;;;;;;EASb,CAAC;AACH,aAAa;AACb,iEAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AACT,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;ACjBY;AAC/B;AAE2C;AAEtC;AAGT;AAEpC,MAAM,sBAAuB,SAAQ,mEAAiB;IAIzD,YAAY,IAAY,EAAE,IAAY,EAAE,QAAyB,IAAI,EAAE,eAAyB,EAAE,eAAyB;QACvH,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,eAAe,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AAc;AAC1I,wBAAwB,6BAA6B,oBAAoB,uCAAuC,kBAAkB;AAClI;;AAEO;AACP;AACA;AACA,yGAAyG,uFAAuF,cAAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEA,iEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;UChUF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNA,+CAA+C;AACmC;AACrD;AAC7B,iEAAe,yEAAiB,EAAC","sources":["webpack://PROCEDURALTEXTURES/webpack/universalModuleDefinition","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/grass/grassProceduralTexture.fragment.ts","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/grass/grassProceduralTexture.ts","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/grass/index.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/src/legacy/legacy-grass.ts","webpack://PROCEDURALTEXTURES/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://PROCEDURALTEXTURES/../../../../node_modules/tslib/tslib.es6.mjs","webpack://PROCEDURALTEXTURES/webpack/bootstrap","webpack://PROCEDURALTEXTURES/webpack/runtime/compat get default export","webpack://PROCEDURALTEXTURES/webpack/runtime/define property getters","webpack://PROCEDURALTEXTURES/webpack/runtime/global","webpack://PROCEDURALTEXTURES/webpack/runtime/hasOwnProperty shorthand","webpack://PROCEDURALTEXTURES/webpack/runtime/make namespace object","webpack://PROCEDURALTEXTURES/./src/grass.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-procedural-textures\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-procedural-textures\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"PROCEDURALTEXTURES\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE_core_Misc_decorators__) => {\nreturn ","// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"grassProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const grassProceduralTexturePixelShader = { name, shader };\n","import { serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./grassProceduralTexture.fragment\";\r\n\r\nexport class GrassProceduralTexture extends ProceduralTexture {\r\n private _grassColors: Color3[];\r\n private _groundColor = new Color3(1, 1, 1);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"grassProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n\r\n this._grassColors = [new Color3(0.29, 0.38, 0.02), new Color3(0.36, 0.49, 0.09), new Color3(0.51, 0.6, 0.28)];\r\n\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"herb1Color\", this._grassColors[0]);\r\n this.setColor3(\"herb2Color\", this._grassColors[1]);\r\n this.setColor3(\"herb3Color\", this._grassColors[2]);\r\n this.setColor3(\"groundColor\", this._groundColor);\r\n }\r\n\r\n public get grassColors(): Color3[] {\r\n return this._grassColors;\r\n }\r\n\r\n public set grassColors(value: Color3[]) {\r\n this._grassColors = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get groundColor(): Color3 {\r\n return this._groundColor;\r\n }\r\n\r\n public set groundColor(value: Color3) {\r\n this._groundColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this grass procedural texture\r\n * @returns a serialized grass procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.GrassProceduralTexture\";\r\n\r\n serializationObject.grassColors = [];\r\n for (let i = 0; i < this._grassColors.length; i++) {\r\n serializationObject.grassColors.push(this._grassColors[i].asArray());\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Grass Procedural Texture from parsed grass procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing grass procedural texture information\r\n * @returns a parsed Grass Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n const colors: Color3[] = [];\r\n for (let i = 0; i < parsedTexture.grassColors.length; i++) {\r\n colors.push(Color3.FromArray(parsedTexture.grassColors[i]));\r\n }\r\n\r\n texture.grassColors = colors;\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GrassProceduralTexture\", GrassProceduralTexture);\r\n","export * from \"./grassProceduralTexture\";\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"procedural-textures/grass/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n for (const key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"procedural-textures/grass/index\";\r\n","module.exports = __WEBPACK_EXTERNAL_MODULE_core_Misc_decorators__;","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"@lts/procedural-textures/legacy/legacy-grass\";\r\nexport { proceduralTexture };\r\nexport default proceduralTexture;\r\n"],"names":[],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- !function(o,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-procedural-textures",["babylonjs"],r):"object"==typeof exports?exports["babylonjs-procedural-textures"]=r(require("babylonjs")):o.PROCEDURALTEXTURES=r(o.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(o=>(()=>{"use strict";var r={520:r=>{r.exports=o}},e={};function t(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return r[o](i,i.exports,t),i.exports}t.d=(o,r)=>{for(var e in r)t.o(r,e)&&!t.o(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:r[e]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(o){if("object"==typeof window)return window}}(),t.o=(o,r)=>Object.prototype.hasOwnProperty.call(o,r),t.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var n={};return(()=>{var o={};t.r(o),t.d(o,{GrassProceduralTexture:()=>n});var r=function(o,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(o[e]=r[e])},r(o,e)};Object.create,Object.create;var e=t(520);e.ShaderStore.ShadersStore.grassProceduralTexturePixelShader="precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";var n=function(o){function t(r,t,n,i,l){void 0===n&&(n=null);var s=o.call(this,r,t,"grassProceduralTexture",n,i,l)||this;return s._groundColor=new e.Color3(1,1,1),s._grassColors=[new e.Color3(.29,.38,.02),new e.Color3(.36,.49,.09),new e.Color3(.51,.6,.28)],s.updateShaderUniforms(),s}return function(o,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=o}r(o,e),o.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}(t,o),t.prototype.updateShaderUniforms=function(){this.setColor3("herb1Color",this._grassColors[0]),this.setColor3("herb2Color",this._grassColors[1]),this.setColor3("herb3Color",this._grassColors[2]),this.setColor3("groundColor",this._groundColor)},Object.defineProperty(t.prototype,"grassColors",{get:function(){return this._grassColors},set:function(o){this._grassColors=o,this.updateShaderUniforms()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"groundColor",{get:function(){return this._groundColor},set:function(o){this._groundColor=o,this.updateShaderUniforms()},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){var r=e.SerializationHelper.Serialize(this,o.prototype.serialize.call(this));r.customType="BABYLON.GrassProceduralTexture",r.grassColors=[];for(var t=0;t<this._grassColors.length;t++)r.grassColors.push(this._grassColors[t].asArray());return r},t.Parse=function(o,r,n){for(var i=e.SerializationHelper.Parse((function(){return new t(o.name,o._size,r,void 0,o._generateMipMaps)}),o,r,n),l=[],s=0;s<o.grassColors.length;s++)l.push(e.Color3.FromArray(o.grassColors[s]));return i.grassColors=l,i},function(o,r,e,t){var n,i=arguments.length,l=i<3?r:null===t?t=Object.getOwnPropertyDescriptor(r,e):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(o,r,e,t);else for(var s=o.length-1;s>=0;s--)(n=o[s])&&(l=(i<3?n(l):i>3?n(r,e,l):n(r,e))||l);i>3&&l&&Object.defineProperty(r,e,l)}([(0,e.serializeAsColor3)()],t.prototype,"groundColor",null),t}(e.ProceduralTexture);(0,e.RegisterClass)("BABYLON.GrassProceduralTexture",n);const i=void 0!==t.g?t.g:"undefined"!=typeof window?window:void 0;if(void 0!==i)for(const r in o)i.BABYLON[r]=o[r]})(),n.default})()));
1
+ !function(r,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-procedural-textures",["babylonjs"],o):"object"==typeof exports?exports["babylonjs-procedural-textures"]=o(require("babylonjs")):r.PROCEDURALTEXTURES=o(r.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(r=>(()=>{"use strict";var o={520:o=>{o.exports=r}},e={};function t(r){var s=e[r];if(void 0!==s)return s.exports;var n=e[r]={exports:{}};return o[r](n,n.exports,t),n.exports}t.d=(r,o)=>{for(var e in o)t.o(o,e)&&!t.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:o[e]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),t.o=(r,o)=>Object.prototype.hasOwnProperty.call(r,o),t.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var s={};return(()=>{t.d(s,{default:()=>i});var r={};t.r(r),t.d(r,{GrassProceduralTexture:()=>n});var o={};t.r(o),t.d(o,{GrassProceduralTexture:()=>n}),Object.create,Object.create;var e=t(520);e.ShaderStore.ShadersStore.grassProceduralTexturePixelShader="precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}";class n extends e.ProceduralTexture{constructor(r,o,t=null,s,n){super(r,o,"grassProceduralTexture",t,s,n),this._groundColor=new e.Color3(1,1,1),this._grassColors=[new e.Color3(.29,.38,.02),new e.Color3(.36,.49,.09),new e.Color3(.51,.6,.28)],this.updateShaderUniforms()}updateShaderUniforms(){this.setColor3("herb1Color",this._grassColors[0]),this.setColor3("herb2Color",this._grassColors[1]),this.setColor3("herb3Color",this._grassColors[2]),this.setColor3("groundColor",this._groundColor)}get grassColors(){return this._grassColors}set grassColors(r){this._grassColors=r,this.updateShaderUniforms()}get groundColor(){return this._groundColor}set groundColor(r){this._groundColor=r,this.updateShaderUniforms()}serialize(){const r=e.SerializationHelper.Serialize(this,super.serialize());r.customType="BABYLON.GrassProceduralTexture",r.grassColors=[];for(let o=0;o<this._grassColors.length;o++)r.grassColors.push(this._grassColors[o].asArray());return r}static Parse(r,o,t){const s=e.SerializationHelper.Parse((()=>new n(r.name,r._size,o,void 0,r._generateMipMaps)),r,o,t),l=[];for(let o=0;o<r.grassColors.length;o++)l.push(e.Color3.FromArray(r.grassColors[o]));return s.grassColors=l,s}}(function(r,o,e,t){var s,n=arguments.length,l=n<3?o:null===t?t=Object.getOwnPropertyDescriptor(o,e):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(r,o,e,t);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(l=(n<3?s(l):n>3?s(o,e,l):s(o,e))||l);n>3&&l&&Object.defineProperty(o,e,l)})([(0,e.serializeAsColor3)()],n.prototype,"groundColor",null),(0,e.RegisterClass)("BABYLON.GrassProceduralTexture",n);var l=void 0!==t.g?t.g:"undefined"!=typeof window?window:void 0;if(void 0!==l)for(var a in r)l.BABYLON[a]=r[a];const i=o})(),s.default})()));
2
2
  //# sourceMappingURL=babylon.grassProceduralTexture.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"babylon.grassProceduralTexture.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,gCAAiC,CAAC,aAAcJ,GAC7B,iBAAZC,QACdA,QAAQ,iCAAmCD,EAAQG,QAAQ,cAE3DJ,EAAyB,mBAAIC,EAAQD,EAAc,QACpD,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EAAQA,EAAOD,QAASU,GAG/CT,EAAOD,OACf,CCrBAU,EAAoBK,EAAI,CAACf,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoB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AClDW,EAAOT,KAAK,EAAAhB,OAAO0B,UAAUP,EAAcN,YAAYC,KAK3D,OAFAO,EAAQR,YAAcY,EAEfJ,CACX,EFjCG,SAAoBM,EAAYC,EAAQ/D,EAAKgE,GAClD,IAA2HlE,EAAvHmE,EAAIC,UAAUhB,OAAQlC,EAAIiD,EAAI,EAAIF,EAAkB,OAATC,EAAgBA,EAAO9D,OAAOiE,yBAAyBJ,EAAQ/D,GAAOgE,EACrH,GAAuB,iBAAZI,SAAoD,mBAArBA,QAAQC,SAAyBrD,EAAIoD,QAAQC,SAASP,EAAYC,EAAQ/D,EAAKgE,QACpH,IAAK,IAAIf,EAAIa,EAAWZ,OAAS,EAAGD,GAAK,EAAGA,KAASnD,EAAIgE,EAAWb,MAAIjC,GAAKiD,EAAI,EAAInE,EAAEkB,GAAKiD,EAAI,EAAInE,EAAEiE,EAAQ/D,EAAKgB,GAAKlB,EAAEiE,EAAQ/D,KAASgB,GACzIiD,EAAI,GAAKjD,GAAKd,OAAOC,eAAe4D,EAAQ/D,EAAKgB,EAC1D,CEpBI,GADC,IAAAsD,sB,gCAkDL,C,CA9EO,CAAqC,EAAAC,oBAgF5C,IAAAC,eAAc,iCAAkCf,GCnFhD,MAAMgB,OAAiC,IAAX,EAAAnE,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjB6E,EACP,IAAK,MAAMzE,KAAO,EACRyE,EAAcC,QAAQ1E,GAAa,EAAmBA,E","sources":["webpack://PROCEDURALTEXTURES/webpack/universalModuleDefinition","webpack://PROCEDURALTEXTURES/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://PROCEDURALTEXTURES/webpack/bootstrap","webpack://PROCEDURALTEXTURES/webpack/runtime/define property getters","webpack://PROCEDURALTEXTURES/webpack/runtime/global","webpack://PROCEDURALTEXTURES/webpack/runtime/hasOwnProperty shorthand","webpack://PROCEDURALTEXTURES/webpack/runtime/make namespace object","webpack://PROCEDURALTEXTURES/../../../../node_modules/tslib/tslib.es6.mjs","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/grass/grassProceduralTexture.fragment.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/grass/grassProceduralTexture.ts","webpack://PROCEDURALTEXTURES/./src/grass.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-procedural-textures\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-procedural-textures\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"PROCEDURALTEXTURES\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__520__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__520__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"grassProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const grassProceduralTexturePixelShader = { name, shader };\n","import { serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./grassProceduralTexture.fragment\";\r\n\r\nexport class GrassProceduralTexture extends ProceduralTexture {\r\n private _grassColors: Color3[];\r\n private _groundColor = new Color3(1, 1, 1);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"grassProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n\r\n this._grassColors = [new Color3(0.29, 0.38, 0.02), new Color3(0.36, 0.49, 0.09), new Color3(0.51, 0.6, 0.28)];\r\n\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"herb1Color\", this._grassColors[0]);\r\n this.setColor3(\"herb2Color\", this._grassColors[1]);\r\n this.setColor3(\"herb3Color\", this._grassColors[2]);\r\n this.setColor3(\"groundColor\", this._groundColor);\r\n }\r\n\r\n public get grassColors(): Color3[] {\r\n return this._grassColors;\r\n }\r\n\r\n public set grassColors(value: Color3[]) {\r\n this._grassColors = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get groundColor(): Color3 {\r\n return this._groundColor;\r\n }\r\n\r\n public set groundColor(value: Color3) {\r\n this._groundColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this grass procedural texture\r\n * @returns a serialized grass procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.GrassProceduralTexture\";\r\n\r\n serializationObject.grassColors = [];\r\n for (let i = 0; i < this._grassColors.length; i++) {\r\n serializationObject.grassColors.push(this._grassColors[i].asArray());\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Grass Procedural Texture from parsed grass procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing grass procedural texture information\r\n * @returns a parsed Grass Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n const colors: Color3[] = [];\r\n for (let i = 0; i < parsedTexture.grassColors.length; i++) {\r\n colors.push(Color3.FromArray(parsedTexture.grassColors[i]));\r\n }\r\n\r\n texture.grassColors = colors;\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GrassProceduralTexture\", GrassProceduralTexture);\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"procedural-textures/grass/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n for (const key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"procedural-textures/grass/index\";\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__520__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","extendStatics","b","setPrototypeOf","__proto__","Array","p","create","ShaderStore","ShadersStore","name","size","scene","fallbackTexture","generateMipMaps","_groundColor","Color3","_grassColors","updateShaderUniforms","TypeError","String","__","constructor","setColor3","serialize","serializationObject","SerializationHelper","Serialize","customType","grassColors","i","length","push","asArray","Parse","parsedTexture","rootUrl","texture","GrassProceduralTexture","_size","_generateMipMaps","colors","FromArray","decorators","target","desc","c","arguments","getOwnPropertyDescriptor","Reflect","decorate","serializeAsColor3","ProceduralTexture","RegisterClass","globalObject","BABYLON"],"sourceRoot":""}
1
+ {"version":3,"file":"babylon.grassProceduralTexture.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,gCAAiC,CAAC,aAAcJ,GAC7B,iBAAZC,QACdA,QAAQ,iCAAmCD,EAAQG,QAAQ,cAE3DJ,EAAyB,mBAAIC,EAAQD,EAAc,QACpD,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAO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AAO4D,yBAAyBJ,EAAQ1D,GAAO2D,EACrH,GAAuB,iBAAZI,SAAoD,mBAArBA,QAAQC,SAAyBhD,EAAI+C,QAAQC,SAASP,EAAYC,EAAQ1D,EAAK2D,QACpH,IAAK,IAAIf,EAAIa,EAAWZ,OAAS,EAAGD,GAAK,EAAGA,KAAS9C,EAAI2D,EAAWb,MAAI5B,GAAK4C,EAAI,EAAI9D,EAAEkB,GAAK4C,EAAI,EAAI9D,EAAE4D,EAAQ1D,EAAKgB,GAAKlB,EAAE4D,EAAQ1D,KAASgB,GACzI4C,EAAI,GAAK5C,GAAKd,OAAOC,eAAeuD,EAAQ1D,EAAKgB,EAC1D,EEpBI,GADC,IAAAiD,sB,iCAoDL,IAAAC,eAAc,iCAAkC3C,GCnFhD,IAAM4C,OAAiC,IAAX,EAAA7D,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjBuE,EACP,IAAK,IAAMnE,KAAO,EACRmE,EAAcC,QAAQpE,GAAa,EAAmBA,GCPpE,S","sources":["webpack://PROCEDURALTEXTURES/webpack/universalModuleDefinition","webpack://PROCEDURALTEXTURES/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://PROCEDURALTEXTURES/webpack/bootstrap","webpack://PROCEDURALTEXTURES/webpack/runtime/define property getters","webpack://PROCEDURALTEXTURES/webpack/runtime/global","webpack://PROCEDURALTEXTURES/webpack/runtime/hasOwnProperty shorthand","webpack://PROCEDURALTEXTURES/webpack/runtime/make namespace object","webpack://PROCEDURALTEXTURES/../../../../node_modules/tslib/tslib.es6.mjs","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/grass/grassProceduralTexture.fragment.ts","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/grass/grassProceduralTexture.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/src/legacy/legacy-grass.ts","webpack://PROCEDURALTEXTURES/./src/grass.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-procedural-textures\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-procedural-textures\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"PROCEDURALTEXTURES\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__520__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__520__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"grassProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform vec3 herb1Color;uniform vec3 herb2Color;uniform vec3 herb3Color;uniform vec3 groundColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));color=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));color=mix(color,herb3Color,rand(gl_FragCoord.xy));color=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const grassProceduralTexturePixelShader = { name, shader };\n","import { serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./grassProceduralTexture.fragment\";\r\n\r\nexport class GrassProceduralTexture extends ProceduralTexture {\r\n private _grassColors: Color3[];\r\n private _groundColor = new Color3(1, 1, 1);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"grassProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n\r\n this._grassColors = [new Color3(0.29, 0.38, 0.02), new Color3(0.36, 0.49, 0.09), new Color3(0.51, 0.6, 0.28)];\r\n\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"herb1Color\", this._grassColors[0]);\r\n this.setColor3(\"herb2Color\", this._grassColors[1]);\r\n this.setColor3(\"herb3Color\", this._grassColors[2]);\r\n this.setColor3(\"groundColor\", this._groundColor);\r\n }\r\n\r\n public get grassColors(): Color3[] {\r\n return this._grassColors;\r\n }\r\n\r\n public set grassColors(value: Color3[]) {\r\n this._grassColors = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get groundColor(): Color3 {\r\n return this._groundColor;\r\n }\r\n\r\n public set groundColor(value: Color3) {\r\n this._groundColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this grass procedural texture\r\n * @returns a serialized grass procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.GrassProceduralTexture\";\r\n\r\n serializationObject.grassColors = [];\r\n for (let i = 0; i < this._grassColors.length; i++) {\r\n serializationObject.grassColors.push(this._grassColors[i].asArray());\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Grass Procedural Texture from parsed grass procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing grass procedural texture information\r\n * @returns a parsed Grass Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): GrassProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n const colors: Color3[] = [];\r\n for (let i = 0; i < parsedTexture.grassColors.length; i++) {\r\n colors.push(Color3.FromArray(parsedTexture.grassColors[i]));\r\n }\r\n\r\n texture.grassColors = colors;\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GrassProceduralTexture\", GrassProceduralTexture);\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"procedural-textures/grass/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n for (const key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"procedural-textures/grass/index\";\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"@lts/procedural-textures/legacy/legacy-grass\";\r\nexport { proceduralTexture };\r\nexport default proceduralTexture;\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__520__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","create","ShaderStore","ShadersStore","GrassProceduralTexture","ProceduralTexture","constructor","name","size","scene","fallbackTexture","generateMipMaps","super","_groundColor","Color3","_grassColors","updateShaderUniforms","setColor3","grassColors","groundColor","serialize","serializationObject","SerializationHelper","Serialize","customType","i","length","push","asArray","static","parsedTexture","rootUrl","texture","Parse","_size","_generateMipMaps","colors","FromArray","decorators","target","desc","c","arguments","getOwnPropertyDescriptor","Reflect","decorate","serializeAsColor3","RegisterClass","globalObject","BABYLON"],"sourceRoot":""}