@babylonjs/materials 5.21.0 → 5.23.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 (121) hide show
  1. package/cell/cell.fragment.js +14 -2
  2. package/cell/cell.fragment.js.map +1 -1
  3. package/cell/cell.vertex.js +45 -3
  4. package/cell/cell.vertex.js.map +1 -1
  5. package/cell/cellMaterial.js +112 -120
  6. package/cell/cellMaterial.js.map +1 -1
  7. package/custom/customMaterial.js +69 -81
  8. package/custom/customMaterial.js.map +1 -1
  9. package/custom/pbrCustomMaterial.js +80 -89
  10. package/custom/pbrCustomMaterial.js.map +1 -1
  11. package/fire/fire.fragment.js +44 -3
  12. package/fire/fire.fragment.js.map +1 -1
  13. package/fire/fire.vertex.js +54 -3
  14. package/fire/fire.vertex.js.map +1 -1
  15. package/fire/fireMaterial.js +101 -109
  16. package/fire/fireMaterial.js.map +1 -1
  17. package/fur/fur.fragment.js +67 -3
  18. package/fur/fur.fragment.js.map +1 -1
  19. package/fur/fur.vertex.js +97 -3
  20. package/fur/fur.vertex.js.map +1 -1
  21. package/fur/furMaterial.js +181 -193
  22. package/fur/furMaterial.js.map +1 -1
  23. package/gradient/gradient.fragment.js +36 -3
  24. package/gradient/gradient.fragment.js.map +1 -1
  25. package/gradient/gradient.vertex.js +41 -3
  26. package/gradient/gradient.vertex.js.map +1 -1
  27. package/gradient/gradientMaterial.js +113 -121
  28. package/gradient/gradientMaterial.js.map +1 -1
  29. package/grid/grid.fragment.js +8 -2
  30. package/grid/grid.fragment.js.map +1 -1
  31. package/grid/grid.vertex.js +22 -3
  32. package/grid/grid.vertex.js.map +1 -1
  33. package/grid/gridMaterial.js +93 -101
  34. package/grid/gridMaterial.js.map +1 -1
  35. package/lava/lava.fragment.js +62 -3
  36. package/lava/lava.fragment.js.map +1 -1
  37. package/lava/lava.vertex.js +84 -3
  38. package/lava/lava.vertex.js.map +1 -1
  39. package/lava/lavaMaterial.js +175 -183
  40. package/lava/lavaMaterial.js.map +1 -1
  41. package/legacy/legacy-cell.js +2 -2
  42. package/legacy/legacy-cell.js.map +1 -1
  43. package/legacy/legacy-custom.js +2 -2
  44. package/legacy/legacy-custom.js.map +1 -1
  45. package/legacy/legacy-fire.js +2 -2
  46. package/legacy/legacy-fire.js.map +1 -1
  47. package/legacy/legacy-fur.js +2 -2
  48. package/legacy/legacy-fur.js.map +1 -1
  49. package/legacy/legacy-gradient.js +2 -2
  50. package/legacy/legacy-gradient.js.map +1 -1
  51. package/legacy/legacy-grid.js +2 -2
  52. package/legacy/legacy-grid.js.map +1 -1
  53. package/legacy/legacy-lava.js +2 -2
  54. package/legacy/legacy-lava.js.map +1 -1
  55. package/legacy/legacy-mix.js +2 -2
  56. package/legacy/legacy-mix.js.map +1 -1
  57. package/legacy/legacy-normal.js +2 -2
  58. package/legacy/legacy-normal.js.map +1 -1
  59. package/legacy/legacy-shadowOnly.js +2 -2
  60. package/legacy/legacy-shadowOnly.js.map +1 -1
  61. package/legacy/legacy-simple.js +2 -2
  62. package/legacy/legacy-simple.js.map +1 -1
  63. package/legacy/legacy-sky.js +2 -2
  64. package/legacy/legacy-sky.js.map +1 -1
  65. package/legacy/legacy-terrain.js +2 -2
  66. package/legacy/legacy-terrain.js.map +1 -1
  67. package/legacy/legacy-triPlanar.js +2 -2
  68. package/legacy/legacy-triPlanar.js.map +1 -1
  69. package/legacy/legacy-water.js +2 -2
  70. package/legacy/legacy-water.js.map +1 -1
  71. package/legacy/legacy.js +2 -2
  72. package/legacy/legacy.js.map +1 -1
  73. package/mix/mix.fragment.js +33 -2
  74. package/mix/mix.fragment.js.map +1 -1
  75. package/mix/mix.vertex.js +67 -3
  76. package/mix/mix.vertex.js.map +1 -1
  77. package/mix/mixMaterial.js +166 -174
  78. package/mix/mixMaterial.js.map +1 -1
  79. package/normal/normal.fragment.js +41 -3
  80. package/normal/normal.fragment.js.map +1 -1
  81. package/normal/normal.vertex.js +42 -3
  82. package/normal/normal.vertex.js.map +1 -1
  83. package/normal/normalMaterial.js +143 -151
  84. package/normal/normalMaterial.js.map +1 -1
  85. package/package.json +3 -6
  86. package/shadowOnly/shadowOnly.fragment.js +21 -3
  87. package/shadowOnly/shadowOnly.fragment.js.map +1 -1
  88. package/shadowOnly/shadowOnly.vertex.js +30 -3
  89. package/shadowOnly/shadowOnly.vertex.js.map +1 -1
  90. package/shadowOnly/shadowOnlyMaterial.js +73 -89
  91. package/shadowOnly/shadowOnlyMaterial.js.map +1 -1
  92. package/simple/simple.fragment.js +36 -3
  93. package/simple/simple.fragment.js.map +1 -1
  94. package/simple/simple.vertex.js +45 -3
  95. package/simple/simple.vertex.js.map +1 -1
  96. package/simple/simpleMaterial.js +102 -110
  97. package/simple/simpleMaterial.js.map +1 -1
  98. package/sky/sky.fragment.js +17 -3
  99. package/sky/sky.fragment.js.map +1 -1
  100. package/sky/sky.vertex.js +20 -3
  101. package/sky/sky.vertex.js.map +1 -1
  102. package/sky/skyMaterial.js +111 -119
  103. package/sky/skyMaterial.js.map +1 -1
  104. package/terrain/terrain.fragment.js +36 -2
  105. package/terrain/terrain.fragment.js.map +1 -1
  106. package/terrain/terrain.vertex.js +67 -3
  107. package/terrain/terrain.vertex.js.map +1 -1
  108. package/terrain/terrainMaterial.js +148 -156
  109. package/terrain/terrainMaterial.js.map +1 -1
  110. package/triPlanar/triPlanarMaterial.js +157 -165
  111. package/triPlanar/triPlanarMaterial.js.map +1 -1
  112. package/triPlanar/triplanar.fragment.js +64 -3
  113. package/triPlanar/triplanar.fragment.js.map +1 -1
  114. package/triPlanar/triplanar.vertex.js +45 -3
  115. package/triPlanar/triplanar.vertex.js.map +1 -1
  116. package/water/water.fragment.js +83 -3
  117. package/water/water.fragment.js.map +1 -1
  118. package/water/water.vertex.js +56 -3
  119. package/water/water.vertex.js.map +1 -1
  120. package/water/waterMaterial.js +284 -313
  121. package/water/waterMaterial.js.map +1 -1
@@ -1,4 +1,4 @@
1
- import { __decorate, __extends } from "tslib";
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serializeAsVector3, serializeAsTexture, serialize, expandToProperty, serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
4
4
  import { Color3 } from "@babylonjs/core/Maths/math.color.js";
@@ -15,81 +15,72 @@ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
15
15
  import { EffectFallbacks } from "@babylonjs/core/Materials/effectFallbacks.js";
16
16
  import "./fur.fragment.js";
17
17
  import "./fur.vertex.js";
18
- var FurMaterialDefines = /** @class */ (function (_super) {
19
- __extends(FurMaterialDefines, _super);
20
- function FurMaterialDefines() {
21
- var _this = _super.call(this) || this;
22
- _this.DIFFUSE = false;
23
- _this.HEIGHTMAP = false;
24
- _this.CLIPPLANE = false;
25
- _this.CLIPPLANE2 = false;
26
- _this.CLIPPLANE3 = false;
27
- _this.CLIPPLANE4 = false;
28
- _this.CLIPPLANE5 = false;
29
- _this.CLIPPLANE6 = false;
30
- _this.ALPHATEST = false;
31
- _this.DEPTHPREPASS = false;
32
- _this.POINTSIZE = false;
33
- _this.FOG = false;
34
- _this.NORMAL = false;
35
- _this.UV1 = false;
36
- _this.UV2 = false;
37
- _this.VERTEXCOLOR = false;
38
- _this.VERTEXALPHA = false;
39
- _this.NUM_BONE_INFLUENCERS = 0;
40
- _this.BonesPerMesh = 0;
41
- _this.INSTANCES = false;
42
- _this.INSTANCESCOLOR = false;
43
- _this.HIGHLEVEL = false;
44
- _this.IMAGEPROCESSINGPOSTPROCESS = false;
45
- _this.SKIPFINALCOLORCLAMP = false;
46
- _this.rebuild();
47
- return _this;
18
+ class FurMaterialDefines extends MaterialDefines {
19
+ constructor() {
20
+ super();
21
+ this.DIFFUSE = false;
22
+ this.HEIGHTMAP = false;
23
+ this.CLIPPLANE = false;
24
+ this.CLIPPLANE2 = false;
25
+ this.CLIPPLANE3 = false;
26
+ this.CLIPPLANE4 = false;
27
+ this.CLIPPLANE5 = false;
28
+ this.CLIPPLANE6 = false;
29
+ this.ALPHATEST = false;
30
+ this.DEPTHPREPASS = false;
31
+ this.POINTSIZE = false;
32
+ this.FOG = false;
33
+ this.NORMAL = false;
34
+ this.UV1 = false;
35
+ this.UV2 = false;
36
+ this.VERTEXCOLOR = false;
37
+ this.VERTEXALPHA = false;
38
+ this.NUM_BONE_INFLUENCERS = 0;
39
+ this.BonesPerMesh = 0;
40
+ this.INSTANCES = false;
41
+ this.INSTANCESCOLOR = false;
42
+ this.HIGHLEVEL = false;
43
+ this.IMAGEPROCESSINGPOSTPROCESS = false;
44
+ this.SKIPFINALCOLORCLAMP = false;
45
+ this.rebuild();
48
46
  }
49
- return FurMaterialDefines;
50
- }(MaterialDefines));
51
- var FurMaterial = /** @class */ (function (_super) {
52
- __extends(FurMaterial, _super);
53
- function FurMaterial(name, scene) {
54
- var _this = _super.call(this, name, scene) || this;
55
- _this.diffuseColor = new Color3(1, 1, 1);
56
- _this.furLength = 1;
57
- _this.furAngle = 0;
58
- _this.furColor = new Color3(0.44, 0.21, 0.02);
59
- _this.furOffset = 0.0;
60
- _this.furSpacing = 12;
61
- _this.furGravity = new Vector3(0, 0, 0);
62
- _this.furSpeed = 100;
63
- _this.furDensity = 20;
64
- _this.furOcclusion = 0.0;
65
- _this._disableLighting = false;
66
- _this._maxSimultaneousLights = 4;
67
- _this.highLevelFur = true;
68
- _this._furTime = 0;
69
- return _this;
47
+ }
48
+ export class FurMaterial extends PushMaterial {
49
+ constructor(name, scene) {
50
+ super(name, scene);
51
+ this.diffuseColor = new Color3(1, 1, 1);
52
+ this.furLength = 1;
53
+ this.furAngle = 0;
54
+ this.furColor = new Color3(0.44, 0.21, 0.02);
55
+ this.furOffset = 0.0;
56
+ this.furSpacing = 12;
57
+ this.furGravity = new Vector3(0, 0, 0);
58
+ this.furSpeed = 100;
59
+ this.furDensity = 20;
60
+ this.furOcclusion = 0.0;
61
+ this._disableLighting = false;
62
+ this._maxSimultaneousLights = 4;
63
+ this.highLevelFur = true;
64
+ this._furTime = 0;
70
65
  }
71
- Object.defineProperty(FurMaterial.prototype, "furTime", {
72
- get: function () {
73
- return this._furTime;
74
- },
75
- set: function (furTime) {
76
- this._furTime = furTime;
77
- },
78
- enumerable: false,
79
- configurable: true
80
- });
81
- FurMaterial.prototype.needAlphaBlending = function () {
66
+ get furTime() {
67
+ return this._furTime;
68
+ }
69
+ set furTime(furTime) {
70
+ this._furTime = furTime;
71
+ }
72
+ needAlphaBlending() {
82
73
  return this.alpha < 1.0;
83
- };
84
- FurMaterial.prototype.needAlphaTesting = function () {
74
+ }
75
+ needAlphaTesting() {
85
76
  return false;
86
- };
87
- FurMaterial.prototype.getAlphaTestTexture = function () {
77
+ }
78
+ getAlphaTestTexture() {
88
79
  return null;
89
- };
90
- FurMaterial.prototype.updateFur = function () {
91
- for (var i = 1; i < this._meshes.length; i++) {
92
- var offsetFur = this._meshes[i].material;
80
+ }
81
+ updateFur() {
82
+ for (let i = 1; i < this._meshes.length; i++) {
83
+ const offsetFur = this._meshes[i].material;
93
84
  offsetFur.furLength = this.furLength;
94
85
  offsetFur.furAngle = this.furAngle;
95
86
  offsetFur.furGravity = this.furGravity;
@@ -102,9 +93,9 @@ var FurMaterial = /** @class */ (function (_super) {
102
93
  offsetFur.furTime = this.furTime;
103
94
  offsetFur.furDensity = this.furDensity;
104
95
  }
105
- };
96
+ }
106
97
  // Methods
107
- FurMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
98
+ isReadyForSubMesh(mesh, subMesh, useInstances) {
108
99
  if (this.isFrozen) {
109
100
  if (subMesh.effect && subMesh.effect._wasPreviouslyReady && subMesh.effect._wasPreviouslyUsingInstances === useInstances) {
110
101
  return true;
@@ -113,12 +104,12 @@ var FurMaterial = /** @class */ (function (_super) {
113
104
  if (!subMesh.materialDefines) {
114
105
  subMesh.materialDefines = new FurMaterialDefines();
115
106
  }
116
- var defines = subMesh.materialDefines;
117
- var scene = this.getScene();
107
+ const defines = subMesh.materialDefines;
108
+ const scene = this.getScene();
118
109
  if (this._isReadyForSubMesh(subMesh)) {
119
110
  return true;
120
111
  }
121
- var engine = scene.getEngine();
112
+ const engine = scene.getEngine();
122
113
  // Textures
123
114
  if (defines._areTexturesDirty) {
124
115
  if (scene.texturesEnabled) {
@@ -160,7 +151,7 @@ var FurMaterial = /** @class */ (function (_super) {
160
151
  defines.markAsProcessed();
161
152
  scene.resetCachedMaterial();
162
153
  // Fallbacks
163
- var fallbacks = new EffectFallbacks();
154
+ const fallbacks = new EffectFallbacks();
164
155
  if (defines.FOG) {
165
156
  fallbacks.addFallback(1, "FOG");
166
157
  }
@@ -170,7 +161,7 @@ var FurMaterial = /** @class */ (function (_super) {
170
161
  }
171
162
  defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
172
163
  //Attributes
173
- var attribs = [VertexBuffer.PositionKind];
164
+ const attribs = [VertexBuffer.PositionKind];
174
165
  if (defines.NORMAL) {
175
166
  attribs.push(VertexBuffer.NormalKind);
176
167
  }
@@ -186,9 +177,9 @@ var FurMaterial = /** @class */ (function (_super) {
186
177
  MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
187
178
  MaterialHelper.PrepareAttributesForInstances(attribs, defines);
188
179
  // Legacy browser patch
189
- var shaderName = "fur";
190
- var join = defines.toString();
191
- var uniforms = [
180
+ const shaderName = "fur";
181
+ const join = defines.toString();
182
+ const uniforms = [
192
183
  "world",
193
184
  "view",
194
185
  "viewProjection",
@@ -217,8 +208,8 @@ var FurMaterial = /** @class */ (function (_super) {
217
208
  "furDensity",
218
209
  "furOcclusion",
219
210
  ];
220
- var samplers = ["diffuseSampler", "heightTexture", "furTexture"];
221
- var uniformBuffers = new Array();
211
+ const samplers = ["diffuseSampler", "heightTexture", "furTexture"];
212
+ const uniformBuffers = new Array();
222
213
  MaterialHelper.PrepareUniformsAndSamplersList({
223
214
  uniformsNames: uniforms,
224
215
  uniformBuffersNames: uniformBuffers,
@@ -245,14 +236,14 @@ var FurMaterial = /** @class */ (function (_super) {
245
236
  subMesh.effect._wasPreviouslyReady = true;
246
237
  subMesh.effect._wasPreviouslyUsingInstances = !!useInstances;
247
238
  return true;
248
- };
249
- FurMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
250
- var scene = this.getScene();
251
- var defines = subMesh.materialDefines;
239
+ }
240
+ bindForSubMesh(world, mesh, subMesh) {
241
+ const scene = this.getScene();
242
+ const defines = subMesh.materialDefines;
252
243
  if (!defines) {
253
244
  return;
254
245
  }
255
- var effect = subMesh.effect;
246
+ const effect = subMesh.effect;
256
247
  if (!effect) {
257
248
  return;
258
249
  }
@@ -304,9 +295,9 @@ var FurMaterial = /** @class */ (function (_super) {
304
295
  this._activeEffect.setTexture("furTexture", this.furTexture);
305
296
  }
306
297
  this._afterBind(mesh, this._activeEffect);
307
- };
308
- FurMaterial.prototype.getAnimatables = function () {
309
- var results = [];
298
+ }
299
+ getAnimatables() {
300
+ const results = [];
310
301
  if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) {
311
302
  results.push(this.diffuseTexture);
312
303
  }
@@ -314,9 +305,9 @@ var FurMaterial = /** @class */ (function (_super) {
314
305
  results.push(this.heightTexture);
315
306
  }
316
307
  return results;
317
- };
318
- FurMaterial.prototype.getActiveTextures = function () {
319
- var activeTextures = _super.prototype.getActiveTextures.call(this);
308
+ }
309
+ getActiveTextures() {
310
+ const activeTextures = super.getActiveTextures();
320
311
  if (this._diffuseTexture) {
321
312
  activeTextures.push(this._diffuseTexture);
322
313
  }
@@ -324,9 +315,9 @@ var FurMaterial = /** @class */ (function (_super) {
324
315
  activeTextures.push(this._heightTexture);
325
316
  }
326
317
  return activeTextures;
327
- };
328
- FurMaterial.prototype.hasTexture = function (texture) {
329
- if (_super.prototype.hasTexture.call(this, texture)) {
318
+ }
319
+ hasTexture(texture) {
320
+ if (super.hasTexture(texture)) {
330
321
  return true;
331
322
  }
332
323
  if (this.diffuseTexture === texture) {
@@ -336,58 +327,57 @@ var FurMaterial = /** @class */ (function (_super) {
336
327
  return true;
337
328
  }
338
329
  return false;
339
- };
340
- FurMaterial.prototype.dispose = function (forceDisposeEffect) {
330
+ }
331
+ dispose(forceDisposeEffect) {
341
332
  if (this.diffuseTexture) {
342
333
  this.diffuseTexture.dispose();
343
334
  }
344
335
  if (this._meshes) {
345
- for (var i = 1; i < this._meshes.length; i++) {
346
- var mat = this._meshes[i].material;
336
+ for (let i = 1; i < this._meshes.length; i++) {
337
+ const mat = this._meshes[i].material;
347
338
  if (mat) {
348
339
  mat.dispose(forceDisposeEffect);
349
340
  }
350
341
  this._meshes[i].dispose();
351
342
  }
352
343
  }
353
- _super.prototype.dispose.call(this, forceDisposeEffect);
354
- };
355
- FurMaterial.prototype.clone = function (name) {
356
- var _this = this;
357
- return SerializationHelper.Clone(function () { return new FurMaterial(name, _this.getScene()); }, this);
358
- };
359
- FurMaterial.prototype.serialize = function () {
360
- var serializationObject = _super.prototype.serialize.call(this);
344
+ super.dispose(forceDisposeEffect);
345
+ }
346
+ clone(name) {
347
+ return SerializationHelper.Clone(() => new FurMaterial(name, this.getScene()), this);
348
+ }
349
+ serialize() {
350
+ const serializationObject = super.serialize();
361
351
  serializationObject.customType = "BABYLON.FurMaterial";
362
352
  if (this._meshes) {
363
353
  serializationObject.sourceMeshName = this._meshes[0].name;
364
354
  serializationObject.quality = this._meshes.length;
365
355
  }
366
356
  return serializationObject;
367
- };
368
- FurMaterial.prototype.getClassName = function () {
357
+ }
358
+ getClassName() {
369
359
  return "FurMaterial";
370
- };
360
+ }
371
361
  // Statics
372
- FurMaterial.Parse = function (source, scene, rootUrl) {
373
- var material = SerializationHelper.Parse(function () { return new FurMaterial(source.name, scene); }, source, scene, rootUrl);
362
+ static Parse(source, scene, rootUrl) {
363
+ const material = SerializationHelper.Parse(() => new FurMaterial(source.name, scene), source, scene, rootUrl);
374
364
  if (source.sourceMeshName && material.highLevelFur) {
375
- scene.executeWhenReady(function () {
376
- var sourceMesh = scene.getMeshByName(source.sourceMeshName);
365
+ scene.executeWhenReady(() => {
366
+ const sourceMesh = scene.getMeshByName(source.sourceMeshName);
377
367
  if (sourceMesh) {
378
- var furTexture = FurMaterial.GenerateTexture("Fur Texture", scene);
368
+ const furTexture = FurMaterial.GenerateTexture("Fur Texture", scene);
379
369
  material.furTexture = furTexture;
380
370
  FurMaterial.FurifyMesh(sourceMesh, source.quality);
381
371
  }
382
372
  });
383
373
  }
384
374
  return material;
385
- };
386
- FurMaterial.GenerateTexture = function (name, scene) {
375
+ }
376
+ static GenerateTexture(name, scene) {
387
377
  // Generate fur textures
388
- var texture = new DynamicTexture("FurTexture " + name, 256, scene, true);
389
- var context = texture.getContext();
390
- for (var i = 0; i < 20000; ++i) {
378
+ const texture = new DynamicTexture("FurTexture " + name, 256, scene, true);
379
+ const context = texture.getContext();
380
+ for (let i = 0; i < 20000; ++i) {
391
381
  context.fillStyle = "rgba(255, " + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", 1)";
392
382
  context.fillRect(Math.random() * texture.getSize().width, Math.random() * texture.getSize().height, 2, 2);
393
383
  }
@@ -395,19 +385,19 @@ var FurMaterial = /** @class */ (function (_super) {
395
385
  texture.wrapU = Texture.WRAP_ADDRESSMODE;
396
386
  texture.wrapV = Texture.WRAP_ADDRESSMODE;
397
387
  return texture;
398
- };
388
+ }
399
389
  // Creates and returns an array of meshes used as shells for the Fur Material
400
390
  // that can be disposed later in your code
401
391
  // The quality is in interval [0, 100]
402
- FurMaterial.FurifyMesh = function (sourceMesh, quality) {
403
- var meshes = [sourceMesh];
404
- var mat = sourceMesh.material;
405
- var i;
392
+ static FurifyMesh(sourceMesh, quality) {
393
+ const meshes = [sourceMesh];
394
+ const mat = sourceMesh.material;
395
+ let i;
406
396
  if (!(mat instanceof FurMaterial)) {
407
397
  throw "The material of the source mesh must be a Fur Material";
408
398
  }
409
399
  for (i = 1; i < quality; i++) {
410
- var offsetFur = new FurMaterial(mat.name + i, sourceMesh.getScene());
400
+ const offsetFur = new FurMaterial(mat.name + i, sourceMesh.getScene());
411
401
  sourceMesh.getScene().materials.pop();
412
402
  Tags.EnableFor(offsetFur);
413
403
  Tags.AddTagsTo(offsetFur, "furShellMaterial");
@@ -423,7 +413,7 @@ var FurMaterial = /** @class */ (function (_super) {
423
413
  offsetFur.highLevelFur = mat.highLevelFur;
424
414
  offsetFur.furTime = mat.furTime;
425
415
  offsetFur.furDensity = mat.furDensity;
426
- var offsetMesh = sourceMesh.clone(sourceMesh.name + i);
416
+ const offsetMesh = sourceMesh.clone(sourceMesh.name + i);
427
417
  offsetMesh.material = offsetFur;
428
418
  offsetMesh.skeleton = sourceMesh.skeleton;
429
419
  offsetMesh.position = Vector3.Zero();
@@ -434,69 +424,67 @@ var FurMaterial = /** @class */ (function (_super) {
434
424
  }
435
425
  sourceMesh.material._meshes = meshes;
436
426
  return meshes;
437
- };
438
- __decorate([
439
- serializeAsTexture("diffuseTexture")
440
- ], FurMaterial.prototype, "_diffuseTexture", void 0);
441
- __decorate([
442
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
443
- ], FurMaterial.prototype, "diffuseTexture", void 0);
444
- __decorate([
445
- serializeAsTexture("heightTexture")
446
- ], FurMaterial.prototype, "_heightTexture", void 0);
447
- __decorate([
448
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
449
- ], FurMaterial.prototype, "heightTexture", void 0);
450
- __decorate([
451
- serializeAsColor3()
452
- ], FurMaterial.prototype, "diffuseColor", void 0);
453
- __decorate([
454
- serialize()
455
- ], FurMaterial.prototype, "furLength", void 0);
456
- __decorate([
457
- serialize()
458
- ], FurMaterial.prototype, "furAngle", void 0);
459
- __decorate([
460
- serializeAsColor3()
461
- ], FurMaterial.prototype, "furColor", void 0);
462
- __decorate([
463
- serialize()
464
- ], FurMaterial.prototype, "furOffset", void 0);
465
- __decorate([
466
- serialize()
467
- ], FurMaterial.prototype, "furSpacing", void 0);
468
- __decorate([
469
- serializeAsVector3()
470
- ], FurMaterial.prototype, "furGravity", void 0);
471
- __decorate([
472
- serialize()
473
- ], FurMaterial.prototype, "furSpeed", void 0);
474
- __decorate([
475
- serialize()
476
- ], FurMaterial.prototype, "furDensity", void 0);
477
- __decorate([
478
- serialize()
479
- ], FurMaterial.prototype, "furOcclusion", void 0);
480
- __decorate([
481
- serialize("disableLighting")
482
- ], FurMaterial.prototype, "_disableLighting", void 0);
483
- __decorate([
484
- expandToProperty("_markAllSubMeshesAsLightsDirty")
485
- ], FurMaterial.prototype, "disableLighting", void 0);
486
- __decorate([
487
- serialize("maxSimultaneousLights")
488
- ], FurMaterial.prototype, "_maxSimultaneousLights", void 0);
489
- __decorate([
490
- expandToProperty("_markAllSubMeshesAsLightsDirty")
491
- ], FurMaterial.prototype, "maxSimultaneousLights", void 0);
492
- __decorate([
493
- serialize()
494
- ], FurMaterial.prototype, "highLevelFur", void 0);
495
- __decorate([
496
- serialize()
497
- ], FurMaterial.prototype, "furTime", null);
498
- return FurMaterial;
499
- }(PushMaterial));
500
- export { FurMaterial };
427
+ }
428
+ }
429
+ __decorate([
430
+ serializeAsTexture("diffuseTexture")
431
+ ], FurMaterial.prototype, "_diffuseTexture", void 0);
432
+ __decorate([
433
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
434
+ ], FurMaterial.prototype, "diffuseTexture", void 0);
435
+ __decorate([
436
+ serializeAsTexture("heightTexture")
437
+ ], FurMaterial.prototype, "_heightTexture", void 0);
438
+ __decorate([
439
+ expandToProperty("_markAllSubMeshesAsTexturesDirty")
440
+ ], FurMaterial.prototype, "heightTexture", void 0);
441
+ __decorate([
442
+ serializeAsColor3()
443
+ ], FurMaterial.prototype, "diffuseColor", void 0);
444
+ __decorate([
445
+ serialize()
446
+ ], FurMaterial.prototype, "furLength", void 0);
447
+ __decorate([
448
+ serialize()
449
+ ], FurMaterial.prototype, "furAngle", void 0);
450
+ __decorate([
451
+ serializeAsColor3()
452
+ ], FurMaterial.prototype, "furColor", void 0);
453
+ __decorate([
454
+ serialize()
455
+ ], FurMaterial.prototype, "furOffset", void 0);
456
+ __decorate([
457
+ serialize()
458
+ ], FurMaterial.prototype, "furSpacing", void 0);
459
+ __decorate([
460
+ serializeAsVector3()
461
+ ], FurMaterial.prototype, "furGravity", void 0);
462
+ __decorate([
463
+ serialize()
464
+ ], FurMaterial.prototype, "furSpeed", void 0);
465
+ __decorate([
466
+ serialize()
467
+ ], FurMaterial.prototype, "furDensity", void 0);
468
+ __decorate([
469
+ serialize()
470
+ ], FurMaterial.prototype, "furOcclusion", void 0);
471
+ __decorate([
472
+ serialize("disableLighting")
473
+ ], FurMaterial.prototype, "_disableLighting", void 0);
474
+ __decorate([
475
+ expandToProperty("_markAllSubMeshesAsLightsDirty")
476
+ ], FurMaterial.prototype, "disableLighting", void 0);
477
+ __decorate([
478
+ serialize("maxSimultaneousLights")
479
+ ], FurMaterial.prototype, "_maxSimultaneousLights", void 0);
480
+ __decorate([
481
+ expandToProperty("_markAllSubMeshesAsLightsDirty")
482
+ ], FurMaterial.prototype, "maxSimultaneousLights", void 0);
483
+ __decorate([
484
+ serialize()
485
+ ], FurMaterial.prototype, "highLevelFur", void 0);
486
+ __decorate([
487
+ serialize()
488
+ ], FurMaterial.prototype, "furTime", null);
501
489
  RegisterClass("BABYLON.FurMaterial", FurMaterial);
502
490
  //# sourceMappingURL=furMaterial.js.map