babylonjs-materials 9.25.0 → 9.26.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.
@@ -92,12 +92,12 @@ var __values = (this && this.__values) || function(o) {
92
92
  }
93
93
  return s;
94
94
  }(i.MaterialDefines));
95
- var o = (function () { var e, o, f, l, u; var d, c, h, m, v, g, p, S, x, T = i.PushMaterial, _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], N = [], M = [], R = [], y = [], V = [], U = [], w = []; return e = /** @class */ (function (_super) {
95
+ var o = (function () { var e, o, f, l, u; var d, c, h, m, v, g, p, S, x, T = i.PushMaterial, _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], R = [], M = [], N = [], y = [], V = [], U = [], w = []; return e = /** @class */ (function (_super) {
96
96
  __extends(e, _super);
97
97
  function e(e, t, r) {
98
98
  if (r === void 0) { r = !1; }
99
99
  var _this = this;
100
- _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = n(_this, _, void 0), o.set(_this, (n(_this, C), n(_this, E, void 0))), _this.diffuseColor = (n(_this, L), n(_this, P, new i.Color3(1, 1, 1))), _this._computeHighLevel = (n(_this, I), n(_this, D, !1)), f.set(_this, (n(_this, b), n(_this, A, void 0))), _this._disableLighting = (n(_this, F), n(_this, O, !1)), l.set(_this, (n(_this, N), n(_this, M, void 0))), _this._maxSimultaneousLights = (n(_this, R), n(_this, y, 4)), u.set(_this, (n(_this, V), n(_this, U, void 0))), n(_this, w);
100
+ _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = n(_this, _, void 0), o.set(_this, (n(_this, C), n(_this, E, void 0))), _this.diffuseColor = (n(_this, L), n(_this, P, new i.Color3(1, 1, 1))), _this._computeHighLevel = (n(_this, I), n(_this, D, !1)), f.set(_this, (n(_this, b), n(_this, A, void 0))), _this._disableLighting = (n(_this, F), n(_this, O, !1)), l.set(_this, (n(_this, R), n(_this, M, void 0))), _this._maxSimultaneousLights = (n(_this, N), n(_this, y, 4)), u.set(_this, (n(_this, V), n(_this, U, void 0))), n(_this, w);
101
101
  return _this;
102
102
  }
103
103
  Object.defineProperty(e.prototype, "diffuseTexture", {
@@ -159,7 +159,7 @@ var __values = (this && this.__values) || function(o) {
159
159
  e.prototype.serialize = function () { var e = _super.prototype.serialize.call(this); return e.customType = "BABYLON.CellMaterial", e; };
160
160
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
161
161
  return e;
162
- }(T)), o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = T[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; d = [i.serializeAsTexture("diffuseTexture")], c = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], h = [i.serializeAsColor3("diffuse")], m = [i.serialize("computeHighLevel")], v = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], g = [i.serialize("disableLighting")], p = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], S = [i.serialize("maxSimultaneousLights")], x = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, c, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, E, L), t(e, null, v, { kind: "accessor", name: "computeHighLevel", static: !1, private: !1, access: { has: function (e) { return "computeHighLevel" in e; }, get: function (e) { return e.computeHighLevel; }, set: function (e, i) { e.computeHighLevel = i; } }, metadata: r }, A, F), t(e, null, p, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, M, R), t(e, null, x, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, U, w), t(null, null, d, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, _, C), t(null, null, h, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, P, I), t(null, null, m, { kind: "field", name: "_computeHighLevel", static: !1, private: !1, access: { has: function (e) { return "_computeHighLevel" in e; }, get: function (e) { return e._computeHighLevel; }, set: function (e, i) { e._computeHighLevel = i; } }, metadata: r }, D, b), t(null, null, g, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, O, N), t(null, null, S, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, y, V), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return X; }), Promise.resolve().then(function () { return K; })]; }, function () { return [Promise.resolve().then(function () { return $; }), Promise.resolve().then(function () { return ne; })]; }), e; })();
162
+ }(T)), o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = T[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; d = [i.serializeAsTexture("diffuseTexture")], c = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], h = [i.serializeAsColor3("diffuse")], m = [i.serialize("computeHighLevel")], v = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], g = [i.serialize("disableLighting")], p = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], S = [i.serialize("maxSimultaneousLights")], x = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, c, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, E, L), t(e, null, v, { kind: "accessor", name: "computeHighLevel", static: !1, private: !1, access: { has: function (e) { return "computeHighLevel" in e; }, get: function (e) { return e.computeHighLevel; }, set: function (e, i) { e.computeHighLevel = i; } }, metadata: r }, A, F), t(e, null, p, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, M, N), t(e, null, x, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, U, w), t(null, null, d, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, _, C), t(null, null, h, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, P, I), t(null, null, m, { kind: "field", name: "_computeHighLevel", static: !1, private: !1, access: { has: function (e) { return "_computeHighLevel" in e; }, get: function (e) { return e._computeHighLevel; }, set: function (e, i) { e._computeHighLevel = i; } }, metadata: r }, D, b), t(null, null, g, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, O, R), t(null, null, S, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, y, V), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return j; }), Promise.resolve().then(function () { return q; })]; }, function () { return [Promise.resolve().then(function () { return ee; }), Promise.resolve().then(function () { return re; })]; }), e; })();
163
163
  i.RegisterClass("BABYLON.CellMaterial", o);
164
164
  var f = /** @class */ (function () {
165
165
  function f() {
@@ -321,12 +321,12 @@ var __values = (this && this.__values) || function(o) {
321
321
  }
322
322
  return m;
323
323
  }(i.MaterialDefines));
324
- var v = (function () { var e, s, o, f; var l, u, d, c, h, v, g, p, S = i.PushMaterial, x = [], T = [], _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], N = [], M = [], R = []; return e = /** @class */ (function (_super) {
324
+ var v = (function () { var e, s, o, f; var l, u, d, c, h, v, g, p, S = i.PushMaterial, x = [], T = [], _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], R = [], M = [], N = []; return e = /** @class */ (function (_super) {
325
325
  __extends(e, _super);
326
326
  function e(e, t, r) {
327
327
  if (r === void 0) { r = !1; }
328
328
  var _this = this;
329
- _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = n(_this, x, void 0), s.set(_this, (n(_this, T), n(_this, _, void 0))), _this._distortionTexture = (n(_this, C), n(_this, E, void 0)), o.set(_this, (n(_this, L), n(_this, P, void 0))), _this._opacityTexture = (n(_this, I), n(_this, D, void 0)), f.set(_this, (n(_this, b), n(_this, A, void 0))), _this.diffuseColor = (n(_this, F), n(_this, O, new i.Color3(1, 1, 1))), _this.speed = (n(_this, N), n(_this, M, 1)), _this._scaledDiffuse = (n(_this, R), new i.Color3), _this._lastTime = 0;
329
+ _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = n(_this, x, void 0), s.set(_this, (n(_this, T), n(_this, _, void 0))), _this._distortionTexture = (n(_this, C), n(_this, E, void 0)), o.set(_this, (n(_this, L), n(_this, P, void 0))), _this._opacityTexture = (n(_this, I), n(_this, D, void 0)), f.set(_this, (n(_this, b), n(_this, A, void 0))), _this.diffuseColor = (n(_this, F), n(_this, O, new i.Color3(1, 1, 1))), _this.speed = (n(_this, R), n(_this, M, 1)), _this._scaledDiffuse = (n(_this, N), new i.Color3), _this._lastTime = 0;
330
330
  return _this;
331
331
  }
332
332
  Object.defineProperty(e.prototype, "diffuseTexture", {
@@ -381,7 +381,7 @@ var __values = (this && this.__values) || function(o) {
381
381
  e.prototype.serialize = function () { var e = _super.prototype.serialize.call(this); return e.customType = "BABYLON.FireMaterial", e.diffuseColor = this.diffuseColor.asArray(), e.speed = this.speed, this._diffuseTexture && (e._diffuseTexture = this._diffuseTexture.serialize()), this._distortionTexture && (e._distortionTexture = this._distortionTexture.serialize()), this._opacityTexture && (e._opacityTexture = this._opacityTexture.serialize()), e; };
382
382
  e.Parse = function (t, n, r) { var a = new e(t.name, n); return a.diffuseColor = i.Color3.FromArray(t.diffuseColor), a.speed = t.speed, a.alpha = t.alpha, a.id = t.id, i.Tags.AddTagsTo(a, t.tags), a.backFaceCulling = t.backFaceCulling, a.wireframe = t.wireframe, t._diffuseTexture && (a._diffuseTexture = i.Texture.Parse(t._diffuseTexture, n, r)), t._distortionTexture && (a._distortionTexture = i.Texture.Parse(t._distortionTexture, n, r)), t._opacityTexture && (a._opacityTexture = i.Texture.Parse(t._opacityTexture, n, r)), a; };
383
383
  return e;
384
- }(S)), s = new WeakMap, o = new WeakMap, f = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = S[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; l = [i.serializeAsTexture("diffuseTexture")], u = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], d = [i.serializeAsTexture("distortionTexture")], c = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], h = [i.serializeAsTexture("opacityTexture")], v = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], g = [i.serializeAsColor3("diffuse")], p = [i.serialize()], t(e, null, u, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, _, C), t(e, null, c, { kind: "accessor", name: "distortionTexture", static: !1, private: !1, access: { has: function (e) { return "distortionTexture" in e; }, get: function (e) { return e.distortionTexture; }, set: function (e, i) { e.distortionTexture = i; } }, metadata: r }, P, I), t(e, null, v, { kind: "accessor", name: "opacityTexture", static: !1, private: !1, access: { has: function (e) { return "opacityTexture" in e; }, get: function (e) { return e.opacityTexture; }, set: function (e, i) { e.opacityTexture = i; } }, metadata: r }, A, F), t(null, null, l, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, x, T), t(null, null, d, { kind: "field", name: "_distortionTexture", static: !1, private: !1, access: { has: function (e) { return "_distortionTexture" in e; }, get: function (e) { return e._distortionTexture; }, set: function (e, i) { e._distortionTexture = i; } }, metadata: r }, E, L), t(null, null, h, { kind: "field", name: "_opacityTexture", static: !1, private: !1, access: { has: function (e) { return "_opacityTexture" in e; }, get: function (e) { return e._opacityTexture; }, set: function (e, i) { e._opacityTexture = i; } }, metadata: r }, D, b), t(null, null, g, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, O, N), t(null, null, p, { kind: "field", name: "speed", static: !1, private: !1, access: { has: function (e) { return "speed" in e; }, get: function (e) { return e.speed; }, set: function (e, i) { e.speed = i; } }, metadata: r }, M, R), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return oe; }), Promise.resolve().then(function () { return de; })]; }, function () { return [Promise.resolve().then(function () { return ve; }), Promise.resolve().then(function () { return xe; })]; }), e; })();
384
+ }(S)), s = new WeakMap, o = new WeakMap, f = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = S[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; l = [i.serializeAsTexture("diffuseTexture")], u = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], d = [i.serializeAsTexture("distortionTexture")], c = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], h = [i.serializeAsTexture("opacityTexture")], v = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], g = [i.serializeAsColor3("diffuse")], p = [i.serialize()], t(e, null, u, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, _, C), t(e, null, c, { kind: "accessor", name: "distortionTexture", static: !1, private: !1, access: { has: function (e) { return "distortionTexture" in e; }, get: function (e) { return e.distortionTexture; }, set: function (e, i) { e.distortionTexture = i; } }, metadata: r }, P, I), t(e, null, v, { kind: "accessor", name: "opacityTexture", static: !1, private: !1, access: { has: function (e) { return "opacityTexture" in e; }, get: function (e) { return e.opacityTexture; }, set: function (e, i) { e.opacityTexture = i; } }, metadata: r }, A, F), t(null, null, l, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, x, T), t(null, null, d, { kind: "field", name: "_distortionTexture", static: !1, private: !1, access: { has: function (e) { return "_distortionTexture" in e; }, get: function (e) { return e._distortionTexture; }, set: function (e, i) { e._distortionTexture = i; } }, metadata: r }, E, L), t(null, null, h, { kind: "field", name: "_opacityTexture", static: !1, private: !1, access: { has: function (e) { return "_opacityTexture" in e; }, get: function (e) { return e._opacityTexture; }, set: function (e, i) { e._opacityTexture = i; } }, metadata: r }, D, b), t(null, null, g, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, O, R), t(null, null, p, { kind: "field", name: "speed", static: !1, private: !1, access: { has: function (e) { return "speed" in e; }, get: function (e) { return e.speed; }, set: function (e, i) { e.speed = i; } }, metadata: r }, M, N), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return fe; }), Promise.resolve().then(function () { return ce; })]; }, function () { return [Promise.resolve().then(function () { return ge; }), Promise.resolve().then(function () { return Te; })]; }), e; })();
385
385
  i.RegisterClass("BABYLON.FireMaterial", v);
386
386
  var g = /** @class */ (function (_super) {
387
387
  __extends(g, _super);
@@ -392,12 +392,12 @@ var __values = (this && this.__values) || function(o) {
392
392
  }
393
393
  return g;
394
394
  }(i.MaterialDefines));
395
- var p = (function () { var e, s, o, f, l; var u, d, c, h, m, v, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O = i.PushMaterial, N = [], M = [], R = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = []; return e = /** @class */ (function (_super) {
395
+ var p = (function () { var e, s, o, f, l; var u, d, c, h, m, v, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O = i.PushMaterial, R = [], M = [], N = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = []; return e = /** @class */ (function (_super) {
396
396
  __extends(e, _super);
397
397
  function e(e, t, r) {
398
398
  if (r === void 0) { r = !1; }
399
399
  var _this = this;
400
- _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = (n(_this, N), n(_this, M, void 0)), s.set(_this, (n(_this, R), n(_this, y, void 0))), _this._heightTexture = (n(_this, V), n(_this, U, void 0)), o.set(_this, (n(_this, w), n(_this, G, void 0))), _this.diffuseColor = (n(_this, W), n(_this, B, new i.Color3(1, 1, 1))), _this.furLength = (n(_this, z), n(_this, H, 1)), _this.furAngle = (n(_this, k), n(_this, X, 0)), _this.furColor = (n(_this, j), n(_this, Z, new i.Color3(.44, .21, .02))), _this.furOffset = (n(_this, Y), n(_this, K, 0)), _this.furSpacing = (n(_this, q), n(_this, Q, 12)), _this.furGravity = (n(_this, J), n(_this, $, new i.Vector3(0, 0, 0))), _this.furSpeed = (n(_this, ee), n(_this, ie, 100)), _this.furDensity = (n(_this, te), n(_this, ne, 20)), _this.furOcclusion = (n(_this, re), n(_this, ae, 0)), _this.furTexture = n(_this, se), _this._disableLighting = n(_this, oe, !1), f.set(_this, (n(_this, fe), n(_this, le, void 0))), _this._maxSimultaneousLights = (n(_this, ue), n(_this, de, 4)), l.set(_this, (n(_this, ce), n(_this, he, void 0))), _this.highLevelFur = (n(_this, me), n(_this, ve, !0)), _this._meshes = n(_this, ge), _this._furTime = 0;
400
+ _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = (n(_this, R), n(_this, M, void 0)), s.set(_this, (n(_this, N), n(_this, y, void 0))), _this._heightTexture = (n(_this, V), n(_this, U, void 0)), o.set(_this, (n(_this, w), n(_this, G, void 0))), _this.diffuseColor = (n(_this, W), n(_this, B, new i.Color3(1, 1, 1))), _this.furLength = (n(_this, z), n(_this, H, 1)), _this.furAngle = (n(_this, k), n(_this, X, 0)), _this.furColor = (n(_this, j), n(_this, Y, new i.Color3(.44, .21, .02))), _this.furOffset = (n(_this, Z), n(_this, K, 0)), _this.furSpacing = (n(_this, q), n(_this, Q, 12)), _this.furGravity = (n(_this, J), n(_this, $, new i.Vector3(0, 0, 0))), _this.furSpeed = (n(_this, ee), n(_this, ie, 100)), _this.furDensity = (n(_this, te), n(_this, ne, 20)), _this.furOcclusion = (n(_this, re), n(_this, ae, 0)), _this.furTexture = n(_this, se), _this._disableLighting = n(_this, oe, !1), f.set(_this, (n(_this, fe), n(_this, le, void 0))), _this._maxSimultaneousLights = (n(_this, ue), n(_this, de, 4)), l.set(_this, (n(_this, ce), n(_this, he, void 0))), _this.highLevelFur = (n(_this, me), n(_this, ve, !0)), _this._meshes = n(_this, ge), _this._furTime = 0;
401
401
  return _this;
402
402
  }
403
403
  Object.defineProperty(e.prototype, "diffuseTexture", {
@@ -495,7 +495,7 @@ var __values = (this && this.__values) || function(o) {
495
495
  } for (s = 1; s < r.length; s++)
496
496
  r[s].parent = t; return t.material._meshes = r, r; };
497
497
  return e;
498
- }(O)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = O[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; u = [i.serializeAsTexture("diffuseTexture")], d = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], c = [i.serializeAsTexture("heightTexture")], h = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], m = [i.serializeAsColor3()], v = [i.serialize()], p = [i.serialize()], S = [i.serializeAsColor3()], x = [i.serialize()], T = [i.serialize()], _ = [i.serializeAsVector3()], C = [i.serialize()], E = [i.serialize()], L = [i.serialize()], P = [i.serialize("disableLighting")], I = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], D = [i.serialize("maxSimultaneousLights")], b = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], A = [i.serialize()], F = [i.serialize()], t(e, null, d, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, y, V), t(e, null, h, { kind: "accessor", name: "heightTexture", static: !1, private: !1, access: { has: function (e) { return "heightTexture" in e; }, get: function (e) { return e.heightTexture; }, set: function (e, i) { e.heightTexture = i; } }, metadata: r }, G, W), t(e, null, I, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, le, ue), t(e, null, b, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, he, me), t(e, null, F, { kind: "getter", name: "furTime", static: !1, private: !1, access: { has: function (e) { return "furTime" in e; }, get: function (e) { return e.furTime; } }, metadata: r }, null, N), t(null, null, u, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, M, R), t(null, null, c, { kind: "field", name: "_heightTexture", static: !1, private: !1, access: { has: function (e) { return "_heightTexture" in e; }, get: function (e) { return e._heightTexture; }, set: function (e, i) { e._heightTexture = i; } }, metadata: r }, U, w), t(null, null, m, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, B, z), t(null, null, v, { kind: "field", name: "furLength", static: !1, private: !1, access: { has: function (e) { return "furLength" in e; }, get: function (e) { return e.furLength; }, set: function (e, i) { e.furLength = i; } }, metadata: r }, H, k), t(null, null, p, { kind: "field", name: "furAngle", static: !1, private: !1, access: { has: function (e) { return "furAngle" in e; }, get: function (e) { return e.furAngle; }, set: function (e, i) { e.furAngle = i; } }, metadata: r }, X, j), t(null, null, S, { kind: "field", name: "furColor", static: !1, private: !1, access: { has: function (e) { return "furColor" in e; }, get: function (e) { return e.furColor; }, set: function (e, i) { e.furColor = i; } }, metadata: r }, Z, Y), t(null, null, x, { kind: "field", name: "furOffset", static: !1, private: !1, access: { has: function (e) { return "furOffset" in e; }, get: function (e) { return e.furOffset; }, set: function (e, i) { e.furOffset = i; } }, metadata: r }, K, q), t(null, null, T, { kind: "field", name: "furSpacing", static: !1, private: !1, access: { has: function (e) { return "furSpacing" in e; }, get: function (e) { return e.furSpacing; }, set: function (e, i) { e.furSpacing = i; } }, metadata: r }, Q, J), t(null, null, _, { kind: "field", name: "furGravity", static: !1, private: !1, access: { has: function (e) { return "furGravity" in e; }, get: function (e) { return e.furGravity; }, set: function (e, i) { e.furGravity = i; } }, metadata: r }, $, ee), t(null, null, C, { kind: "field", name: "furSpeed", static: !1, private: !1, access: { has: function (e) { return "furSpeed" in e; }, get: function (e) { return e.furSpeed; }, set: function (e, i) { e.furSpeed = i; } }, metadata: r }, ie, te), t(null, null, E, { kind: "field", name: "furDensity", static: !1, private: !1, access: { has: function (e) { return "furDensity" in e; }, get: function (e) { return e.furDensity; }, set: function (e, i) { e.furDensity = i; } }, metadata: r }, ne, re), t(null, null, L, { kind: "field", name: "furOcclusion", static: !1, private: !1, access: { has: function (e) { return "furOcclusion" in e; }, get: function (e) { return e.furOcclusion; }, set: function (e, i) { e.furOcclusion = i; } }, metadata: r }, ae, se), t(null, null, P, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, oe, fe), t(null, null, D, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, de, ce), t(null, null, A, { kind: "field", name: "highLevelFur", static: !1, private: !1, access: { has: function (e) { return "highLevelFur" in e; }, get: function (e) { return e.highLevelFur; }, set: function (e, i) { e.highLevelFur = i; } }, metadata: r }, ve, ge), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Ee; }), Promise.resolve().then(function () { return De; })]; }, function () { return [Promise.resolve().then(function () { return Oe; }), Promise.resolve().then(function () { return ye; })]; }), e; })();
498
+ }(O)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = O[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; u = [i.serializeAsTexture("diffuseTexture")], d = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], c = [i.serializeAsTexture("heightTexture")], h = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], m = [i.serializeAsColor3()], v = [i.serialize()], p = [i.serialize()], S = [i.serializeAsColor3()], x = [i.serialize()], T = [i.serialize()], _ = [i.serializeAsVector3()], C = [i.serialize()], E = [i.serialize()], L = [i.serialize()], P = [i.serialize("disableLighting")], I = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], D = [i.serialize("maxSimultaneousLights")], b = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], A = [i.serialize()], F = [i.serialize()], t(e, null, d, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, y, V), t(e, null, h, { kind: "accessor", name: "heightTexture", static: !1, private: !1, access: { has: function (e) { return "heightTexture" in e; }, get: function (e) { return e.heightTexture; }, set: function (e, i) { e.heightTexture = i; } }, metadata: r }, G, W), t(e, null, I, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, le, ue), t(e, null, b, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, he, me), t(e, null, F, { kind: "getter", name: "furTime", static: !1, private: !1, access: { has: function (e) { return "furTime" in e; }, get: function (e) { return e.furTime; } }, metadata: r }, null, R), t(null, null, u, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, M, N), t(null, null, c, { kind: "field", name: "_heightTexture", static: !1, private: !1, access: { has: function (e) { return "_heightTexture" in e; }, get: function (e) { return e._heightTexture; }, set: function (e, i) { e._heightTexture = i; } }, metadata: r }, U, w), t(null, null, m, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, B, z), t(null, null, v, { kind: "field", name: "furLength", static: !1, private: !1, access: { has: function (e) { return "furLength" in e; }, get: function (e) { return e.furLength; }, set: function (e, i) { e.furLength = i; } }, metadata: r }, H, k), t(null, null, p, { kind: "field", name: "furAngle", static: !1, private: !1, access: { has: function (e) { return "furAngle" in e; }, get: function (e) { return e.furAngle; }, set: function (e, i) { e.furAngle = i; } }, metadata: r }, X, j), t(null, null, S, { kind: "field", name: "furColor", static: !1, private: !1, access: { has: function (e) { return "furColor" in e; }, get: function (e) { return e.furColor; }, set: function (e, i) { e.furColor = i; } }, metadata: r }, Y, Z), t(null, null, x, { kind: "field", name: "furOffset", static: !1, private: !1, access: { has: function (e) { return "furOffset" in e; }, get: function (e) { return e.furOffset; }, set: function (e, i) { e.furOffset = i; } }, metadata: r }, K, q), t(null, null, T, { kind: "field", name: "furSpacing", static: !1, private: !1, access: { has: function (e) { return "furSpacing" in e; }, get: function (e) { return e.furSpacing; }, set: function (e, i) { e.furSpacing = i; } }, metadata: r }, Q, J), t(null, null, _, { kind: "field", name: "furGravity", static: !1, private: !1, access: { has: function (e) { return "furGravity" in e; }, get: function (e) { return e.furGravity; }, set: function (e, i) { e.furGravity = i; } }, metadata: r }, $, ee), t(null, null, C, { kind: "field", name: "furSpeed", static: !1, private: !1, access: { has: function (e) { return "furSpeed" in e; }, get: function (e) { return e.furSpeed; }, set: function (e, i) { e.furSpeed = i; } }, metadata: r }, ie, te), t(null, null, E, { kind: "field", name: "furDensity", static: !1, private: !1, access: { has: function (e) { return "furDensity" in e; }, get: function (e) { return e.furDensity; }, set: function (e, i) { e.furDensity = i; } }, metadata: r }, ne, re), t(null, null, L, { kind: "field", name: "furOcclusion", static: !1, private: !1, access: { has: function (e) { return "furOcclusion" in e; }, get: function (e) { return e.furOcclusion; }, set: function (e, i) { e.furOcclusion = i; } }, metadata: r }, ae, se), t(null, null, P, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, oe, fe), t(null, null, D, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, de, ce), t(null, null, A, { kind: "field", name: "highLevelFur", static: !1, private: !1, access: { has: function (e) { return "highLevelFur" in e; }, get: function (e) { return e.highLevelFur; }, set: function (e, i) { e.highLevelFur = i; } }, metadata: r }, ve, ge), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Le; }), Promise.resolve().then(function () { return be; })]; }, function () { return [Promise.resolve().then(function () { return Re; }), Promise.resolve().then(function () { return Ve; })]; }), e; })();
499
499
  i.RegisterClass("BABYLON.FurMaterial", p);
500
500
  var S = /** @class */ (function (_super) {
501
501
  __extends(S, _super);
@@ -506,12 +506,12 @@ var __values = (this && this.__values) || function(o) {
506
506
  }
507
507
  return S;
508
508
  }(i.MaterialDefines));
509
- var x = (function () { var e, s, o; var f, l, u, d, c, h, m, v, g, p, x, T = i.PushMaterial, _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], N = [], M = [], R = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = []; return e = /** @class */ (function (_super) {
509
+ var x = (function () { var e, s, o; var f, l, u, d, c, h, m, v, g, p, x, T = i.PushMaterial, _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], R = [], M = [], N = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = []; return e = /** @class */ (function (_super) {
510
510
  __extends(e, _super);
511
511
  function e(e, t, r) {
512
512
  if (r === void 0) { r = !1; }
513
513
  var _this = this;
514
- _this = _super.call(this, e, t, void 0, r) || this, _this._maxSimultaneousLights = n(_this, _, 4), s.set(_this, (n(_this, C), n(_this, E, void 0))), _this.topColor = (n(_this, L), n(_this, P, new i.Color3(1, 0, 0))), _this.topColorAlpha = (n(_this, I), n(_this, D, 1)), _this.bottomColor = (n(_this, b), n(_this, A, new i.Color3(0, 0, 1))), _this.bottomColorAlpha = (n(_this, F), n(_this, O, 1)), _this.offset = (n(_this, N), n(_this, M, 0)), _this.scale = (n(_this, R), n(_this, y, 1)), _this.smoothness = (n(_this, V), n(_this, U, 1)), _this._disableLighting = (n(_this, w), n(_this, G, !1)), o.set(_this, (n(_this, W), n(_this, B, void 0))), n(_this, z);
514
+ _this = _super.call(this, e, t, void 0, r) || this, _this._maxSimultaneousLights = n(_this, _, 4), s.set(_this, (n(_this, C), n(_this, E, void 0))), _this.topColor = (n(_this, L), n(_this, P, new i.Color3(1, 0, 0))), _this.topColorAlpha = (n(_this, I), n(_this, D, 1)), _this.bottomColor = (n(_this, b), n(_this, A, new i.Color3(0, 0, 1))), _this.bottomColorAlpha = (n(_this, F), n(_this, O, 1)), _this.offset = (n(_this, R), n(_this, M, 0)), _this.scale = (n(_this, N), n(_this, y, 1)), _this.smoothness = (n(_this, V), n(_this, U, 1)), _this._disableLighting = (n(_this, w), n(_this, G, !1)), o.set(_this, (n(_this, W), n(_this, B, void 0))), n(_this, z);
515
515
  return _this;
516
516
  }
517
517
  Object.defineProperty(e.prototype, "maxSimultaneousLights", {
@@ -557,7 +557,7 @@ var __values = (this && this.__values) || function(o) {
557
557
  e.prototype.getClassName = function () { return "GradientMaterial"; };
558
558
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
559
559
  return e;
560
- }(T)), s = new WeakMap, o = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = T[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; f = [i.serialize("maxSimultaneousLights")], l = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], u = [i.serializeAsColor3()], d = [i.serialize()], c = [i.serializeAsColor3()], h = [i.serialize()], m = [i.serialize()], v = [i.serialize()], g = [i.serialize()], p = [i.serialize("disableLighting")], x = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, l, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, E, L), t(e, null, x, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, B, z), t(null, null, f, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, _, C), t(null, null, u, { kind: "field", name: "topColor", static: !1, private: !1, access: { has: function (e) { return "topColor" in e; }, get: function (e) { return e.topColor; }, set: function (e, i) { e.topColor = i; } }, metadata: r }, P, I), t(null, null, d, { kind: "field", name: "topColorAlpha", static: !1, private: !1, access: { has: function (e) { return "topColorAlpha" in e; }, get: function (e) { return e.topColorAlpha; }, set: function (e, i) { e.topColorAlpha = i; } }, metadata: r }, D, b), t(null, null, c, { kind: "field", name: "bottomColor", static: !1, private: !1, access: { has: function (e) { return "bottomColor" in e; }, get: function (e) { return e.bottomColor; }, set: function (e, i) { e.bottomColor = i; } }, metadata: r }, A, F), t(null, null, h, { kind: "field", name: "bottomColorAlpha", static: !1, private: !1, access: { has: function (e) { return "bottomColorAlpha" in e; }, get: function (e) { return e.bottomColorAlpha; }, set: function (e, i) { e.bottomColorAlpha = i; } }, metadata: r }, O, N), t(null, null, m, { kind: "field", name: "offset", static: !1, private: !1, access: { has: function (e) { return "offset" in e; }, get: function (e) { return e.offset; }, set: function (e, i) { e.offset = i; } }, metadata: r }, M, R), t(null, null, v, { kind: "field", name: "scale", static: !1, private: !1, access: { has: function (e) { return "scale" in e; }, get: function (e) { return e.scale; }, set: function (e, i) { e.scale = i; } }, metadata: r }, y, V), t(null, null, g, { kind: "field", name: "smoothness", static: !1, private: !1, access: { has: function (e) { return "smoothness" in e; }, get: function (e) { return e.smoothness; }, set: function (e, i) { e.smoothness = i; } }, metadata: r }, U, w), t(null, null, p, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, G, W), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Ge; }), Promise.resolve().then(function () { return He; })]; }, function () { return [Promise.resolve().then(function () { return Ze; }), Promise.resolve().then(function () { return Qe; })]; }), e; })();
560
+ }(T)), s = new WeakMap, o = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = T[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; f = [i.serialize("maxSimultaneousLights")], l = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], u = [i.serializeAsColor3()], d = [i.serialize()], c = [i.serializeAsColor3()], h = [i.serialize()], m = [i.serialize()], v = [i.serialize()], g = [i.serialize()], p = [i.serialize("disableLighting")], x = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, l, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, E, L), t(e, null, x, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, B, z), t(null, null, f, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, _, C), t(null, null, u, { kind: "field", name: "topColor", static: !1, private: !1, access: { has: function (e) { return "topColor" in e; }, get: function (e) { return e.topColor; }, set: function (e, i) { e.topColor = i; } }, metadata: r }, P, I), t(null, null, d, { kind: "field", name: "topColorAlpha", static: !1, private: !1, access: { has: function (e) { return "topColorAlpha" in e; }, get: function (e) { return e.topColorAlpha; }, set: function (e, i) { e.topColorAlpha = i; } }, metadata: r }, D, b), t(null, null, c, { kind: "field", name: "bottomColor", static: !1, private: !1, access: { has: function (e) { return "bottomColor" in e; }, get: function (e) { return e.bottomColor; }, set: function (e, i) { e.bottomColor = i; } }, metadata: r }, A, F), t(null, null, h, { kind: "field", name: "bottomColorAlpha", static: !1, private: !1, access: { has: function (e) { return "bottomColorAlpha" in e; }, get: function (e) { return e.bottomColorAlpha; }, set: function (e, i) { e.bottomColorAlpha = i; } }, metadata: r }, O, R), t(null, null, m, { kind: "field", name: "offset", static: !1, private: !1, access: { has: function (e) { return "offset" in e; }, get: function (e) { return e.offset; }, set: function (e, i) { e.offset = i; } }, metadata: r }, M, N), t(null, null, v, { kind: "field", name: "scale", static: !1, private: !1, access: { has: function (e) { return "scale" in e; }, get: function (e) { return e.scale; }, set: function (e, i) { e.scale = i; } }, metadata: r }, y, V), t(null, null, g, { kind: "field", name: "smoothness", static: !1, private: !1, access: { has: function (e) { return "smoothness" in e; }, get: function (e) { return e.smoothness; }, set: function (e, i) { e.smoothness = i; } }, metadata: r }, U, w), t(null, null, p, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, G, W), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return We; }), Promise.resolve().then(function () { return ke; })]; }, function () { return [Promise.resolve().then(function () { return Ze; }), Promise.resolve().then(function () { return Je; })]; }), e; })();
561
561
  i.RegisterClass("BABYLON.GradientMaterial", x);
562
562
  var T = /** @class */ (function (_super) {
563
563
  __extends(T, _super);
@@ -568,12 +568,12 @@ var __values = (this && this.__values) || function(o) {
568
568
  }
569
569
  return T;
570
570
  }(i.MaterialDefines));
571
- var _ = (function () { var e, s; var o, f, l, u, d, c, h, m, v, g, p, S, x, _, C, E, L, P, I, D, b = i.PushMaterial, A = [], F = [], O = [], N = [], M = [], R = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = []; return e = /** @class */ (function (_super) {
571
+ var _ = (function () { var e, s; var o, f, l, u, d, c, h, m, v, g, p, S, x, _, C, E, L, P, I, D, b = i.PushMaterial, A = [], F = [], O = [], R = [], M = [], N = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = []; return e = /** @class */ (function (_super) {
572
572
  __extends(e, _super);
573
573
  function e(e, t, r) {
574
574
  if (r === void 0) { r = !1; }
575
575
  var _this = this;
576
- _this = _super.call(this, e, t, void 0, r) || this, _this.mainColor = (n(_this, A), n(_this, F, i.Color3.Black())), _this.lineColor = (n(_this, O), n(_this, N, i.Color3.Teal())), _this.gridRatio = (n(_this, M), n(_this, R, 1)), _this.gridOffset = (n(_this, y), n(_this, V, i.Vector3.Zero())), _this.majorUnitFrequency = (n(_this, U), n(_this, w, 10)), _this.minorUnitVisibility = (n(_this, G), n(_this, W, .33)), _this.opacity = (n(_this, B), n(_this, z, 1)), _this.antialias = (n(_this, H), n(_this, k, !0)), _this._belowLineColor = (n(_this, X), null), _this.useMultiScale = n(_this, j, !1), _this.minGridSpacing = (n(_this, Z), n(_this, Y, .001)), _this.gridOctaves = (n(_this, K), n(_this, q, 4)), _this.useHorizonFade = (n(_this, Q), n(_this, J, !1)), _this.useOriginMarker = (n(_this, $), n(_this, ee, !1)), _this._linesOnly = (n(_this, ie), !1), _this.gridThicknessModifier = n(_this, te, 1), _this.preMultiplyAlpha = (n(_this, ne), n(_this, re, !1)), _this.useMaxLine = (n(_this, ae), n(_this, se, !1)), _this._opacityTexture = (n(_this, oe), n(_this, fe, void 0)), s.set(_this, (n(_this, le), n(_this, ue, void 0))), _this._gridControl = (n(_this, de), new i.Vector4(_this.gridRatio, _this.majorUnitFrequency, _this.minorUnitVisibility, _this.opacity)), _this._viewportSize = new i.Vector2;
576
+ _this = _super.call(this, e, t, void 0, r) || this, _this.mainColor = (n(_this, A), n(_this, F, i.Color3.Black())), _this.lineColor = (n(_this, O), n(_this, R, i.Color3.Teal())), _this.gridRatio = (n(_this, M), n(_this, N, 1)), _this.gridOffset = (n(_this, y), n(_this, V, i.Vector3.Zero())), _this.majorUnitFrequency = (n(_this, U), n(_this, w, 10)), _this.minorUnitVisibility = (n(_this, G), n(_this, W, .33)), _this.opacity = (n(_this, B), n(_this, z, 1)), _this.antialias = (n(_this, H), n(_this, k, !0)), _this._belowLineColor = (n(_this, X), null), _this.useMultiScale = n(_this, j, !1), _this.minGridSpacing = (n(_this, Y), n(_this, Z, .001)), _this.gridOctaves = (n(_this, K), n(_this, q, 4)), _this.useHorizonFade = (n(_this, Q), n(_this, J, !1)), _this.useOriginMarker = (n(_this, $), n(_this, ee, !1)), _this._linesOnly = (n(_this, ie), !1), _this.gridThicknessModifier = n(_this, te, 1), _this.preMultiplyAlpha = (n(_this, ne), n(_this, re, !1)), _this.useMaxLine = (n(_this, ae), n(_this, se, !1)), _this._opacityTexture = (n(_this, oe), n(_this, fe, void 0)), s.set(_this, (n(_this, le), n(_this, ue, void 0))), _this._gridControl = (n(_this, de), new i.Vector4(_this.gridRatio, _this.majorUnitFrequency, _this.minorUnitVisibility, _this.opacity)), _this._viewportSize = new i.Vector2;
577
577
  return _this;
578
578
  }
579
579
  Object.defineProperty(e.prototype, "belowLineColor", {
@@ -632,7 +632,7 @@ var __values = (this && this.__values) || function(o) {
632
632
  e.prototype.getClassName = function () { return "GridMaterial"; };
633
633
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
634
634
  return e;
635
- }(b)), s = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = b[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; o = [i.serializeAsColor3()], f = [i.serializeAsColor3()], l = [i.serialize()], u = [i.serializeAsVector3()], d = [i.serialize()], c = [i.serialize()], h = [i.serialize()], m = [i.serialize()], v = [i.serializeAsColor3()], g = [i.serialize()], p = [i.serialize()], S = [i.serialize()], x = [i.serialize()], _ = [i.serialize()], C = [i.serialize()], E = [i.serialize()], L = [i.serialize()], P = [i.serialize()], I = [i.serializeAsTexture("opacityTexture")], D = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t(e, null, v, { kind: "getter", name: "belowLineColor", static: !1, private: !1, access: { has: function (e) { return "belowLineColor" in e; }, get: function (e) { return e.belowLineColor; } }, metadata: r }, null, A), t(e, null, C, { kind: "getter", name: "linesOnly", static: !1, private: !1, access: { has: function (e) { return "linesOnly" in e; }, get: function (e) { return e.linesOnly; } }, metadata: r }, null, A), t(e, null, D, { kind: "accessor", name: "opacityTexture", static: !1, private: !1, access: { has: function (e) { return "opacityTexture" in e; }, get: function (e) { return e.opacityTexture; }, set: function (e, i) { e.opacityTexture = i; } }, metadata: r }, ue, de), t(null, null, o, { kind: "field", name: "mainColor", static: !1, private: !1, access: { has: function (e) { return "mainColor" in e; }, get: function (e) { return e.mainColor; }, set: function (e, i) { e.mainColor = i; } }, metadata: r }, F, O), t(null, null, f, { kind: "field", name: "lineColor", static: !1, private: !1, access: { has: function (e) { return "lineColor" in e; }, get: function (e) { return e.lineColor; }, set: function (e, i) { e.lineColor = i; } }, metadata: r }, N, M), t(null, null, l, { kind: "field", name: "gridRatio", static: !1, private: !1, access: { has: function (e) { return "gridRatio" in e; }, get: function (e) { return e.gridRatio; }, set: function (e, i) { e.gridRatio = i; } }, metadata: r }, R, y), t(null, null, u, { kind: "field", name: "gridOffset", static: !1, private: !1, access: { has: function (e) { return "gridOffset" in e; }, get: function (e) { return e.gridOffset; }, set: function (e, i) { e.gridOffset = i; } }, metadata: r }, V, U), t(null, null, d, { kind: "field", name: "majorUnitFrequency", static: !1, private: !1, access: { has: function (e) { return "majorUnitFrequency" in e; }, get: function (e) { return e.majorUnitFrequency; }, set: function (e, i) { e.majorUnitFrequency = i; } }, metadata: r }, w, G), t(null, null, c, { kind: "field", name: "minorUnitVisibility", static: !1, private: !1, access: { has: function (e) { return "minorUnitVisibility" in e; }, get: function (e) { return e.minorUnitVisibility; }, set: function (e, i) { e.minorUnitVisibility = i; } }, metadata: r }, W, B), t(null, null, h, { kind: "field", name: "opacity", static: !1, private: !1, access: { has: function (e) { return "opacity" in e; }, get: function (e) { return e.opacity; }, set: function (e, i) { e.opacity = i; } }, metadata: r }, z, H), t(null, null, m, { kind: "field", name: "antialias", static: !1, private: !1, access: { has: function (e) { return "antialias" in e; }, get: function (e) { return e.antialias; }, set: function (e, i) { e.antialias = i; } }, metadata: r }, k, X), t(null, null, g, { kind: "field", name: "useMultiScale", static: !1, private: !1, access: { has: function (e) { return "useMultiScale" in e; }, get: function (e) { return e.useMultiScale; }, set: function (e, i) { e.useMultiScale = i; } }, metadata: r }, j, Z), t(null, null, p, { kind: "field", name: "minGridSpacing", static: !1, private: !1, access: { has: function (e) { return "minGridSpacing" in e; }, get: function (e) { return e.minGridSpacing; }, set: function (e, i) { e.minGridSpacing = i; } }, metadata: r }, Y, K), t(null, null, S, { kind: "field", name: "gridOctaves", static: !1, private: !1, access: { has: function (e) { return "gridOctaves" in e; }, get: function (e) { return e.gridOctaves; }, set: function (e, i) { e.gridOctaves = i; } }, metadata: r }, q, Q), t(null, null, x, { kind: "field", name: "useHorizonFade", static: !1, private: !1, access: { has: function (e) { return "useHorizonFade" in e; }, get: function (e) { return e.useHorizonFade; }, set: function (e, i) { e.useHorizonFade = i; } }, metadata: r }, J, $), t(null, null, _, { kind: "field", name: "useOriginMarker", static: !1, private: !1, access: { has: function (e) { return "useOriginMarker" in e; }, get: function (e) { return e.useOriginMarker; }, set: function (e, i) { e.useOriginMarker = i; } }, metadata: r }, ee, ie), t(null, null, E, { kind: "field", name: "gridThicknessModifier", static: !1, private: !1, access: { has: function (e) { return "gridThicknessModifier" in e; }, get: function (e) { return e.gridThicknessModifier; }, set: function (e, i) { e.gridThicknessModifier = i; } }, metadata: r }, te, ne), t(null, null, L, { kind: "field", name: "preMultiplyAlpha", static: !1, private: !1, access: { has: function (e) { return "preMultiplyAlpha" in e; }, get: function (e) { return e.preMultiplyAlpha; }, set: function (e, i) { e.preMultiplyAlpha = i; } }, metadata: r }, re, ae), t(null, null, P, { kind: "field", name: "useMaxLine", static: !1, private: !1, access: { has: function (e) { return "useMaxLine" in e; }, get: function (e) { return e.useMaxLine; }, set: function (e, i) { e.useMaxLine = i; } }, metadata: r }, se, oe), t(null, null, I, { kind: "field", name: "_opacityTexture", static: !1, private: !1, access: { has: function (e) { return "_opacityTexture" in e; }, get: function (e) { return e._opacityTexture; }, set: function (e, i) { e._opacityTexture = i; } }, metadata: r }, fe, le), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return ii; }), Promise.resolve().then(function () { return ai; })]; }, function () { return [Promise.resolve().then(function () { return li; }), Promise.resolve().then(function () { return hi; })]; }), e; })();
635
+ }(b)), s = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = b[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; o = [i.serializeAsColor3()], f = [i.serializeAsColor3()], l = [i.serialize()], u = [i.serializeAsVector3()], d = [i.serialize()], c = [i.serialize()], h = [i.serialize()], m = [i.serialize()], v = [i.serializeAsColor3()], g = [i.serialize()], p = [i.serialize()], S = [i.serialize()], x = [i.serialize()], _ = [i.serialize()], C = [i.serialize()], E = [i.serialize()], L = [i.serialize()], P = [i.serialize()], I = [i.serializeAsTexture("opacityTexture")], D = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], t(e, null, v, { kind: "getter", name: "belowLineColor", static: !1, private: !1, access: { has: function (e) { return "belowLineColor" in e; }, get: function (e) { return e.belowLineColor; } }, metadata: r }, null, A), t(e, null, C, { kind: "getter", name: "linesOnly", static: !1, private: !1, access: { has: function (e) { return "linesOnly" in e; }, get: function (e) { return e.linesOnly; } }, metadata: r }, null, A), t(e, null, D, { kind: "accessor", name: "opacityTexture", static: !1, private: !1, access: { has: function (e) { return "opacityTexture" in e; }, get: function (e) { return e.opacityTexture; }, set: function (e, i) { e.opacityTexture = i; } }, metadata: r }, ue, de), t(null, null, o, { kind: "field", name: "mainColor", static: !1, private: !1, access: { has: function (e) { return "mainColor" in e; }, get: function (e) { return e.mainColor; }, set: function (e, i) { e.mainColor = i; } }, metadata: r }, F, O), t(null, null, f, { kind: "field", name: "lineColor", static: !1, private: !1, access: { has: function (e) { return "lineColor" in e; }, get: function (e) { return e.lineColor; }, set: function (e, i) { e.lineColor = i; } }, metadata: r }, R, M), t(null, null, l, { kind: "field", name: "gridRatio", static: !1, private: !1, access: { has: function (e) { return "gridRatio" in e; }, get: function (e) { return e.gridRatio; }, set: function (e, i) { e.gridRatio = i; } }, metadata: r }, N, y), t(null, null, u, { kind: "field", name: "gridOffset", static: !1, private: !1, access: { has: function (e) { return "gridOffset" in e; }, get: function (e) { return e.gridOffset; }, set: function (e, i) { e.gridOffset = i; } }, metadata: r }, V, U), t(null, null, d, { kind: "field", name: "majorUnitFrequency", static: !1, private: !1, access: { has: function (e) { return "majorUnitFrequency" in e; }, get: function (e) { return e.majorUnitFrequency; }, set: function (e, i) { e.majorUnitFrequency = i; } }, metadata: r }, w, G), t(null, null, c, { kind: "field", name: "minorUnitVisibility", static: !1, private: !1, access: { has: function (e) { return "minorUnitVisibility" in e; }, get: function (e) { return e.minorUnitVisibility; }, set: function (e, i) { e.minorUnitVisibility = i; } }, metadata: r }, W, B), t(null, null, h, { kind: "field", name: "opacity", static: !1, private: !1, access: { has: function (e) { return "opacity" in e; }, get: function (e) { return e.opacity; }, set: function (e, i) { e.opacity = i; } }, metadata: r }, z, H), t(null, null, m, { kind: "field", name: "antialias", static: !1, private: !1, access: { has: function (e) { return "antialias" in e; }, get: function (e) { return e.antialias; }, set: function (e, i) { e.antialias = i; } }, metadata: r }, k, X), t(null, null, g, { kind: "field", name: "useMultiScale", static: !1, private: !1, access: { has: function (e) { return "useMultiScale" in e; }, get: function (e) { return e.useMultiScale; }, set: function (e, i) { e.useMultiScale = i; } }, metadata: r }, j, Y), t(null, null, p, { kind: "field", name: "minGridSpacing", static: !1, private: !1, access: { has: function (e) { return "minGridSpacing" in e; }, get: function (e) { return e.minGridSpacing; }, set: function (e, i) { e.minGridSpacing = i; } }, metadata: r }, Z, K), t(null, null, S, { kind: "field", name: "gridOctaves", static: !1, private: !1, access: { has: function (e) { return "gridOctaves" in e; }, get: function (e) { return e.gridOctaves; }, set: function (e, i) { e.gridOctaves = i; } }, metadata: r }, q, Q), t(null, null, x, { kind: "field", name: "useHorizonFade", static: !1, private: !1, access: { has: function (e) { return "useHorizonFade" in e; }, get: function (e) { return e.useHorizonFade; }, set: function (e, i) { e.useHorizonFade = i; } }, metadata: r }, J, $), t(null, null, _, { kind: "field", name: "useOriginMarker", static: !1, private: !1, access: { has: function (e) { return "useOriginMarker" in e; }, get: function (e) { return e.useOriginMarker; }, set: function (e, i) { e.useOriginMarker = i; } }, metadata: r }, ee, ie), t(null, null, E, { kind: "field", name: "gridThicknessModifier", static: !1, private: !1, access: { has: function (e) { return "gridThicknessModifier" in e; }, get: function (e) { return e.gridThicknessModifier; }, set: function (e, i) { e.gridThicknessModifier = i; } }, metadata: r }, te, ne), t(null, null, L, { kind: "field", name: "preMultiplyAlpha", static: !1, private: !1, access: { has: function (e) { return "preMultiplyAlpha" in e; }, get: function (e) { return e.preMultiplyAlpha; }, set: function (e, i) { e.preMultiplyAlpha = i; } }, metadata: r }, re, ae), t(null, null, P, { kind: "field", name: "useMaxLine", static: !1, private: !1, access: { has: function (e) { return "useMaxLine" in e; }, get: function (e) { return e.useMaxLine; }, set: function (e, i) { e.useMaxLine = i; } }, metadata: r }, se, oe), t(null, null, I, { kind: "field", name: "_opacityTexture", static: !1, private: !1, access: { has: function (e) { return "_opacityTexture" in e; }, get: function (e) { return e._opacityTexture; }, set: function (e, i) { e._opacityTexture = i; } }, metadata: r }, fe, le), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return ti; }), Promise.resolve().then(function () { return si; })]; }, function () { return [Promise.resolve().then(function () { return ui; }), Promise.resolve().then(function () { return mi; })]; }), e; })();
636
636
  i.RegisterClass("BABYLON.GridMaterial", _);
637
637
  var C = /** @class */ (function (_super) {
638
638
  __extends(C, _super);
@@ -643,12 +643,12 @@ var __values = (this && this.__values) || function(o) {
643
643
  }
644
644
  return C;
645
645
  }(i.MaterialDefines));
646
- var E = (function () { var e, s, o, f, l; var u, d, c, h, m, v, g, p, S, x, T, _, E, L, P, I = i.PushMaterial, D = [], b = [], A = [], F = [], O = [], N = [], M = [], R = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = []; return e = /** @class */ (function (_super) {
646
+ var E = (function () { var e, s, o, f, l; var u, d, c, h, m, v, g, p, S, x, T, _, E, L, P, I = i.PushMaterial, D = [], b = [], A = [], F = [], O = [], R = [], M = [], N = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = []; return e = /** @class */ (function (_super) {
647
647
  __extends(e, _super);
648
648
  function e(e, t, r) {
649
649
  if (r === void 0) { r = !1; }
650
650
  var _this = this;
651
- _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = n(_this, D, void 0), s.set(_this, (n(_this, b), n(_this, A, void 0))), _this.noiseTexture = (n(_this, F), n(_this, O, void 0)), _this.fogColor = (n(_this, N), n(_this, M, void 0)), _this.speed = (n(_this, R), n(_this, y, 1)), _this.movingSpeed = (n(_this, V), n(_this, U, 1)), _this.lowFrequencySpeed = (n(_this, w), n(_this, G, 1)), _this.fogDensity = (n(_this, W), n(_this, B, .15)), _this._lastTime = (n(_this, z), 0), _this.diffuseColor = n(_this, H, new i.Color3(1, 1, 1)), _this._disableLighting = (n(_this, k), n(_this, X, !1)), o.set(_this, (n(_this, j), n(_this, Z, void 0))), _this._unlit = (n(_this, Y), n(_this, K, !1)), f.set(_this, (n(_this, q), n(_this, Q, void 0))), _this._maxSimultaneousLights = (n(_this, J), n(_this, $, 4)), l.set(_this, (n(_this, ee), n(_this, ie, void 0))), _this._scaledDiffuse = (n(_this, te), new i.Color3);
651
+ _this = _super.call(this, e, t, void 0, r) || this, _this._diffuseTexture = n(_this, D, void 0), s.set(_this, (n(_this, b), n(_this, A, void 0))), _this.noiseTexture = (n(_this, F), n(_this, O, void 0)), _this.fogColor = (n(_this, R), n(_this, M, void 0)), _this.speed = (n(_this, N), n(_this, y, 1)), _this.movingSpeed = (n(_this, V), n(_this, U, 1)), _this.lowFrequencySpeed = (n(_this, w), n(_this, G, 1)), _this.fogDensity = (n(_this, W), n(_this, B, .15)), _this._lastTime = (n(_this, z), 0), _this.diffuseColor = n(_this, H, new i.Color3(1, 1, 1)), _this._disableLighting = (n(_this, k), n(_this, X, !1)), o.set(_this, (n(_this, j), n(_this, Y, void 0))), _this._unlit = (n(_this, Z), n(_this, K, !1)), f.set(_this, (n(_this, q), n(_this, Q, void 0))), _this._maxSimultaneousLights = (n(_this, J), n(_this, $, 4)), l.set(_this, (n(_this, ee), n(_this, ie, void 0))), _this._scaledDiffuse = (n(_this, te), new i.Color3);
652
652
  return _this;
653
653
  }
654
654
  Object.defineProperty(e.prototype, "diffuseTexture", {
@@ -712,7 +712,7 @@ var __values = (this && this.__values) || function(o) {
712
712
  e.prototype.getClassName = function () { return "LavaMaterial"; };
713
713
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
714
714
  return e;
715
- }(I)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = I[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; u = [i.serializeAsTexture("diffuseTexture")], d = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], c = [i.serializeAsTexture()], h = [i.serializeAsColor3()], m = [i.serialize()], v = [i.serialize()], g = [i.serialize()], p = [i.serialize()], S = [i.serializeAsColor3()], x = [i.serialize("disableLighting")], T = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], _ = [i.serialize("unlit")], E = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], L = [i.serialize("maxSimultaneousLights")], P = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, d, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, A, F), t(e, null, T, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, Z, Y), t(e, null, E, { kind: "accessor", name: "unlit", static: !1, private: !1, access: { has: function (e) { return "unlit" in e; }, get: function (e) { return e.unlit; }, set: function (e, i) { e.unlit = i; } }, metadata: r }, Q, J), t(e, null, P, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, ie, te), t(null, null, u, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, D, b), t(null, null, c, { kind: "field", name: "noiseTexture", static: !1, private: !1, access: { has: function (e) { return "noiseTexture" in e; }, get: function (e) { return e.noiseTexture; }, set: function (e, i) { e.noiseTexture = i; } }, metadata: r }, O, N), t(null, null, h, { kind: "field", name: "fogColor", static: !1, private: !1, access: { has: function (e) { return "fogColor" in e; }, get: function (e) { return e.fogColor; }, set: function (e, i) { e.fogColor = i; } }, metadata: r }, M, R), t(null, null, m, { kind: "field", name: "speed", static: !1, private: !1, access: { has: function (e) { return "speed" in e; }, get: function (e) { return e.speed; }, set: function (e, i) { e.speed = i; } }, metadata: r }, y, V), t(null, null, v, { kind: "field", name: "movingSpeed", static: !1, private: !1, access: { has: function (e) { return "movingSpeed" in e; }, get: function (e) { return e.movingSpeed; }, set: function (e, i) { e.movingSpeed = i; } }, metadata: r }, U, w), t(null, null, g, { kind: "field", name: "lowFrequencySpeed", static: !1, private: !1, access: { has: function (e) { return "lowFrequencySpeed" in e; }, get: function (e) { return e.lowFrequencySpeed; }, set: function (e, i) { e.lowFrequencySpeed = i; } }, metadata: r }, G, W), t(null, null, p, { kind: "field", name: "fogDensity", static: !1, private: !1, access: { has: function (e) { return "fogDensity" in e; }, get: function (e) { return e.fogDensity; }, set: function (e, i) { e.fogDensity = i; } }, metadata: r }, B, z), t(null, null, S, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, H, k), t(null, null, x, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, X, j), t(null, null, _, { kind: "field", name: "_unlit", static: !1, private: !1, access: { has: function (e) { return "_unlit" in e; }, get: function (e) { return e._unlit; }, set: function (e, i) { e._unlit = i; } }, metadata: r }, K, q), t(null, null, L, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, $, ee), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return pi; }), Promise.resolve().then(function () { return _i; })]; }, function () { return [Promise.resolve().then(function () { return Pi; }), Promise.resolve().then(function () { return Ai; })]; }), e; })();
715
+ }(I)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = I[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; u = [i.serializeAsTexture("diffuseTexture")], d = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], c = [i.serializeAsTexture()], h = [i.serializeAsColor3()], m = [i.serialize()], v = [i.serialize()], g = [i.serialize()], p = [i.serialize()], S = [i.serializeAsColor3()], x = [i.serialize("disableLighting")], T = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], _ = [i.serialize("unlit")], E = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], L = [i.serialize("maxSimultaneousLights")], P = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, d, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, A, F), t(e, null, T, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, Y, Z), t(e, null, E, { kind: "accessor", name: "unlit", static: !1, private: !1, access: { has: function (e) { return "unlit" in e; }, get: function (e) { return e.unlit; }, set: function (e, i) { e.unlit = i; } }, metadata: r }, Q, J), t(e, null, P, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, ie, te), t(null, null, u, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, D, b), t(null, null, c, { kind: "field", name: "noiseTexture", static: !1, private: !1, access: { has: function (e) { return "noiseTexture" in e; }, get: function (e) { return e.noiseTexture; }, set: function (e, i) { e.noiseTexture = i; } }, metadata: r }, O, R), t(null, null, h, { kind: "field", name: "fogColor", static: !1, private: !1, access: { has: function (e) { return "fogColor" in e; }, get: function (e) { return e.fogColor; }, set: function (e, i) { e.fogColor = i; } }, metadata: r }, M, N), t(null, null, m, { kind: "field", name: "speed", static: !1, private: !1, access: { has: function (e) { return "speed" in e; }, get: function (e) { return e.speed; }, set: function (e, i) { e.speed = i; } }, metadata: r }, y, V), t(null, null, v, { kind: "field", name: "movingSpeed", static: !1, private: !1, access: { has: function (e) { return "movingSpeed" in e; }, get: function (e) { return e.movingSpeed; }, set: function (e, i) { e.movingSpeed = i; } }, metadata: r }, U, w), t(null, null, g, { kind: "field", name: "lowFrequencySpeed", static: !1, private: !1, access: { has: function (e) { return "lowFrequencySpeed" in e; }, get: function (e) { return e.lowFrequencySpeed; }, set: function (e, i) { e.lowFrequencySpeed = i; } }, metadata: r }, G, W), t(null, null, p, { kind: "field", name: "fogDensity", static: !1, private: !1, access: { has: function (e) { return "fogDensity" in e; }, get: function (e) { return e.fogDensity; }, set: function (e, i) { e.fogDensity = i; } }, metadata: r }, B, z), t(null, null, S, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, H, k), t(null, null, x, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, X, j), t(null, null, _, { kind: "field", name: "_unlit", static: !1, private: !1, access: { has: function (e) { return "_unlit" in e; }, get: function (e) { return e._unlit; }, set: function (e, i) { e._unlit = i; } }, metadata: r }, K, q), t(null, null, L, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, $, ee), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Si; }), Promise.resolve().then(function () { return Ci; })]; }, function () { return [Promise.resolve().then(function () { return Ii; }), Promise.resolve().then(function () { return Fi; })]; }), e; })();
716
716
  i.RegisterClass("BABYLON.LavaMaterial", E);
717
717
  var L = /** @class */ (function (_super) {
718
718
  __extends(L, _super);
@@ -723,12 +723,12 @@ var __values = (this && this.__values) || function(o) {
723
723
  }
724
724
  return L;
725
725
  }(i.MaterialDefines));
726
- var P = (function () { var e, s, o, f, l, u, d, c, h, m, v, g, p; var S, x, T, _, C, E, P, I, D, b, A, F, O, N, M, R, y, V, U, w, G, W, B, z, H, k, X, j = i.PushMaterial, Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = [], Pe = [], Ie = [], De = [], be = [], Ae = [], Fe = [], Oe = [], Ne = [], Me = [], Re = [], ye = [], Ve = [], Ue = [], we = [], Ge = [], We = [], Be = [], ze = [], He = [], ke = [], Xe = [], je = []; return e = /** @class */ (function (_super) {
726
+ var P = (function () { var e, s, o, f, l, u, d, c, h, m, v, g, p; var S, x, T, _, C, E, P, I, D, b, A, F, O, R, M, N, y, V, U, w, G, W, B, z, H, k, X, j = i.PushMaterial, Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = [], Pe = [], Ie = [], De = [], be = [], Ae = [], Fe = [], Oe = [], Re = [], Me = [], Ne = [], ye = [], Ve = [], Ue = [], we = [], Ge = [], We = [], Be = [], ze = [], He = [], ke = [], Xe = [], je = []; return e = /** @class */ (function (_super) {
727
727
  __extends(e, _super);
728
728
  function e(e, t, r) {
729
729
  if (r === void 0) { r = !1; }
730
730
  var _this = this;
731
- _this = _super.call(this, e, t, void 0, r) || this, _this._mixTexture1 = n(_this, Z, void 0), s.set(_this, (n(_this, Y), n(_this, K, void 0))), _this._mixTexture2 = (n(_this, q), n(_this, Q, void 0)), o.set(_this, (n(_this, J), n(_this, $, void 0))), _this._diffuseTexture1 = (n(_this, ee), n(_this, ie, void 0)), f.set(_this, (n(_this, te), n(_this, ne, void 0))), _this._diffuseTexture2 = (n(_this, re), n(_this, ae, void 0)), l.set(_this, (n(_this, se), n(_this, oe, void 0))), _this._diffuseTexture3 = (n(_this, fe), n(_this, le, void 0)), u.set(_this, (n(_this, ue), n(_this, de, void 0))), _this._diffuseTexture4 = (n(_this, ce), n(_this, he, void 0)), d.set(_this, (n(_this, me), n(_this, ve, void 0))), _this._diffuseTexture5 = (n(_this, ge), n(_this, pe, void 0)), c.set(_this, (n(_this, Se), n(_this, xe, void 0))), _this._diffuseTexture6 = (n(_this, Te), n(_this, _e, void 0)), h.set(_this, (n(_this, Ce), n(_this, Ee, void 0))), _this._diffuseTexture7 = (n(_this, Le), n(_this, Pe, void 0)), m.set(_this, (n(_this, Ie), n(_this, De, void 0))), _this._diffuseTexture8 = (n(_this, be), n(_this, Ae, void 0)), v.set(_this, (n(_this, Fe), n(_this, Oe, void 0))), _this.diffuseColor = (n(_this, Ne), n(_this, Me, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, Re), n(_this, ye, new i.Color3(0, 0, 0))), _this.specularPower = (n(_this, Ve), n(_this, Ue, 64)), _this._disableLighting = (n(_this, we), n(_this, Ge, !1)), g.set(_this, (n(_this, We), n(_this, Be, void 0))), _this._maxSimultaneousLights = (n(_this, ze), n(_this, He, 4)), p.set(_this, (n(_this, ke), n(_this, Xe, void 0))), n(_this, je);
731
+ _this = _super.call(this, e, t, void 0, r) || this, _this._mixTexture1 = n(_this, Y, void 0), s.set(_this, (n(_this, Z), n(_this, K, void 0))), _this._mixTexture2 = (n(_this, q), n(_this, Q, void 0)), o.set(_this, (n(_this, J), n(_this, $, void 0))), _this._diffuseTexture1 = (n(_this, ee), n(_this, ie, void 0)), f.set(_this, (n(_this, te), n(_this, ne, void 0))), _this._diffuseTexture2 = (n(_this, re), n(_this, ae, void 0)), l.set(_this, (n(_this, se), n(_this, oe, void 0))), _this._diffuseTexture3 = (n(_this, fe), n(_this, le, void 0)), u.set(_this, (n(_this, ue), n(_this, de, void 0))), _this._diffuseTexture4 = (n(_this, ce), n(_this, he, void 0)), d.set(_this, (n(_this, me), n(_this, ve, void 0))), _this._diffuseTexture5 = (n(_this, ge), n(_this, pe, void 0)), c.set(_this, (n(_this, Se), n(_this, xe, void 0))), _this._diffuseTexture6 = (n(_this, Te), n(_this, _e, void 0)), h.set(_this, (n(_this, Ce), n(_this, Ee, void 0))), _this._diffuseTexture7 = (n(_this, Le), n(_this, Pe, void 0)), m.set(_this, (n(_this, Ie), n(_this, De, void 0))), _this._diffuseTexture8 = (n(_this, be), n(_this, Ae, void 0)), v.set(_this, (n(_this, Fe), n(_this, Oe, void 0))), _this.diffuseColor = (n(_this, Re), n(_this, Me, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, Ne), n(_this, ye, new i.Color3(0, 0, 0))), _this.specularPower = (n(_this, Ve), n(_this, Ue, 64)), _this._disableLighting = (n(_this, we), n(_this, Ge, !1)), g.set(_this, (n(_this, We), n(_this, Be, void 0))), _this._maxSimultaneousLights = (n(_this, ze), n(_this, He, 4)), p.set(_this, (n(_this, ke), n(_this, Xe, void 0))), n(_this, je);
732
732
  return _this;
733
733
  }
734
734
  Object.defineProperty(e.prototype, "mixTexture1", {
@@ -856,7 +856,7 @@ var __values = (this && this.__values) || function(o) {
856
856
  e.prototype.getClassName = function () { return "MixMaterial"; };
857
857
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
858
858
  return e;
859
- }(j)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, h = new WeakMap, m = new WeakMap, v = new WeakMap, g = new WeakMap, p = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = j[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; S = [i.serializeAsTexture("mixTexture1")], x = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], T = [i.serializeAsTexture("mixTexture2")], _ = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], C = [i.serializeAsTexture("diffuseTexture1")], E = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], P = [i.serializeAsTexture("diffuseTexture2")], I = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], D = [i.serializeAsTexture("diffuseTexture3")], b = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], A = [i.serializeAsTexture("diffuseTexture4")], F = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], O = [i.serializeAsTexture("diffuseTexture1")], N = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], M = [i.serializeAsTexture("diffuseTexture2")], R = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], y = [i.serializeAsTexture("diffuseTexture3")], V = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], U = [i.serializeAsTexture("diffuseTexture4")], w = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], G = [i.serializeAsColor3()], W = [i.serializeAsColor3()], B = [i.serialize()], z = [i.serialize("disableLighting")], H = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], k = [i.serialize("maxSimultaneousLights")], X = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, x, { kind: "accessor", name: "mixTexture1", static: !1, private: !1, access: { has: function (e) { return "mixTexture1" in e; }, get: function (e) { return e.mixTexture1; }, set: function (e, i) { e.mixTexture1 = i; } }, metadata: r }, K, q), t(e, null, _, { kind: "accessor", name: "mixTexture2", static: !1, private: !1, access: { has: function (e) { return "mixTexture2" in e; }, get: function (e) { return e.mixTexture2; }, set: function (e, i) { e.mixTexture2 = i; } }, metadata: r }, $, ee), t(e, null, E, { kind: "accessor", name: "diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture1" in e; }, get: function (e) { return e.diffuseTexture1; }, set: function (e, i) { e.diffuseTexture1 = i; } }, metadata: r }, ne, re), t(e, null, I, { kind: "accessor", name: "diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture2" in e; }, get: function (e) { return e.diffuseTexture2; }, set: function (e, i) { e.diffuseTexture2 = i; } }, metadata: r }, oe, fe), t(e, null, b, { kind: "accessor", name: "diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture3" in e; }, get: function (e) { return e.diffuseTexture3; }, set: function (e, i) { e.diffuseTexture3 = i; } }, metadata: r }, de, ce), t(e, null, F, { kind: "accessor", name: "diffuseTexture4", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture4" in e; }, get: function (e) { return e.diffuseTexture4; }, set: function (e, i) { e.diffuseTexture4 = i; } }, metadata: r }, ve, ge), t(e, null, N, { kind: "accessor", name: "diffuseTexture5", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture5" in e; }, get: function (e) { return e.diffuseTexture5; }, set: function (e, i) { e.diffuseTexture5 = i; } }, metadata: r }, xe, Te), t(e, null, R, { kind: "accessor", name: "diffuseTexture6", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture6" in e; }, get: function (e) { return e.diffuseTexture6; }, set: function (e, i) { e.diffuseTexture6 = i; } }, metadata: r }, Ee, Le), t(e, null, V, { kind: "accessor", name: "diffuseTexture7", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture7" in e; }, get: function (e) { return e.diffuseTexture7; }, set: function (e, i) { e.diffuseTexture7 = i; } }, metadata: r }, De, be), t(e, null, w, { kind: "accessor", name: "diffuseTexture8", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture8" in e; }, get: function (e) { return e.diffuseTexture8; }, set: function (e, i) { e.diffuseTexture8 = i; } }, metadata: r }, Oe, Ne), t(e, null, H, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, Be, ze), t(e, null, X, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, Xe, je), t(null, null, S, { kind: "field", name: "_mixTexture1", static: !1, private: !1, access: { has: function (e) { return "_mixTexture1" in e; }, get: function (e) { return e._mixTexture1; }, set: function (e, i) { e._mixTexture1 = i; } }, metadata: r }, Z, Y), t(null, null, T, { kind: "field", name: "_mixTexture2", static: !1, private: !1, access: { has: function (e) { return "_mixTexture2" in e; }, get: function (e) { return e._mixTexture2; }, set: function (e, i) { e._mixTexture2 = i; } }, metadata: r }, Q, J), t(null, null, C, { kind: "field", name: "_diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture1" in e; }, get: function (e) { return e._diffuseTexture1; }, set: function (e, i) { e._diffuseTexture1 = i; } }, metadata: r }, ie, te), t(null, null, P, { kind: "field", name: "_diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture2" in e; }, get: function (e) { return e._diffuseTexture2; }, set: function (e, i) { e._diffuseTexture2 = i; } }, metadata: r }, ae, se), t(null, null, D, { kind: "field", name: "_diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture3" in e; }, get: function (e) { return e._diffuseTexture3; }, set: function (e, i) { e._diffuseTexture3 = i; } }, metadata: r }, le, ue), t(null, null, A, { kind: "field", name: "_diffuseTexture4", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture4" in e; }, get: function (e) { return e._diffuseTexture4; }, set: function (e, i) { e._diffuseTexture4 = i; } }, metadata: r }, he, me), t(null, null, O, { kind: "field", name: "_diffuseTexture5", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture5" in e; }, get: function (e) { return e._diffuseTexture5; }, set: function (e, i) { e._diffuseTexture5 = i; } }, metadata: r }, pe, Se), t(null, null, M, { kind: "field", name: "_diffuseTexture6", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture6" in e; }, get: function (e) { return e._diffuseTexture6; }, set: function (e, i) { e._diffuseTexture6 = i; } }, metadata: r }, _e, Ce), t(null, null, y, { kind: "field", name: "_diffuseTexture7", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture7" in e; }, get: function (e) { return e._diffuseTexture7; }, set: function (e, i) { e._diffuseTexture7 = i; } }, metadata: r }, Pe, Ie), t(null, null, U, { kind: "field", name: "_diffuseTexture8", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture8" in e; }, get: function (e) { return e._diffuseTexture8; }, set: function (e, i) { e._diffuseTexture8 = i; } }, metadata: r }, Ae, Fe), t(null, null, G, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, Me, Re), t(null, null, W, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, ye, Ve), t(null, null, B, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, Ue, we), t(null, null, z, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, Ge, We), t(null, null, k, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, He, ke), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Mi; }), Promise.resolve().then(function () { return Ui; })]; }, function () { return [Promise.resolve().then(function () { return Bi; }), Promise.resolve().then(function () { return Xi; })]; }), e; })();
859
+ }(j)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, h = new WeakMap, m = new WeakMap, v = new WeakMap, g = new WeakMap, p = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = j[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; S = [i.serializeAsTexture("mixTexture1")], x = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], T = [i.serializeAsTexture("mixTexture2")], _ = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], C = [i.serializeAsTexture("diffuseTexture1")], E = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], P = [i.serializeAsTexture("diffuseTexture2")], I = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], D = [i.serializeAsTexture("diffuseTexture3")], b = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], A = [i.serializeAsTexture("diffuseTexture4")], F = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], O = [i.serializeAsTexture("diffuseTexture1")], R = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], M = [i.serializeAsTexture("diffuseTexture2")], N = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], y = [i.serializeAsTexture("diffuseTexture3")], V = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], U = [i.serializeAsTexture("diffuseTexture4")], w = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], G = [i.serializeAsColor3()], W = [i.serializeAsColor3()], B = [i.serialize()], z = [i.serialize("disableLighting")], H = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], k = [i.serialize("maxSimultaneousLights")], X = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, x, { kind: "accessor", name: "mixTexture1", static: !1, private: !1, access: { has: function (e) { return "mixTexture1" in e; }, get: function (e) { return e.mixTexture1; }, set: function (e, i) { e.mixTexture1 = i; } }, metadata: r }, K, q), t(e, null, _, { kind: "accessor", name: "mixTexture2", static: !1, private: !1, access: { has: function (e) { return "mixTexture2" in e; }, get: function (e) { return e.mixTexture2; }, set: function (e, i) { e.mixTexture2 = i; } }, metadata: r }, $, ee), t(e, null, E, { kind: "accessor", name: "diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture1" in e; }, get: function (e) { return e.diffuseTexture1; }, set: function (e, i) { e.diffuseTexture1 = i; } }, metadata: r }, ne, re), t(e, null, I, { kind: "accessor", name: "diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture2" in e; }, get: function (e) { return e.diffuseTexture2; }, set: function (e, i) { e.diffuseTexture2 = i; } }, metadata: r }, oe, fe), t(e, null, b, { kind: "accessor", name: "diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture3" in e; }, get: function (e) { return e.diffuseTexture3; }, set: function (e, i) { e.diffuseTexture3 = i; } }, metadata: r }, de, ce), t(e, null, F, { kind: "accessor", name: "diffuseTexture4", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture4" in e; }, get: function (e) { return e.diffuseTexture4; }, set: function (e, i) { e.diffuseTexture4 = i; } }, metadata: r }, ve, ge), t(e, null, R, { kind: "accessor", name: "diffuseTexture5", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture5" in e; }, get: function (e) { return e.diffuseTexture5; }, set: function (e, i) { e.diffuseTexture5 = i; } }, metadata: r }, xe, Te), t(e, null, N, { kind: "accessor", name: "diffuseTexture6", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture6" in e; }, get: function (e) { return e.diffuseTexture6; }, set: function (e, i) { e.diffuseTexture6 = i; } }, metadata: r }, Ee, Le), t(e, null, V, { kind: "accessor", name: "diffuseTexture7", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture7" in e; }, get: function (e) { return e.diffuseTexture7; }, set: function (e, i) { e.diffuseTexture7 = i; } }, metadata: r }, De, be), t(e, null, w, { kind: "accessor", name: "diffuseTexture8", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture8" in e; }, get: function (e) { return e.diffuseTexture8; }, set: function (e, i) { e.diffuseTexture8 = i; } }, metadata: r }, Oe, Re), t(e, null, H, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, Be, ze), t(e, null, X, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, Xe, je), t(null, null, S, { kind: "field", name: "_mixTexture1", static: !1, private: !1, access: { has: function (e) { return "_mixTexture1" in e; }, get: function (e) { return e._mixTexture1; }, set: function (e, i) { e._mixTexture1 = i; } }, metadata: r }, Y, Z), t(null, null, T, { kind: "field", name: "_mixTexture2", static: !1, private: !1, access: { has: function (e) { return "_mixTexture2" in e; }, get: function (e) { return e._mixTexture2; }, set: function (e, i) { e._mixTexture2 = i; } }, metadata: r }, Q, J), t(null, null, C, { kind: "field", name: "_diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture1" in e; }, get: function (e) { return e._diffuseTexture1; }, set: function (e, i) { e._diffuseTexture1 = i; } }, metadata: r }, ie, te), t(null, null, P, { kind: "field", name: "_diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture2" in e; }, get: function (e) { return e._diffuseTexture2; }, set: function (e, i) { e._diffuseTexture2 = i; } }, metadata: r }, ae, se), t(null, null, D, { kind: "field", name: "_diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture3" in e; }, get: function (e) { return e._diffuseTexture3; }, set: function (e, i) { e._diffuseTexture3 = i; } }, metadata: r }, le, ue), t(null, null, A, { kind: "field", name: "_diffuseTexture4", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture4" in e; }, get: function (e) { return e._diffuseTexture4; }, set: function (e, i) { e._diffuseTexture4 = i; } }, metadata: r }, he, me), t(null, null, O, { kind: "field", name: "_diffuseTexture5", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture5" in e; }, get: function (e) { return e._diffuseTexture5; }, set: function (e, i) { e._diffuseTexture5 = i; } }, metadata: r }, pe, Se), t(null, null, M, { kind: "field", name: "_diffuseTexture6", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture6" in e; }, get: function (e) { return e._diffuseTexture6; }, set: function (e, i) { e._diffuseTexture6 = i; } }, metadata: r }, _e, Ce), t(null, null, y, { kind: "field", name: "_diffuseTexture7", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture7" in e; }, get: function (e) { return e._diffuseTexture7; }, set: function (e, i) { e._diffuseTexture7 = i; } }, metadata: r }, Pe, Ie), t(null, null, U, { kind: "field", name: "_diffuseTexture8", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture8" in e; }, get: function (e) { return e._diffuseTexture8; }, set: function (e, i) { e._diffuseTexture8 = i; } }, metadata: r }, Ae, Fe), t(null, null, G, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, Me, Ne), t(null, null, W, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, ye, Ve), t(null, null, B, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, Ue, we), t(null, null, z, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, Ge, We), t(null, null, k, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, He, ke), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Ni; }), Promise.resolve().then(function () { return wi; })]; }, function () { return [Promise.resolve().then(function () { return zi; }), Promise.resolve().then(function () { return ji; })]; }), e; })();
860
860
  i.RegisterClass("BABYLON.MixMaterial", P);
861
861
  var I = /** @class */ (function (_super) {
862
862
  __extends(I, _super);
@@ -929,13 +929,13 @@ var __values = (this && this.__values) || function(o) {
929
929
  e.prototype.getClassName = function () { return "NormalMaterial"; };
930
930
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
931
931
  return e;
932
- }(g)), s = new WeakMap, o = new WeakMap, f = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = g[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; l = [i.serializeAsTexture("diffuseTexture")], u = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], d = [i.serializeAsColor3()], c = [i.serialize("disableLighting")], h = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], m = [i.serialize("maxSimultaneousLights")], v = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, u, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, x, T), t(e, null, h, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, P, D), t(e, null, v, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, F, O), t(null, null, l, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, p, S), t(null, null, d, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, _, C), t(null, null, c, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, E, L), t(null, null, m, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, b, A), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Ki; }), Promise.resolve().then(function () { return $i; })]; }, function () { return [Promise.resolve().then(function () { return nt; }), Promise.resolve().then(function () { return ot; })]; }), e; })();
932
+ }(g)), s = new WeakMap, o = new WeakMap, f = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = g[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; l = [i.serializeAsTexture("diffuseTexture")], u = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], d = [i.serializeAsColor3()], c = [i.serialize("disableLighting")], h = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], m = [i.serialize("maxSimultaneousLights")], v = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, u, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, x, T), t(e, null, h, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, P, D), t(e, null, v, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, F, O), t(null, null, l, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, p, S), t(null, null, d, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, _, C), t(null, null, c, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, E, L), t(null, null, m, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, b, A), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return qi; }), Promise.resolve().then(function () { return et; })]; }, function () { return [Promise.resolve().then(function () { return rt; }), Promise.resolve().then(function () { return ft; })]; }), e; })();
933
933
  i.RegisterClass("BABYLON.NormalMaterial", D);
934
934
  var b = /** @class */ (function (_super) {
935
935
  __extends(b, _super);
936
- function b() {
936
+ function b(e) {
937
937
  var _this = this;
938
- _this = _super.call(this) || this, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.NORMAL = !1, _this.NUM_BONE_INFLUENCERS = 0, _this.BonesPerMesh = 0, _this.INSTANCES = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.LOGARITHMICDEPTH = !1, _this.rebuild();
938
+ _this = _super.call(this, e) || this, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.NORMAL = !1, _this.NUM_BONE_INFLUENCERS = 0, _this.BonesPerMesh = 0, _this.INSTANCES = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.LOGARITHMICDEPTH = !1, _this.rebuild();
939
939
  return _this;
940
940
  }
941
941
  return b;
@@ -948,6 +948,7 @@ var __values = (this && this.__values) || function(o) {
948
948
  _this = _super.call(this, e, t, void 0, n) || this, _this._needAlphaBlending = !0, _this.shadowColor = i.Color3.Black();
949
949
  return _this;
950
950
  }
951
+ A.prototype._createUniformBuffer = function () { _super.prototype._createUniformBuffer.call(this), this._uniformBuffer.useUbo && (this._uniformBuffer.dispose(), this._uniformBuffer = new i.UniformBuffer(this.getScene().getEngine(), void 0, void 0, this.name, !0), this._uniformBufferLayoutBuilt = !1); };
951
952
  A.prototype.needAlphaBlending = function () { return this._needAlphaBlending; };
952
953
  A.prototype.needAlphaTesting = function () { return !1; };
953
954
  A.prototype.getAlphaTestTexture = function () { return null; };
@@ -978,10 +979,11 @@ var __values = (this && this.__values) || function(o) {
978
979
  A.prototype.isReadyForSubMesh = function (e, t, n) {
979
980
  var e_75, _a;
980
981
  var r;
982
+ this._uniformBufferLayoutBuilt || this.buildUniformLayout();
981
983
  var a = t._drawWrapper;
982
984
  if (this.isFrozen && a.effect && a._wasPreviouslyReady && a._wasPreviouslyUsingInstances === n)
983
985
  return !0;
984
- t.materialDefines || (t.materialDefines = new b);
986
+ t.materialDefines || (this._callbackPluginEventGeneric(4, this._eventInfo), t.materialDefines = new b(this._eventInfo.defineNames));
985
987
  var s = t.materialDefines, o = this.getScene();
986
988
  if (this._isReadyForSubMesh(t))
987
989
  return !0;
@@ -1012,25 +1014,27 @@ var __values = (this && this.__values) || function(o) {
1012
1014
  var e_76 = l;
1013
1015
  this._needAlphaBlending = !e_76.autoCalcDepthBounds;
1014
1016
  }
1015
- if (i.PrepareDefinesForAttributes(e, s, !1, !0), s.isDirty) {
1017
+ if (this._eventInfo.defines = s, this._eventInfo.mesh = e, this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo), i.PrepareDefinesForAttributes(e, s, !1, !0), this._callbackPluginEventPrepareDefines(this._eventInfo), this._eventInfo.isReadyForSubMesh = !0, this._eventInfo.defines = s, this._eventInfo.subMesh = t, this._callbackPluginEventIsReadyForSubMesh(this._eventInfo), !this._eventInfo.isReadyForSubMesh)
1018
+ return !1;
1019
+ if (s.isDirty) {
1016
1020
  s.markAsProcessed(), o.resetCachedMaterial();
1017
1021
  var n_5 = new i.EffectFallbacks;
1018
1022
  s.FOG && n_5.addFallback(1, "FOG"), i.HandleFallbacksForShadows(s, n_5, 1), s.NUM_BONE_INFLUENCERS > 0 && n_5.addCPUSkinningFallback(0, e), s.IMAGEPROCESSINGPOSTPROCESS = o.imageProcessingConfiguration.applyByPostProcess;
1019
1023
  var r_10 = [i.VertexBuffer.PositionKind];
1020
1024
  s.NORMAL && r_10.push(i.VertexBuffer.NormalKind), i.PrepareAttributesForBones(r_10, e, s, n_5), i.PrepareAttributesForInstances(r_10, s);
1021
- var a_9 = "shadowOnly", l_7 = s.toString(), u_8 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vFogInfos", "vFogColor", "pointSize", "alpha", "shadowColor", "mBones", "logarithmicDepthConstant"], d_8 = [], c_7 = ["Scene"];
1022
- i.AddClipPlaneUniforms(u_8), i.PrepareUniformsAndSamplersList({ uniformsNames: u_8, uniformBuffersNames: c_7, samplers: d_8, defines: s, maxSimultaneousLights: 1, shaderLanguage: this._shaderLanguage }), t.setEffect(o.getEngine().createEffect(a_9, { attributes: r_10, uniformsNames: u_8, uniformBuffersNames: c_7, samplers: d_8, defines: l_7, fallbacks: n_5, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: 1 }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: A._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1025
+ var a_9 = "shadowOnly", l_7 = s.toString(), u_8 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vFogInfos", "vFogColor", "pointSize", "alpha", "shadowColor", "mBones", "logarithmicDepthConstant"], d_8 = [], c_7 = ["Scene", "Material"], h_7 = { maxSimultaneousLights: 1 };
1026
+ i.AddClipPlaneUniforms(u_8), i.PrepareUniformsAndSamplersList({ uniformsNames: u_8, uniformBuffersNames: c_7, samplers: d_8, defines: s, maxSimultaneousLights: 1, shaderLanguage: this._shaderLanguage }), this._eventInfo.fallbacks = n_5, this._eventInfo.fallbackRank = 0, this._eventInfo.defines = s, this._eventInfo.uniforms = u_8, this._eventInfo.attributes = r_10, this._eventInfo.samplers = d_8, this._eventInfo.uniformBuffersNames = c_7, this._eventInfo.customCode = void 0, this._eventInfo.mesh = e, this._eventInfo.indexParameters = h_7, this._callbackPluginEventGeneric(128, this._eventInfo), t.setEffect(o.getEngine().createEffect(a_9, { attributes: r_10, uniformsNames: u_8, uniformBuffersNames: c_7, samplers: d_8, defines: l_7, fallbacks: n_5, onCompiled: this.onCompiled, onError: this.onError, indexParameters: h_7, processCodeAfterIncludes: this._eventInfo.customCode, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: A._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1023
1027
  }
1024
1028
  return !(!t.effect || !t.effect.isReady() || (s._renderId = o.getRenderId(), a._wasPreviouslyReady = !0, a._wasPreviouslyUsingInstances = !!n, 0));
1025
1029
  };
1026
1030
  A.prototype.bindForSubMesh = function (e, t, n) { var r = this.getScene(), a = n.materialDefines; if (!a)
1027
1031
  return; var s = n.effect; if (s) {
1028
- if (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this.bindViewProjection(s), i.BindBonesParameters(t, this._activeEffect), this._mustRebind(r, s, n) && (i.BindClipPlane(s, this, r), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._activeEffect.setFloat("alpha", this.alpha), this._activeEffect.setColor3("shadowColor", this.shadowColor), this._useLogarithmicDepth && i.BindLogDepth(a, s, r), r.bindEyePosition(s)), r.lightsEnabled) {
1032
+ if (this._activeEffect = s, this._uniformBuffer.bindToEffect(s, "Material"), this.bindOnlyWorldMatrix(e), this.bindViewProjection(s), this._eventInfo.subMesh = n, this._callbackPluginEventHardBindForSubMesh(this._eventInfo), i.BindBonesParameters(t, this._activeEffect), this._mustRebind(r, s, n) && (i.BindClipPlane(s, this, r), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._activeEffect.setFloat("alpha", this.alpha), this._activeEffect.setColor3("shadowColor", this.shadowColor), this._useLogarithmicDepth && i.BindLogDepth(a, s, r), r.bindEyePosition(s), this._eventInfo.subMesh = n, this._callbackPluginEventBindForSubMesh(this._eventInfo)), r.lightsEnabled) {
1029
1033
  i.BindLights(r, t, this._activeEffect, a, 1);
1030
1034
  var e_77 = this._getFirstShadowLightForMesh(t);
1031
1035
  e_77 && (e_77._renderId = -1);
1032
1036
  }
1033
- (r.fogEnabled && t.applyFog && r.fogMode !== i.Scene.FOGMODE_NONE || a.SHADOWCSM0) && this.bindView(s), i.BindFogParameters(r, t, this._activeEffect), this._afterBind(t, this._activeEffect, n);
1037
+ (r.fogEnabled && t.applyFog && r.fogMode !== i.Scene.FOGMODE_NONE || a.SHADOWCSM0) && this.bindView(s), i.BindFogParameters(r, t, this._activeEffect), this._afterBind(t, this._activeEffect, n), this._uniformBuffer.update();
1034
1038
  } };
1035
1039
  A.prototype.clone = function (e) {
1036
1040
  var _this = this;
@@ -1041,7 +1045,7 @@ var __values = (this && this.__values) || function(o) {
1041
1045
  A.Parse = function (e, t, n) { return i.SerializationHelper.Parse(function () { return new A(e.name, t); }, e, t, n); };
1042
1046
  return A;
1043
1047
  }(i.PushMaterial));
1044
- A._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return dt; }), Promise.resolve().then(function () { return vt; })]; }, function () { return [Promise.resolve().then(function () { return xt; }), Promise.resolve().then(function () { return Et; })]; }), i.RegisterClass("BABYLON.ShadowOnlyMaterial", A);
1048
+ A._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return ct; }), Promise.resolve().then(function () { return gt; })]; }, function () { return [Promise.resolve().then(function () { return Tt; }), Promise.resolve().then(function () { return Lt; })]; }), i.RegisterClass("BABYLON.ShadowOnlyMaterial", A);
1045
1049
  var F = /** @class */ (function (_super) {
1046
1050
  __extends(F, _super);
1047
1051
  function F() {
@@ -1092,8 +1096,8 @@ var __values = (this && this.__values) || function(o) {
1092
1096
  s.FOG && r_11.addFallback(1, "FOG"), i.HandleFallbacksForShadows(s, r_11, this.maxSimultaneousLights), s.NUM_BONE_INFLUENCERS > 0 && r_11.addCPUSkinningFallback(0, t), s.IMAGEPROCESSINGPOSTPROCESS = o.imageProcessingConfiguration.applyByPostProcess;
1093
1097
  var a_10 = [i.VertexBuffer.PositionKind];
1094
1098
  s.NORMAL && a_10.push(i.VertexBuffer.NormalKind), s.UV1 && a_10.push(i.VertexBuffer.UVKind), s.UV2 && a_10.push(i.VertexBuffer.UV2Kind), s.VERTEXCOLOR && a_10.push(i.VertexBuffer.ColorKind), i.PrepareAttributesForBones(a_10, t, s, r_11), i.PrepareAttributesForInstances(a_10, s);
1095
- var l_8 = "simple", u_9 = s.toString(), d_9 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vFogInfos", "vFogColor", "pointSize", "vDiffuseInfos", "mBones", "diffuseMatrix", "logarithmicDepthConstant"], c_8 = ["diffuseSampler", "areaLightsLTC1Sampler", "areaLightsLTC2Sampler"], h_7 = [];
1096
- i.AddClipPlaneUniforms(d_9), i.PrepareUniformsAndSamplersList({ uniformsNames: d_9, uniformBuffersNames: h_7, samplers: c_8, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_8, { attributes: a_10, uniformsNames: d_9, uniformBuffersNames: h_7, samplers: c_8, defines: u_9, fallbacks: r_11, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights - 1 }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1099
+ var l_8 = "simple", u_9 = s.toString(), d_9 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vFogInfos", "vFogColor", "pointSize", "vDiffuseInfos", "mBones", "diffuseMatrix", "logarithmicDepthConstant"], c_8 = ["diffuseSampler", "areaLightsLTC1Sampler", "areaLightsLTC2Sampler"], h_8 = [];
1100
+ i.AddClipPlaneUniforms(d_9), i.PrepareUniformsAndSamplersList({ uniformsNames: d_9, uniformBuffersNames: h_8, samplers: c_8, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_8, { attributes: a_10, uniformsNames: d_9, uniformBuffersNames: h_8, samplers: c_8, defines: u_9, fallbacks: r_11, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights - 1 }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1097
1101
  } if (s.AREALIGHTUSED)
1098
1102
  for (var e_78 = 0; e_78 < t.lightSources.length; e_78++)
1099
1103
  if (!t.lightSources[e_78]._isReady())
@@ -1112,49 +1116,57 @@ var __values = (this && this.__values) || function(o) {
1112
1116
  e.prototype.getClassName = function () { return "SimpleMaterial"; };
1113
1117
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
1114
1118
  return e;
1115
- }(g)), s = new WeakMap, o = new WeakMap, f = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = g[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; l = [i.serializeAsTexture("diffuseTexture")], u = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], d = [i.serializeAsColor3("diffuse")], c = [i.serialize("disableLighting")], h = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], m = [i.serialize("maxSimultaneousLights")], v = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, u, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, x, T), t(e, null, h, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, P, I), t(e, null, v, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, A, O), t(null, null, l, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, p, S), t(null, null, d, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, _, C), t(null, null, c, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, E, L), t(null, null, m, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, D, b), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Dt; }), Promise.resolve().then(function () { return Ot; })]; }, function () { return [Promise.resolve().then(function () { return yt; }), Promise.resolve().then(function () { return Gt; })]; }), e; })();
1119
+ }(g)), s = new WeakMap, o = new WeakMap, f = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = g[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; l = [i.serializeAsTexture("diffuseTexture")], u = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], d = [i.serializeAsColor3("diffuse")], c = [i.serialize("disableLighting")], h = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], m = [i.serialize("maxSimultaneousLights")], v = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, u, { kind: "accessor", name: "diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture" in e; }, get: function (e) { return e.diffuseTexture; }, set: function (e, i) { e.diffuseTexture = i; } }, metadata: r }, x, T), t(e, null, h, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, P, I), t(e, null, v, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, A, O), t(null, null, l, { kind: "field", name: "_diffuseTexture", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture" in e; }, get: function (e) { return e._diffuseTexture; }, set: function (e, i) { e._diffuseTexture = i; } }, metadata: r }, p, S), t(null, null, d, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, _, C), t(null, null, c, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, E, L), t(null, null, m, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, D, b), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return bt; }), Promise.resolve().then(function () { return Rt; })]; }, function () { return [Promise.resolve().then(function () { return Vt; }), Promise.resolve().then(function () { return Wt; })]; }), e; })();
1116
1120
  i.RegisterClass("BABYLON.SimpleMaterial", O);
1117
- var N = /** @class */ (function (_super) {
1118
- __extends(N, _super);
1119
- function N() {
1121
+ var R = /** @class */ (function (_super) {
1122
+ __extends(R, _super);
1123
+ function R() {
1120
1124
  var _this = this;
1121
- _this = _super.call(this) || this, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.VERTEXCOLOR = !1, _this.VERTEXALPHA = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.DITHER = !1, _this.LOGARITHMICDEPTH = !1, _this.rebuild();
1125
+ _this = _super.call(this) || this, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.VERTEXCOLOR = !1, _this.VERTEXALPHA = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.DITHER = !1, _this.LOGARITHMICDEPTH = !1, _this.SKY_RAW_HDR_OUTPUT = !1, _this.rebuild();
1122
1126
  return _this;
1123
1127
  }
1124
- return N;
1128
+ return R;
1125
1129
  }(i.MaterialDefines));
1126
- var M = (function () { var e; var r, a, s, o, f, l, u, d, c, h, m, v, g, p = i.PushMaterial, S = [], x = [], T = [], _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], M = [], R = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = []; return e = /** @class */ (function (_super) {
1130
+ function M(e) { switch (e) {
1131
+ case i.Constants.TEXTURETYPE_HALF_FLOAT: return 65504;
1132
+ case i.Constants.TEXTURETYPE_FLOAT: return 3e38;
1133
+ default: return 1;
1134
+ } }
1135
+ var N = (function () { var e; var r, a, s, o, f, l, u, d, c, h, m, v, g, p, S, x = i.PushMaterial, T = [], _ = [], C = [], E = [], L = [], P = [], I = [], D = [], b = [], A = [], F = [], O = [], N = [], y = [], V = [], U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = []; return e = /** @class */ (function (_super) {
1127
1136
  __extends(e, _super);
1128
1137
  function e(e, t, r) {
1129
1138
  if (r === void 0) { r = !1; }
1130
1139
  var _this = this;
1131
- _this = _super.call(this, e, t, void 0, r) || this, _this.luminance = n(_this, S, 1), _this.turbidity = (n(_this, x), n(_this, T, 10)), _this.rayleigh = (n(_this, _), n(_this, C, 2)), _this.mieCoefficient = (n(_this, E), n(_this, L, .005)), _this.mieDirectionalG = (n(_this, P), n(_this, I, .8)), _this.distance = (n(_this, D), n(_this, b, 500)), _this.inclination = (n(_this, A), n(_this, F, .49)), _this.azimuth = (n(_this, O), n(_this, M, .25)), _this.sunPosition = (n(_this, R), n(_this, y, new i.Vector3(0, 100, 0))), _this.useSunPosition = (n(_this, V), n(_this, U, !1)), _this.cameraOffset = (n(_this, w), n(_this, G, i.Vector3.Zero())), _this.up = (n(_this, W), n(_this, B, i.Vector3.Up())), _this.dithering = (n(_this, z), n(_this, H, !1)), _this._cameraPosition = (n(_this, k), i.Vector3.Zero()), _this._skyOrientation = new i.Quaternion;
1140
+ _this = _super.call(this, e, t, void 0, r) || this, _this.luminance = n(_this, T, 1), _this.turbidity = (n(_this, _), n(_this, C, 10)), _this.rayleigh = (n(_this, E), n(_this, L, 2)), _this.mieCoefficient = (n(_this, P), n(_this, I, .005)), _this.mieDirectionalG = (n(_this, D), n(_this, b, .8)), _this.distance = (n(_this, A), n(_this, F, 500)), _this.inclination = (n(_this, O), n(_this, N, .49)), _this.azimuth = (n(_this, y), n(_this, V, .25)), _this.sunPosition = (n(_this, U), n(_this, w, new i.Vector3(0, 100, 0))), _this.useSunPosition = (n(_this, G), n(_this, W, !1)), _this.cameraOffset = (n(_this, B), n(_this, z, i.Vector3.Zero())), _this.up = (n(_this, H), n(_this, k, i.Vector3.Up())), _this.dithering = (n(_this, X), n(_this, j, !1)), _this.rawHdrOutput = (n(_this, Y), n(_this, Z, !1)), _this.cloudiness = (n(_this, K), n(_this, q, 0)), _this._cameraPosition = (n(_this, Q), i.Vector3.Zero()), _this._skyOrientation = new i.Quaternion;
1132
1141
  return _this;
1133
1142
  }
1134
1143
  e.prototype.needAlphaBlending = function () { return this.alpha < 1; };
1135
1144
  e.prototype.needAlphaTesting = function () { return !1; };
1136
1145
  e.prototype.getAlphaTestTexture = function () { return null; };
1137
1146
  e.prototype.isReadyForSubMesh = function (t, n) { var r = n._drawWrapper; if (this.isFrozen && r.effect && r._wasPreviouslyReady)
1138
- return !0; n.materialDefines || (n.materialDefines = new N); var a = n.materialDefines, s = this.getScene(); if (this._isReadyForSubMesh(n))
1139
- return !0; if (i.PrepareDefinesForMisc(t, s, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, !1, a, void 0, void 0, void 0, this._isVertexOutputInvariant), i.PrepareDefinesForAttributes(t, a, !0, !1), a.IMAGEPROCESSINGPOSTPROCESS !== s.imageProcessingConfiguration.applyByPostProcess && a.markAsMiscDirty(), a.DITHER !== this.dithering && a.markAsMiscDirty(), a.isDirty) {
1147
+ return !0; n.materialDefines || (n.materialDefines = new R); var a = n.materialDefines, s = this.getScene(); if (this._isReadyForSubMesh(n))
1148
+ return !0; if (i.PrepareDefinesForMisc(t, s, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, !1, a, void 0, void 0, void 0, this._isVertexOutputInvariant), i.PrepareDefinesForAttributes(t, a, !0, !1), a.IMAGEPROCESSINGPOSTPROCESS !== s.imageProcessingConfiguration.applyByPostProcess && a.markAsMiscDirty(), a.DITHER !== this.dithering && a.markAsMiscDirty(), a.SKY_RAW_HDR_OUTPUT !== this.rawHdrOutput && a.markAsMiscDirty(), a.isDirty) {
1140
1149
  a.markAsProcessed(), s.resetCachedMaterial();
1141
1150
  var t_5 = new i.EffectFallbacks;
1142
- a.FOG && t_5.addFallback(1, "FOG"), a.IMAGEPROCESSINGPOSTPROCESS = s.imageProcessingConfiguration.applyByPostProcess, a.DITHER = this.dithering;
1151
+ a.FOG && t_5.addFallback(1, "FOG"), a.IMAGEPROCESSINGPOSTPROCESS = s.imageProcessingConfiguration.applyByPostProcess, a.DITHER = this.dithering, a.SKY_RAW_HDR_OUTPUT = this.rawHdrOutput;
1143
1152
  var r_12 = [i.VertexBuffer.PositionKind];
1144
1153
  a.VERTEXCOLOR && r_12.push(i.VertexBuffer.ColorKind);
1145
- var o_2 = "sky", f_3 = ["world", "viewProjection", "view", "vFogInfos", "vFogColor", "logarithmicDepthConstant", "pointSize", "luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition", "cameraPosition", "cameraOffset", "up"];
1154
+ var o_2 = "sky", f_3 = ["world", "viewProjection", "view", "vFogInfos", "vFogColor", "logarithmicDepthConstant", "pointSize", "luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition", "cameraPosition", "cameraOffset", "up", "cloudiness", "maxColorValue"];
1146
1155
  i.AddClipPlaneUniforms(f_3);
1147
1156
  var l_9 = a.toString();
1148
1157
  n.setEffect(s.getEngine().createEffect(o_2, { attributes: r_12, uniformsNames: f_3, uniformBuffersNames: [], samplers: [], defines: l_9, fallbacks: t_5, onCompiled: this.onCompiled, onError: this.onError, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, s.getEngine()), a, this._materialContext);
1149
1158
  } return !(!n.effect || !n.effect.isReady() || (a._renderId = s.getRenderId(), r._wasPreviouslyReady = !0, 0)); };
1150
- e.prototype.bindForSubMesh = function (e, t, n) { var r = this.getScene(), a = n.materialDefines; if (!a)
1151
- return; var s = n.effect; if (!s)
1152
- return; this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", r.getTransformMatrix()), this._mustRebind(r, s, n) && (i.BindClipPlane(s, this, r), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && i.BindLogDepth(a, s, r)), r.fogEnabled && t.applyFog && r.fogMode !== i.Scene.FOGMODE_NONE && this._activeEffect.setMatrix("view", r.getViewMatrix()), i.BindFogParameters(r, t, this._activeEffect); var o = r.activeCamera; if (o) {
1153
- var e_79 = o.getWorldMatrix();
1154
- this._cameraPosition.x = e_79.m[12], this._cameraPosition.y = e_79.m[13], this._cameraPosition.z = e_79.m[14], this._activeEffect.setVector3("cameraPosition", i.TmpVectors.Vector3[0].copyFrom(this._cameraPosition).subtractInPlace(r.floatingOriginOffset));
1155
- } if (this._activeEffect.setVector3("cameraOffset", this.cameraOffset), this._activeEffect.setVector3("up", this.up), this.luminance > 0 && this._activeEffect.setFloat("luminance", this.luminance), this._activeEffect.setFloat("turbidity", this.turbidity), this._activeEffect.setFloat("rayleigh", this.rayleigh), this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient), this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG), !this.useSunPosition) {
1156
- var e_80 = Math.PI * (this.inclination - .5), t_6 = 2 * Math.PI * (this.azimuth - .5);
1157
- this.sunPosition.x = this.distance * Math.cos(t_6) * Math.cos(e_80), this.sunPosition.y = this.distance * Math.sin(-e_80), this.sunPosition.z = this.distance * Math.sin(t_6) * Math.cos(e_80), i.Quaternion.FromUnitVectorsToRef(i.Vector3.UpReadOnly, this.up, this._skyOrientation), this.sunPosition.rotateByQuaternionToRef(this._skyOrientation, this.sunPosition);
1159
+ e.prototype.bindForSubMesh = function (e, t, n) { var r; var a = this.getScene(), s = n.materialDefines; if (!s)
1160
+ return; var o = n.effect; if (!o)
1161
+ return; this._activeEffect = o, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", a.getTransformMatrix()), this._mustRebind(a, o, n) && (i.BindClipPlane(o, this, a), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && i.BindLogDepth(s, o, a)), a.fogEnabled && t.applyFog && a.fogMode !== i.Scene.FOGMODE_NONE && this._activeEffect.setMatrix("view", a.getViewMatrix()), i.BindFogParameters(a, t, this._activeEffect, this.rawHdrOutput); var f = a.activeCamera; if (f) {
1162
+ var e_79 = f.getWorldMatrix();
1163
+ this._cameraPosition.x = e_79.m[12], this._cameraPosition.y = e_79.m[13], this._cameraPosition.z = e_79.m[14], this._activeEffect.setVector3("cameraPosition", i.TmpVectors.Vector3[0].copyFrom(this._cameraPosition).subtractInPlace(a.floatingOriginOffset));
1164
+ } if (this._activeEffect.setVector3("cameraOffset", this.cameraOffset), this._activeEffect.setVector3("up", this.up), (this.rawHdrOutput || this.luminance > 0) && this._activeEffect.setFloat("luminance", this.luminance), this._activeEffect.setFloat("turbidity", this.turbidity), this._activeEffect.setFloat("rayleigh", this.rayleigh), this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient), this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG), this._activeEffect.setFloat("cloudiness", this.cloudiness), this.rawHdrOutput) {
1165
+ var e_80 = a.getEngine()._currentRenderTarget;
1166
+ this._activeEffect.setFloat("maxColorValue", M(null === (r = null == e_80 ? void 0 : e_80.texture) || void 0 === r ? void 0 : r.type));
1167
+ } if (!this.useSunPosition) {
1168
+ var e_81 = Math.PI * (this.inclination - .5), t_6 = 2 * Math.PI * (this.azimuth - .5);
1169
+ this.sunPosition.x = this.distance * Math.cos(t_6) * Math.cos(e_81), this.sunPosition.y = this.distance * Math.sin(-e_81), this.sunPosition.z = this.distance * Math.sin(t_6) * Math.cos(e_81), i.Quaternion.FromUnitVectorsToRef(i.Vector3.UpReadOnly, this.up, this._skyOrientation), this.sunPosition.rotateByQuaternionToRef(this._skyOrientation, this.sunPosition);
1158
1170
  } this._activeEffect.setVector3("sunPosition", this.sunPosition), this._afterBind(t, this._activeEffect, n); };
1159
1171
  e.prototype.getAnimatables = function () { return []; };
1160
1172
  e.prototype.dispose = function (e) { _super.prototype.dispose.call(this, e); };
@@ -1166,23 +1178,23 @@ var __values = (this && this.__values) || function(o) {
1166
1178
  e.prototype.getClassName = function () { return "SkyMaterial"; };
1167
1179
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
1168
1180
  return e;
1169
- }(p)), (function () { var n; var N = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = p[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; r = [i.serialize()], a = [i.serialize()], s = [i.serialize()], o = [i.serialize()], f = [i.serialize()], l = [i.serialize()], u = [i.serialize()], d = [i.serialize()], c = [i.serializeAsVector3()], h = [i.serialize()], m = [i.serializeAsVector3()], v = [i.serializeAsVector3()], g = [i.serialize()], t(null, null, r, { kind: "field", name: "luminance", static: !1, private: !1, access: { has: function (e) { return "luminance" in e; }, get: function (e) { return e.luminance; }, set: function (e, i) { e.luminance = i; } }, metadata: N }, S, x), t(null, null, a, { kind: "field", name: "turbidity", static: !1, private: !1, access: { has: function (e) { return "turbidity" in e; }, get: function (e) { return e.turbidity; }, set: function (e, i) { e.turbidity = i; } }, metadata: N }, T, _), t(null, null, s, { kind: "field", name: "rayleigh", static: !1, private: !1, access: { has: function (e) { return "rayleigh" in e; }, get: function (e) { return e.rayleigh; }, set: function (e, i) { e.rayleigh = i; } }, metadata: N }, C, E), t(null, null, o, { kind: "field", name: "mieCoefficient", static: !1, private: !1, access: { has: function (e) { return "mieCoefficient" in e; }, get: function (e) { return e.mieCoefficient; }, set: function (e, i) { e.mieCoefficient = i; } }, metadata: N }, L, P), t(null, null, f, { kind: "field", name: "mieDirectionalG", static: !1, private: !1, access: { has: function (e) { return "mieDirectionalG" in e; }, get: function (e) { return e.mieDirectionalG; }, set: function (e, i) { e.mieDirectionalG = i; } }, metadata: N }, I, D), t(null, null, l, { kind: "field", name: "distance", static: !1, private: !1, access: { has: function (e) { return "distance" in e; }, get: function (e) { return e.distance; }, set: function (e, i) { e.distance = i; } }, metadata: N }, b, A), t(null, null, u, { kind: "field", name: "inclination", static: !1, private: !1, access: { has: function (e) { return "inclination" in e; }, get: function (e) { return e.inclination; }, set: function (e, i) { e.inclination = i; } }, metadata: N }, F, O), t(null, null, d, { kind: "field", name: "azimuth", static: !1, private: !1, access: { has: function (e) { return "azimuth" in e; }, get: function (e) { return e.azimuth; }, set: function (e, i) { e.azimuth = i; } }, metadata: N }, M, R), t(null, null, c, { kind: "field", name: "sunPosition", static: !1, private: !1, access: { has: function (e) { return "sunPosition" in e; }, get: function (e) { return e.sunPosition; }, set: function (e, i) { e.sunPosition = i; } }, metadata: N }, y, V), t(null, null, h, { kind: "field", name: "useSunPosition", static: !1, private: !1, access: { has: function (e) { return "useSunPosition" in e; }, get: function (e) { return e.useSunPosition; }, set: function (e, i) { e.useSunPosition = i; } }, metadata: N }, U, w), t(null, null, m, { kind: "field", name: "cameraOffset", static: !1, private: !1, access: { has: function (e) { return "cameraOffset" in e; }, get: function (e) { return e.cameraOffset; }, set: function (e, i) { e.cameraOffset = i; } }, metadata: N }, G, W), t(null, null, v, { kind: "field", name: "up", static: !1, private: !1, access: { has: function (e) { return "up" in e; }, get: function (e) { return e.up; }, set: function (e, i) { e.up = i; } }, metadata: N }, B, z), t(null, null, g, { kind: "field", name: "dithering", static: !1, private: !1, access: { has: function (e) { return "dithering" in e; }, get: function (e) { return e.dithering; }, set: function (e, i) { e.dithering = i; } }, metadata: N }, H, k), N && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: N }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Ht; }), Promise.resolve().then(function () { return Zt; })]; }, function () { return [Promise.resolve().then(function () { return Qt; }), Promise.resolve().then(function () { return tn; })]; }), e; })();
1170
- i.RegisterClass("BABYLON.SkyMaterial", M);
1171
- var R = /** @class */ (function (_super) {
1172
- __extends(R, _super);
1173
- function R() {
1181
+ }(x)), (function () { var n; var R = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = x[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; r = [i.serialize()], a = [i.serialize()], s = [i.serialize()], o = [i.serialize()], f = [i.serialize()], l = [i.serialize()], u = [i.serialize()], d = [i.serialize()], c = [i.serializeAsVector3()], h = [i.serialize()], m = [i.serializeAsVector3()], v = [i.serializeAsVector3()], g = [i.serialize()], p = [i.serialize()], S = [i.serialize()], t(null, null, r, { kind: "field", name: "luminance", static: !1, private: !1, access: { has: function (e) { return "luminance" in e; }, get: function (e) { return e.luminance; }, set: function (e, i) { e.luminance = i; } }, metadata: R }, T, _), t(null, null, a, { kind: "field", name: "turbidity", static: !1, private: !1, access: { has: function (e) { return "turbidity" in e; }, get: function (e) { return e.turbidity; }, set: function (e, i) { e.turbidity = i; } }, metadata: R }, C, E), t(null, null, s, { kind: "field", name: "rayleigh", static: !1, private: !1, access: { has: function (e) { return "rayleigh" in e; }, get: function (e) { return e.rayleigh; }, set: function (e, i) { e.rayleigh = i; } }, metadata: R }, L, P), t(null, null, o, { kind: "field", name: "mieCoefficient", static: !1, private: !1, access: { has: function (e) { return "mieCoefficient" in e; }, get: function (e) { return e.mieCoefficient; }, set: function (e, i) { e.mieCoefficient = i; } }, metadata: R }, I, D), t(null, null, f, { kind: "field", name: "mieDirectionalG", static: !1, private: !1, access: { has: function (e) { return "mieDirectionalG" in e; }, get: function (e) { return e.mieDirectionalG; }, set: function (e, i) { e.mieDirectionalG = i; } }, metadata: R }, b, A), t(null, null, l, { kind: "field", name: "distance", static: !1, private: !1, access: { has: function (e) { return "distance" in e; }, get: function (e) { return e.distance; }, set: function (e, i) { e.distance = i; } }, metadata: R }, F, O), t(null, null, u, { kind: "field", name: "inclination", static: !1, private: !1, access: { has: function (e) { return "inclination" in e; }, get: function (e) { return e.inclination; }, set: function (e, i) { e.inclination = i; } }, metadata: R }, N, y), t(null, null, d, { kind: "field", name: "azimuth", static: !1, private: !1, access: { has: function (e) { return "azimuth" in e; }, get: function (e) { return e.azimuth; }, set: function (e, i) { e.azimuth = i; } }, metadata: R }, V, U), t(null, null, c, { kind: "field", name: "sunPosition", static: !1, private: !1, access: { has: function (e) { return "sunPosition" in e; }, get: function (e) { return e.sunPosition; }, set: function (e, i) { e.sunPosition = i; } }, metadata: R }, w, G), t(null, null, h, { kind: "field", name: "useSunPosition", static: !1, private: !1, access: { has: function (e) { return "useSunPosition" in e; }, get: function (e) { return e.useSunPosition; }, set: function (e, i) { e.useSunPosition = i; } }, metadata: R }, W, B), t(null, null, m, { kind: "field", name: "cameraOffset", static: !1, private: !1, access: { has: function (e) { return "cameraOffset" in e; }, get: function (e) { return e.cameraOffset; }, set: function (e, i) { e.cameraOffset = i; } }, metadata: R }, z, H), t(null, null, v, { kind: "field", name: "up", static: !1, private: !1, access: { has: function (e) { return "up" in e; }, get: function (e) { return e.up; }, set: function (e, i) { e.up = i; } }, metadata: R }, k, X), t(null, null, g, { kind: "field", name: "dithering", static: !1, private: !1, access: { has: function (e) { return "dithering" in e; }, get: function (e) { return e.dithering; }, set: function (e, i) { e.dithering = i; } }, metadata: R }, j, Y), t(null, null, p, { kind: "field", name: "rawHdrOutput", static: !1, private: !1, access: { has: function (e) { return "rawHdrOutput" in e; }, get: function (e) { return e.rawHdrOutput; }, set: function (e, i) { e.rawHdrOutput = i; } }, metadata: R }, Z, K), t(null, null, S, { kind: "field", name: "cloudiness", static: !1, private: !1, access: { has: function (e) { return "cloudiness" in e; }, get: function (e) { return e.cloudiness; }, set: function (e, i) { e.cloudiness = i; } }, metadata: R }, q, Q), R && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: R }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return kt; }), Promise.resolve().then(function () { return Zt; })]; }, function () { return [Promise.resolve().then(function () { return Jt; }), Promise.resolve().then(function () { return nn; })]; }), e; })();
1182
+ i.RegisterClass("BABYLON.SkyMaterial", N);
1183
+ var y = /** @class */ (function (_super) {
1184
+ __extends(y, _super);
1185
+ function y() {
1174
1186
  var _this = this;
1175
1187
  _this = _super.call(this) || this, _this.DIFFUSE = !1, _this.BUMP = !1, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.ALPHATEST = !1, _this.DEPTHPREPASS = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.SPECULARTERM = !1, _this.NORMAL = !1, _this.UV1 = !1, _this.UV2 = !1, _this.VERTEXCOLOR = !1, _this.VERTEXALPHA = !1, _this.NUM_BONE_INFLUENCERS = 0, _this.BonesPerMesh = 0, _this.INSTANCES = !1, _this.INSTANCESCOLOR = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.LOGARITHMICDEPTH = !1, _this.AREALIGHTSUPPORTED = !0, _this.AREALIGHTNOROUGHTNESS = !0, _this.rebuild();
1176
1188
  return _this;
1177
1189
  }
1178
- return R;
1190
+ return y;
1179
1191
  }(i.MaterialDefines));
1180
- var y = (function () { var e, s, o, f, l, u, d, c, h, m; var v, g, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O, N, M, y, V, U = i.PushMaterial, w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = [], Pe = []; return e = /** @class */ (function (_super) {
1192
+ var V = (function () { var e, s, o, f, l, u, d, c, h, m; var v, g, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O, R, M, N, V, U = i.PushMaterial, w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = [], Pe = []; return e = /** @class */ (function (_super) {
1181
1193
  __extends(e, _super);
1182
1194
  function e(e, t, r) {
1183
1195
  if (r === void 0) { r = !1; }
1184
1196
  var _this = this;
1185
- _this = _super.call(this, e, t, void 0, r) || this, _this._mixTexture = n(_this, w, void 0), s.set(_this, (n(_this, G), n(_this, W, void 0))), _this._diffuseTexture1 = (n(_this, B), n(_this, z, void 0)), o.set(_this, (n(_this, H), n(_this, k, void 0))), _this._diffuseTexture2 = (n(_this, X), n(_this, j, void 0)), f.set(_this, (n(_this, Z), n(_this, Y, void 0))), _this._diffuseTexture3 = (n(_this, K), n(_this, q, void 0)), l.set(_this, (n(_this, Q), n(_this, J, void 0))), _this._bumpTexture1 = (n(_this, $), n(_this, ee, void 0)), u.set(_this, (n(_this, ie), n(_this, te, void 0))), _this._bumpTexture2 = (n(_this, ne), n(_this, re, void 0)), d.set(_this, (n(_this, ae), n(_this, se, void 0))), _this._bumpTexture3 = (n(_this, oe), n(_this, fe, void 0)), c.set(_this, (n(_this, le), n(_this, ue, void 0))), _this.diffuseColor = (n(_this, de), n(_this, ce, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, he), n(_this, me, new i.Color3(0, 0, 0))), _this.specularPower = (n(_this, ve), n(_this, ge, 64)), _this._disableLighting = (n(_this, pe), n(_this, Se, !1)), h.set(_this, (n(_this, xe), n(_this, Te, void 0))), _this._maxSimultaneousLights = (n(_this, _e), n(_this, Ce, 4)), m.set(_this, (n(_this, Ee), n(_this, Le, void 0))), n(_this, Pe);
1197
+ _this = _super.call(this, e, t, void 0, r) || this, _this._mixTexture = n(_this, w, void 0), s.set(_this, (n(_this, G), n(_this, W, void 0))), _this._diffuseTexture1 = (n(_this, B), n(_this, z, void 0)), o.set(_this, (n(_this, H), n(_this, k, void 0))), _this._diffuseTexture2 = (n(_this, X), n(_this, j, void 0)), f.set(_this, (n(_this, Y), n(_this, Z, void 0))), _this._diffuseTexture3 = (n(_this, K), n(_this, q, void 0)), l.set(_this, (n(_this, Q), n(_this, J, void 0))), _this._bumpTexture1 = (n(_this, $), n(_this, ee, void 0)), u.set(_this, (n(_this, ie), n(_this, te, void 0))), _this._bumpTexture2 = (n(_this, ne), n(_this, re, void 0)), d.set(_this, (n(_this, ae), n(_this, se, void 0))), _this._bumpTexture3 = (n(_this, oe), n(_this, fe, void 0)), c.set(_this, (n(_this, le), n(_this, ue, void 0))), _this.diffuseColor = (n(_this, de), n(_this, ce, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, he), n(_this, me, new i.Color3(0, 0, 0))), _this.specularPower = (n(_this, ve), n(_this, ge, 64)), _this._disableLighting = (n(_this, pe), n(_this, Se, !1)), h.set(_this, (n(_this, xe), n(_this, Te, void 0))), _this._maxSimultaneousLights = (n(_this, _e), n(_this, Ce, 4)), m.set(_this, (n(_this, Ee), n(_this, Le, void 0))), n(_this, Pe);
1186
1198
  return _this;
1187
1199
  }
1188
1200
  Object.defineProperty(e.prototype, "mixTexture", {
@@ -1243,7 +1255,7 @@ var __values = (this && this.__values) || function(o) {
1243
1255
  e.prototype.needAlphaTesting = function () { return !1; };
1244
1256
  e.prototype.getAlphaTestTexture = function () { return null; };
1245
1257
  e.prototype.isReadyForSubMesh = function (t, n, r) { var a = n._drawWrapper; if (this.isFrozen && a.effect && a._wasPreviouslyReady && a._wasPreviouslyUsingInstances === r)
1246
- return !0; n.materialDefines || (n.materialDefines = new R); var s = n.materialDefines, o = this.getScene(); if (this._isReadyForSubMesh(n))
1258
+ return !0; n.materialDefines || (n.materialDefines = new y); var s = n.materialDefines, o = this.getScene(); if (this._isReadyForSubMesh(n))
1247
1259
  return !0; var f = o.getEngine(); if (o.texturesEnabled) {
1248
1260
  if (!this.mixTexture || !this.mixTexture.isReady())
1249
1261
  return !1;
@@ -1271,11 +1283,11 @@ var __values = (this && this.__values) || function(o) {
1271
1283
  s.FOG && r_13.addFallback(1, "FOG"), i.HandleFallbacksForShadows(s, r_13, this.maxSimultaneousLights), s.NUM_BONE_INFLUENCERS > 0 && r_13.addCPUSkinningFallback(0, t), s.IMAGEPROCESSINGPOSTPROCESS = o.imageProcessingConfiguration.applyByPostProcess;
1272
1284
  var a_11 = [i.VertexBuffer.PositionKind];
1273
1285
  s.NORMAL && a_11.push(i.VertexBuffer.NormalKind), s.UV1 && a_11.push(i.VertexBuffer.UVKind), s.UV2 && a_11.push(i.VertexBuffer.UV2Kind), s.VERTEXCOLOR && a_11.push(i.VertexBuffer.ColorKind), i.PrepareAttributesForBones(a_11, t, s, r_13), i.PrepareAttributesForInstances(a_11, s);
1274
- var l_10 = "terrain", u_10 = s.toString(), d_10 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", "vFogInfos", "vFogColor", "pointSize", "vTextureInfos", "mBones", "textureMatrix", "diffuse1Infos", "diffuse2Infos", "diffuse3Infos"], c_9 = ["textureSampler", "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler", "bump1Sampler", "bump2Sampler", "bump3Sampler", "logarithmicDepthConstant", "areaLightsLTC1Sampler", "areaLightsLTC2Sampler"], h_8 = [];
1275
- i.AddClipPlaneUniforms(d_10), i.PrepareUniformsAndSamplersList({ uniformsNames: d_10, uniformBuffersNames: h_8, samplers: c_9, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_10, { attributes: a_11, uniformsNames: d_10, uniformBuffersNames: h_8, samplers: c_9, defines: u_10, fallbacks: r_13, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1286
+ var l_10 = "terrain", u_10 = s.toString(), d_10 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", "vFogInfos", "vFogColor", "pointSize", "vTextureInfos", "mBones", "textureMatrix", "diffuse1Infos", "diffuse2Infos", "diffuse3Infos"], c_9 = ["textureSampler", "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler", "bump1Sampler", "bump2Sampler", "bump3Sampler", "logarithmicDepthConstant", "areaLightsLTC1Sampler", "areaLightsLTC2Sampler"], h_9 = [];
1287
+ i.AddClipPlaneUniforms(d_10), i.PrepareUniformsAndSamplersList({ uniformsNames: d_10, uniformBuffersNames: h_9, samplers: c_9, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_10, { attributes: a_11, uniformsNames: d_10, uniformBuffersNames: h_9, samplers: c_9, defines: u_10, fallbacks: r_13, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1276
1288
  } if (s.AREALIGHTUSED)
1277
- for (var e_81 = 0; e_81 < t.lightSources.length; e_81++)
1278
- if (!t.lightSources[e_81]._isReady())
1289
+ for (var e_82 = 0; e_82 < t.lightSources.length; e_82++)
1290
+ if (!t.lightSources[e_82]._isReady())
1279
1291
  return !1; return !(!n.effect || !n.effect.isReady() || (s._renderId = o.getRenderId(), a._wasPreviouslyReady = !0, a._wasPreviouslyUsingInstances = !!r, 0)); };
1280
1292
  e.prototype.bindForSubMesh = function (e, t, n) { var r = this.getScene(), a = n.materialDefines; if (!a)
1281
1293
  return; var s = n.effect; s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("view", r.getViewMatrix()), this._activeEffect.setMatrix("viewProjection", r.getTransformMatrix()), i.BindBonesParameters(t, this._activeEffect), this._mustRebind(r, s, n) && (this.mixTexture && (this._activeEffect.setTexture("textureSampler", this._mixTexture), this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level), this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix()), i.MaterialFlags.DiffuseTextureEnabled && (this._diffuseTexture1 && (this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1), this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale)), this._diffuseTexture2 && (this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2), this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale)), this._diffuseTexture3 && (this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3), this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale))), i.MaterialFlags.BumpTextureEnabled && r.getEngine().getCaps().standardDerivatives && (this._bumpTexture1 && this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1), this._bumpTexture2 && this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2), this._bumpTexture3 && this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3))), i.BindClipPlane(s, this, r), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && i.BindLogDepth(a, s, r), r.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), a.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), r.lightsEnabled && !this.disableLighting && i.BindLights(r, t, this._activeEffect, a, this.maxSimultaneousLights), r.fogEnabled && t.applyFog && r.fogMode !== i.Scene.FOGMODE_NONE && this._activeEffect.setMatrix("view", r.getViewMatrix()), i.BindFogParameters(r, t, this._activeEffect), this._afterBind(t, this._activeEffect, n)); };
@@ -1291,23 +1303,23 @@ var __values = (this && this.__values) || function(o) {
1291
1303
  e.prototype.getClassName = function () { return "TerrainMaterial"; };
1292
1304
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
1293
1305
  return e;
1294
- }(U)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, h = new WeakMap, m = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = U[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; v = [i.serializeAsTexture("mixTexture")], g = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], p = [i.serializeAsTexture("diffuseTexture1")], S = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], x = [i.serializeAsTexture("diffuseTexture2")], T = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], _ = [i.serializeAsTexture("diffuseTexture3")], C = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], E = [i.serializeAsTexture("bumpTexture1")], L = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], P = [i.serializeAsTexture("bumpTexture2")], I = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], D = [i.serializeAsTexture("bumpTexture3")], b = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], A = [i.serializeAsColor3()], F = [i.serializeAsColor3()], O = [i.serialize()], N = [i.serialize("disableLighting")], M = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], y = [i.serialize("maxSimultaneousLights")], V = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, g, { kind: "accessor", name: "mixTexture", static: !1, private: !1, access: { has: function (e) { return "mixTexture" in e; }, get: function (e) { return e.mixTexture; }, set: function (e, i) { e.mixTexture = i; } }, metadata: r }, W, B), t(e, null, S, { kind: "accessor", name: "diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture1" in e; }, get: function (e) { return e.diffuseTexture1; }, set: function (e, i) { e.diffuseTexture1 = i; } }, metadata: r }, k, X), t(e, null, T, { kind: "accessor", name: "diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture2" in e; }, get: function (e) { return e.diffuseTexture2; }, set: function (e, i) { e.diffuseTexture2 = i; } }, metadata: r }, Y, K), t(e, null, C, { kind: "accessor", name: "diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture3" in e; }, get: function (e) { return e.diffuseTexture3; }, set: function (e, i) { e.diffuseTexture3 = i; } }, metadata: r }, J, $), t(e, null, L, { kind: "accessor", name: "bumpTexture1", static: !1, private: !1, access: { has: function (e) { return "bumpTexture1" in e; }, get: function (e) { return e.bumpTexture1; }, set: function (e, i) { e.bumpTexture1 = i; } }, metadata: r }, te, ne), t(e, null, I, { kind: "accessor", name: "bumpTexture2", static: !1, private: !1, access: { has: function (e) { return "bumpTexture2" in e; }, get: function (e) { return e.bumpTexture2; }, set: function (e, i) { e.bumpTexture2 = i; } }, metadata: r }, se, oe), t(e, null, b, { kind: "accessor", name: "bumpTexture3", static: !1, private: !1, access: { has: function (e) { return "bumpTexture3" in e; }, get: function (e) { return e.bumpTexture3; }, set: function (e, i) { e.bumpTexture3 = i; } }, metadata: r }, ue, de), t(e, null, M, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, Te, _e), t(e, null, V, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, Le, Pe), t(null, null, v, { kind: "field", name: "_mixTexture", static: !1, private: !1, access: { has: function (e) { return "_mixTexture" in e; }, get: function (e) { return e._mixTexture; }, set: function (e, i) { e._mixTexture = i; } }, metadata: r }, w, G), t(null, null, p, { kind: "field", name: "_diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture1" in e; }, get: function (e) { return e._diffuseTexture1; }, set: function (e, i) { e._diffuseTexture1 = i; } }, metadata: r }, z, H), t(null, null, x, { kind: "field", name: "_diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture2" in e; }, get: function (e) { return e._diffuseTexture2; }, set: function (e, i) { e._diffuseTexture2 = i; } }, metadata: r }, j, Z), t(null, null, _, { kind: "field", name: "_diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture3" in e; }, get: function (e) { return e._diffuseTexture3; }, set: function (e, i) { e._diffuseTexture3 = i; } }, metadata: r }, q, Q), t(null, null, E, { kind: "field", name: "_bumpTexture1", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture1" in e; }, get: function (e) { return e._bumpTexture1; }, set: function (e, i) { e._bumpTexture1 = i; } }, metadata: r }, ee, ie), t(null, null, P, { kind: "field", name: "_bumpTexture2", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture2" in e; }, get: function (e) { return e._bumpTexture2; }, set: function (e, i) { e._bumpTexture2 = i; } }, metadata: r }, re, ae), t(null, null, D, { kind: "field", name: "_bumpTexture3", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture3" in e; }, get: function (e) { return e._bumpTexture3; }, set: function (e, i) { e._bumpTexture3 = i; } }, metadata: r }, fe, le), t(null, null, A, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, ce, he), t(null, null, F, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, me, ve), t(null, null, O, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, ge, pe), t(null, null, N, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, Se, xe), t(null, null, y, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, Ce, Ee), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return sn; }), Promise.resolve().then(function () { return un; })]; }, function () { return [Promise.resolve().then(function () { return mn; }), Promise.resolve().then(function () { return Sn; })]; }), e; })();
1295
- i.RegisterClass("BABYLON.TerrainMaterial", y);
1296
- var V = /** @class */ (function (_super) {
1297
- __extends(V, _super);
1298
- function V() {
1306
+ }(U)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, h = new WeakMap, m = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = U[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; v = [i.serializeAsTexture("mixTexture")], g = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], p = [i.serializeAsTexture("diffuseTexture1")], S = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], x = [i.serializeAsTexture("diffuseTexture2")], T = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], _ = [i.serializeAsTexture("diffuseTexture3")], C = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], E = [i.serializeAsTexture("bumpTexture1")], L = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], P = [i.serializeAsTexture("bumpTexture2")], I = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], D = [i.serializeAsTexture("bumpTexture3")], b = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], A = [i.serializeAsColor3()], F = [i.serializeAsColor3()], O = [i.serialize()], R = [i.serialize("disableLighting")], M = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], N = [i.serialize("maxSimultaneousLights")], V = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, g, { kind: "accessor", name: "mixTexture", static: !1, private: !1, access: { has: function (e) { return "mixTexture" in e; }, get: function (e) { return e.mixTexture; }, set: function (e, i) { e.mixTexture = i; } }, metadata: r }, W, B), t(e, null, S, { kind: "accessor", name: "diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture1" in e; }, get: function (e) { return e.diffuseTexture1; }, set: function (e, i) { e.diffuseTexture1 = i; } }, metadata: r }, k, X), t(e, null, T, { kind: "accessor", name: "diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture2" in e; }, get: function (e) { return e.diffuseTexture2; }, set: function (e, i) { e.diffuseTexture2 = i; } }, metadata: r }, Z, K), t(e, null, C, { kind: "accessor", name: "diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "diffuseTexture3" in e; }, get: function (e) { return e.diffuseTexture3; }, set: function (e, i) { e.diffuseTexture3 = i; } }, metadata: r }, J, $), t(e, null, L, { kind: "accessor", name: "bumpTexture1", static: !1, private: !1, access: { has: function (e) { return "bumpTexture1" in e; }, get: function (e) { return e.bumpTexture1; }, set: function (e, i) { e.bumpTexture1 = i; } }, metadata: r }, te, ne), t(e, null, I, { kind: "accessor", name: "bumpTexture2", static: !1, private: !1, access: { has: function (e) { return "bumpTexture2" in e; }, get: function (e) { return e.bumpTexture2; }, set: function (e, i) { e.bumpTexture2 = i; } }, metadata: r }, se, oe), t(e, null, b, { kind: "accessor", name: "bumpTexture3", static: !1, private: !1, access: { has: function (e) { return "bumpTexture3" in e; }, get: function (e) { return e.bumpTexture3; }, set: function (e, i) { e.bumpTexture3 = i; } }, metadata: r }, ue, de), t(e, null, M, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, Te, _e), t(e, null, V, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, Le, Pe), t(null, null, v, { kind: "field", name: "_mixTexture", static: !1, private: !1, access: { has: function (e) { return "_mixTexture" in e; }, get: function (e) { return e._mixTexture; }, set: function (e, i) { e._mixTexture = i; } }, metadata: r }, w, G), t(null, null, p, { kind: "field", name: "_diffuseTexture1", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture1" in e; }, get: function (e) { return e._diffuseTexture1; }, set: function (e, i) { e._diffuseTexture1 = i; } }, metadata: r }, z, H), t(null, null, x, { kind: "field", name: "_diffuseTexture2", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture2" in e; }, get: function (e) { return e._diffuseTexture2; }, set: function (e, i) { e._diffuseTexture2 = i; } }, metadata: r }, j, Y), t(null, null, _, { kind: "field", name: "_diffuseTexture3", static: !1, private: !1, access: { has: function (e) { return "_diffuseTexture3" in e; }, get: function (e) { return e._diffuseTexture3; }, set: function (e, i) { e._diffuseTexture3 = i; } }, metadata: r }, q, Q), t(null, null, E, { kind: "field", name: "_bumpTexture1", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture1" in e; }, get: function (e) { return e._bumpTexture1; }, set: function (e, i) { e._bumpTexture1 = i; } }, metadata: r }, ee, ie), t(null, null, P, { kind: "field", name: "_bumpTexture2", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture2" in e; }, get: function (e) { return e._bumpTexture2; }, set: function (e, i) { e._bumpTexture2 = i; } }, metadata: r }, re, ae), t(null, null, D, { kind: "field", name: "_bumpTexture3", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture3" in e; }, get: function (e) { return e._bumpTexture3; }, set: function (e, i) { e._bumpTexture3 = i; } }, metadata: r }, fe, le), t(null, null, A, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, ce, he), t(null, null, F, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, me, ve), t(null, null, O, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, ge, pe), t(null, null, R, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, Se, xe), t(null, null, N, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, Ce, Ee), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return on; }), Promise.resolve().then(function () { return dn; })]; }, function () { return [Promise.resolve().then(function () { return vn; }), Promise.resolve().then(function () { return xn; })]; }), e; })();
1307
+ i.RegisterClass("BABYLON.TerrainMaterial", V);
1308
+ var U = /** @class */ (function (_super) {
1309
+ __extends(U, _super);
1310
+ function U() {
1299
1311
  var _this = this;
1300
1312
  _this = _super.call(this) || this, _this.DIFFUSEX = !1, _this.DIFFUSEY = !1, _this.DIFFUSEZ = !1, _this.BUMPX = !1, _this.BUMPY = !1, _this.BUMPZ = !1, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.ALPHATEST = !1, _this.DEPTHPREPASS = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.SPECULARTERM = !1, _this.NORMAL = !1, _this.VERTEXCOLOR = !1, _this.VERTEXALPHA = !1, _this.NUM_BONE_INFLUENCERS = 0, _this.BonesPerMesh = 0, _this.INSTANCES = !1, _this.INSTANCESCOLOR = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.NONUNIFORMSCALING = !1, _this.LOGARITHMICDEPTH = !1, _this.AREALIGHTSUPPORTED = !0, _this.AREALIGHTNOROUGHTNESS = !0, _this.rebuild();
1301
1313
  return _this;
1302
1314
  }
1303
- return V;
1315
+ return U;
1304
1316
  }(i.MaterialDefines));
1305
- var U = (function () { var e, s, o, f, l, u, d, c, h; var m, v, g, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O, N, M, R, y = i.PushMaterial, U = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = []; return e = /** @class */ (function (_super) {
1317
+ var w = (function () { var e, s, o, f, l, u, d, c, h; var m, v, g, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O, R, M, N, y = i.PushMaterial, V = [], w = [], G = [], W = [], B = [], z = [], H = [], k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = []; return e = /** @class */ (function (_super) {
1306
1318
  __extends(e, _super);
1307
1319
  function e(e, t, r) {
1308
1320
  if (r === void 0) { r = !1; }
1309
1321
  var _this = this;
1310
- _this = _super.call(this, e, t, void 0, r) || this, _this.mixTexture = n(_this, U, void 0), _this._diffuseTextureX = (n(_this, w), n(_this, G, void 0)), s.set(_this, (n(_this, W), n(_this, B, void 0))), _this._diffuseTextureY = (n(_this, z), n(_this, H, void 0)), o.set(_this, (n(_this, k), n(_this, X, void 0))), _this._diffuseTextureZ = (n(_this, j), n(_this, Z, void 0)), f.set(_this, (n(_this, Y), n(_this, K, void 0))), _this._normalTextureX = (n(_this, q), n(_this, Q, void 0)), l.set(_this, (n(_this, J), n(_this, $, void 0))), _this._normalTextureY = (n(_this, ee), n(_this, ie, void 0)), u.set(_this, (n(_this, te), n(_this, ne, void 0))), _this._normalTextureZ = (n(_this, re), n(_this, ae, void 0)), d.set(_this, (n(_this, se), n(_this, oe, void 0))), _this.tileSize = (n(_this, fe), n(_this, le, 1)), _this.diffuseColor = (n(_this, ue), n(_this, de, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, ce), n(_this, he, new i.Color3(.2, .2, .2))), _this.specularPower = (n(_this, me), n(_this, ve, 64)), _this._disableLighting = (n(_this, ge), n(_this, pe, !1)), c.set(_this, (n(_this, Se), n(_this, xe, void 0))), _this._maxSimultaneousLights = (n(_this, Te), n(_this, _e, 4)), h.set(_this, (n(_this, Ce), n(_this, Ee, void 0))), n(_this, Le);
1322
+ _this = _super.call(this, e, t, void 0, r) || this, _this.mixTexture = n(_this, V, void 0), _this._diffuseTextureX = (n(_this, w), n(_this, G, void 0)), s.set(_this, (n(_this, W), n(_this, B, void 0))), _this._diffuseTextureY = (n(_this, z), n(_this, H, void 0)), o.set(_this, (n(_this, k), n(_this, X, void 0))), _this._diffuseTextureZ = (n(_this, j), n(_this, Y, void 0)), f.set(_this, (n(_this, Z), n(_this, K, void 0))), _this._normalTextureX = (n(_this, q), n(_this, Q, void 0)), l.set(_this, (n(_this, J), n(_this, $, void 0))), _this._normalTextureY = (n(_this, ee), n(_this, ie, void 0)), u.set(_this, (n(_this, te), n(_this, ne, void 0))), _this._normalTextureZ = (n(_this, re), n(_this, ae, void 0)), d.set(_this, (n(_this, se), n(_this, oe, void 0))), _this.tileSize = (n(_this, fe), n(_this, le, 1)), _this.diffuseColor = (n(_this, ue), n(_this, de, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, ce), n(_this, he, new i.Color3(.2, .2, .2))), _this.specularPower = (n(_this, me), n(_this, ve, 64)), _this._disableLighting = (n(_this, ge), n(_this, pe, !1)), c.set(_this, (n(_this, Se), n(_this, xe, void 0))), _this._maxSimultaneousLights = (n(_this, Te), n(_this, _e, 4)), h.set(_this, (n(_this, Ce), n(_this, Ee, void 0))), n(_this, Le);
1311
1323
  return _this;
1312
1324
  }
1313
1325
  Object.defineProperty(e.prototype, "diffuseTextureX", {
@@ -1362,22 +1374,22 @@ var __values = (this && this.__values) || function(o) {
1362
1374
  e.prototype.needAlphaTesting = function () { return !1; };
1363
1375
  e.prototype.getAlphaTestTexture = function () { return null; };
1364
1376
  e.prototype.isReadyForSubMesh = function (t, n, r) { var a = n._drawWrapper; if (this.isFrozen && a.effect && a._wasPreviouslyReady && a._wasPreviouslyUsingInstances === r)
1365
- return !0; n.materialDefines || (n.materialDefines = new V); var s = n.materialDefines, o = this.getScene(); if (this._isReadyForSubMesh(n))
1377
+ return !0; n.materialDefines || (n.materialDefines = new U); var s = n.materialDefines, o = this.getScene(); if (this._isReadyForSubMesh(n))
1366
1378
  return !0; var f = o.getEngine(); if (s._areTexturesDirty && o.texturesEnabled) {
1367
1379
  if (i.MaterialFlags.DiffuseTextureEnabled) {
1368
- var e_82 = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ], i_10 = ["DIFFUSEX", "DIFFUSEY", "DIFFUSEZ"];
1369
- for (var t_7 = 0; t_7 < e_82.length; t_7++)
1370
- if (e_82[t_7]) {
1371
- if (!e_82[t_7].isReady())
1380
+ var e_83 = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ], i_10 = ["DIFFUSEX", "DIFFUSEY", "DIFFUSEZ"];
1381
+ for (var t_7 = 0; t_7 < e_83.length; t_7++)
1382
+ if (e_83[t_7]) {
1383
+ if (!e_83[t_7].isReady())
1372
1384
  return !1;
1373
1385
  s[i_10[t_7]] = !0;
1374
1386
  }
1375
1387
  }
1376
1388
  if (i.MaterialFlags.BumpTextureEnabled) {
1377
- var e_83 = [this.normalTextureX, this.normalTextureY, this.normalTextureZ], i_11 = ["BUMPX", "BUMPY", "BUMPZ"];
1378
- for (var t_8 = 0; t_8 < e_83.length; t_8++)
1379
- if (e_83[t_8]) {
1380
- if (!e_83[t_8].isReady())
1389
+ var e_84 = [this.normalTextureX, this.normalTextureY, this.normalTextureZ], i_11 = ["BUMPX", "BUMPY", "BUMPZ"];
1390
+ for (var t_8 = 0; t_8 < e_84.length; t_8++)
1391
+ if (e_84[t_8]) {
1392
+ if (!e_84[t_8].isReady())
1381
1393
  return !1;
1382
1394
  s[i_11[t_8]] = !0;
1383
1395
  }
@@ -1388,11 +1400,11 @@ var __values = (this && this.__values) || function(o) {
1388
1400
  s.FOG && r_14.addFallback(1, "FOG"), i.HandleFallbacksForShadows(s, r_14, this.maxSimultaneousLights), s.NUM_BONE_INFLUENCERS > 0 && r_14.addCPUSkinningFallback(0, t), s.IMAGEPROCESSINGPOSTPROCESS = o.imageProcessingConfiguration.applyByPostProcess;
1389
1401
  var a_12 = [i.VertexBuffer.PositionKind];
1390
1402
  s.NORMAL && a_12.push(i.VertexBuffer.NormalKind), s.VERTEXCOLOR && a_12.push(i.VertexBuffer.ColorKind), i.PrepareAttributesForBones(a_12, t, s, r_14), i.PrepareAttributesForInstances(a_12, s);
1391
- var l_11 = "triplanar", u_11 = s.toString(), d_11 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", "vFogInfos", "vFogColor", "pointSize", "mBones", "tileSize"], c_10 = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ", "normalSamplerX", "normalSamplerY", "normalSamplerZ", "logarithmicDepthConstant", "areaLightsLTC1Sampler", "areaLightsLTC2Sampler"], h_9 = [];
1392
- i.AddClipPlaneUniforms(d_11), i.PrepareUniformsAndSamplersList({ uniformsNames: d_11, uniformBuffersNames: h_9, samplers: c_10, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_11, { attributes: a_12, uniformsNames: d_11, uniformBuffersNames: h_9, samplers: c_10, defines: u_11, fallbacks: r_14, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1403
+ var l_11 = "triplanar", u_11 = s.toString(), d_11 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", "vFogInfos", "vFogColor", "pointSize", "mBones", "tileSize"], c_10 = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ", "normalSamplerX", "normalSamplerY", "normalSamplerZ", "logarithmicDepthConstant", "areaLightsLTC1Sampler", "areaLightsLTC2Sampler"], h_10 = [];
1404
+ i.AddClipPlaneUniforms(d_11), i.PrepareUniformsAndSamplersList({ uniformsNames: d_11, uniformBuffersNames: h_10, samplers: c_10, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_11, { attributes: a_12, uniformsNames: d_11, uniformBuffersNames: h_10, samplers: c_10, defines: u_11, fallbacks: r_14, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1393
1405
  } if (s.AREALIGHTUSED)
1394
- for (var e_84 = 0; e_84 < t.lightSources.length; e_84++)
1395
- if (!t.lightSources[e_84]._isReady())
1406
+ for (var e_85 = 0; e_85 < t.lightSources.length; e_85++)
1407
+ if (!t.lightSources[e_85]._isReady())
1396
1408
  return !1; return !(!n.effect || !n.effect.isReady() || (s._renderId = o.getRenderId(), a._wasPreviouslyReady = !0, a._wasPreviouslyUsingInstances = !!r, 0)); };
1397
1409
  e.prototype.bindForSubMesh = function (e, t, n) { var r = this.getScene(), a = n.materialDefines; if (!a)
1398
1410
  return; var s = n.effect; s && (this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", r.getTransformMatrix()), i.BindBonesParameters(t, this._activeEffect), this._activeEffect.setFloat("tileSize", this.tileSize), this._mustRebind(r, s, n) && (this.diffuseTextureX && this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX), this.diffuseTextureY && this._activeEffect.setTexture("diffuseSamplerY", this.diffuseTextureY), this.diffuseTextureZ && this._activeEffect.setTexture("diffuseSamplerZ", this.diffuseTextureZ), this.normalTextureX && this._activeEffect.setTexture("normalSamplerX", this.normalTextureX), this.normalTextureY && this._activeEffect.setTexture("normalSamplerY", this.normalTextureY), this.normalTextureZ && this._activeEffect.setTexture("normalSamplerZ", this.normalTextureZ), i.BindClipPlane(s, this, r), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && i.BindLogDepth(a, s, r), r.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), a.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), r.lightsEnabled && !this.disableLighting && i.BindLights(r, t, this._activeEffect, a, this.maxSimultaneousLights), r.fogEnabled && t.applyFog && r.fogMode !== i.Scene.FOGMODE_NONE && this._activeEffect.setMatrix("view", r.getViewMatrix()), i.BindFogParameters(r, t, this._activeEffect), this._afterBind(t, this._activeEffect, n)); };
@@ -1408,24 +1420,24 @@ var __values = (this && this.__values) || function(o) {
1408
1420
  e.prototype.getClassName = function () { return "TriPlanarMaterial"; };
1409
1421
  e.Parse = function (t, n, r) { return i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); };
1410
1422
  return e;
1411
- }(y)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, h = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = y[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; m = [i.serializeAsTexture()], v = [i.serializeAsTexture("diffuseTextureX")], g = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], p = [i.serializeAsTexture("diffuseTexturY")], S = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], x = [i.serializeAsTexture("diffuseTextureZ")], T = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], _ = [i.serializeAsTexture("normalTextureX")], C = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], E = [i.serializeAsTexture("normalTextureY")], L = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], P = [i.serializeAsTexture("normalTextureZ")], I = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], D = [i.serialize()], b = [i.serializeAsColor3()], A = [i.serializeAsColor3()], F = [i.serialize()], O = [i.serialize("disableLighting")], N = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], M = [i.serialize("maxSimultaneousLights")], R = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, g, { kind: "accessor", name: "diffuseTextureX", static: !1, private: !1, access: { has: function (e) { return "diffuseTextureX" in e; }, get: function (e) { return e.diffuseTextureX; }, set: function (e, i) { e.diffuseTextureX = i; } }, metadata: r }, B, z), t(e, null, S, { kind: "accessor", name: "diffuseTextureY", static: !1, private: !1, access: { has: function (e) { return "diffuseTextureY" in e; }, get: function (e) { return e.diffuseTextureY; }, set: function (e, i) { e.diffuseTextureY = i; } }, metadata: r }, X, j), t(e, null, T, { kind: "accessor", name: "diffuseTextureZ", static: !1, private: !1, access: { has: function (e) { return "diffuseTextureZ" in e; }, get: function (e) { return e.diffuseTextureZ; }, set: function (e, i) { e.diffuseTextureZ = i; } }, metadata: r }, K, q), t(e, null, C, { kind: "accessor", name: "normalTextureX", static: !1, private: !1, access: { has: function (e) { return "normalTextureX" in e; }, get: function (e) { return e.normalTextureX; }, set: function (e, i) { e.normalTextureX = i; } }, metadata: r }, $, ee), t(e, null, L, { kind: "accessor", name: "normalTextureY", static: !1, private: !1, access: { has: function (e) { return "normalTextureY" in e; }, get: function (e) { return e.normalTextureY; }, set: function (e, i) { e.normalTextureY = i; } }, metadata: r }, ne, re), t(e, null, I, { kind: "accessor", name: "normalTextureZ", static: !1, private: !1, access: { has: function (e) { return "normalTextureZ" in e; }, get: function (e) { return e.normalTextureZ; }, set: function (e, i) { e.normalTextureZ = i; } }, metadata: r }, oe, fe), t(e, null, N, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, xe, Te), t(e, null, R, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, Ee, Le), t(null, null, m, { kind: "field", name: "mixTexture", static: !1, private: !1, access: { has: function (e) { return "mixTexture" in e; }, get: function (e) { return e.mixTexture; }, set: function (e, i) { e.mixTexture = i; } }, metadata: r }, U, w), t(null, null, v, { kind: "field", name: "_diffuseTextureX", static: !1, private: !1, access: { has: function (e) { return "_diffuseTextureX" in e; }, get: function (e) { return e._diffuseTextureX; }, set: function (e, i) { e._diffuseTextureX = i; } }, metadata: r }, G, W), t(null, null, p, { kind: "field", name: "_diffuseTextureY", static: !1, private: !1, access: { has: function (e) { return "_diffuseTextureY" in e; }, get: function (e) { return e._diffuseTextureY; }, set: function (e, i) { e._diffuseTextureY = i; } }, metadata: r }, H, k), t(null, null, x, { kind: "field", name: "_diffuseTextureZ", static: !1, private: !1, access: { has: function (e) { return "_diffuseTextureZ" in e; }, get: function (e) { return e._diffuseTextureZ; }, set: function (e, i) { e._diffuseTextureZ = i; } }, metadata: r }, Z, Y), t(null, null, _, { kind: "field", name: "_normalTextureX", static: !1, private: !1, access: { has: function (e) { return "_normalTextureX" in e; }, get: function (e) { return e._normalTextureX; }, set: function (e, i) { e._normalTextureX = i; } }, metadata: r }, Q, J), t(null, null, E, { kind: "field", name: "_normalTextureY", static: !1, private: !1, access: { has: function (e) { return "_normalTextureY" in e; }, get: function (e) { return e._normalTextureY; }, set: function (e, i) { e._normalTextureY = i; } }, metadata: r }, ie, te), t(null, null, P, { kind: "field", name: "_normalTextureZ", static: !1, private: !1, access: { has: function (e) { return "_normalTextureZ" in e; }, get: function (e) { return e._normalTextureZ; }, set: function (e, i) { e._normalTextureZ = i; } }, metadata: r }, ae, se), t(null, null, D, { kind: "field", name: "tileSize", static: !1, private: !1, access: { has: function (e) { return "tileSize" in e; }, get: function (e) { return e.tileSize; }, set: function (e, i) { e.tileSize = i; } }, metadata: r }, le, ue), t(null, null, b, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, de, ce), t(null, null, A, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, he, me), t(null, null, F, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, ve, ge), t(null, null, O, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, pe, Se), t(null, null, M, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, _e, Ce), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Cn; }), Promise.resolve().then(function () { return In; })]; }, function () { return [Promise.resolve().then(function () { return Fn; }), Promise.resolve().then(function () { return Rn; })]; }), e; })();
1412
- i.RegisterClass("BABYLON.TriPlanarMaterial", U);
1413
- var w = /** @class */ (function (_super) {
1414
- __extends(w, _super);
1415
- function w() {
1423
+ }(y)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, h = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = y[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; m = [i.serializeAsTexture()], v = [i.serializeAsTexture("diffuseTextureX")], g = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], p = [i.serializeAsTexture("diffuseTexturY")], S = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], x = [i.serializeAsTexture("diffuseTextureZ")], T = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], _ = [i.serializeAsTexture("normalTextureX")], C = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], E = [i.serializeAsTexture("normalTextureY")], L = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], P = [i.serializeAsTexture("normalTextureZ")], I = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], D = [i.serialize()], b = [i.serializeAsColor3()], A = [i.serializeAsColor3()], F = [i.serialize()], O = [i.serialize("disableLighting")], R = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], M = [i.serialize("maxSimultaneousLights")], N = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], t(e, null, g, { kind: "accessor", name: "diffuseTextureX", static: !1, private: !1, access: { has: function (e) { return "diffuseTextureX" in e; }, get: function (e) { return e.diffuseTextureX; }, set: function (e, i) { e.diffuseTextureX = i; } }, metadata: r }, B, z), t(e, null, S, { kind: "accessor", name: "diffuseTextureY", static: !1, private: !1, access: { has: function (e) { return "diffuseTextureY" in e; }, get: function (e) { return e.diffuseTextureY; }, set: function (e, i) { e.diffuseTextureY = i; } }, metadata: r }, X, j), t(e, null, T, { kind: "accessor", name: "diffuseTextureZ", static: !1, private: !1, access: { has: function (e) { return "diffuseTextureZ" in e; }, get: function (e) { return e.diffuseTextureZ; }, set: function (e, i) { e.diffuseTextureZ = i; } }, metadata: r }, K, q), t(e, null, C, { kind: "accessor", name: "normalTextureX", static: !1, private: !1, access: { has: function (e) { return "normalTextureX" in e; }, get: function (e) { return e.normalTextureX; }, set: function (e, i) { e.normalTextureX = i; } }, metadata: r }, $, ee), t(e, null, L, { kind: "accessor", name: "normalTextureY", static: !1, private: !1, access: { has: function (e) { return "normalTextureY" in e; }, get: function (e) { return e.normalTextureY; }, set: function (e, i) { e.normalTextureY = i; } }, metadata: r }, ne, re), t(e, null, I, { kind: "accessor", name: "normalTextureZ", static: !1, private: !1, access: { has: function (e) { return "normalTextureZ" in e; }, get: function (e) { return e.normalTextureZ; }, set: function (e, i) { e.normalTextureZ = i; } }, metadata: r }, oe, fe), t(e, null, R, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, xe, Te), t(e, null, N, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, Ee, Le), t(null, null, m, { kind: "field", name: "mixTexture", static: !1, private: !1, access: { has: function (e) { return "mixTexture" in e; }, get: function (e) { return e.mixTexture; }, set: function (e, i) { e.mixTexture = i; } }, metadata: r }, V, w), t(null, null, v, { kind: "field", name: "_diffuseTextureX", static: !1, private: !1, access: { has: function (e) { return "_diffuseTextureX" in e; }, get: function (e) { return e._diffuseTextureX; }, set: function (e, i) { e._diffuseTextureX = i; } }, metadata: r }, G, W), t(null, null, p, { kind: "field", name: "_diffuseTextureY", static: !1, private: !1, access: { has: function (e) { return "_diffuseTextureY" in e; }, get: function (e) { return e._diffuseTextureY; }, set: function (e, i) { e._diffuseTextureY = i; } }, metadata: r }, H, k), t(null, null, x, { kind: "field", name: "_diffuseTextureZ", static: !1, private: !1, access: { has: function (e) { return "_diffuseTextureZ" in e; }, get: function (e) { return e._diffuseTextureZ; }, set: function (e, i) { e._diffuseTextureZ = i; } }, metadata: r }, Y, Z), t(null, null, _, { kind: "field", name: "_normalTextureX", static: !1, private: !1, access: { has: function (e) { return "_normalTextureX" in e; }, get: function (e) { return e._normalTextureX; }, set: function (e, i) { e._normalTextureX = i; } }, metadata: r }, Q, J), t(null, null, E, { kind: "field", name: "_normalTextureY", static: !1, private: !1, access: { has: function (e) { return "_normalTextureY" in e; }, get: function (e) { return e._normalTextureY; }, set: function (e, i) { e._normalTextureY = i; } }, metadata: r }, ie, te), t(null, null, P, { kind: "field", name: "_normalTextureZ", static: !1, private: !1, access: { has: function (e) { return "_normalTextureZ" in e; }, get: function (e) { return e._normalTextureZ; }, set: function (e, i) { e._normalTextureZ = i; } }, metadata: r }, ae, se), t(null, null, D, { kind: "field", name: "tileSize", static: !1, private: !1, access: { has: function (e) { return "tileSize" in e; }, get: function (e) { return e.tileSize; }, set: function (e, i) { e.tileSize = i; } }, metadata: r }, le, ue), t(null, null, b, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, de, ce), t(null, null, A, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, he, me), t(null, null, F, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, ve, ge), t(null, null, O, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, pe, Se), t(null, null, M, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, _e, Ce), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return En; }), Promise.resolve().then(function () { return Dn; })]; }, function () { return [Promise.resolve().then(function () { return On; }), Promise.resolve().then(function () { return yn; })]; }), e; })();
1424
+ i.RegisterClass("BABYLON.TriPlanarMaterial", w);
1425
+ var G = /** @class */ (function (_super) {
1426
+ __extends(G, _super);
1427
+ function G() {
1416
1428
  var _this = this;
1417
1429
  _this = _super.call(this) || this, _this.BUMP = !1, _this.REFLECTION = !1, _this.CLIPPLANE = !1, _this.CLIPPLANE2 = !1, _this.CLIPPLANE3 = !1, _this.CLIPPLANE4 = !1, _this.CLIPPLANE5 = !1, _this.CLIPPLANE6 = !1, _this.ALPHATEST = !1, _this.DEPTHPREPASS = !1, _this.POINTSIZE = !1, _this.FOG = !1, _this.NORMAL = !1, _this.UV1 = !1, _this.UV2 = !1, _this.VERTEXCOLOR = !1, _this.VERTEXALPHA = !1, _this.NUM_BONE_INFLUENCERS = 0, _this.BonesPerMesh = 0, _this.INSTANCES = !1, _this.INSTANCESCOLOR = !1, _this.SPECULARTERM = !1, _this.LOGARITHMICDEPTH = !1, _this.USE_REVERSE_DEPTHBUFFER = !1, _this.FRESNELSEPARATE = !1, _this.BUMPSUPERIMPOSE = !1, _this.BUMPAFFECTSREFLECTION = !1, _this.USE_WORLD_COORDINATES = !1, _this.IMAGEPROCESSING = !1, _this.WHITEBALANCE = !1, _this.VIGNETTE = !1, _this.VIGNETTEBLENDMODEMULTIPLY = !1, _this.VIGNETTEBLENDMODEOPAQUE = !1, _this.TONEMAPPING = 0, _this.CONTRAST = !1, _this.EXPOSURE = !1, _this.COLORCURVES = !1, _this.COLORGRADING = !1, _this.COLORGRADING3D = !1, _this.SAMPLER3DGREENDEPTH = !1, _this.SAMPLER3DBGRMAP = !1, _this.DITHER = !1, _this.IMAGEPROCESSINGPOSTPROCESS = !1, _this.SKIPFINALCOLORCLAMP = !1, _this.rebuild();
1418
1430
  return _this;
1419
1431
  }
1420
- return w;
1432
+ return G;
1421
1433
  }(i.MaterialDefines));
1422
- var G = (function () { var e, s, o, f, l, u, d, c; var h, m, v, g, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O, N, M, R, y, V, U, G, W, B, z, H = i.PushMaterial, k = [], X = [], j = [], Z = [], Y = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = [], Pe = [], Ie = [], De = [], be = [], Ae = [], Fe = [], Oe = [], Ne = [], Me = [], Re = [], ye = [], Ve = [], Ue = [], we = [], Ge = [], We = [], Be = [], ze = [], He = [], ke = [], Xe = [], je = [], Ze = []; return e = /** @class */ (function (_super) {
1434
+ var W = (function () { var e, s, o, f, l, u, d, c; var h, m, v, g, p, S, x, T, _, C, E, L, P, I, D, b, A, F, O, R, M, N, y, V, U, w, W, B, z, H = i.PushMaterial, k = [], X = [], j = [], Y = [], Z = [], K = [], q = [], Q = [], J = [], $ = [], ee = [], ie = [], te = [], ne = [], re = [], ae = [], se = [], oe = [], fe = [], le = [], ue = [], de = [], ce = [], he = [], me = [], ve = [], ge = [], pe = [], Se = [], xe = [], Te = [], _e = [], Ce = [], Ee = [], Le = [], Pe = [], Ie = [], De = [], be = [], Ae = [], Fe = [], Oe = [], Re = [], Me = [], Ne = [], ye = [], Ve = [], Ue = [], we = [], Ge = [], We = [], Be = [], ze = [], He = [], ke = [], Xe = [], je = [], Ye = []; return e = /** @class */ (function (_super) {
1423
1435
  __extends(e, _super);
1424
1436
  function e(e, t, r, a) {
1425
1437
  if (r === void 0) { r = new i.Vector2(512, 512); }
1426
1438
  if (a === void 0) { a = !1; }
1427
1439
  var _this = this;
1428
- _this = _super.call(this, e, t, void 0, a) || this, _this.renderTargetSize = r, _this._bumpTexture = n(_this, k, void 0), s.set(_this, (n(_this, X), n(_this, j, void 0))), _this.diffuseColor = (n(_this, Z), n(_this, Y, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, K), n(_this, q, new i.Color3(0, 0, 0))), _this.specularPower = (n(_this, Q), n(_this, J, 64)), _this._disableLighting = (n(_this, $), n(_this, ee, !1)), o.set(_this, (n(_this, ie), n(_this, te, void 0))), _this._maxSimultaneousLights = (n(_this, ne), n(_this, re, 4)), f.set(_this, (n(_this, ae), n(_this, se, void 0))), _this.windForce = (n(_this, oe), n(_this, fe, 6)), _this.windDirection = (n(_this, le), n(_this, ue, new i.Vector2(0, 1))), _this.waveHeight = (n(_this, de), n(_this, ce, .4)), _this.bumpHeight = (n(_this, he), n(_this, me, .4)), _this._bumpSuperimpose = (n(_this, ve), n(_this, ge, !1)), l.set(_this, (n(_this, pe), n(_this, Se, void 0))), _this._fresnelSeparate = (n(_this, xe), n(_this, Te, !1)), u.set(_this, (n(_this, _e), n(_this, Ce, void 0))), _this._bumpAffectsReflection = (n(_this, Ee), n(_this, Le, !1)), d.set(_this, (n(_this, Pe), n(_this, Ie, void 0))), _this.waterColor = (n(_this, De), n(_this, be, new i.Color3(.1, .1, .6))), _this.colorBlendFactor = (n(_this, Ae), n(_this, Fe, .2)), _this.waterColor2 = (n(_this, Oe), n(_this, Ne, new i.Color3(.1, .1, .6))), _this.colorBlendFactor2 = (n(_this, Me), n(_this, Re, .2)), _this.waveLength = (n(_this, ye), n(_this, Ve, .1)), _this.waveSpeed = (n(_this, Ue), n(_this, we, 1)), _this.waveCount = (n(_this, Ge), n(_this, We, 20)), _this.disableClipPlane = (n(_this, Be), n(_this, ze, !1)), _this._useWorldCoordinatesForWaveDeformation = (n(_this, He), n(_this, ke, !1)), c.set(_this, (n(_this, Xe), n(_this, je, void 0))), _this._renderTargets = (n(_this, Ze), new i.SmartArray(16)), _this._mesh = null, _this._reflectionTransform = i.Matrix.Zero(), _this._offsetMirror = i.Matrix.Zero(), _this._tempPlane = new i.Plane(0, 0, 0, 0), _this._lastTime = 0, _this._lastDeltaTime = 0, _this._createRenderTargets(_this.getScene(), r), _this.getRenderTargetTextures = function () { return (_this._renderTargets.reset(), _this._renderTargets.push(_this._reflectionRTT), _this._renderTargets.push(_this._refractionRTT), _this._renderTargets); }, _this._imageProcessingConfiguration = _this.getScene().imageProcessingConfiguration, _this._imageProcessingConfiguration && (_this._imageProcessingObserver = _this._imageProcessingConfiguration.onUpdateParameters.add(function () { _this._markAllSubMeshesAsImageProcessingDirty(); }));
1440
+ _this = _super.call(this, e, t, void 0, a) || this, _this.renderTargetSize = r, _this._bumpTexture = n(_this, k, void 0), s.set(_this, (n(_this, X), n(_this, j, void 0))), _this.diffuseColor = (n(_this, Y), n(_this, Z, new i.Color3(1, 1, 1))), _this.specularColor = (n(_this, K), n(_this, q, new i.Color3(0, 0, 0))), _this.specularPower = (n(_this, Q), n(_this, J, 64)), _this._disableLighting = (n(_this, $), n(_this, ee, !1)), o.set(_this, (n(_this, ie), n(_this, te, void 0))), _this._maxSimultaneousLights = (n(_this, ne), n(_this, re, 4)), f.set(_this, (n(_this, ae), n(_this, se, void 0))), _this.windForce = (n(_this, oe), n(_this, fe, 6)), _this.windDirection = (n(_this, le), n(_this, ue, new i.Vector2(0, 1))), _this.waveHeight = (n(_this, de), n(_this, ce, .4)), _this.bumpHeight = (n(_this, he), n(_this, me, .4)), _this._bumpSuperimpose = (n(_this, ve), n(_this, ge, !1)), l.set(_this, (n(_this, pe), n(_this, Se, void 0))), _this._fresnelSeparate = (n(_this, xe), n(_this, Te, !1)), u.set(_this, (n(_this, _e), n(_this, Ce, void 0))), _this._bumpAffectsReflection = (n(_this, Ee), n(_this, Le, !1)), d.set(_this, (n(_this, Pe), n(_this, Ie, void 0))), _this.waterColor = (n(_this, De), n(_this, be, new i.Color3(.1, .1, .6))), _this.colorBlendFactor = (n(_this, Ae), n(_this, Fe, .2)), _this.waterColor2 = (n(_this, Oe), n(_this, Re, new i.Color3(.1, .1, .6))), _this.colorBlendFactor2 = (n(_this, Me), n(_this, Ne, .2)), _this.waveLength = (n(_this, ye), n(_this, Ve, .1)), _this.waveSpeed = (n(_this, Ue), n(_this, we, 1)), _this.waveCount = (n(_this, Ge), n(_this, We, 20)), _this.disableClipPlane = (n(_this, Be), n(_this, ze, !1)), _this._useWorldCoordinatesForWaveDeformation = (n(_this, He), n(_this, ke, !1)), c.set(_this, (n(_this, Xe), n(_this, je, void 0))), _this._renderTargets = (n(_this, Ye), new i.SmartArray(16)), _this._mesh = null, _this._reflectionTransform = i.Matrix.Zero(), _this._offsetMirror = i.Matrix.Zero(), _this._tempPlane = new i.Plane(0, 0, 0, 0), _this._lastTime = 0, _this._lastDeltaTime = 0, _this._createRenderTargets(_this.getScene(), r), _this.getRenderTargetTextures = function () { return (_this._renderTargets.reset(), _this._renderTargets.push(_this._reflectionRTT), _this._renderTargets.push(_this._refractionRTT), _this._renderTargets); }, _this._imageProcessingConfiguration = _this.getScene().imageProcessingConfiguration, _this._imageProcessingConfiguration && (_this._imageProcessingObserver = _this._imageProcessingConfiguration.onUpdateParameters.add(function () { _this._markAllSubMeshesAsImageProcessingDirty(); }));
1429
1441
  return _this;
1430
1442
  }
1431
1443
  Object.defineProperty(e.prototype, "bumpTexture", {
@@ -1504,7 +1516,7 @@ var __values = (this && this.__values) || function(o) {
1504
1516
  e.prototype.needAlphaTesting = function () { return !1; };
1505
1517
  e.prototype.getAlphaTestTexture = function () { return null; };
1506
1518
  e.prototype.isReadyForSubMesh = function (t, n, r) { var a = n._drawWrapper; if (this.isFrozen && a.effect && a._wasPreviouslyReady && a._wasPreviouslyUsingInstances === r)
1507
- return !0; n.materialDefines || (n.materialDefines = new w); var s = n.materialDefines, o = this.getScene(); if (this._isReadyForSubMesh(n))
1519
+ return !0; n.materialDefines || (n.materialDefines = new G); var s = n.materialDefines, o = this.getScene(); if (this._isReadyForSubMesh(n))
1508
1520
  return !0; var f = o.getEngine(); if (s._areTexturesDirty && (s._needUVs = !1, o.texturesEnabled)) {
1509
1521
  if (this.bumpTexture && i.MaterialFlags.BumpTextureEnabled) {
1510
1522
  if (!this.bumpTexture.isReady())
@@ -1517,8 +1529,8 @@ var __values = (this && this.__values) || function(o) {
1517
1529
  return !1;
1518
1530
  this._imageProcessingConfiguration.prepareDefines(s), s.IS_REFLECTION_LINEAR = null != this.reflectionTexture && !this.reflectionTexture.gammaSpace, s.IS_REFRACTION_LINEAR = null != this.refractionTexture && !this.refractionTexture.gammaSpace;
1519
1531
  } if (i.PrepareDefinesForAttributes(t, s, !0, !0), this._mesh = t, this._waitingRenderList) {
1520
- for (var e_85 = 0; e_85 < this._waitingRenderList.length; e_85++)
1521
- this.addToRenderList(o.getNodeById(this._waitingRenderList[e_85]));
1532
+ for (var e_86 = 0; e_86 < this._waitingRenderList.length; e_86++)
1533
+ this.addToRenderList(o.getNodeById(this._waitingRenderList[e_86]));
1522
1534
  this._waitingRenderList = null;
1523
1535
  } if (s.isDirty) {
1524
1536
  s.markAsProcessed(), o.resetCachedMaterial();
@@ -1526,14 +1538,14 @@ var __values = (this && this.__values) || function(o) {
1526
1538
  s.FOG && r_15.addFallback(1, "FOG"), s.LOGARITHMICDEPTH && r_15.addFallback(0, "LOGARITHMICDEPTH"), i.HandleFallbacksForShadows(s, r_15, this.maxSimultaneousLights), s.NUM_BONE_INFLUENCERS > 0 && r_15.addCPUSkinningFallback(0, t);
1527
1539
  var a_13 = [i.VertexBuffer.PositionKind];
1528
1540
  s.NORMAL && a_13.push(i.VertexBuffer.NormalKind), s.UV1 && a_13.push(i.VertexBuffer.UVKind), s.UV2 && a_13.push(i.VertexBuffer.UV2Kind), s.VERTEXCOLOR && a_13.push(i.VertexBuffer.ColorKind), i.PrepareAttributesForBones(a_13, t, s, r_15), i.PrepareAttributesForInstances(a_13, s);
1529
- var l_12 = "water", u_12 = s.toString(), d_12 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", "vFogInfos", "vFogColor", "pointSize", "vNormalInfos", "mBones", "normalMatrix", "logarithmicDepthConstant", "reflectionViewProjection", "windDirection", "waveLength", "time", "windForce", "cameraPosition", "bumpHeight", "waveHeight", "waterColor", "waterColor2", "colorBlendFactor", "colorBlendFactor2", "waveSpeed", "waveCount"], c_11 = ["normalSampler", "refractionSampler", "reflectionSampler"], h_10 = [];
1530
- i.ImageProcessingConfiguration && (i.ImageProcessingConfiguration.PrepareUniforms(d_12, s), i.ImageProcessingConfiguration.PrepareSamplers(c_11, s)), i.AddClipPlaneUniforms(d_12), i.PrepareUniformsAndSamplersList({ uniformsNames: d_12, uniformBuffersNames: h_10, samplers: c_11, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_12, { attributes: a_13, uniformsNames: d_12, uniformBuffersNames: h_10, samplers: c_11, defines: u_12, fallbacks: r_15, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1541
+ var l_12 = "water", u_12 = s.toString(), d_12 = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor", "vFogInfos", "vFogColor", "pointSize", "vNormalInfos", "mBones", "normalMatrix", "logarithmicDepthConstant", "reflectionViewProjection", "windDirection", "waveLength", "time", "windForce", "cameraPosition", "bumpHeight", "waveHeight", "waterColor", "waterColor2", "colorBlendFactor", "colorBlendFactor2", "waveSpeed", "waveCount"], c_11 = ["normalSampler", "refractionSampler", "reflectionSampler"], h_11 = [];
1542
+ i.ImageProcessingConfiguration && (i.ImageProcessingConfiguration.PrepareUniforms(d_12, s), i.ImageProcessingConfiguration.PrepareSamplers(c_11, s)), i.AddClipPlaneUniforms(d_12), i.PrepareUniformsAndSamplersList({ uniformsNames: d_12, uniformBuffersNames: h_11, samplers: c_11, defines: s, maxSimultaneousLights: this.maxSimultaneousLights, shaderLanguage: this._shaderLanguage }), n.setEffect(o.getEngine().createEffect(l_12, { attributes: a_13, uniformsNames: d_12, uniformBuffersNames: h_11, samplers: c_11, defines: u_12, fallbacks: r_15, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights }, shaderLanguage: this._shaderLanguage, extraInitializationsAsync: e._ShaderLoader.getLoadCallback(this._shaderLanguage) }, f), s, this._materialContext);
1531
1543
  } return !(!n.effect || !n.effect.isReady() || (s._renderId = o.getRenderId(), a._wasPreviouslyReady = !0, a._wasPreviouslyUsingInstances = !!r, 0)); };
1532
1544
  e.prototype.bindForSubMesh = function (e, t, n) { var r = this.getScene(), a = n.materialDefines; if (!a)
1533
1545
  return; var s = n.effect; if (!s || !this._mesh)
1534
1546
  return; this._activeEffect = s, this.bindOnlyWorldMatrix(e), this._activeEffect.setMatrix("viewProjection", r.getTransformMatrix()), i.BindBonesParameters(t, this._activeEffect), this._mustRebind(r, s, n) && (this.bumpTexture && i.MaterialFlags.BumpTextureEnabled && (this._activeEffect.setTexture("normalSampler", this.bumpTexture), this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level), this._activeEffect.setMatrix("normalMatrix", this.bumpTexture.getTextureMatrix())), i.BindClipPlane(s, this, r), this.pointsCloud && this._activeEffect.setFloat("pointSize", this.pointSize), this._useLogarithmicDepth && i.BindLogDepth(a, s, r), r.bindEyePosition(s)), this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * t.visibility), a.SPECULARTERM && this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower), r.lightsEnabled && !this.disableLighting && i.BindLights(r, t, this._activeEffect, a, this.maxSimultaneousLights), r.fogEnabled && t.applyFog && r.fogMode !== i.Scene.FOGMODE_NONE && this._activeEffect.setMatrix("view", r.getViewMatrix()), i.BindFogParameters(r, t, this._activeEffect), i.BindLogDepth(a, this._activeEffect, r), i.MaterialFlags.ReflectionTextureEnabled && (this._activeEffect.setTexture("refractionSampler", this._refractionRTT), this._activeEffect.setTexture("reflectionSampler", this._reflectionRTT)); var o = i.TmpVectors.Matrix[3].copyFrom(this._reflectionTransform); if (r.floatingOriginMode) {
1535
- var e_86 = i.OffsetViewToRef(r.floatingOriginOffset, r.getViewMatrix(), i.TmpVectors.Matrix[1]);
1536
- i.MultiplyMatricesToRef(this._offsetMirror, e_86, o);
1547
+ var e_87 = i.OffsetViewToRef(r.floatingOriginOffset, r.getViewMatrix(), i.TmpVectors.Matrix[1]);
1548
+ i.MultiplyMatricesToRef(this._offsetMirror, e_87, o);
1537
1549
  } o.multiplyToRef(r.getProjectionMatrix(), o); var f = r.getEngine().getDeltaTime(); f !== this._lastDeltaTime && (this._lastDeltaTime = f, this._lastTime += this._lastDeltaTime), this._activeEffect.setMatrix("reflectionViewProjection", o), this._activeEffect.setVector2("windDirection", this.windDirection), this._activeEffect.setFloat("waveLength", this.waveLength), this._activeEffect.setFloat("time", this._lastTime / 1e5), this._activeEffect.setFloat("windForce", this.windForce), this._activeEffect.setFloat("waveHeight", this.waveHeight), this._activeEffect.setFloat("bumpHeight", this.bumpHeight), this._activeEffect.setColor4("waterColor", this.waterColor, 1), this._activeEffect.setFloat("colorBlendFactor", this.colorBlendFactor), this._activeEffect.setColor4("waterColor2", this.waterColor2, 1), this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2), this._activeEffect.setFloat("waveSpeed", this.waveSpeed), this._activeEffect.setFloat("waveCount", this.waveCount), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect), this._afterBind(t, this._activeEffect, n); };
1538
1550
  e.prototype._createRenderTargets = function (e, t) {
1539
1551
  var _this = this;
@@ -1567,967 +1579,967 @@ var __values = (this && this.__values) || function(o) {
1567
1579
  e.Parse = function (t, n, r) { var a = i.SerializationHelper.Parse(function () { return new e(t.name, n); }, t, n, r); return a._waitingRenderList = t.renderList, a; };
1568
1580
  e.CreateDefaultMesh = function (e, t) { return i.CreateGround(e, { width: 512, height: 512, subdivisions: 32, updatable: !1 }, t); };
1569
1581
  return e;
1570
- }(H)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = H[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; h = [i.serializeAsTexture("bumpTexture")], m = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], v = [i.serializeAsColor3()], g = [i.serializeAsColor3()], p = [i.serialize()], S = [i.serialize("disableLighting")], x = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], T = [i.serialize("maxSimultaneousLights")], _ = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], C = [i.serialize()], E = [i.serializeAsVector2()], L = [i.serialize()], P = [i.serialize()], I = [i.serialize("bumpSuperimpose")], D = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], b = [i.serialize("fresnelSeparate")], A = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], F = [i.serialize("bumpAffectsReflection")], O = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], N = [i.serializeAsColor3()], M = [i.serialize()], R = [i.serializeAsColor3()], y = [i.serialize()], V = [i.serialize()], U = [i.serialize()], G = [i.serialize()], W = [i.serialize()], B = [i.serialize("useWorldCoordinatesForWaveDeformation")], z = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], t(e, null, m, { kind: "accessor", name: "bumpTexture", static: !1, private: !1, access: { has: function (e) { return "bumpTexture" in e; }, get: function (e) { return e.bumpTexture; }, set: function (e, i) { e.bumpTexture = i; } }, metadata: r }, j, Z), t(e, null, x, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, te, ne), t(e, null, _, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, se, oe), t(e, null, D, { kind: "accessor", name: "bumpSuperimpose", static: !1, private: !1, access: { has: function (e) { return "bumpSuperimpose" in e; }, get: function (e) { return e.bumpSuperimpose; }, set: function (e, i) { e.bumpSuperimpose = i; } }, metadata: r }, Se, xe), t(e, null, A, { kind: "accessor", name: "fresnelSeparate", static: !1, private: !1, access: { has: function (e) { return "fresnelSeparate" in e; }, get: function (e) { return e.fresnelSeparate; }, set: function (e, i) { e.fresnelSeparate = i; } }, metadata: r }, Ce, Ee), t(e, null, O, { kind: "accessor", name: "bumpAffectsReflection", static: !1, private: !1, access: { has: function (e) { return "bumpAffectsReflection" in e; }, get: function (e) { return e.bumpAffectsReflection; }, set: function (e, i) { e.bumpAffectsReflection = i; } }, metadata: r }, Ie, De), t(e, null, z, { kind: "accessor", name: "useWorldCoordinatesForWaveDeformation", static: !1, private: !1, access: { has: function (e) { return "useWorldCoordinatesForWaveDeformation" in e; }, get: function (e) { return e.useWorldCoordinatesForWaveDeformation; }, set: function (e, i) { e.useWorldCoordinatesForWaveDeformation = i; } }, metadata: r }, je, Ze), t(null, null, h, { kind: "field", name: "_bumpTexture", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture" in e; }, get: function (e) { return e._bumpTexture; }, set: function (e, i) { e._bumpTexture = i; } }, metadata: r }, k, X), t(null, null, v, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, Y, K), t(null, null, g, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, q, Q), t(null, null, p, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, J, $), t(null, null, S, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, ee, ie), t(null, null, T, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, re, ae), t(null, null, C, { kind: "field", name: "windForce", static: !1, private: !1, access: { has: function (e) { return "windForce" in e; }, get: function (e) { return e.windForce; }, set: function (e, i) { e.windForce = i; } }, metadata: r }, fe, le), t(null, null, E, { kind: "field", name: "windDirection", static: !1, private: !1, access: { has: function (e) { return "windDirection" in e; }, get: function (e) { return e.windDirection; }, set: function (e, i) { e.windDirection = i; } }, metadata: r }, ue, de), t(null, null, L, { kind: "field", name: "waveHeight", static: !1, private: !1, access: { has: function (e) { return "waveHeight" in e; }, get: function (e) { return e.waveHeight; }, set: function (e, i) { e.waveHeight = i; } }, metadata: r }, ce, he), t(null, null, P, { kind: "field", name: "bumpHeight", static: !1, private: !1, access: { has: function (e) { return "bumpHeight" in e; }, get: function (e) { return e.bumpHeight; }, set: function (e, i) { e.bumpHeight = i; } }, metadata: r }, me, ve), t(null, null, I, { kind: "field", name: "_bumpSuperimpose", static: !1, private: !1, access: { has: function (e) { return "_bumpSuperimpose" in e; }, get: function (e) { return e._bumpSuperimpose; }, set: function (e, i) { e._bumpSuperimpose = i; } }, metadata: r }, ge, pe), t(null, null, b, { kind: "field", name: "_fresnelSeparate", static: !1, private: !1, access: { has: function (e) { return "_fresnelSeparate" in e; }, get: function (e) { return e._fresnelSeparate; }, set: function (e, i) { e._fresnelSeparate = i; } }, metadata: r }, Te, _e), t(null, null, F, { kind: "field", name: "_bumpAffectsReflection", static: !1, private: !1, access: { has: function (e) { return "_bumpAffectsReflection" in e; }, get: function (e) { return e._bumpAffectsReflection; }, set: function (e, i) { e._bumpAffectsReflection = i; } }, metadata: r }, Le, Pe), t(null, null, N, { kind: "field", name: "waterColor", static: !1, private: !1, access: { has: function (e) { return "waterColor" in e; }, get: function (e) { return e.waterColor; }, set: function (e, i) { e.waterColor = i; } }, metadata: r }, be, Ae), t(null, null, M, { kind: "field", name: "colorBlendFactor", static: !1, private: !1, access: { has: function (e) { return "colorBlendFactor" in e; }, get: function (e) { return e.colorBlendFactor; }, set: function (e, i) { e.colorBlendFactor = i; } }, metadata: r }, Fe, Oe), t(null, null, R, { kind: "field", name: "waterColor2", static: !1, private: !1, access: { has: function (e) { return "waterColor2" in e; }, get: function (e) { return e.waterColor2; }, set: function (e, i) { e.waterColor2 = i; } }, metadata: r }, Ne, Me), t(null, null, y, { kind: "field", name: "colorBlendFactor2", static: !1, private: !1, access: { has: function (e) { return "colorBlendFactor2" in e; }, get: function (e) { return e.colorBlendFactor2; }, set: function (e, i) { e.colorBlendFactor2 = i; } }, metadata: r }, Re, ye), t(null, null, V, { kind: "field", name: "waveLength", static: !1, private: !1, access: { has: function (e) { return "waveLength" in e; }, get: function (e) { return e.waveLength; }, set: function (e, i) { e.waveLength = i; } }, metadata: r }, Ve, Ue), t(null, null, U, { kind: "field", name: "waveSpeed", static: !1, private: !1, access: { has: function (e) { return "waveSpeed" in e; }, get: function (e) { return e.waveSpeed; }, set: function (e, i) { e.waveSpeed = i; } }, metadata: r }, we, Ge), t(null, null, G, { kind: "field", name: "waveCount", static: !1, private: !1, access: { has: function (e) { return "waveCount" in e; }, get: function (e) { return e.waveCount; }, set: function (e, i) { e.waveCount = i; } }, metadata: r }, We, Be), t(null, null, W, { kind: "field", name: "disableClipPlane", static: !1, private: !1, access: { has: function (e) { return "disableClipPlane" in e; }, get: function (e) { return e.disableClipPlane; }, set: function (e, i) { e.disableClipPlane = i; } }, metadata: r }, ze, He), t(null, null, B, { kind: "field", name: "_useWorldCoordinatesForWaveDeformation", static: !1, private: !1, access: { has: function (e) { return "_useWorldCoordinatesForWaveDeformation" in e; }, get: function (e) { return e._useWorldCoordinatesForWaveDeformation; }, set: function (e, i) { e._useWorldCoordinatesForWaveDeformation = i; } }, metadata: r }, ke, Xe), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return wn; }), Promise.resolve().then(function () { return zn; })]; }, function () { return [Promise.resolve().then(function () { return jn; }), Promise.resolve().then(function () { return qn; })]; }), e; })();
1571
- i.RegisterClass("BABYLON.WaterMaterial", G);
1572
- var W = { __proto__: null, CellMaterial: o, CustomMaterial: u, CustomShaderStructure: f, FireMaterial: v, FurMaterial: p, GradientMaterial: x, GridMaterial: _, LavaMaterial: E, MixMaterial: P, NormalMaterial: D, PBRCustomMaterial: h, ShaderAlbedoParts: d, ShaderAlebdoParts: c, ShaderSpecialParts: l, ShadowOnlyMaterial: A, SimpleMaterial: O, SkyMaterial: M, TerrainMaterial: y, TriPlanarMaterial: U, WaterMaterial: G };
1573
- var B = "undefined" != typeof global ? global : "undefined" != typeof window ? window : void 0;
1574
- if (void 0 !== B) {
1575
- B.BABYLON = B.BABYLON || {};
1576
- for (var e_87 in W)
1577
- B.BABYLON[e_87] = W[e_87];
1578
- B.MATERIALS = W;
1579
- }
1580
- var z = "cellVertexShader", H = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1581
- i.ShaderStore.ShadersStore[z] || (i.ShaderStore.ShadersStore[z] = H);
1582
- var k = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
1582
+ }(H)), s = new WeakMap, o = new WeakMap, f = new WeakMap, l = new WeakMap, u = new WeakMap, d = new WeakMap, c = new WeakMap, (function () { var n; var r = "function" == typeof Symbol && Symbol.metadata ? Object.create(null !== (n = H[Symbol.metadata]) && void 0 !== n ? n : null) : void 0; h = [i.serializeAsTexture("bumpTexture")], m = [i.expandToProperty("_markAllSubMeshesAsTexturesDirty")], v = [i.serializeAsColor3()], g = [i.serializeAsColor3()], p = [i.serialize()], S = [i.serialize("disableLighting")], x = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], T = [i.serialize("maxSimultaneousLights")], _ = [i.expandToProperty("_markAllSubMeshesAsLightsDirty")], C = [i.serialize()], E = [i.serializeAsVector2()], L = [i.serialize()], P = [i.serialize()], I = [i.serialize("bumpSuperimpose")], D = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], b = [i.serialize("fresnelSeparate")], A = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], F = [i.serialize("bumpAffectsReflection")], O = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], R = [i.serializeAsColor3()], M = [i.serialize()], N = [i.serializeAsColor3()], y = [i.serialize()], V = [i.serialize()], U = [i.serialize()], w = [i.serialize()], W = [i.serialize()], B = [i.serialize("useWorldCoordinatesForWaveDeformation")], z = [i.expandToProperty("_markAllSubMeshesAsMiscDirty")], t(e, null, m, { kind: "accessor", name: "bumpTexture", static: !1, private: !1, access: { has: function (e) { return "bumpTexture" in e; }, get: function (e) { return e.bumpTexture; }, set: function (e, i) { e.bumpTexture = i; } }, metadata: r }, j, Y), t(e, null, x, { kind: "accessor", name: "disableLighting", static: !1, private: !1, access: { has: function (e) { return "disableLighting" in e; }, get: function (e) { return e.disableLighting; }, set: function (e, i) { e.disableLighting = i; } }, metadata: r }, te, ne), t(e, null, _, { kind: "accessor", name: "maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "maxSimultaneousLights" in e; }, get: function (e) { return e.maxSimultaneousLights; }, set: function (e, i) { e.maxSimultaneousLights = i; } }, metadata: r }, se, oe), t(e, null, D, { kind: "accessor", name: "bumpSuperimpose", static: !1, private: !1, access: { has: function (e) { return "bumpSuperimpose" in e; }, get: function (e) { return e.bumpSuperimpose; }, set: function (e, i) { e.bumpSuperimpose = i; } }, metadata: r }, Se, xe), t(e, null, A, { kind: "accessor", name: "fresnelSeparate", static: !1, private: !1, access: { has: function (e) { return "fresnelSeparate" in e; }, get: function (e) { return e.fresnelSeparate; }, set: function (e, i) { e.fresnelSeparate = i; } }, metadata: r }, Ce, Ee), t(e, null, O, { kind: "accessor", name: "bumpAffectsReflection", static: !1, private: !1, access: { has: function (e) { return "bumpAffectsReflection" in e; }, get: function (e) { return e.bumpAffectsReflection; }, set: function (e, i) { e.bumpAffectsReflection = i; } }, metadata: r }, Ie, De), t(e, null, z, { kind: "accessor", name: "useWorldCoordinatesForWaveDeformation", static: !1, private: !1, access: { has: function (e) { return "useWorldCoordinatesForWaveDeformation" in e; }, get: function (e) { return e.useWorldCoordinatesForWaveDeformation; }, set: function (e, i) { e.useWorldCoordinatesForWaveDeformation = i; } }, metadata: r }, je, Ye), t(null, null, h, { kind: "field", name: "_bumpTexture", static: !1, private: !1, access: { has: function (e) { return "_bumpTexture" in e; }, get: function (e) { return e._bumpTexture; }, set: function (e, i) { e._bumpTexture = i; } }, metadata: r }, k, X), t(null, null, v, { kind: "field", name: "diffuseColor", static: !1, private: !1, access: { has: function (e) { return "diffuseColor" in e; }, get: function (e) { return e.diffuseColor; }, set: function (e, i) { e.diffuseColor = i; } }, metadata: r }, Z, K), t(null, null, g, { kind: "field", name: "specularColor", static: !1, private: !1, access: { has: function (e) { return "specularColor" in e; }, get: function (e) { return e.specularColor; }, set: function (e, i) { e.specularColor = i; } }, metadata: r }, q, Q), t(null, null, p, { kind: "field", name: "specularPower", static: !1, private: !1, access: { has: function (e) { return "specularPower" in e; }, get: function (e) { return e.specularPower; }, set: function (e, i) { e.specularPower = i; } }, metadata: r }, J, $), t(null, null, S, { kind: "field", name: "_disableLighting", static: !1, private: !1, access: { has: function (e) { return "_disableLighting" in e; }, get: function (e) { return e._disableLighting; }, set: function (e, i) { e._disableLighting = i; } }, metadata: r }, ee, ie), t(null, null, T, { kind: "field", name: "_maxSimultaneousLights", static: !1, private: !1, access: { has: function (e) { return "_maxSimultaneousLights" in e; }, get: function (e) { return e._maxSimultaneousLights; }, set: function (e, i) { e._maxSimultaneousLights = i; } }, metadata: r }, re, ae), t(null, null, C, { kind: "field", name: "windForce", static: !1, private: !1, access: { has: function (e) { return "windForce" in e; }, get: function (e) { return e.windForce; }, set: function (e, i) { e.windForce = i; } }, metadata: r }, fe, le), t(null, null, E, { kind: "field", name: "windDirection", static: !1, private: !1, access: { has: function (e) { return "windDirection" in e; }, get: function (e) { return e.windDirection; }, set: function (e, i) { e.windDirection = i; } }, metadata: r }, ue, de), t(null, null, L, { kind: "field", name: "waveHeight", static: !1, private: !1, access: { has: function (e) { return "waveHeight" in e; }, get: function (e) { return e.waveHeight; }, set: function (e, i) { e.waveHeight = i; } }, metadata: r }, ce, he), t(null, null, P, { kind: "field", name: "bumpHeight", static: !1, private: !1, access: { has: function (e) { return "bumpHeight" in e; }, get: function (e) { return e.bumpHeight; }, set: function (e, i) { e.bumpHeight = i; } }, metadata: r }, me, ve), t(null, null, I, { kind: "field", name: "_bumpSuperimpose", static: !1, private: !1, access: { has: function (e) { return "_bumpSuperimpose" in e; }, get: function (e) { return e._bumpSuperimpose; }, set: function (e, i) { e._bumpSuperimpose = i; } }, metadata: r }, ge, pe), t(null, null, b, { kind: "field", name: "_fresnelSeparate", static: !1, private: !1, access: { has: function (e) { return "_fresnelSeparate" in e; }, get: function (e) { return e._fresnelSeparate; }, set: function (e, i) { e._fresnelSeparate = i; } }, metadata: r }, Te, _e), t(null, null, F, { kind: "field", name: "_bumpAffectsReflection", static: !1, private: !1, access: { has: function (e) { return "_bumpAffectsReflection" in e; }, get: function (e) { return e._bumpAffectsReflection; }, set: function (e, i) { e._bumpAffectsReflection = i; } }, metadata: r }, Le, Pe), t(null, null, R, { kind: "field", name: "waterColor", static: !1, private: !1, access: { has: function (e) { return "waterColor" in e; }, get: function (e) { return e.waterColor; }, set: function (e, i) { e.waterColor = i; } }, metadata: r }, be, Ae), t(null, null, M, { kind: "field", name: "colorBlendFactor", static: !1, private: !1, access: { has: function (e) { return "colorBlendFactor" in e; }, get: function (e) { return e.colorBlendFactor; }, set: function (e, i) { e.colorBlendFactor = i; } }, metadata: r }, Fe, Oe), t(null, null, N, { kind: "field", name: "waterColor2", static: !1, private: !1, access: { has: function (e) { return "waterColor2" in e; }, get: function (e) { return e.waterColor2; }, set: function (e, i) { e.waterColor2 = i; } }, metadata: r }, Re, Me), t(null, null, y, { kind: "field", name: "colorBlendFactor2", static: !1, private: !1, access: { has: function (e) { return "colorBlendFactor2" in e; }, get: function (e) { return e.colorBlendFactor2; }, set: function (e, i) { e.colorBlendFactor2 = i; } }, metadata: r }, Ne, ye), t(null, null, V, { kind: "field", name: "waveLength", static: !1, private: !1, access: { has: function (e) { return "waveLength" in e; }, get: function (e) { return e.waveLength; }, set: function (e, i) { e.waveLength = i; } }, metadata: r }, Ve, Ue), t(null, null, U, { kind: "field", name: "waveSpeed", static: !1, private: !1, access: { has: function (e) { return "waveSpeed" in e; }, get: function (e) { return e.waveSpeed; }, set: function (e, i) { e.waveSpeed = i; } }, metadata: r }, we, Ge), t(null, null, w, { kind: "field", name: "waveCount", static: !1, private: !1, access: { has: function (e) { return "waveCount" in e; }, get: function (e) { return e.waveCount; }, set: function (e, i) { e.waveCount = i; } }, metadata: r }, We, Be), t(null, null, W, { kind: "field", name: "disableClipPlane", static: !1, private: !1, access: { has: function (e) { return "disableClipPlane" in e; }, get: function (e) { return e.disableClipPlane; }, set: function (e, i) { e.disableClipPlane = i; } }, metadata: r }, ze, He), t(null, null, B, { kind: "field", name: "_useWorldCoordinatesForWaveDeformation", static: !1, private: !1, access: { has: function (e) { return "_useWorldCoordinatesForWaveDeformation" in e; }, get: function (e) { return e._useWorldCoordinatesForWaveDeformation; }, set: function (e, i) { e._useWorldCoordinatesForWaveDeformation = i; } }, metadata: r }, ke, Xe), r && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r }); })(), e._ShaderLoader = new i._ShaderImportLoader(function () { return [Promise.resolve().then(function () { return Gn; }), Promise.resolve().then(function () { return Hn; })]; }, function () { return [Promise.resolve().then(function () { return Yn; }), Promise.resolve().then(function () { return Qn; })]; }), e; })();
1583
+ i.RegisterClass("BABYLON.WaterMaterial", W);
1584
+ var B = { __proto__: null, CellMaterial: o, CustomMaterial: u, CustomShaderStructure: f, FireMaterial: v, FurMaterial: p, GradientMaterial: x, GridMaterial: _, LavaMaterial: E, MixMaterial: P, NormalMaterial: D, PBRCustomMaterial: h, ShaderAlbedoParts: d, ShaderAlebdoParts: c, ShaderSpecialParts: l, ShadowOnlyMaterial: A, SimpleMaterial: O, SkyMaterial: N, TerrainMaterial: V, TriPlanarMaterial: w, WaterMaterial: W, _MaxColorValueForRenderTarget: M };
1585
+ var z = "undefined" != typeof global ? global : "undefined" != typeof window ? window : void 0;
1586
+ if (void 0 !== z) {
1587
+ z.BABYLON = z.BABYLON || {};
1588
+ for (var e_88 in B)
1589
+ z.BABYLON[e_88] = B[e_88];
1590
+ z.MATERIALS = B;
1591
+ }
1592
+ var H = "cellVertexShader", k = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1593
+ i.ShaderStore.ShadersStore[H] || (i.ShaderStore.ShadersStore[H] = k);
1594
+ var X = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
1583
1595
  try {
1584
- for (var k_1 = __values(k), k_1_1 = k_1.next(); !k_1_1.done; k_1_1 = k_1.next()) {
1585
- var e_88 = k_1_1.value;
1586
- i.ShaderStore.IncludesShadersStore[e_88.name] || (i.ShaderStore.IncludesShadersStore[e_88.name] = e_88.shader);
1596
+ for (var X_1 = __values(X), X_1_1 = X_1.next(); !X_1_1.done; X_1_1 = X_1.next()) {
1597
+ var e_89 = X_1_1.value;
1598
+ i.ShaderStore.IncludesShadersStore[e_89.name] || (i.ShaderStore.IncludesShadersStore[e_89.name] = e_89.shader);
1587
1599
  }
1588
1600
  }
1589
1601
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1590
1602
  finally {
1591
1603
  try {
1592
- if (k_1_1 && !k_1_1.done && (_a = k_1.return)) _a.call(k_1);
1604
+ if (X_1_1 && !X_1_1.done && (_a = X_1.return)) _a.call(X_1);
1593
1605
  }
1594
1606
  finally { if (e_1) throw e_1.error; }
1595
1607
  }
1596
- var X = { __proto__: null, cellVertexShader: { name: z, shader: H } };
1597
- var j = "cellPixelShader", Z = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow)\n{diffuseBase=info.diffuse*shadow;\n#ifdef CELLBASIC\nfloat level=1.0;if (info.ndl<0.5)\nlevel=0.5;diffuseBase.rgb*vec3(level,level,level);\n#else\nfloat ToonThresholds[4];ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;float ToonBrightnessLevels[5];ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0])\n{diffuseBase.rgb*=ToonBrightnessLevels[0];}\nelse if (info.ndl>ToonThresholds[1])\n{diffuseBase.rgb*=ToonBrightnessLevels[1];}\nelse if (info.ndl>ToonThresholds[2])\n{diffuseBase.rgb*=ToonBrightnessLevels[2];}\nelse if (info.ndl>ToonThresholds[3])\n{diffuseBase.rgb*=ToonBrightnessLevels[3];}\nelse\n{diffuseBase.rgb*=ToonBrightnessLevels[4];}\n#endif\nreturn max(diffuseBase,vec3(0.2));}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nlightingInfo info;vec3 diffuseBase=vec3(0.,0.,0.);float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1598
- i.ShaderStore.ShadersStore[j] || (i.ShaderStore.ShadersStore[j] = Z);
1599
- var Y = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1608
+ var j = { __proto__: null, cellVertexShader: { name: H, shader: k } };
1609
+ var Y = "cellPixelShader", Z = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow)\n{diffuseBase=info.diffuse*shadow;\n#ifdef CELLBASIC\nfloat level=1.0;if (info.ndl<0.5)\nlevel=0.5;diffuseBase.rgb*vec3(level,level,level);\n#else\nfloat ToonThresholds[4];ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;float ToonBrightnessLevels[5];ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0])\n{diffuseBase.rgb*=ToonBrightnessLevels[0];}\nelse if (info.ndl>ToonThresholds[1])\n{diffuseBase.rgb*=ToonBrightnessLevels[1];}\nelse if (info.ndl>ToonThresholds[2])\n{diffuseBase.rgb*=ToonBrightnessLevels[2];}\nelse if (info.ndl>ToonThresholds[3])\n{diffuseBase.rgb*=ToonBrightnessLevels[3];}\nelse\n{diffuseBase.rgb*=ToonBrightnessLevels[4];}\n#endif\nreturn max(diffuseBase,vec3(0.2));}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nlightingInfo info;vec3 diffuseBase=vec3(0.,0.,0.);float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1610
+ i.ShaderStore.ShadersStore[Y] || (i.ShaderStore.ShadersStore[Y] = Z);
1611
+ var K = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1600
1612
  try {
1601
- for (var Y_1 = __values(Y), Y_1_1 = Y_1.next(); !Y_1_1.done; Y_1_1 = Y_1.next()) {
1602
- var e_89 = Y_1_1.value;
1603
- i.ShaderStore.IncludesShadersStore[e_89.name] || (i.ShaderStore.IncludesShadersStore[e_89.name] = e_89.shader);
1613
+ for (var K_1 = __values(K), K_1_1 = K_1.next(); !K_1_1.done; K_1_1 = K_1.next()) {
1614
+ var e_90 = K_1_1.value;
1615
+ i.ShaderStore.IncludesShadersStore[e_90.name] || (i.ShaderStore.IncludesShadersStore[e_90.name] = e_90.shader);
1604
1616
  }
1605
1617
  }
1606
1618
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1607
1619
  finally {
1608
1620
  try {
1609
- if (Y_1_1 && !Y_1_1.done && (_b = Y_1.return)) _b.call(Y_1);
1621
+ if (K_1_1 && !K_1_1.done && (_b = K_1.return)) _b.call(K_1);
1610
1622
  }
1611
1623
  finally { if (e_2) throw e_2.error; }
1612
1624
  }
1613
- var K = { __proto__: null, cellPixelShader: { name: j, shader: Z } };
1614
- var q = "cellVertexShader", Q = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1615
- i.ShaderStore.ShadersStoreWGSL[q] || (i.ShaderStore.ShadersStoreWGSL[q] = Q);
1616
- var J = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
1625
+ var q = { __proto__: null, cellPixelShader: { name: Y, shader: Z } };
1626
+ var Q = "cellVertexShader", J = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1627
+ i.ShaderStore.ShadersStoreWGSL[Q] || (i.ShaderStore.ShadersStoreWGSL[Q] = J);
1628
+ var $ = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
1617
1629
  try {
1618
- for (var J_1 = __values(J), J_1_1 = J_1.next(); !J_1_1.done; J_1_1 = J_1.next()) {
1619
- var e_90 = J_1_1.value;
1620
- i.ShaderStore.IncludesShadersStoreWGSL[e_90.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_90.name] = e_90.shader);
1630
+ for (var $_1 = __values($), $_1_1 = $_1.next(); !$_1_1.done; $_1_1 = $_1.next()) {
1631
+ var e_91 = $_1_1.value;
1632
+ i.ShaderStore.IncludesShadersStoreWGSL[e_91.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_91.name] = e_91.shader);
1621
1633
  }
1622
1634
  }
1623
1635
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
1624
1636
  finally {
1625
1637
  try {
1626
- if (J_1_1 && !J_1_1.done && (_c = J_1.return)) _c.call(J_1);
1638
+ if ($_1_1 && !$_1_1.done && (_c = $_1.return)) _c.call($_1);
1627
1639
  }
1628
1640
  finally { if (e_3) throw e_3.error; }
1629
1641
  }
1630
- var $ = { __proto__: null, cellVertexShaderWGSL: { name: q, shader: Q } };
1631
- var ee = "cellPixelShader", ie = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfn computeCustomDiffuseLighting(info: lightingInfo,diffuseBaseIn: vec3f,shadow: f32)->vec3f\n{var diffuseBase: vec3f=info.diffuse*shadow;\n#ifdef CELLBASIC\nvar level: f32=1.0;if (info.ndl<0.5) {level=0.5;}\ndiffuseBase=diffuseBase.rgb* vec3f(level,level,level);\n#else\nvar ToonThresholds: array<f32,4>;ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;var ToonBrightnessLevels: array<f32,5>;ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[0];}\nelse if (info.ndl>ToonThresholds[1])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[1];}\nelse if (info.ndl>ToonThresholds[2])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[2];}\nelse if (info.ndl>ToonThresholds[3])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[3];}\nelse\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[4];}\n#endif\nreturn max(diffuseBase, vec3f(0.2));}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar info: lightingInfo;var diffuseBase: vec3f= vec3f(0.,0.,0.);var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1632
- i.ShaderStore.ShadersStoreWGSL[ee] || (i.ShaderStore.ShadersStoreWGSL[ee] = ie);
1633
- var te = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1642
+ var ee = { __proto__: null, cellVertexShaderWGSL: { name: Q, shader: J } };
1643
+ var ie = "cellPixelShader", te = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfn computeCustomDiffuseLighting(info: lightingInfo,diffuseBaseIn: vec3f,shadow: f32)->vec3f\n{var diffuseBase: vec3f=info.diffuse*shadow;\n#ifdef CELLBASIC\nvar level: f32=1.0;if (info.ndl<0.5) {level=0.5;}\ndiffuseBase=diffuseBase.rgb* vec3f(level,level,level);\n#else\nvar ToonThresholds: array<f32,4>;ToonThresholds[0]=0.95;ToonThresholds[1]=0.5;ToonThresholds[2]=0.2;ToonThresholds[3]=0.03;var ToonBrightnessLevels: array<f32,5>;ToonBrightnessLevels[0]=1.0;ToonBrightnessLevels[1]=0.8;ToonBrightnessLevels[2]=0.6;ToonBrightnessLevels[3]=0.35;ToonBrightnessLevels[4]=0.2;if (info.ndl>ToonThresholds[0])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[0];}\nelse if (info.ndl>ToonThresholds[1])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[1];}\nelse if (info.ndl>ToonThresholds[2])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[2];}\nelse if (info.ndl>ToonThresholds[3])\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[3];}\nelse\n{diffuseBase=diffuseBase.rgb*ToonBrightnessLevels[4];}\n#endif\nreturn max(diffuseBase, vec3f(0.2));}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar info: lightingInfo;var diffuseBase: vec3f= vec3f(0.,0.,0.);var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1644
+ i.ShaderStore.ShadersStoreWGSL[ie] || (i.ShaderStore.ShadersStoreWGSL[ie] = te);
1645
+ var ne = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1634
1646
  try {
1635
- for (var te_1 = __values(te), te_1_1 = te_1.next(); !te_1_1.done; te_1_1 = te_1.next()) {
1636
- var e_91 = te_1_1.value;
1637
- i.ShaderStore.IncludesShadersStoreWGSL[e_91.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_91.name] = e_91.shader);
1647
+ for (var ne_1 = __values(ne), ne_1_1 = ne_1.next(); !ne_1_1.done; ne_1_1 = ne_1.next()) {
1648
+ var e_92 = ne_1_1.value;
1649
+ i.ShaderStore.IncludesShadersStoreWGSL[e_92.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_92.name] = e_92.shader);
1638
1650
  }
1639
1651
  }
1640
1652
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
1641
1653
  finally {
1642
1654
  try {
1643
- if (te_1_1 && !te_1_1.done && (_d = te_1.return)) _d.call(te_1);
1655
+ if (ne_1_1 && !ne_1_1.done && (_d = ne_1.return)) _d.call(ne_1);
1644
1656
  }
1645
1657
  finally { if (e_4) throw e_4.error; }
1646
1658
  }
1647
- var ne = { __proto__: null, cellPixelShaderWGSL: { name: ee, shader: ie } };
1648
- var re = "fireVertexShader", ae = "precision highp float;attribute vec3 position;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\nuniform float time;uniform float speed;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSE\nvDiffuseUV=uv;vDiffuseUV.y-=0.2;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#ifdef DIFFUSE\nvec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;vDistortionCoords1.x=uv.x;vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;vDistortionCoords2.x=uv.x;vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;vDistortionCoords3.x=uv.x;vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1649
- i.ShaderStore.ShadersStore[re] || (i.ShaderStore.ShadersStore[re] = ae);
1650
- var se = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.vertexColorMixing];
1659
+ var re = { __proto__: null, cellPixelShaderWGSL: { name: ie, shader: te } };
1660
+ var ae = "fireVertexShader", se = "precision highp float;attribute vec3 position;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\nuniform float time;uniform float speed;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSE\nvDiffuseUV=uv;vDiffuseUV.y-=0.2;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#ifdef DIFFUSE\nvec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;vDistortionCoords1.x=uv.x;vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;vDistortionCoords2.x=uv.x;vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;vDistortionCoords3.x=uv.x;vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1661
+ i.ShaderStore.ShadersStore[ae] || (i.ShaderStore.ShadersStore[ae] = se);
1662
+ var oe = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.vertexColorMixing];
1651
1663
  try {
1652
- for (var se_1 = __values(se), se_1_1 = se_1.next(); !se_1_1.done; se_1_1 = se_1.next()) {
1653
- var e_92 = se_1_1.value;
1654
- i.ShaderStore.IncludesShadersStore[e_92.name] || (i.ShaderStore.IncludesShadersStore[e_92.name] = e_92.shader);
1664
+ for (var oe_1 = __values(oe), oe_1_1 = oe_1.next(); !oe_1_1.done; oe_1_1 = oe_1.next()) {
1665
+ var e_93 = oe_1_1.value;
1666
+ i.ShaderStore.IncludesShadersStore[e_93.name] || (i.ShaderStore.IncludesShadersStore[e_93.name] = e_93.shader);
1655
1667
  }
1656
1668
  }
1657
1669
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
1658
1670
  finally {
1659
1671
  try {
1660
- if (se_1_1 && !se_1_1.done && (_f = se_1.return)) _f.call(se_1);
1672
+ if (oe_1_1 && !oe_1_1.done && (_f = oe_1.return)) _f.call(oe_1);
1661
1673
  }
1662
1674
  finally { if (e_5) throw e_5.error; }
1663
1675
  }
1664
- var oe = { __proto__: null, fireVertexShader: { name: re, shader: ae } };
1665
- var fe = "firePixelShader", le = "precision highp float;uniform vec4 vEyePosition;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\nuniform sampler2D distortionSampler;uniform sampler2D opacitySampler;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvec4 bx2(vec4 x)\n{return vec4(2.0)*x-vec4(1.0);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);float alpha=1.0;\n#ifdef DIFFUSE\nconst float distortionAmount0 =0.092;const float distortionAmount1 =0.092;const float distortionAmount2 =0.092;vec2 heightAttenuation=vec2(0.3,0.39);vec4 noise0=texture2D(distortionSampler,vDistortionCoords1);vec4 noise1=texture2D(distortionSampler,vDistortionCoords2);vec4 noise2=texture2D(distortionSampler,vDistortionCoords3);vec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;vec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);vec4 opacityColor=texture2D(opacitySampler,perturbedBaseCoords.xy);\n#ifdef ALPHATEST\nif (opacityColor.r<0.1)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor=texture2D(diffuseSampler,perturbedBaseCoords.xy)*2.0;baseColor*=opacityColor;baseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(1.0,1.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec4 color=vec4(baseColor.rgb,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1666
- i.ShaderStore.ShadersStore[fe] || (i.ShaderStore.ShadersStore[fe] = le);
1667
- var ue = [i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1676
+ var fe = { __proto__: null, fireVertexShader: { name: ae, shader: se } };
1677
+ var le = "firePixelShader", ue = "precision highp float;uniform vec4 vEyePosition;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\nuniform sampler2D distortionSampler;uniform sampler2D opacitySampler;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvec4 bx2(vec4 x)\n{return vec4(2.0)*x-vec4(1.0);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);float alpha=1.0;\n#ifdef DIFFUSE\nconst float distortionAmount0 =0.092;const float distortionAmount1 =0.092;const float distortionAmount2 =0.092;vec2 heightAttenuation=vec2(0.3,0.39);vec4 noise0=texture2D(distortionSampler,vDistortionCoords1);vec4 noise1=texture2D(distortionSampler,vDistortionCoords2);vec4 noise2=texture2D(distortionSampler,vDistortionCoords3);vec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;vec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);vec4 opacityColor=texture2D(opacitySampler,perturbedBaseCoords.xy);\n#ifdef ALPHATEST\nif (opacityColor.r<0.1)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor=texture2D(diffuseSampler,perturbedBaseCoords.xy)*2.0;baseColor*=opacityColor;baseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(1.0,1.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec4 color=vec4(baseColor.rgb,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1678
+ i.ShaderStore.ShadersStore[le] || (i.ShaderStore.ShadersStore[le] = ue);
1679
+ var de = [i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1668
1680
  try {
1669
- for (var ue_1 = __values(ue), ue_1_1 = ue_1.next(); !ue_1_1.done; ue_1_1 = ue_1.next()) {
1670
- var e_93 = ue_1_1.value;
1671
- i.ShaderStore.IncludesShadersStore[e_93.name] || (i.ShaderStore.IncludesShadersStore[e_93.name] = e_93.shader);
1681
+ for (var de_1 = __values(de), de_1_1 = de_1.next(); !de_1_1.done; de_1_1 = de_1.next()) {
1682
+ var e_94 = de_1_1.value;
1683
+ i.ShaderStore.IncludesShadersStore[e_94.name] || (i.ShaderStore.IncludesShadersStore[e_94.name] = e_94.shader);
1672
1684
  }
1673
1685
  }
1674
1686
  catch (e_6_1) { e_6 = { error: e_6_1 }; }
1675
1687
  finally {
1676
1688
  try {
1677
- if (ue_1_1 && !ue_1_1.done && (_g = ue_1.return)) _g.call(ue_1);
1689
+ if (de_1_1 && !de_1_1.done && (_g = de_1.return)) _g.call(de_1);
1678
1690
  }
1679
1691
  finally { if (e_6) throw e_6.error; }
1680
1692
  }
1681
- var de = { __proto__: null, firePixelShader: { name: fe, shader: le } };
1682
- var ce = "fireVertexShader", he = "attribute position: vec3f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\nuniform time: f32;uniform speed: f32;\n#ifdef DIFFUSE\nvarying vDistortionCoords1: vec2f;varying vDistortionCoords2: vec2f;varying vDistortionCoords3: vec2f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSE\nvertexOutputs.vDiffuseUV=vec2f(vertexInputs.uv.x,vertexInputs.uv.y-0.2);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#ifdef DIFFUSE\nvar layerSpeed: vec3f= vec3f(-0.2,-0.52,-0.1)*uniforms.speed;vertexOutputs.vDistortionCoords1=vec2f(vertexInputs.uv.x,vertexInputs.uv.y+layerSpeed.x*uniforms.time/1000.0);vertexOutputs.vDistortionCoords2=vec2f(vertexInputs.uv.x,vertexInputs.uv.y+layerSpeed.y*uniforms.time/1000.0);vertexOutputs.vDistortionCoords3=vec2f(vertexInputs.uv.x,vertexInputs.uv.y+layerSpeed.z*uniforms.time/1000.0);\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1683
- i.ShaderStore.ShadersStoreWGSL[ce] || (i.ShaderStore.ShadersStoreWGSL[ce] = he);
1684
- var me = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.vertexColorMixingWGSL];
1693
+ var ce = { __proto__: null, firePixelShader: { name: le, shader: ue } };
1694
+ var he = "fireVertexShader", me = "attribute position: vec3f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\nuniform time: f32;uniform speed: f32;\n#ifdef DIFFUSE\nvarying vDistortionCoords1: vec2f;varying vDistortionCoords2: vec2f;varying vDistortionCoords3: vec2f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSE\nvertexOutputs.vDiffuseUV=vec2f(vertexInputs.uv.x,vertexInputs.uv.y-0.2);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<vertexColorMixing>\n#ifdef DIFFUSE\nvar layerSpeed: vec3f= vec3f(-0.2,-0.52,-0.1)*uniforms.speed;vertexOutputs.vDistortionCoords1=vec2f(vertexInputs.uv.x,vertexInputs.uv.y+layerSpeed.x*uniforms.time/1000.0);vertexOutputs.vDistortionCoords2=vec2f(vertexInputs.uv.x,vertexInputs.uv.y+layerSpeed.y*uniforms.time/1000.0);vertexOutputs.vDistortionCoords3=vec2f(vertexInputs.uv.x,vertexInputs.uv.y+layerSpeed.z*uniforms.time/1000.0);\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1695
+ i.ShaderStore.ShadersStoreWGSL[he] || (i.ShaderStore.ShadersStoreWGSL[he] = me);
1696
+ var ve = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.vertexColorMixingWGSL];
1685
1697
  try {
1686
- for (var me_1 = __values(me), me_1_1 = me_1.next(); !me_1_1.done; me_1_1 = me_1.next()) {
1687
- var e_94 = me_1_1.value;
1688
- i.ShaderStore.IncludesShadersStoreWGSL[e_94.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_94.name] = e_94.shader);
1698
+ for (var ve_1 = __values(ve), ve_1_1 = ve_1.next(); !ve_1_1.done; ve_1_1 = ve_1.next()) {
1699
+ var e_95 = ve_1_1.value;
1700
+ i.ShaderStore.IncludesShadersStoreWGSL[e_95.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_95.name] = e_95.shader);
1689
1701
  }
1690
1702
  }
1691
1703
  catch (e_7_1) { e_7 = { error: e_7_1 }; }
1692
1704
  finally {
1693
1705
  try {
1694
- if (me_1_1 && !me_1_1.done && (_h = me_1.return)) _h.call(me_1);
1706
+ if (ve_1_1 && !ve_1_1.done && (_h = ve_1.return)) _h.call(ve_1);
1695
1707
  }
1696
1708
  finally { if (e_7) throw e_7.error; }
1697
1709
  }
1698
- var ve = { __proto__: null, fireVertexShaderWGSL: { name: ce, shader: he } };
1699
- var ge = "firePixelShader", pe = "uniform vEyePosition: vec4f;varying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\nvar distortionSamplerSampler: sampler;var distortionSampler: texture_2d<f32>;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;\n#ifdef DIFFUSE\nvarying vDistortionCoords1: vec2f;varying vDistortionCoords2: vec2f;varying vDistortionCoords3: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfn bx2(x: vec4f)->vec4f\n{return vec4f(2.0)*x- vec4f(1.0);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var alpha: f32=1.0;\n#ifdef DIFFUSE\nlet distortionAmount0: f32=0.092;let distortionAmount1: f32=0.092;let distortionAmount2: f32=0.092;var heightAttenuation: vec2f= vec2f(0.3,0.39);var noise0: vec4f=textureSample(distortionSampler,distortionSamplerSampler,fragmentInputs.vDistortionCoords1);var noise1: vec4f=textureSample(distortionSampler,distortionSamplerSampler,fragmentInputs.vDistortionCoords2);var noise2: vec4f=textureSample(distortionSampler,distortionSamplerSampler,fragmentInputs.vDistortionCoords3);var noiseSum: vec4f=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;var perturbedBaseCoords: vec4f= vec4f(fragmentInputs.vDiffuseUV,0.0,1.0)+noiseSum*(fragmentInputs.vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);var opacityColor: vec4f=textureSample(opacitySampler,opacitySamplerSampler,perturbedBaseCoords.xy);\n#ifdef ALPHATEST\nif (opacityColor.r<0.1) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,perturbedBaseCoords.xy)*2.0;baseColor=baseColor*opacityColor;baseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(1.0,1.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar color: vec4f= vec4f(baseColor.rgb,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1700
- i.ShaderStore.ShadersStoreWGSL[ge] || (i.ShaderStore.ShadersStoreWGSL[ge] = pe);
1701
- var Se = [i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1710
+ var ge = { __proto__: null, fireVertexShaderWGSL: { name: he, shader: me } };
1711
+ var pe = "firePixelShader", Se = "uniform vEyePosition: vec4f;varying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\nvar distortionSamplerSampler: sampler;var distortionSampler: texture_2d<f32>;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;\n#ifdef DIFFUSE\nvarying vDistortionCoords1: vec2f;varying vDistortionCoords2: vec2f;varying vDistortionCoords3: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfn bx2(x: vec4f)->vec4f\n{return vec4f(2.0)*x- vec4f(1.0);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var alpha: f32=1.0;\n#ifdef DIFFUSE\nlet distortionAmount0: f32=0.092;let distortionAmount1: f32=0.092;let distortionAmount2: f32=0.092;var heightAttenuation: vec2f= vec2f(0.3,0.39);var noise0: vec4f=textureSample(distortionSampler,distortionSamplerSampler,fragmentInputs.vDistortionCoords1);var noise1: vec4f=textureSample(distortionSampler,distortionSamplerSampler,fragmentInputs.vDistortionCoords2);var noise2: vec4f=textureSample(distortionSampler,distortionSamplerSampler,fragmentInputs.vDistortionCoords3);var noiseSum: vec4f=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;var perturbedBaseCoords: vec4f= vec4f(fragmentInputs.vDiffuseUV,0.0,1.0)+noiseSum*(fragmentInputs.vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);var opacityColor: vec4f=textureSample(opacitySampler,opacitySamplerSampler,perturbedBaseCoords.xy);\n#ifdef ALPHATEST\nif (opacityColor.r<0.1) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,perturbedBaseCoords.xy)*2.0;baseColor=baseColor*opacityColor;baseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(1.0,1.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar color: vec4f= vec4f(baseColor.rgb,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1712
+ i.ShaderStore.ShadersStoreWGSL[pe] || (i.ShaderStore.ShadersStoreWGSL[pe] = Se);
1713
+ var xe = [i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1702
1714
  try {
1703
- for (var Se_1 = __values(Se), Se_1_1 = Se_1.next(); !Se_1_1.done; Se_1_1 = Se_1.next()) {
1704
- var e_95 = Se_1_1.value;
1705
- i.ShaderStore.IncludesShadersStoreWGSL[e_95.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_95.name] = e_95.shader);
1715
+ for (var xe_1 = __values(xe), xe_1_1 = xe_1.next(); !xe_1_1.done; xe_1_1 = xe_1.next()) {
1716
+ var e_96 = xe_1_1.value;
1717
+ i.ShaderStore.IncludesShadersStoreWGSL[e_96.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_96.name] = e_96.shader);
1706
1718
  }
1707
1719
  }
1708
1720
  catch (e_8_1) { e_8 = { error: e_8_1 }; }
1709
1721
  finally {
1710
1722
  try {
1711
- if (Se_1_1 && !Se_1_1.done && (_j = Se_1.return)) _j.call(Se_1);
1723
+ if (xe_1_1 && !xe_1_1.done && (_j = xe_1.return)) _j.call(xe_1);
1712
1724
  }
1713
1725
  finally { if (e_8) throw e_8.error; }
1714
1726
  }
1715
- var xe = { __proto__: null, firePixelShaderWGSL: { name: ge, shader: pe } };
1716
- var Te = "furVertexShader", _e = "precision highp float;attribute vec3 position;attribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\nuniform float furLength;uniform float furAngle;\n#ifdef HIGHLEVEL\nuniform float furOffset;uniform vec3 furGravity;uniform float furTime;uniform float furSpacing;uniform float furDensity;\n#endif\n#ifdef HEIGHTMAP\nuniform sampler2D heightTexture;\n#endif\n#ifdef HIGHLEVEL\nvarying vec2 vFurUV;\n#endif\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\nvarying float vfur_length;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nfloat Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nfloat r=Rand(position);\n#ifdef HEIGHTMAP\n#if __VERSION__>100\nvfur_length=furLength*texture(heightTexture,uv).x;\n#else\nvfur_length=furLength*texture2D(heightTexture,uv).r;\n#endif\n#else \nvfur_length=(furLength*r);\n#endif\nvec3 tangent1=vec3(normal.y,-normal.x,0);vec3 tangent2=vec3(-normal.z,0,normal.x);r=Rand(tangent1*r);float J=(2.0+4.0*r);r=Rand(tangent2*r);float K=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);vec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle);\n#ifdef HIGHLEVEL\nvec3 forceDirection=vec3(0.0,0.0,0.0);forceDirection.x=sin(furTime+position.x*0.05)*0.2;forceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;forceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;vec3 displacement=vec3(0.0,0.0,0.0);displacement=furGravity+forceDirection;float displacementFactor=pow(furOffset,3.0);vec3 aNormal=normal;aNormal.xyz+=displacement*displacementFactor;newPosition=vec3(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*furOffset*furSpacing);\n#endif\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\ngl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#ifdef HIGHLEVEL\nvFurUV=vDiffuseUV*furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvFurUV=uv*furDensity;\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1717
- i.ShaderStore.ShadersStore[Te] || (i.ShaderStore.ShadersStore[Te] = _e);
1718
- var Ce = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
1727
+ var Te = { __proto__: null, firePixelShaderWGSL: { name: pe, shader: Se } };
1728
+ var _e = "furVertexShader", Ce = "precision highp float;attribute vec3 position;attribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\nuniform float furLength;uniform float furAngle;\n#ifdef HIGHLEVEL\nuniform float furOffset;uniform vec3 furGravity;uniform float furTime;uniform float furSpacing;uniform float furDensity;\n#endif\n#ifdef HEIGHTMAP\nuniform sampler2D heightTexture;\n#endif\n#ifdef HIGHLEVEL\nvarying vec2 vFurUV;\n#endif\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\nvarying float vfur_length;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nfloat Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nfloat r=Rand(position);\n#ifdef HEIGHTMAP\n#if __VERSION__>100\nvfur_length=furLength*texture(heightTexture,uv).x;\n#else\nvfur_length=furLength*texture2D(heightTexture,uv).r;\n#endif\n#else \nvfur_length=(furLength*r);\n#endif\nvec3 tangent1=vec3(normal.y,-normal.x,0);vec3 tangent2=vec3(-normal.z,0,normal.x);r=Rand(tangent1*r);float J=(2.0+4.0*r);r=Rand(tangent2*r);float K=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);vec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle);\n#ifdef HIGHLEVEL\nvec3 forceDirection=vec3(0.0,0.0,0.0);forceDirection.x=sin(furTime+position.x*0.05)*0.2;forceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;forceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;vec3 displacement=vec3(0.0,0.0,0.0);displacement=furGravity+forceDirection;float displacementFactor=pow(furOffset,3.0);vec3 aNormal=normal;aNormal.xyz+=displacement*displacementFactor;newPosition=vec3(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*furOffset*furSpacing);\n#endif\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\ngl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#ifdef HIGHLEVEL\nvFurUV=vDiffuseUV*furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvFurUV=uv*furDensity;\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1729
+ i.ShaderStore.ShadersStore[_e] || (i.ShaderStore.ShadersStore[_e] = Ce);
1730
+ var Ee = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
1719
1731
  try {
1720
- for (var Ce_1 = __values(Ce), Ce_1_1 = Ce_1.next(); !Ce_1_1.done; Ce_1_1 = Ce_1.next()) {
1721
- var e_96 = Ce_1_1.value;
1722
- i.ShaderStore.IncludesShadersStore[e_96.name] || (i.ShaderStore.IncludesShadersStore[e_96.name] = e_96.shader);
1732
+ for (var Ee_1 = __values(Ee), Ee_1_1 = Ee_1.next(); !Ee_1_1.done; Ee_1_1 = Ee_1.next()) {
1733
+ var e_97 = Ee_1_1.value;
1734
+ i.ShaderStore.IncludesShadersStore[e_97.name] || (i.ShaderStore.IncludesShadersStore[e_97.name] = e_97.shader);
1723
1735
  }
1724
1736
  }
1725
1737
  catch (e_9_1) { e_9 = { error: e_9_1 }; }
1726
1738
  finally {
1727
1739
  try {
1728
- if (Ce_1_1 && !Ce_1_1.done && (_k = Ce_1.return)) _k.call(Ce_1);
1740
+ if (Ee_1_1 && !Ee_1_1.done && (_k = Ee_1.return)) _k.call(Ee_1);
1729
1741
  }
1730
1742
  finally { if (e_9) throw e_9.error; }
1731
1743
  }
1732
- var Ee = { __proto__: null, furVertexShader: { name: Te, shader: _e } };
1733
- var Le = "furPixelShader", Pe = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 furColor;uniform float furLength;varying vec3 vPositionW;varying float vfur_length;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef HIGHLEVEL\nuniform float furOffset;uniform float furOcclusion;uniform sampler2D furTexture;varying vec2 vFurUV;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<fogFragmentDeclaration>\n#include<clipPlaneFragmentDeclaration>\nfloat Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=furColor;vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor*=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\nvec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g<furOffset) {discard;}\nfloat occlusion=mix(0.0,furTextureColor.b*1.2,furOffset);baseColor=vec4(baseColor.xyz*max(occlusion,furOcclusion),1.1-furOffset);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0);\n#ifdef HIGHLEVEL\nvec4 color=vec4(finalDiffuse,alpha);\n#else\nfloat r=vfur_length/furLength*0.5;vec4 color=vec4(finalDiffuse*(0.5+r),alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1734
- i.ShaderStore.ShadersStore[Le] || (i.ShaderStore.ShadersStore[Le] = Pe);
1735
- var Ie = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.logDepthDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.fogFragmentDeclaration, i.clipPlaneFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1744
+ var Le = { __proto__: null, furVertexShader: { name: _e, shader: Ce } };
1745
+ var Pe = "furPixelShader", Ie = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 furColor;uniform float furLength;varying vec3 vPositionW;varying float vfur_length;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef HIGHLEVEL\nuniform float furOffset;uniform float furOcclusion;uniform sampler2D furTexture;varying vec2 vFurUV;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<fogFragmentDeclaration>\n#include<clipPlaneFragmentDeclaration>\nfloat Rand(vec3 rv) {float x=dot(rv,vec3(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=furColor;vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor*=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\nvec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g<furOffset) {discard;}\nfloat occlusion=mix(0.0,furTextureColor.b*1.2,furOffset);baseColor=vec4(baseColor.xyz*max(occlusion,furOcclusion),1.1-furOffset);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0);\n#ifdef HIGHLEVEL\nvec4 color=vec4(finalDiffuse,alpha);\n#else\nfloat r=vfur_length/furLength*0.5;vec4 color=vec4(finalDiffuse*(0.5+r),alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1746
+ i.ShaderStore.ShadersStore[Pe] || (i.ShaderStore.ShadersStore[Pe] = Ie);
1747
+ var De = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.logDepthDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.fogFragmentDeclaration, i.clipPlaneFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1736
1748
  try {
1737
- for (var Ie_1 = __values(Ie), Ie_1_1 = Ie_1.next(); !Ie_1_1.done; Ie_1_1 = Ie_1.next()) {
1738
- var e_97 = Ie_1_1.value;
1739
- i.ShaderStore.IncludesShadersStore[e_97.name] || (i.ShaderStore.IncludesShadersStore[e_97.name] = e_97.shader);
1749
+ for (var De_1 = __values(De), De_1_1 = De_1.next(); !De_1_1.done; De_1_1 = De_1.next()) {
1750
+ var e_98 = De_1_1.value;
1751
+ i.ShaderStore.IncludesShadersStore[e_98.name] || (i.ShaderStore.IncludesShadersStore[e_98.name] = e_98.shader);
1740
1752
  }
1741
1753
  }
1742
1754
  catch (e_10_1) { e_10 = { error: e_10_1 }; }
1743
1755
  finally {
1744
1756
  try {
1745
- if (Ie_1_1 && !Ie_1_1.done && (_l = Ie_1.return)) _l.call(Ie_1);
1757
+ if (De_1_1 && !De_1_1.done && (_l = De_1.return)) _l.call(De_1);
1746
1758
  }
1747
1759
  finally { if (e_10) throw e_10.error; }
1748
1760
  }
1749
- var De = { __proto__: null, furPixelShader: { name: Le, shader: Pe } };
1750
- var be = "furVertexShader", Ae = "attribute position: vec3f;attribute normal: vec3f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\nuniform furLength: f32;uniform furAngle: f32;\n#ifdef HIGHLEVEL\nuniform furOffset: f32;uniform furGravity: vec3f;uniform furTime: f32;uniform furSpacing: f32;uniform furDensity: f32;\n#endif\n#ifdef HEIGHTMAP\nvar heightTextureSampler: sampler;var heightTexture: texture_2d<f32>;\n#endif\n#ifdef HIGHLEVEL\nvarying vFurUV: vec2f;\n#endif\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\nvarying vfur_length: f32;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\nfn Rand(rv: vec3f)->f32 {var x: f32=dot(rv, vec3f(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar r: f32=Rand(vertexInputs.position);\n#ifdef HEIGHTMAP\nvertexOutputs.vfur_length=uniforms.furLength*textureSampleLevel(heightTexture,heightTextureSampler,vertexInputs.uv,0.).x;\n#else\nvertexOutputs.vfur_length=(uniforms.furLength*r);\n#endif\nvar tangent1: vec3f= vec3f(vertexInputs.normal.y,-vertexInputs.normal.x,0);var tangent2: vec3f= vec3f(-vertexInputs.normal.z,0,vertexInputs.normal.x);r=Rand(tangent1*r);var J: f32=(2.0+4.0*r);r=Rand(tangent2*r);var K: f32=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);var newPosition: vec3f=vertexInputs.position+vertexInputs.normal*vertexOutputs.vfur_length*cos(uniforms.furAngle)+tangent1*vertexOutputs.vfur_length*sin(uniforms.furAngle);\n#ifdef HIGHLEVEL\nvar forceDirection: vec3f= vec3f(0.0,0.0,0.0);forceDirection.x=sin(uniforms.furTime+vertexInputs.position.x*0.05)*0.2;forceDirection.y=cos(uniforms.furTime*0.7+vertexInputs.position.y*0.04)*0.2;forceDirection.z=sin(uniforms.furTime*0.7+vertexInputs.position.z*0.04)*0.2;var displacement: vec3f= vec3f(0.0,0.0,0.0);displacement=uniforms.furGravity+forceDirection;var displacementFactor: f32=pow(uniforms.furOffset,3.0);var aNormal: vec3f=vertexInputs.normal;aNormal=vec3f(aNormal.xyz+displacement*displacementFactor);newPosition= vec3f(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*uniforms.furOffset*uniforms.furSpacing);\n#endif\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\nvertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(newPosition,1.0);var worldPos: vec4f=finalWorld* vec4f(newPosition,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#ifdef HIGHLEVEL\nvertexOutputs.vFurUV=vertexOutputs.vDiffuseUV*uniforms.furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvertexOutputs.vFurUV=uv*uniforms.furDensity;\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1751
- i.ShaderStore.ShadersStoreWGSL[be] || (i.ShaderStore.ShadersStoreWGSL[be] = Ae);
1752
- var Fe = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
1761
+ var be = { __proto__: null, furPixelShader: { name: Pe, shader: Ie } };
1762
+ var Ae = "furVertexShader", Fe = "attribute position: vec3f;attribute normal: vec3f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\nuniform furLength: f32;uniform furAngle: f32;\n#ifdef HIGHLEVEL\nuniform furOffset: f32;uniform furGravity: vec3f;uniform furTime: f32;uniform furSpacing: f32;uniform furDensity: f32;\n#endif\n#ifdef HEIGHTMAP\nvar heightTextureSampler: sampler;var heightTexture: texture_2d<f32>;\n#endif\n#ifdef HIGHLEVEL\nvarying vFurUV: vec2f;\n#endif\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\nvarying vfur_length: f32;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\nfn Rand(rv: vec3f)->f32 {var x: f32=dot(rv, vec3f(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar r: f32=Rand(vertexInputs.position);\n#ifdef HEIGHTMAP\nvertexOutputs.vfur_length=uniforms.furLength*textureSampleLevel(heightTexture,heightTextureSampler,vertexInputs.uv,0.).x;\n#else\nvertexOutputs.vfur_length=(uniforms.furLength*r);\n#endif\nvar tangent1: vec3f= vec3f(vertexInputs.normal.y,-vertexInputs.normal.x,0);var tangent2: vec3f= vec3f(-vertexInputs.normal.z,0,vertexInputs.normal.x);r=Rand(tangent1*r);var J: f32=(2.0+4.0*r);r=Rand(tangent2*r);var K: f32=(2.0+2.0*r);tangent1=tangent1*J+tangent2*K;tangent1=normalize(tangent1);var newPosition: vec3f=vertexInputs.position+vertexInputs.normal*vertexOutputs.vfur_length*cos(uniforms.furAngle)+tangent1*vertexOutputs.vfur_length*sin(uniforms.furAngle);\n#ifdef HIGHLEVEL\nvar forceDirection: vec3f= vec3f(0.0,0.0,0.0);forceDirection.x=sin(uniforms.furTime+vertexInputs.position.x*0.05)*0.2;forceDirection.y=cos(uniforms.furTime*0.7+vertexInputs.position.y*0.04)*0.2;forceDirection.z=sin(uniforms.furTime*0.7+vertexInputs.position.z*0.04)*0.2;var displacement: vec3f= vec3f(0.0,0.0,0.0);displacement=uniforms.furGravity+forceDirection;var displacementFactor: f32=pow(uniforms.furOffset,3.0);var aNormal: vec3f=vertexInputs.normal;aNormal=vec3f(aNormal.xyz+displacement*displacementFactor);newPosition= vec3f(newPosition.x,newPosition.y,newPosition.z)+(normalize(aNormal)*uniforms.furOffset*uniforms.furSpacing);\n#endif\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\nvertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(newPosition,1.0);var worldPos: vec4f=finalWorld* vec4f(newPosition,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#ifdef HIGHLEVEL\nvertexOutputs.vFurUV=vertexOutputs.vDiffuseUV*uniforms.furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvertexOutputs.vFurUV=uv*uniforms.furDensity;\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1763
+ i.ShaderStore.ShadersStoreWGSL[Ae] || (i.ShaderStore.ShadersStoreWGSL[Ae] = Fe);
1764
+ var Oe = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
1753
1765
  try {
1754
- for (var Fe_1 = __values(Fe), Fe_1_1 = Fe_1.next(); !Fe_1_1.done; Fe_1_1 = Fe_1.next()) {
1755
- var e_98 = Fe_1_1.value;
1756
- i.ShaderStore.IncludesShadersStoreWGSL[e_98.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_98.name] = e_98.shader);
1766
+ for (var Oe_1 = __values(Oe), Oe_1_1 = Oe_1.next(); !Oe_1_1.done; Oe_1_1 = Oe_1.next()) {
1767
+ var e_99 = Oe_1_1.value;
1768
+ i.ShaderStore.IncludesShadersStoreWGSL[e_99.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_99.name] = e_99.shader);
1757
1769
  }
1758
1770
  }
1759
1771
  catch (e_11_1) { e_11 = { error: e_11_1 }; }
1760
1772
  finally {
1761
1773
  try {
1762
- if (Fe_1_1 && !Fe_1_1.done && (_m = Fe_1.return)) _m.call(Fe_1);
1774
+ if (Oe_1_1 && !Oe_1_1.done && (_m = Oe_1.return)) _m.call(Oe_1);
1763
1775
  }
1764
1776
  finally { if (e_11) throw e_11.error; }
1765
1777
  }
1766
- var Oe = { __proto__: null, furVertexShaderWGSL: { name: be, shader: Ae } };
1767
- var Ne = "furPixelShader", Me = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;uniform furColor: vec4f;uniform furLength: f32;varying vPositionW: vec3f;varying vfur_length: f32;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef HIGHLEVEL\nuniform furOffset: f32;uniform furOcclusion: f32;var furTextureSampler: sampler;var furTexture: texture_2d<f32>;varying vFurUV: vec2f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<fogFragmentDeclaration>\n#include<clipPlaneFragmentDeclaration>\nfn Rand(rv: vec3f)->f32 {var x: f32=dot(rv, vec3f(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f=uniforms.furColor;var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=baseColor*textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\nvar furTextureColor: vec4f=textureSample(furTexture,furTextureSampler, vec2f(fragmentInputs.vFurUV.x,fragmentInputs.vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g<uniforms.furOffset) {discard;}\nvar occlusion: f32=mix(0.0,furTextureColor.b*1.2,uniforms.furOffset);baseColor= vec4f(baseColor.xyz*max(occlusion,uniforms.furOcclusion),1.1-uniforms.furOffset);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase.rgb*baseColor.rgb,vec3f(0.0),vec3f(1.0));\n#ifdef HIGHLEVEL\nvar color: vec4f= vec4f(finalDiffuse,alpha);\n#else\nvar rr: f32=fragmentInputs.vfur_length/uniforms.furLength*0.5;var color: vec4f= vec4f(finalDiffuse*(0.5+rr),alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1768
- i.ShaderStore.ShadersStoreWGSL[Ne] || (i.ShaderStore.ShadersStoreWGSL[Ne] = Me);
1769
- var Re = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1778
+ var Re = { __proto__: null, furVertexShaderWGSL: { name: Ae, shader: Fe } };
1779
+ var Me = "furPixelShader", Ne = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;uniform furColor: vec4f;uniform furLength: f32;varying vPositionW: vec3f;varying vfur_length: f32;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef HIGHLEVEL\nuniform furOffset: f32;uniform furOcclusion: f32;var furTextureSampler: sampler;var furTexture: texture_2d<f32>;varying vFurUV: vec2f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<fogFragmentDeclaration>\n#include<clipPlaneFragmentDeclaration>\nfn Rand(rv: vec3f)->f32 {var x: f32=dot(rv, vec3f(12.9898,78.233,24.65487));return fract(sin(x)*43758.5453);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f=uniforms.furColor;var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=baseColor*textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\nvar furTextureColor: vec4f=textureSample(furTexture,furTextureSampler, vec2f(fragmentInputs.vFurUV.x,fragmentInputs.vFurUV.y));if (furTextureColor.a<=0.0 || furTextureColor.g<uniforms.furOffset) {discard;}\nvar occlusion: f32=mix(0.0,furTextureColor.b*1.2,uniforms.furOffset);baseColor= vec4f(baseColor.xyz*max(occlusion,uniforms.furOcclusion),1.1-uniforms.furOffset);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase.rgb*baseColor.rgb,vec3f(0.0),vec3f(1.0));\n#ifdef HIGHLEVEL\nvar color: vec4f= vec4f(finalDiffuse,alpha);\n#else\nvar rr: f32=fragmentInputs.vfur_length/uniforms.furLength*0.5;var color: vec4f= vec4f(finalDiffuse*(0.5+rr),alpha);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1780
+ i.ShaderStore.ShadersStoreWGSL[Me] || (i.ShaderStore.ShadersStoreWGSL[Me] = Ne);
1781
+ var ye = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1770
1782
  try {
1771
- for (var Re_1 = __values(Re), Re_1_1 = Re_1.next(); !Re_1_1.done; Re_1_1 = Re_1.next()) {
1772
- var e_99 = Re_1_1.value;
1773
- i.ShaderStore.IncludesShadersStoreWGSL[e_99.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_99.name] = e_99.shader);
1783
+ for (var ye_1 = __values(ye), ye_1_1 = ye_1.next(); !ye_1_1.done; ye_1_1 = ye_1.next()) {
1784
+ var e_100 = ye_1_1.value;
1785
+ i.ShaderStore.IncludesShadersStoreWGSL[e_100.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_100.name] = e_100.shader);
1774
1786
  }
1775
1787
  }
1776
1788
  catch (e_12_1) { e_12 = { error: e_12_1 }; }
1777
1789
  finally {
1778
1790
  try {
1779
- if (Re_1_1 && !Re_1_1.done && (_o = Re_1.return)) _o.call(Re_1);
1791
+ if (ye_1_1 && !ye_1_1.done && (_o = ye_1.return)) _o.call(ye_1);
1780
1792
  }
1781
1793
  finally { if (e_12) throw e_12.error; }
1782
1794
  }
1783
- var ye = { __proto__: null, furPixelShaderWGSL: { name: Ne, shader: Me } };
1784
- var Ve = "gradientVertexShader", Ue = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;varying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);vPosition=position;\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1785
- i.ShaderStore.ShadersStore[Ve] || (i.ShaderStore.ShadersStore[Ve] = Ue);
1786
- var we = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
1795
+ var Ve = { __proto__: null, furPixelShaderWGSL: { name: Me, shader: Ne } };
1796
+ var Ue = "gradientVertexShader", we = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;varying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);vPosition=position;\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1797
+ i.ShaderStore.ShadersStore[Ue] || (i.ShaderStore.ShadersStore[Ue] = we);
1798
+ var Ge = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
1787
1799
  try {
1788
- for (var we_1 = __values(we), we_1_1 = we_1.next(); !we_1_1.done; we_1_1 = we_1.next()) {
1789
- var e_100 = we_1_1.value;
1790
- i.ShaderStore.IncludesShadersStore[e_100.name] || (i.ShaderStore.IncludesShadersStore[e_100.name] = e_100.shader);
1800
+ for (var Ge_1 = __values(Ge), Ge_1_1 = Ge_1.next(); !Ge_1_1.done; Ge_1_1 = Ge_1.next()) {
1801
+ var e_101 = Ge_1_1.value;
1802
+ i.ShaderStore.IncludesShadersStore[e_101.name] || (i.ShaderStore.IncludesShadersStore[e_101.name] = e_101.shader);
1791
1803
  }
1792
1804
  }
1793
1805
  catch (e_13_1) { e_13 = { error: e_13_1 }; }
1794
1806
  finally {
1795
1807
  try {
1796
- if (we_1_1 && !we_1_1.done && (_p = we_1.return)) _p.call(we_1);
1808
+ if (Ge_1_1 && !Ge_1_1.done && (_p = Ge_1.return)) _p.call(Ge_1);
1797
1809
  }
1798
1810
  finally { if (e_13) throw e_13.error; }
1799
1811
  }
1800
- var Ge = { __proto__: null, gradientVertexShader: { name: Ve, shader: Ue } };
1801
- var We = "gradientPixelShader", Be = "precision highp float;uniform vec4 vEyePosition;uniform vec4 topColor;uniform vec4 bottomColor;uniform float offset;uniform float scale;uniform float smoothness;varying vec3 vPositionW;varying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);float h=vPosition.y*scale+offset;float mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));vec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));vec3 diffuseColor=baseColor.rgb;float alpha=baseColor.a;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef EMISSIVE\nvec3 diffuseBase=baseColor.rgb;\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);\n#endif\nlightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
1802
- i.ShaderStore.ShadersStore[We] || (i.ShaderStore.ShadersStore[We] = Be);
1803
- var ze = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1812
+ var We = { __proto__: null, gradientVertexShader: { name: Ue, shader: we } };
1813
+ var Be = "gradientPixelShader", ze = "precision highp float;uniform vec4 vEyePosition;uniform vec4 topColor;uniform vec4 bottomColor;uniform float offset;uniform float scale;uniform float smoothness;varying vec3 vPositionW;varying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);float h=vPosition.y*scale+offset;float mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));vec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));vec3 diffuseColor=baseColor.rgb;float alpha=baseColor.a;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef EMISSIVE\nvec3 diffuseBase=baseColor.rgb;\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);\n#endif\nlightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
1814
+ i.ShaderStore.ShadersStore[Be] || (i.ShaderStore.ShadersStore[Be] = ze);
1815
+ var He = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1804
1816
  try {
1805
- for (var ze_1 = __values(ze), ze_1_1 = ze_1.next(); !ze_1_1.done; ze_1_1 = ze_1.next()) {
1806
- var e_101 = ze_1_1.value;
1807
- i.ShaderStore.IncludesShadersStore[e_101.name] || (i.ShaderStore.IncludesShadersStore[e_101.name] = e_101.shader);
1817
+ for (var He_1 = __values(He), He_1_1 = He_1.next(); !He_1_1.done; He_1_1 = He_1.next()) {
1818
+ var e_102 = He_1_1.value;
1819
+ i.ShaderStore.IncludesShadersStore[e_102.name] || (i.ShaderStore.IncludesShadersStore[e_102.name] = e_102.shader);
1808
1820
  }
1809
1821
  }
1810
1822
  catch (e_14_1) { e_14 = { error: e_14_1 }; }
1811
1823
  finally {
1812
1824
  try {
1813
- if (ze_1_1 && !ze_1_1.done && (_q = ze_1.return)) _q.call(ze_1);
1825
+ if (He_1_1 && !He_1_1.done && (_q = He_1.return)) _q.call(He_1);
1814
1826
  }
1815
1827
  finally { if (e_14) throw e_14.error; }
1816
1828
  }
1817
- var He = { __proto__: null, gradientPixelShader: { name: We, shader: Be } };
1818
- var ke = "gradientVertexShader", Xe = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;varying vPosition: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;vertexOutputs.vPosition=vertexInputs.position;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1819
- i.ShaderStore.ShadersStoreWGSL[ke] || (i.ShaderStore.ShadersStoreWGSL[ke] = Xe);
1820
- var je = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
1829
+ var ke = { __proto__: null, gradientPixelShader: { name: Be, shader: ze } };
1830
+ var Xe = "gradientVertexShader", je = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;varying vPosition: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;vertexOutputs.vPosition=vertexInputs.position;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1831
+ i.ShaderStore.ShadersStoreWGSL[Xe] || (i.ShaderStore.ShadersStoreWGSL[Xe] = je);
1832
+ var Ye = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
1821
1833
  try {
1822
- for (var je_1 = __values(je), je_1_1 = je_1.next(); !je_1_1.done; je_1_1 = je_1.next()) {
1823
- var e_102 = je_1_1.value;
1824
- i.ShaderStore.IncludesShadersStoreWGSL[e_102.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_102.name] = e_102.shader);
1834
+ for (var Ye_1 = __values(Ye), Ye_1_1 = Ye_1.next(); !Ye_1_1.done; Ye_1_1 = Ye_1.next()) {
1835
+ var e_103 = Ye_1_1.value;
1836
+ i.ShaderStore.IncludesShadersStoreWGSL[e_103.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_103.name] = e_103.shader);
1825
1837
  }
1826
1838
  }
1827
1839
  catch (e_15_1) { e_15 = { error: e_15_1 }; }
1828
1840
  finally {
1829
1841
  try {
1830
- if (je_1_1 && !je_1_1.done && (_r = je_1.return)) _r.call(je_1);
1842
+ if (Ye_1_1 && !Ye_1_1.done && (_r = Ye_1.return)) _r.call(Ye_1);
1831
1843
  }
1832
1844
  finally { if (e_15) throw e_15.error; }
1833
1845
  }
1834
- var Ze = { __proto__: null, gradientVertexShaderWGSL: { name: ke, shader: Xe } };
1835
- var Ye = "gradientPixelShader", Ke = "uniform vEyePosition: vec4f;uniform topColor: vec4f;uniform bottomColor: vec4f;uniform offset: f32;uniform scale: f32;uniform smoothness: f32;varying vPositionW: vec3f;varying vPosition: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0]\n#include<lightUboDeclaration>[1]\n#include<lightUboDeclaration>[2]\n#include<lightUboDeclaration>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var h: f32=fragmentInputs.vPosition.y*uniforms.scale+uniforms.offset;var mysmoothness: f32=clamp(uniforms.smoothness,0.01,max(uniforms.smoothness,10.));var baseColor: vec4f=mix(uniforms.bottomColor,uniforms.topColor,vec4f(max(pow(max(h,0.0),mysmoothness),0.0)));var diffuseColor: vec3f=baseColor.rgb;var alpha: f32=baseColor.a;\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef EMISSIVE\nvar diffuseBase: vec3f=baseColor.rgb;\n#else\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);\n#endif\nvar info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1836
- i.ShaderStore.ShadersStoreWGSL[Ye] || (i.ShaderStore.ShadersStoreWGSL[Ye] = Ke);
1837
- var qe = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1846
+ var Ze = { __proto__: null, gradientVertexShaderWGSL: { name: Xe, shader: je } };
1847
+ var Ke = "gradientPixelShader", qe = "uniform vEyePosition: vec4f;uniform topColor: vec4f;uniform bottomColor: vec4f;uniform offset: f32;uniform scale: f32;uniform smoothness: f32;varying vPositionW: vec3f;varying vPosition: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0]\n#include<lightUboDeclaration>[1]\n#include<lightUboDeclaration>[2]\n#include<lightUboDeclaration>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var h: f32=fragmentInputs.vPosition.y*uniforms.scale+uniforms.offset;var mysmoothness: f32=clamp(uniforms.smoothness,0.01,max(uniforms.smoothness,10.));var baseColor: vec4f=mix(uniforms.bottomColor,uniforms.topColor,vec4f(max(pow(max(h,0.0),mysmoothness),0.0)));var diffuseColor: vec3f=baseColor.rgb;var alpha: f32=baseColor.a;\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef EMISSIVE\nvar diffuseBase: vec3f=baseColor.rgb;\n#else\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);\n#endif\nvar info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1848
+ i.ShaderStore.ShadersStoreWGSL[Ke] || (i.ShaderStore.ShadersStoreWGSL[Ke] = qe);
1849
+ var Qe = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1838
1850
  try {
1839
- for (var qe_1 = __values(qe), qe_1_1 = qe_1.next(); !qe_1_1.done; qe_1_1 = qe_1.next()) {
1840
- var e_103 = qe_1_1.value;
1841
- i.ShaderStore.IncludesShadersStoreWGSL[e_103.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_103.name] = e_103.shader);
1851
+ for (var Qe_1 = __values(Qe), Qe_1_1 = Qe_1.next(); !Qe_1_1.done; Qe_1_1 = Qe_1.next()) {
1852
+ var e_104 = Qe_1_1.value;
1853
+ i.ShaderStore.IncludesShadersStoreWGSL[e_104.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_104.name] = e_104.shader);
1842
1854
  }
1843
1855
  }
1844
1856
  catch (e_16_1) { e_16 = { error: e_16_1 }; }
1845
1857
  finally {
1846
1858
  try {
1847
- if (qe_1_1 && !qe_1_1.done && (_s = qe_1.return)) _s.call(qe_1);
1859
+ if (Qe_1_1 && !Qe_1_1.done && (_s = Qe_1.return)) _s.call(Qe_1);
1848
1860
  }
1849
1861
  finally { if (e_16) throw e_16.error; }
1850
1862
  }
1851
- var Qe = { __proto__: null, gradientPixelShaderWGSL: { name: Ye, shader: Ke } };
1852
- var Je = "gridVertexShader", $e = "precision highp float;attribute vec3 position;attribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#include<instancesDeclaration>\n#include<__decl__sceneVertex>\nvarying vec3 vPosition;varying vec3 vNormal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vec3 vWorldPos;\n#endif\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;\n#endif\n#include<clipPlaneVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include<fogVertex>\nvec4 cameraSpacePosition=view*worldPos;gl_Position=projection*cameraSpacePosition;\n#ifdef OPACITY\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\nif (vOpacityInfos.x==0.)\n{vOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));}\nelse\n{vOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));}\n#endif \n#include<clipPlaneVertex>\n#include<logDepthVertex>\nvPosition=position;vNormal=normal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvWorldPos=worldPos.xyz;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";
1853
- i.ShaderStore.ShadersStore[Je] || (i.ShaderStore.ShadersStore[Je] = $e);
1854
- var ei = [i.instancesDeclaration, i.sceneVertexDeclaration, i.sceneUboDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.clipPlaneVertexDeclaration, i.instancesVertex, i.fogVertex, i.clipPlaneVertex, i.logDepthVertex];
1863
+ var Je = { __proto__: null, gradientPixelShaderWGSL: { name: Ke, shader: qe } };
1864
+ var $e = "gridVertexShader", ei = "precision highp float;attribute vec3 position;attribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#include<instancesDeclaration>\n#include<__decl__sceneVertex>\nvarying vec3 vPosition;varying vec3 vNormal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vec3 vWorldPos;\n#endif\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;uniform mat4 opacityMatrix;uniform vec2 vOpacityInfos;\n#endif\n#include<clipPlaneVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include<fogVertex>\nvec4 cameraSpacePosition=view*worldPos;gl_Position=projection*cameraSpacePosition;\n#ifdef OPACITY\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\nif (vOpacityInfos.x==0.)\n{vOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));}\nelse\n{vOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));}\n#endif \n#include<clipPlaneVertex>\n#include<logDepthVertex>\nvPosition=position;vNormal=normal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvWorldPos=worldPos.xyz;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";
1865
+ i.ShaderStore.ShadersStore[$e] || (i.ShaderStore.ShadersStore[$e] = ei);
1866
+ var ii = [i.instancesDeclaration, i.sceneVertexDeclaration, i.sceneUboDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.clipPlaneVertexDeclaration, i.instancesVertex, i.fogVertex, i.clipPlaneVertex, i.logDepthVertex];
1855
1867
  try {
1856
- for (var ei_1 = __values(ei), ei_1_1 = ei_1.next(); !ei_1_1.done; ei_1_1 = ei_1.next()) {
1857
- var e_104 = ei_1_1.value;
1858
- i.ShaderStore.IncludesShadersStore[e_104.name] || (i.ShaderStore.IncludesShadersStore[e_104.name] = e_104.shader);
1868
+ for (var ii_1 = __values(ii), ii_1_1 = ii_1.next(); !ii_1_1.done; ii_1_1 = ii_1.next()) {
1869
+ var e_105 = ii_1_1.value;
1870
+ i.ShaderStore.IncludesShadersStore[e_105.name] || (i.ShaderStore.IncludesShadersStore[e_105.name] = e_105.shader);
1859
1871
  }
1860
1872
  }
1861
1873
  catch (e_17_1) { e_17 = { error: e_17_1 }; }
1862
1874
  finally {
1863
1875
  try {
1864
- if (ei_1_1 && !ei_1_1.done && (_u = ei_1.return)) _u.call(ei_1);
1876
+ if (ii_1_1 && !ii_1_1.done && (_u = ii_1.return)) _u.call(ii_1);
1865
1877
  }
1866
1878
  finally { if (e_17) throw e_17.error; }
1867
1879
  }
1868
- var ii = { __proto__: null, gridVertexShader: { name: Je, shader: $e } };
1869
- var ti = "gridPixelShader", ni = "#extension GL_OES_standard_derivatives : enable\n#define SQRT2 1.41421356\n#define PI 3.14159\n#define MAX_OCTAVES 8\n#define LINE_WIDTH_SCREEN_FRACTION 0.004\n#define HORIZON_FADE_EXPONENT 400.0\n#define ORIGIN_MARKER_SPAN 10000000.0\n#define ORIGIN_MARKER_WIDTH_SCALE 0.00000015\n#define ORIGIN_MARKER_THRESHOLD 0.0001\n#define TRANSPARENT_MIN_OPACITY 0.08\nprecision highp float;uniform float visibility;uniform vec3 mainColor;uniform vec3 lineColor;uniform vec4 gridControl;uniform vec3 gridOffset;uniform float gridThicknessModifier;\n#ifdef MULTI_SCALE\nuniform float minGridSpacing;uniform float gridOctaves;\n#endif\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nuniform vec3 cameraPosition;uniform vec2 viewportSize;\n#endif\n#ifdef BELOW_LINE_COLOR\nuniform vec3 belowLineColor;\n#endif\nvarying vec3 vPosition;varying vec3 vNormal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vec3 vWorldPos;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;uniform sampler2D opacitySampler;uniform vec2 vOpacityInfos;\n#endif\nfloat getDynamicVisibility(float position) {float majorGridFrequency=gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{return 1.0;}\nreturn gridControl.z;}\nfloat getAnisotropicAttenuation(float differentialLength) {const float maxNumberOfLines=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);}\nfloat isPointOnLine(float position,float differentialLength) {float fractionPartOfPosition=position-floor(position+0.5); \nfractionPartOfPosition/=differentialLength; \n#ifdef ANTIALIAS\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);float result=0.5+0.5*cos(fractionPartOfPosition*PI); \nreturn result;\n#else\nreturn abs(fractionPartOfPosition)<SQRT2/4. ? 1. : 0.;\n#endif\n}\nfloat contributionOnAxis(float position,float tcLineWidthCap,float thicknessModifier) {float dPosDx=dFdx(position);float dPosDy=dFdy(position);float differentialLength=length(vec2(dPosDx,dPosDy))*SQRT2;if (tcLineWidthCap>0.0) {differentialLength=max(differentialLength,tcLineWidthCap);}\nfloat lineWidth=differentialLength*thicknessModifier;float result=isPointOnLine(position,lineWidth);result*=getDynamicVisibility(position);result*=getAnisotropicAttenuation(differentialLength);return result;}\nfloat normalImpactOnAxis(float x) {float normalImpact=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);return normalImpact;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 normal=normalize(vNormal);float horizonFade=1.0;float tcLineWidthCap=0.0;\n#if defined(HORIZON_FADE) || defined(ORIGIN_MARKER)\nfloat tc=length(vWorldPos-cameraPosition);\n#endif\n#ifdef HORIZON_FADE\ntcLineWidthCap=LINE_WIDTH_SCREEN_FRACTION*tc/viewportSize.y;vec3 rd=normalize(vWorldPos-cameraPosition);if (abs(rd.y)>0.99) {horizonFade=1.0;} else {vec3 flatRayDir=normalize(vec3(rd.x,0.0,rd.z));horizonFade=-pow(abs(dot(rd,flatRayDir)),HORIZON_FADE_EXPONENT)+1.0;}\n#endif\nfloat grid=0.0;\n#ifdef MULTI_SCALE\nfor (int i=0; i<MAX_OCTAVES; i++) {if (i>=int(gridOctaves)) break;float scale=minGridSpacing*pow(10.0,float(i));vec3 gridPos=(vPosition+gridOffset.xyz)/scale;float gx=contributionOnAxis(gridPos.x,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.x);float gy=contributionOnAxis(gridPos.y,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.y);float gz=contributionOnAxis(gridPos.z,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=max(grid,clamp(max(max(gx,gy),gz),0.,1.));\n#else\ngrid=max(grid,clamp(gx+gy+gz,0.,1.));\n#endif\n}\n#else\nfloat gridRatio=gridControl.x;vec3 gridPos=(vPosition+gridOffset.xyz)/gridRatio;float x=contributionOnAxis(gridPos.x,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.x);float y=contributionOnAxis(gridPos.y,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.y);float z=contributionOnAxis(gridPos.z,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=clamp(max(max(x,y),z),0.,1.);\n#else\ngrid=clamp(x+y+z,0.,1.);\n#endif\n#endif\ngrid*=horizonFade;\n#ifdef ORIGIN_MARKER\nfloat tcOrigin=ORIGIN_MARKER_WIDTH_SCALE*tc/viewportSize.y;float ox=contributionOnAxis(vWorldPos.x/ORIGIN_MARKER_SPAN,tcOrigin,gridThicknessModifier);float oz=contributionOnAxis(vWorldPos.z/ORIGIN_MARKER_SPAN,tcOrigin,gridThicknessModifier);float originMask=clamp(ox+oz,0.0,1.0)*horizonFade;if (originMask>ORIGIN_MARKER_THRESHOLD) grid=originMask;\n#endif\n#ifdef BELOW_LINE_COLOR\nbool belowSurface=cameraPosition.y<vWorldPos.y;vec3 effectiveLineColor=belowSurface ? belowLineColor : lineColor;\n#else\nvec3 effectiveLineColor=lineColor;\n#endif\nvec3 color=mix(mainColor,effectiveLineColor,grid);\n#ifdef FOG\n#include<fogFragment>\n#endif\nfloat opacity=gridControl.w;\n#ifdef LINES_ONLY\nif (grid<0.01) discard;opacity=clamp(grid,TRANSPARENT_MIN_OPACITY,gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity*=texture2D(opacitySampler,vOpacityUV).a;\n#endif\ngl_FragColor=vec4(color.rgb,opacity*visibility);\n#ifdef PREMULTIPLYALPHA\ngl_FragColor.rgb*=opacity;\n#endif\n#include<logDepthFragment>\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
1870
- i.ShaderStore.ShadersStore[ti] || (i.ShaderStore.ShadersStore[ti] = ni);
1871
- var ri = [i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.fogFragment, i.logDepthFragment, i.imageProcessingCompatibility];
1880
+ var ti = { __proto__: null, gridVertexShader: { name: $e, shader: ei } };
1881
+ var ni = "gridPixelShader", ri = "#extension GL_OES_standard_derivatives : enable\n#define SQRT2 1.41421356\n#define PI 3.14159\n#define MAX_OCTAVES 8\n#define LINE_WIDTH_SCREEN_FRACTION 0.004\n#define HORIZON_FADE_EXPONENT 400.0\n#define ORIGIN_MARKER_SPAN 10000000.0\n#define ORIGIN_MARKER_WIDTH_SCALE 0.00000015\n#define ORIGIN_MARKER_THRESHOLD 0.0001\n#define TRANSPARENT_MIN_OPACITY 0.08\nprecision highp float;uniform float visibility;uniform vec3 mainColor;uniform vec3 lineColor;uniform vec4 gridControl;uniform vec3 gridOffset;uniform float gridThicknessModifier;\n#ifdef MULTI_SCALE\nuniform float minGridSpacing;uniform float gridOctaves;\n#endif\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nuniform vec3 cameraPosition;uniform vec2 viewportSize;\n#endif\n#ifdef BELOW_LINE_COLOR\nuniform vec3 belowLineColor;\n#endif\nvarying vec3 vPosition;varying vec3 vNormal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vec3 vWorldPos;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;uniform sampler2D opacitySampler;uniform vec2 vOpacityInfos;\n#endif\nfloat getDynamicVisibility(float position) {float majorGridFrequency=gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{return 1.0;}\nreturn gridControl.z;}\nfloat getAnisotropicAttenuation(float differentialLength) {const float maxNumberOfLines=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);}\nfloat isPointOnLine(float position,float differentialLength) {float fractionPartOfPosition=position-floor(position+0.5); \nfractionPartOfPosition/=differentialLength; \n#ifdef ANTIALIAS\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);float result=0.5+0.5*cos(fractionPartOfPosition*PI); \nreturn result;\n#else\nreturn abs(fractionPartOfPosition)<SQRT2/4. ? 1. : 0.;\n#endif\n}\nfloat contributionOnAxis(float position,float tcLineWidthCap,float thicknessModifier) {float dPosDx=dFdx(position);float dPosDy=dFdy(position);float differentialLength=length(vec2(dPosDx,dPosDy))*SQRT2;if (tcLineWidthCap>0.0) {differentialLength=max(differentialLength,tcLineWidthCap);}\nfloat lineWidth=differentialLength*thicknessModifier;float result=isPointOnLine(position,lineWidth);result*=getDynamicVisibility(position);result*=getAnisotropicAttenuation(differentialLength);return result;}\nfloat normalImpactOnAxis(float x) {float normalImpact=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);return normalImpact;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 normal=normalize(vNormal);float horizonFade=1.0;float tcLineWidthCap=0.0;\n#if defined(HORIZON_FADE) || defined(ORIGIN_MARKER)\nfloat tc=length(vWorldPos-cameraPosition);\n#endif\n#ifdef HORIZON_FADE\ntcLineWidthCap=LINE_WIDTH_SCREEN_FRACTION*tc/viewportSize.y;vec3 rd=normalize(vWorldPos-cameraPosition);if (abs(rd.y)>0.99) {horizonFade=1.0;} else {vec3 flatRayDir=normalize(vec3(rd.x,0.0,rd.z));horizonFade=-pow(abs(dot(rd,flatRayDir)),HORIZON_FADE_EXPONENT)+1.0;}\n#endif\nfloat grid=0.0;\n#ifdef MULTI_SCALE\nfor (int i=0; i<MAX_OCTAVES; i++) {if (i>=int(gridOctaves)) break;float scale=minGridSpacing*pow(10.0,float(i));vec3 gridPos=(vPosition+gridOffset.xyz)/scale;float gx=contributionOnAxis(gridPos.x,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.x);float gy=contributionOnAxis(gridPos.y,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.y);float gz=contributionOnAxis(gridPos.z,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=max(grid,clamp(max(max(gx,gy),gz),0.,1.));\n#else\ngrid=max(grid,clamp(gx+gy+gz,0.,1.));\n#endif\n}\n#else\nfloat gridRatio=gridControl.x;vec3 gridPos=(vPosition+gridOffset.xyz)/gridRatio;float x=contributionOnAxis(gridPos.x,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.x);float y=contributionOnAxis(gridPos.y,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.y);float z=contributionOnAxis(gridPos.z,tcLineWidthCap,gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=clamp(max(max(x,y),z),0.,1.);\n#else\ngrid=clamp(x+y+z,0.,1.);\n#endif\n#endif\ngrid*=horizonFade;\n#ifdef ORIGIN_MARKER\nfloat tcOrigin=ORIGIN_MARKER_WIDTH_SCALE*tc/viewportSize.y;float ox=contributionOnAxis(vWorldPos.x/ORIGIN_MARKER_SPAN,tcOrigin,gridThicknessModifier);float oz=contributionOnAxis(vWorldPos.z/ORIGIN_MARKER_SPAN,tcOrigin,gridThicknessModifier);float originMask=clamp(ox+oz,0.0,1.0)*horizonFade;if (originMask>ORIGIN_MARKER_THRESHOLD) grid=originMask;\n#endif\n#ifdef BELOW_LINE_COLOR\nbool belowSurface=cameraPosition.y<vWorldPos.y;vec3 effectiveLineColor=belowSurface ? belowLineColor : lineColor;\n#else\nvec3 effectiveLineColor=lineColor;\n#endif\nvec3 color=mix(mainColor,effectiveLineColor,grid);\n#ifdef FOG\n#include<fogFragment>\n#endif\nfloat opacity=gridControl.w;\n#ifdef LINES_ONLY\nif (grid<0.01) discard;opacity=clamp(grid,TRANSPARENT_MIN_OPACITY,gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity*=texture2D(opacitySampler,vOpacityUV).a;\n#endif\ngl_FragColor=vec4(color.rgb,opacity*visibility);\n#ifdef PREMULTIPLYALPHA\ngl_FragColor.rgb*=opacity;\n#endif\n#include<logDepthFragment>\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
1882
+ i.ShaderStore.ShadersStore[ni] || (i.ShaderStore.ShadersStore[ni] = ri);
1883
+ var ai = [i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.fogFragment, i.logDepthFragment, i.imageProcessingCompatibility];
1872
1884
  try {
1873
- for (var ri_1 = __values(ri), ri_1_1 = ri_1.next(); !ri_1_1.done; ri_1_1 = ri_1.next()) {
1874
- var e_105 = ri_1_1.value;
1875
- i.ShaderStore.IncludesShadersStore[e_105.name] || (i.ShaderStore.IncludesShadersStore[e_105.name] = e_105.shader);
1885
+ for (var ai_1 = __values(ai), ai_1_1 = ai_1.next(); !ai_1_1.done; ai_1_1 = ai_1.next()) {
1886
+ var e_106 = ai_1_1.value;
1887
+ i.ShaderStore.IncludesShadersStore[e_106.name] || (i.ShaderStore.IncludesShadersStore[e_106.name] = e_106.shader);
1876
1888
  }
1877
1889
  }
1878
1890
  catch (e_18_1) { e_18 = { error: e_18_1 }; }
1879
1891
  finally {
1880
1892
  try {
1881
- if (ri_1_1 && !ri_1_1.done && (_v = ri_1.return)) _v.call(ri_1);
1893
+ if (ai_1_1 && !ai_1_1.done && (_v = ai_1.return)) _v.call(ai_1);
1882
1894
  }
1883
1895
  finally { if (e_18) throw e_18.error; }
1884
1896
  }
1885
- var ai = { __proto__: null, gridPixelShader: { name: ti, shader: ni } };
1886
- var si = "gridVertexShader", oi = "attribute position: vec3f;attribute normal: vec3f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\nvarying vPosition: vec3f;varying vNormal: vec3f;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vWorldPos: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#ifdef OPACITY\nvarying vOpacityUV: vec2f;uniform opacityMatrix: mat4x4f;uniform vOpacityInfos: vec2f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);\n#include<fogVertex>\nvar cameraSpacePosition: vec4f=scene.view*worldPos;vertexOutputs.position=scene.projection*cameraSpacePosition;\n#ifdef OPACITY\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\nif (uniforms.vOpacityInfos.x==0.)\n{vertexOutputs.vOpacityUV=(uniforms.opacityMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vOpacityUV=(uniforms.opacityMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\nvertexOutputs.vPosition=vertexInputs.position;vertexOutputs.vNormal=vertexInputs.normal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvertexOutputs.vWorldPos=worldPos.xyz;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1887
- i.ShaderStore.ShadersStoreWGSL[si] || (i.ShaderStore.ShadersStoreWGSL[si] = oi);
1888
- var fi = [i.instancesDeclarationWGSL, i.sceneUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.instancesVertexWGSL, i.fogVertexWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL];
1897
+ var si = { __proto__: null, gridPixelShader: { name: ni, shader: ri } };
1898
+ var oi = "gridVertexShader", fi = "attribute position: vec3f;attribute normal: vec3f;\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\nvarying vPosition: vec3f;varying vNormal: vec3f;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vWorldPos: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#ifdef OPACITY\nvarying vOpacityUV: vec2f;uniform opacityMatrix: mat4x4f;uniform vOpacityInfos: vec2f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);\n#include<fogVertex>\nvar cameraSpacePosition: vec4f=scene.view*worldPos;vertexOutputs.position=scene.projection*cameraSpacePosition;\n#ifdef OPACITY\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\nif (uniforms.vOpacityInfos.x==0.)\n{vertexOutputs.vOpacityUV=(uniforms.opacityMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vOpacityUV=(uniforms.opacityMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\nvertexOutputs.vPosition=vertexInputs.position;vertexOutputs.vNormal=vertexInputs.normal;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvertexOutputs.vWorldPos=worldPos.xyz;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1899
+ i.ShaderStore.ShadersStoreWGSL[oi] || (i.ShaderStore.ShadersStoreWGSL[oi] = fi);
1900
+ var li = [i.instancesDeclarationWGSL, i.sceneUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.instancesVertexWGSL, i.fogVertexWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL];
1889
1901
  try {
1890
- for (var fi_1 = __values(fi), fi_1_1 = fi_1.next(); !fi_1_1.done; fi_1_1 = fi_1.next()) {
1891
- var e_106 = fi_1_1.value;
1892
- i.ShaderStore.IncludesShadersStoreWGSL[e_106.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_106.name] = e_106.shader);
1902
+ for (var li_1 = __values(li), li_1_1 = li_1.next(); !li_1_1.done; li_1_1 = li_1.next()) {
1903
+ var e_107 = li_1_1.value;
1904
+ i.ShaderStore.IncludesShadersStoreWGSL[e_107.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_107.name] = e_107.shader);
1893
1905
  }
1894
1906
  }
1895
1907
  catch (e_19_1) { e_19 = { error: e_19_1 }; }
1896
1908
  finally {
1897
1909
  try {
1898
- if (fi_1_1 && !fi_1_1.done && (_w = fi_1.return)) _w.call(fi_1);
1910
+ if (li_1_1 && !li_1_1.done && (_w = li_1.return)) _w.call(li_1);
1899
1911
  }
1900
1912
  finally { if (e_19) throw e_19.error; }
1901
1913
  }
1902
- var li = { __proto__: null, gridVertexShaderWGSL: { name: si, shader: oi } };
1903
- var ui = "gridPixelShader", di = "#define SQRT2 1.41421356\n#define PI 3.14159\n#define MAX_OCTAVES 8\n#define LINE_WIDTH_SCREEN_FRACTION 0.004\n#define HORIZON_FADE_EXPONENT 400.0\n#define ORIGIN_MARKER_SPAN 10000000.0\n#define ORIGIN_MARKER_WIDTH_SCALE 0.00000015\n#define ORIGIN_MARKER_THRESHOLD 0.0001\n#define TRANSPARENT_MIN_OPACITY 0.08\nuniform visibility: f32;uniform mainColor: vec3f;uniform lineColor: vec3f;uniform gridControl: vec4f;uniform gridOffset: vec3f;uniform gridThicknessModifier: f32;\n#ifdef MULTI_SCALE\nuniform minGridSpacing: f32;uniform gridOctaves: f32;\n#endif\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nuniform cameraPosition: vec3f;uniform viewportSize: vec2f;\n#endif\n#ifdef BELOW_LINE_COLOR\nuniform belowLineColor: vec3f;\n#endif\nvarying vPosition: vec3f;varying vNormal: vec3f;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vWorldPos: vec3f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef OPACITY\nvarying vOpacityUV: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform vOpacityInfos: vec2f;\n#endif\nfn getDynamicVisibility(position: f32)->f32 {var majorGridFrequency: f32=uniforms.gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{return 1.0;}\nreturn uniforms.gridControl.z;}\nfn getAnisotropicAttenuation(differentialLength: f32)->f32 {let maxNumberOfLines: f32=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);}\nfn isPointOnLine(position: f32,differentialLength: f32)->f32 {var fractionPartOfPosition: f32=position-floor(position+0.5);fractionPartOfPosition=fractionPartOfPosition/differentialLength;\n#ifdef ANTIALIAS\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);var result: f32=0.5+0.5*cos(fractionPartOfPosition*PI);return result;\n#else\nif (abs(fractionPartOfPosition)<SQRT2/4.) {return 1.;}\nreturn 0.;\n#endif\n}\nfn contributionOnAxis(position: f32,tcLineWidthCap: f32,thicknessModifier: f32)->f32 {let dPosDx: f32=dpdx(position);let dPosDy: f32=dpdy(position);var differentialLength: f32=length(vec2f(dPosDx,dPosDy))*SQRT2;if (tcLineWidthCap>0.0) {differentialLength=max(differentialLength,tcLineWidthCap);}\nlet lineWidth: f32=differentialLength*thicknessModifier;var result: f32=isPointOnLine(position,lineWidth);result=result*getDynamicVisibility(position);result=result*getAnisotropicAttenuation(differentialLength);return result;}\nfn normalImpactOnAxis(x: f32)->f32 {var normalImpact: f32=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);return normalImpact;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar normal: vec3f=normalize(fragmentInputs.vNormal);var horizonFade: f32=1.0;var tcLineWidthCap: f32=0.0;\n#if defined(HORIZON_FADE) || defined(ORIGIN_MARKER)\nvar tc: f32=length(fragmentInputs.vWorldPos-uniforms.cameraPosition);\n#ifdef HORIZON_FADE\ntcLineWidthCap=LINE_WIDTH_SCREEN_FRACTION*tc/uniforms.viewportSize.y;let rd: vec3f=normalize(fragmentInputs.vWorldPos-uniforms.cameraPosition);if (abs(rd.y)>0.99) {horizonFade=1.0;} else {let flatRayDir: vec3f=normalize(vec3f(rd.x,0.0,rd.z));horizonFade=-pow(abs(dot(rd,flatRayDir)),HORIZON_FADE_EXPONENT)+1.0;}\n#endif\n#endif\nvar grid: f32=0.0;\n#ifdef MULTI_SCALE\nfor (var i: i32=0; i<MAX_OCTAVES; i++) {if (i>=i32(uniforms.gridOctaves)) { break; }\nlet scale: f32=uniforms.minGridSpacing*pow(10.0,f32(i));let gridPos: vec3f=(fragmentInputs.vPosition+uniforms.gridOffset.xyz)/scale;let gx: f32=contributionOnAxis(gridPos.x,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.x);let gy: f32=contributionOnAxis(gridPos.y,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.y);let gz: f32=contributionOnAxis(gridPos.z,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=max(grid,clamp(max(max(gx,gy),gz),0.,1.));\n#else\ngrid=max(grid,clamp(gx+gy+gz,0.,1.));\n#endif\n}\n#else\nlet gridRatio: f32=uniforms.gridControl.x;let gridPos: vec3f=(fragmentInputs.vPosition+uniforms.gridOffset.xyz)/gridRatio;let x: f32=contributionOnAxis(gridPos.x,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.x);let y: f32=contributionOnAxis(gridPos.y,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.y);let z: f32=contributionOnAxis(gridPos.z,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=clamp(max(max(x,y),z),0.,1.);\n#else\ngrid=clamp(x+y+z,0.,1.);\n#endif\n#endif\ngrid=grid*horizonFade;\n#ifdef ORIGIN_MARKER\nlet tcOrigin: f32=ORIGIN_MARKER_WIDTH_SCALE*tc/uniforms.viewportSize.y;let ox: f32=contributionOnAxis(fragmentInputs.vWorldPos.x/ORIGIN_MARKER_SPAN,tcOrigin,uniforms.gridThicknessModifier);let oz: f32=contributionOnAxis(fragmentInputs.vWorldPos.z/ORIGIN_MARKER_SPAN,tcOrigin,uniforms.gridThicknessModifier);let originMask: f32=clamp(ox+oz,0.0,1.0)*horizonFade;if (originMask>ORIGIN_MARKER_THRESHOLD) { grid=originMask; }\n#endif\n#ifdef BELOW_LINE_COLOR\nlet belowSurface: bool=uniforms.cameraPosition.y<fragmentInputs.vWorldPos.y;let effectiveLineColor: vec3f=select(uniforms.lineColor,uniforms.belowLineColor,belowSurface);\n#else\nlet effectiveLineColor: vec3f=uniforms.lineColor;\n#endif\nvar color: vec4f=vec4f(mix(uniforms.mainColor,effectiveLineColor,vec3f(grid)),1.0);\n#ifdef FOG\n#include<fogFragment>\n#endif\nvar opacity: f32=uniforms.gridControl.w;\n#ifdef LINES_ONLY\nif (grid<0.01) { discard; }\nopacity=clamp(grid,TRANSPARENT_MIN_OPACITY,uniforms.gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity=opacity*textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV).a;\n#endif\nfragmentOutputs.color=vec4f(color.rgb,opacity*uniforms.visibility);\n#ifdef PREMULTIPLYALPHA\nfragmentOutputs.color=vec4f(fragmentOutputs.color.rgb*opacity,fragmentOutputs.color.a);\n#endif\n#include<logDepthFragment>\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
1904
- i.ShaderStore.ShadersStoreWGSL[ui] || (i.ShaderStore.ShadersStoreWGSL[ui] = di);
1905
- var ci = [i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.fogFragmentWGSL, i.logDepthFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1914
+ var ui = { __proto__: null, gridVertexShaderWGSL: { name: oi, shader: fi } };
1915
+ var di = "gridPixelShader", ci = "#define SQRT2 1.41421356\n#define PI 3.14159\n#define MAX_OCTAVES 8\n#define LINE_WIDTH_SCREEN_FRACTION 0.004\n#define HORIZON_FADE_EXPONENT 400.0\n#define ORIGIN_MARKER_SPAN 10000000.0\n#define ORIGIN_MARKER_WIDTH_SCALE 0.00000015\n#define ORIGIN_MARKER_THRESHOLD 0.0001\n#define TRANSPARENT_MIN_OPACITY 0.08\nuniform visibility: f32;uniform mainColor: vec3f;uniform lineColor: vec3f;uniform gridControl: vec4f;uniform gridOffset: vec3f;uniform gridThicknessModifier: f32;\n#ifdef MULTI_SCALE\nuniform minGridSpacing: f32;uniform gridOctaves: f32;\n#endif\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nuniform cameraPosition: vec3f;uniform viewportSize: vec2f;\n#endif\n#ifdef BELOW_LINE_COLOR\nuniform belowLineColor: vec3f;\n#endif\nvarying vPosition: vec3f;varying vNormal: vec3f;\n#if defined(HORIZON_FADE) || defined(BELOW_LINE_COLOR) || defined(ORIGIN_MARKER)\nvarying vWorldPos: vec3f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef OPACITY\nvarying vOpacityUV: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform vOpacityInfos: vec2f;\n#endif\nfn getDynamicVisibility(position: f32)->f32 {var majorGridFrequency: f32=uniforms.gridControl.y;if (floor(position+0.5)==floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{return 1.0;}\nreturn uniforms.gridControl.z;}\nfn getAnisotropicAttenuation(differentialLength: f32)->f32 {let maxNumberOfLines: f32=10.0;return clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);}\nfn isPointOnLine(position: f32,differentialLength: f32)->f32 {var fractionPartOfPosition: f32=position-floor(position+0.5);fractionPartOfPosition=fractionPartOfPosition/differentialLength;\n#ifdef ANTIALIAS\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);var result: f32=0.5+0.5*cos(fractionPartOfPosition*PI);return result;\n#else\nif (abs(fractionPartOfPosition)<SQRT2/4.) {return 1.;}\nreturn 0.;\n#endif\n}\nfn contributionOnAxis(position: f32,tcLineWidthCap: f32,thicknessModifier: f32)->f32 {let dPosDx: f32=dpdx(position);let dPosDy: f32=dpdy(position);var differentialLength: f32=length(vec2f(dPosDx,dPosDy))*SQRT2;if (tcLineWidthCap>0.0) {differentialLength=max(differentialLength,tcLineWidthCap);}\nlet lineWidth: f32=differentialLength*thicknessModifier;var result: f32=isPointOnLine(position,lineWidth);result=result*getDynamicVisibility(position);result=result*getAnisotropicAttenuation(differentialLength);return result;}\nfn normalImpactOnAxis(x: f32)->f32 {var normalImpact: f32=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);return normalImpact;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar normal: vec3f=normalize(fragmentInputs.vNormal);var horizonFade: f32=1.0;var tcLineWidthCap: f32=0.0;\n#if defined(HORIZON_FADE) || defined(ORIGIN_MARKER)\nvar tc: f32=length(fragmentInputs.vWorldPos-uniforms.cameraPosition);\n#ifdef HORIZON_FADE\ntcLineWidthCap=LINE_WIDTH_SCREEN_FRACTION*tc/uniforms.viewportSize.y;let rd: vec3f=normalize(fragmentInputs.vWorldPos-uniforms.cameraPosition);if (abs(rd.y)>0.99) {horizonFade=1.0;} else {let flatRayDir: vec3f=normalize(vec3f(rd.x,0.0,rd.z));horizonFade=-pow(abs(dot(rd,flatRayDir)),HORIZON_FADE_EXPONENT)+1.0;}\n#endif\n#endif\nvar grid: f32=0.0;\n#ifdef MULTI_SCALE\nfor (var i: i32=0; i<MAX_OCTAVES; i++) {if (i>=i32(uniforms.gridOctaves)) { break; }\nlet scale: f32=uniforms.minGridSpacing*pow(10.0,f32(i));let gridPos: vec3f=(fragmentInputs.vPosition+uniforms.gridOffset.xyz)/scale;let gx: f32=contributionOnAxis(gridPos.x,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.x);let gy: f32=contributionOnAxis(gridPos.y,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.y);let gz: f32=contributionOnAxis(gridPos.z,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=max(grid,clamp(max(max(gx,gy),gz),0.,1.));\n#else\ngrid=max(grid,clamp(gx+gy+gz,0.,1.));\n#endif\n}\n#else\nlet gridRatio: f32=uniforms.gridControl.x;let gridPos: vec3f=(fragmentInputs.vPosition+uniforms.gridOffset.xyz)/gridRatio;let x: f32=contributionOnAxis(gridPos.x,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.x);let y: f32=contributionOnAxis(gridPos.y,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.y);let z: f32=contributionOnAxis(gridPos.z,tcLineWidthCap,uniforms.gridThicknessModifier)*normalImpactOnAxis(normal.z);\n#ifdef MAX_LINE\ngrid=clamp(max(max(x,y),z),0.,1.);\n#else\ngrid=clamp(x+y+z,0.,1.);\n#endif\n#endif\ngrid=grid*horizonFade;\n#ifdef ORIGIN_MARKER\nlet tcOrigin: f32=ORIGIN_MARKER_WIDTH_SCALE*tc/uniforms.viewportSize.y;let ox: f32=contributionOnAxis(fragmentInputs.vWorldPos.x/ORIGIN_MARKER_SPAN,tcOrigin,uniforms.gridThicknessModifier);let oz: f32=contributionOnAxis(fragmentInputs.vWorldPos.z/ORIGIN_MARKER_SPAN,tcOrigin,uniforms.gridThicknessModifier);let originMask: f32=clamp(ox+oz,0.0,1.0)*horizonFade;if (originMask>ORIGIN_MARKER_THRESHOLD) { grid=originMask; }\n#endif\n#ifdef BELOW_LINE_COLOR\nlet belowSurface: bool=uniforms.cameraPosition.y<fragmentInputs.vWorldPos.y;let effectiveLineColor: vec3f=select(uniforms.lineColor,uniforms.belowLineColor,belowSurface);\n#else\nlet effectiveLineColor: vec3f=uniforms.lineColor;\n#endif\nvar color: vec4f=vec4f(mix(uniforms.mainColor,effectiveLineColor,vec3f(grid)),1.0);\n#ifdef FOG\n#include<fogFragment>\n#endif\nvar opacity: f32=uniforms.gridControl.w;\n#ifdef LINES_ONLY\nif (grid<0.01) { discard; }\nopacity=clamp(grid,TRANSPARENT_MIN_OPACITY,uniforms.gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity=opacity*textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV).a;\n#endif\nfragmentOutputs.color=vec4f(color.rgb,opacity*uniforms.visibility);\n#ifdef PREMULTIPLYALPHA\nfragmentOutputs.color=vec4f(fragmentOutputs.color.rgb*opacity,fragmentOutputs.color.a);\n#endif\n#include<logDepthFragment>\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
1916
+ i.ShaderStore.ShadersStoreWGSL[di] || (i.ShaderStore.ShadersStoreWGSL[di] = ci);
1917
+ var hi = [i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.fogFragmentWGSL, i.logDepthFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1906
1918
  try {
1907
- for (var ci_1 = __values(ci), ci_1_1 = ci_1.next(); !ci_1_1.done; ci_1_1 = ci_1.next()) {
1908
- var e_107 = ci_1_1.value;
1909
- i.ShaderStore.IncludesShadersStoreWGSL[e_107.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_107.name] = e_107.shader);
1919
+ for (var hi_1 = __values(hi), hi_1_1 = hi_1.next(); !hi_1_1.done; hi_1_1 = hi_1.next()) {
1920
+ var e_108 = hi_1_1.value;
1921
+ i.ShaderStore.IncludesShadersStoreWGSL[e_108.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_108.name] = e_108.shader);
1910
1922
  }
1911
1923
  }
1912
1924
  catch (e_20_1) { e_20 = { error: e_20_1 }; }
1913
1925
  finally {
1914
1926
  try {
1915
- if (ci_1_1 && !ci_1_1.done && (_x = ci_1.return)) _x.call(ci_1);
1927
+ if (hi_1_1 && !hi_1_1.done && (_x = hi_1.return)) _x.call(hi_1);
1916
1928
  }
1917
1929
  finally { if (e_20) throw e_20.error; }
1918
1930
  }
1919
- var hi = { __proto__: null, gridPixelShaderWGSL: { name: ui, shader: di } };
1920
- var mi = "lavaVertexShader", vi = "precision highp float;uniform float time;uniform float lowFrequencySpeed;varying float noise;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n/* NOISE FUNCTIONS */\nvec3 mod289(vec3 x)\n{return x-floor(x*(1.0/289.0))*289.0;}\nvec4 mod289(vec4 x)\n{return x-floor(x*(1.0/289.0))*289.0;}\nvec4 permute(vec4 x)\n{return mod289(((x*34.0)+1.0)*x);}\nvec4 taylorInvSqrt(vec4 r)\n{return 1.79284291400159-0.85373472095314*r;}\nvec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfloat pnoise(vec3 P,vec3 rep)\n{vec3 Pi0=mod(floor(P),rep); \nvec3 Pi1=mod(Pi0+vec3(1.0),rep); \nPi0=mod289(Pi0);Pi1=mod289(Pi1);vec3 Pf0=fract(P); \nvec3 Pf1=Pf0-vec3(1.0); \nvec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);vec4 iy=vec4(Pi0.yy,Pi1.yy);vec4 iz0=Pi0.zzzz;vec4 iz1=Pi1.zzzz;vec4 ixy=permute(permute(ix)+iy);vec4 ixy0=permute(ixy+iz0);vec4 ixy1=permute(ixy+iz1);vec4 gx0=ixy0*(1.0/7.0);vec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);vec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);vec4 sz0=step(gz0,vec4(0.0));gx0-=sz0*(step(0.0,gx0)-0.5);gy0-=sz0*(step(0.0,gy0)-0.5);vec4 gx1=ixy1*(1.0/7.0);vec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);vec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);vec4 sz1=step(gz1,vec4(0.0));gx1-=sz1*(step(0.0,gx1)-0.5);gy1-=sz1*(step(0.0,gy1)-0.5);vec3 g000=vec3(gx0.x,gy0.x,gz0.x);vec3 g100=vec3(gx0.y,gy0.y,gz0.y);vec3 g010=vec3(gx0.z,gy0.z,gz0.z);vec3 g110=vec3(gx0.w,gy0.w,gz0.w);vec3 g001=vec3(gx1.x,gy1.x,gz1.x);vec3 g101=vec3(gx1.y,gy1.y,gz1.y);vec3 g011=vec3(gx1.z,gy1.z,gz1.z);vec3 g111=vec3(gx1.w,gy1.w,gz1.w);vec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000*=norm0.x;g010*=norm0.y;g100*=norm0.z;g110*=norm0.w;vec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001*=norm1.x;g011*=norm1.y;g101*=norm1.z;g111*=norm1.w;float n000=dot(g000,Pf0);float n100=dot(g100,vec3(Pf1.x,Pf0.yz));float n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));float n110=dot(g110,vec3(Pf1.xy,Pf0.z));float n001=dot(g001,vec3(Pf0.xy,Pf1.z));float n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));float n011=dot(g011,vec3(Pf0.x,Pf1.yz));float n111=dot(g111,Pf1);vec3 fade_xyz=fade(Pf0);vec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);vec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);float n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;}\n/* END FUNCTION */\nfloat turbulence( vec3 p ) {float w=100.0;float t=-.5;for (float f=1.0 ; f<=10.0 ; f++ ){float power=pow( 2.0,f );t+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );}\nreturn t;}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef NORMAL\nnoise=10.0* -.10*turbulence( .5*normal+time*1.15 );float b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );float displacement=- 1.5*noise+b;vec3 newPosition=position+normal*displacement;gl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";
1921
- i.ShaderStore.ShadersStore[mi] || (i.ShaderStore.ShadersStore[mi] = vi);
1922
- var gi = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
1931
+ var mi = { __proto__: null, gridPixelShaderWGSL: { name: di, shader: ci } };
1932
+ var vi = "lavaVertexShader", gi = "precision highp float;uniform float time;uniform float lowFrequencySpeed;varying float noise;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n/* NOISE FUNCTIONS */\nvec3 mod289(vec3 x)\n{return x-floor(x*(1.0/289.0))*289.0;}\nvec4 mod289(vec4 x)\n{return x-floor(x*(1.0/289.0))*289.0;}\nvec4 permute(vec4 x)\n{return mod289(((x*34.0)+1.0)*x);}\nvec4 taylorInvSqrt(vec4 r)\n{return 1.79284291400159-0.85373472095314*r;}\nvec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfloat pnoise(vec3 P,vec3 rep)\n{vec3 Pi0=mod(floor(P),rep); \nvec3 Pi1=mod(Pi0+vec3(1.0),rep); \nPi0=mod289(Pi0);Pi1=mod289(Pi1);vec3 Pf0=fract(P); \nvec3 Pf1=Pf0-vec3(1.0); \nvec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);vec4 iy=vec4(Pi0.yy,Pi1.yy);vec4 iz0=Pi0.zzzz;vec4 iz1=Pi1.zzzz;vec4 ixy=permute(permute(ix)+iy);vec4 ixy0=permute(ixy+iz0);vec4 ixy1=permute(ixy+iz1);vec4 gx0=ixy0*(1.0/7.0);vec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);vec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);vec4 sz0=step(gz0,vec4(0.0));gx0-=sz0*(step(0.0,gx0)-0.5);gy0-=sz0*(step(0.0,gy0)-0.5);vec4 gx1=ixy1*(1.0/7.0);vec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);vec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);vec4 sz1=step(gz1,vec4(0.0));gx1-=sz1*(step(0.0,gx1)-0.5);gy1-=sz1*(step(0.0,gy1)-0.5);vec3 g000=vec3(gx0.x,gy0.x,gz0.x);vec3 g100=vec3(gx0.y,gy0.y,gz0.y);vec3 g010=vec3(gx0.z,gy0.z,gz0.z);vec3 g110=vec3(gx0.w,gy0.w,gz0.w);vec3 g001=vec3(gx1.x,gy1.x,gz1.x);vec3 g101=vec3(gx1.y,gy1.y,gz1.y);vec3 g011=vec3(gx1.z,gy1.z,gz1.z);vec3 g111=vec3(gx1.w,gy1.w,gz1.w);vec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000*=norm0.x;g010*=norm0.y;g100*=norm0.z;g110*=norm0.w;vec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001*=norm1.x;g011*=norm1.y;g101*=norm1.z;g111*=norm1.w;float n000=dot(g000,Pf0);float n100=dot(g100,vec3(Pf1.x,Pf0.yz));float n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));float n110=dot(g110,vec3(Pf1.xy,Pf0.z));float n001=dot(g001,vec3(Pf0.xy,Pf1.z));float n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));float n011=dot(g011,vec3(Pf0.x,Pf1.yz));float n111=dot(g111,Pf1);vec3 fade_xyz=fade(Pf0);vec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);vec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);float n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;}\n/* END FUNCTION */\nfloat turbulence( vec3 p ) {float w=100.0;float t=-.5;for (float f=1.0 ; f<=10.0 ; f++ ){float power=pow( 2.0,f );t+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );}\nreturn t;}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef NORMAL\nnoise=10.0* -.10*turbulence( .5*normal+time*1.15 );float b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );float displacement=- 1.5*noise+b;vec3 newPosition=position+normal*displacement;gl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );vec4 worldPos=finalWorld*vec4(newPosition,1.0);vPositionW=vec3(worldPos);vNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}";
1933
+ i.ShaderStore.ShadersStore[vi] || (i.ShaderStore.ShadersStore[vi] = gi);
1934
+ var pi = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
1923
1935
  try {
1924
- for (var gi_1 = __values(gi), gi_1_1 = gi_1.next(); !gi_1_1.done; gi_1_1 = gi_1.next()) {
1925
- var e_108 = gi_1_1.value;
1926
- i.ShaderStore.IncludesShadersStore[e_108.name] || (i.ShaderStore.IncludesShadersStore[e_108.name] = e_108.shader);
1936
+ for (var pi_1 = __values(pi), pi_1_1 = pi_1.next(); !pi_1_1.done; pi_1_1 = pi_1.next()) {
1937
+ var e_109 = pi_1_1.value;
1938
+ i.ShaderStore.IncludesShadersStore[e_109.name] || (i.ShaderStore.IncludesShadersStore[e_109.name] = e_109.shader);
1927
1939
  }
1928
1940
  }
1929
1941
  catch (e_21_1) { e_21 = { error: e_21_1 }; }
1930
1942
  finally {
1931
1943
  try {
1932
- if (gi_1_1 && !gi_1_1.done && (_y = gi_1.return)) _y.call(gi_1);
1944
+ if (pi_1_1 && !pi_1_1.done && (_y = pi_1.return)) _y.call(pi_1);
1933
1945
  }
1934
1946
  finally { if (e_21) throw e_21.error; }
1935
1947
  }
1936
- var pi = { __proto__: null, lavaVertexShader: { name: mi, shader: vi } };
1937
- var Si = "lavaPixelShader", xi = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;uniform float time;uniform float speed;uniform float movingSpeed;uniform vec3 fogColor;uniform sampler2D noiseTexture;uniform float fogDensity;varying float noise;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfloat random( vec3 scale,float seed ){return fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nvec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );vec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time *0.02;vec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;T1.x+=noiseTex.x*2.0;T1.y+=noiseTex.y*2.0;T2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;T2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;float p=texture2D( noiseTexture,T1*3.0 ).a;vec4 lavaColor=texture2D( diffuseSampler,T2*4.0);vec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );baseColor=temp;float depth=gl_FragCoord.z*4.0;const float LOG2=1.442695;float fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );fogFactor=1.0-clamp( fogFactor,0.0,1.0 );baseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );diffuseColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1938
- i.ShaderStore.ShadersStore[Si] || (i.ShaderStore.ShadersStore[Si] = xi);
1939
- var Ti = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1948
+ var Si = { __proto__: null, lavaVertexShader: { name: vi, shader: gi } };
1949
+ var xi = "lavaPixelShader", Ti = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;uniform float time;uniform float speed;uniform float movingSpeed;uniform vec3 fogColor;uniform sampler2D noiseTexture;uniform float fogDensity;varying float noise;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfloat random( vec3 scale,float seed ){return fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nvec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );vec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time *0.02;vec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;T1.x+=noiseTex.x*2.0;T1.y+=noiseTex.y*2.0;T2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;T2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;float p=texture2D( noiseTexture,T1*3.0 ).a;vec4 lavaColor=texture2D( diffuseSampler,T2*4.0);vec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );baseColor=temp;float depth=gl_FragCoord.z*4.0;const float LOG2=1.442695;float fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );fogFactor=1.0-clamp( fogFactor,0.0,1.0 );baseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );diffuseColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
1950
+ i.ShaderStore.ShadersStore[xi] || (i.ShaderStore.ShadersStore[xi] = Ti);
1951
+ var _i = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
1940
1952
  try {
1941
- for (var Ti_1 = __values(Ti), Ti_1_1 = Ti_1.next(); !Ti_1_1.done; Ti_1_1 = Ti_1.next()) {
1942
- var e_109 = Ti_1_1.value;
1943
- i.ShaderStore.IncludesShadersStore[e_109.name] || (i.ShaderStore.IncludesShadersStore[e_109.name] = e_109.shader);
1953
+ for (var _i_1 = __values(_i), _i_1_1 = _i_1.next(); !_i_1_1.done; _i_1_1 = _i_1.next()) {
1954
+ var e_110 = _i_1_1.value;
1955
+ i.ShaderStore.IncludesShadersStore[e_110.name] || (i.ShaderStore.IncludesShadersStore[e_110.name] = e_110.shader);
1944
1956
  }
1945
1957
  }
1946
1958
  catch (e_22_1) { e_22 = { error: e_22_1 }; }
1947
1959
  finally {
1948
1960
  try {
1949
- if (Ti_1_1 && !Ti_1_1.done && (_z = Ti_1.return)) _z.call(Ti_1);
1961
+ if (_i_1_1 && !_i_1_1.done && (_z = _i_1.return)) _z.call(_i_1);
1950
1962
  }
1951
1963
  finally { if (e_22) throw e_22.error; }
1952
1964
  }
1953
- var _i = { __proto__: null, lavaPixelShader: { name: Si, shader: xi } };
1954
- var Ci = "lavaVertexShader", Ei = "uniform time: f32;uniform lowFrequencySpeed: f32;varying noise: f32;attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n/* NOISE FUNCTIONS */\nfn mod289v3(x: vec3f)->vec3f\n{return x-floor(x*(1.0/289.0))*289.0;}\nfn mod289v4(x: vec4f)->vec4f\n{return x-floor(x*(1.0/289.0))*289.0;}\nfn permute(x: vec4f)->vec4f\n{return mod289v4(((x*34.0)+1.0)*x);}\nfn taylorInvSqrt(r: vec4f)->vec4f\n{return vec4f(1.79284291400159)-0.85373472095314*r;}\nfn fade(t: vec3f)->vec3f {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfn pnoise(P: vec3f,rep: vec3f)->f32\n{var Pi0: vec3f=(P-rep*floor(P/rep)); \nPi0=floor(Pi0);var Pi1: vec3f=Pi0+ vec3f(1.0);Pi1=Pi1-rep*floor(Pi1/rep);Pi0=mod289v3(Pi0);Pi1=mod289v3(Pi1);var Pf0: vec3f=fract(P);var Pf1: vec3f=Pf0- vec3f(1.0);var ix: vec4f= vec4f(Pi0.x,Pi1.x,Pi0.x,Pi1.x);var iy: vec4f= vec4f(Pi0.y,Pi0.y,Pi1.y,Pi1.y);var iz0: vec4f= vec4f(Pi0.z);var iz1: vec4f= vec4f(Pi1.z);var ixy: vec4f=permute(permute(ix)+iy);var ixy0: vec4f=permute(ixy+iz0);var ixy1: vec4f=permute(ixy+iz1);var gx0: vec4f=ixy0*(1.0/7.0);var gy0: vec4f=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);var gz0: vec4f= vec4f(0.5)-abs(gx0)-abs(gy0);var sz0: vec4f=step(gz0, vec4f(0.0));gx0=gx0-sz0*(step( vec4f(0.0),gx0)-0.5);gy0=gy0-sz0*(step( vec4f(0.0),gy0)-0.5);var gx1: vec4f=ixy1*(1.0/7.0);var gy1: vec4f=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);var gz1: vec4f= vec4f(0.5)-abs(gx1)-abs(gy1);var sz1: vec4f=step(gz1, vec4f(0.0));gx1=gx1-sz1*(step( vec4f(0.0),gx1)-0.5);gy1=gy1-sz1*(step( vec4f(0.0),gy1)-0.5);var g000: vec3f= vec3f(gx0.x,gy0.x,gz0.x);var g100: vec3f= vec3f(gx0.y,gy0.y,gz0.y);var g010: vec3f= vec3f(gx0.z,gy0.z,gz0.z);var g110: vec3f= vec3f(gx0.w,gy0.w,gz0.w);var g001: vec3f= vec3f(gx1.x,gy1.x,gz1.x);var g101: vec3f= vec3f(gx1.y,gy1.y,gz1.y);var g011: vec3f= vec3f(gx1.z,gy1.z,gz1.z);var g111: vec3f= vec3f(gx1.w,gy1.w,gz1.w);var norm0: vec4f=taylorInvSqrt( vec4f(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000=g000*norm0.x;g010=g010*norm0.y;g100=g100*norm0.z;g110=g110*norm0.w;var norm1: vec4f=taylorInvSqrt( vec4f(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001=g001*norm1.x;g011=g011*norm1.y;g101=g101*norm1.z;g111=g111*norm1.w;var n000: f32=dot(g000,Pf0);var n100: f32=dot(g100, vec3f(Pf1.x,Pf0.yz));var n010: f32=dot(g010, vec3f(Pf0.x,Pf1.y,Pf0.z));var n110: f32=dot(g110, vec3f(Pf1.xy,Pf0.z));var n001: f32=dot(g001, vec3f(Pf0.xy,Pf1.z));var n101: f32=dot(g101, vec3f(Pf1.x,Pf0.y,Pf1.z));var n011: f32=dot(g011, vec3f(Pf0.x,Pf1.yz));var n111: f32=dot(g111,Pf1);var fade_xyz: vec3f=fade(Pf0);var n_z: vec4f=mix( vec4f(n000,n100,n010,n110), vec4f(n001,n101,n011,n111), vec4f(fade_xyz.z));var n_yz: vec2f=mix(n_z.xy,n_z.zw, vec2f(fade_xyz.y));var n_xyz: f32=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;}\n/* END FUNCTION */\nfn turbulence(p: vec3f)->f32 {var w: f32=100.0;var t: f32=-.5;for (var f: f32=1.0; f<=10.0; f=f+1.0){var power: f32=pow(2.0,f);t=t+abs(pnoise( vec3f(power*p), vec3f(10.0,10.0,10.0))/power);}\nreturn t;}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef NORMAL\nvertexOutputs.noise=10.0*-.10*turbulence(.5*vertexInputs.normal+uniforms.time*1.15);var b: f32=uniforms.lowFrequencySpeed*5.0*pnoise(0.05*vertexInputs.position+ vec3f(uniforms.time*1.025), vec3f(100.0));var displacement: f32=-1.5*vertexOutputs.noise+b;var newPosition: vec3f=vertexInputs.position+vertexInputs.normal*displacement;vertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(newPosition,1.0);var worldPos: vec4f=finalWorld* vec4f(newPosition,1.0);vertexOutputs.vPositionW= worldPos.xyz;vertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1955
- i.ShaderStore.ShadersStoreWGSL[Ci] || (i.ShaderStore.ShadersStoreWGSL[Ci] = Ei);
1956
- var Li = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
1965
+ var Ci = { __proto__: null, lavaPixelShader: { name: xi, shader: Ti } };
1966
+ var Ei = "lavaVertexShader", Li = "uniform time: f32;uniform lowFrequencySpeed: f32;varying noise: f32;attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n/* NOISE FUNCTIONS */\nfn mod289v3(x: vec3f)->vec3f\n{return x-floor(x*(1.0/289.0))*289.0;}\nfn mod289v4(x: vec4f)->vec4f\n{return x-floor(x*(1.0/289.0))*289.0;}\nfn permute(x: vec4f)->vec4f\n{return mod289v4(((x*34.0)+1.0)*x);}\nfn taylorInvSqrt(r: vec4f)->vec4f\n{return vec4f(1.79284291400159)-0.85373472095314*r;}\nfn fade(t: vec3f)->vec3f {return t*t*t*(t*(t*6.0-15.0)+10.0);}\nfn pnoise(P: vec3f,rep: vec3f)->f32\n{var Pi0: vec3f=(P-rep*floor(P/rep)); \nPi0=floor(Pi0);var Pi1: vec3f=Pi0+ vec3f(1.0);Pi1=Pi1-rep*floor(Pi1/rep);Pi0=mod289v3(Pi0);Pi1=mod289v3(Pi1);var Pf0: vec3f=fract(P);var Pf1: vec3f=Pf0- vec3f(1.0);var ix: vec4f= vec4f(Pi0.x,Pi1.x,Pi0.x,Pi1.x);var iy: vec4f= vec4f(Pi0.y,Pi0.y,Pi1.y,Pi1.y);var iz0: vec4f= vec4f(Pi0.z);var iz1: vec4f= vec4f(Pi1.z);var ixy: vec4f=permute(permute(ix)+iy);var ixy0: vec4f=permute(ixy+iz0);var ixy1: vec4f=permute(ixy+iz1);var gx0: vec4f=ixy0*(1.0/7.0);var gy0: vec4f=fract(floor(gx0)*(1.0/7.0))-0.5;gx0=fract(gx0);var gz0: vec4f= vec4f(0.5)-abs(gx0)-abs(gy0);var sz0: vec4f=step(gz0, vec4f(0.0));gx0=gx0-sz0*(step( vec4f(0.0),gx0)-0.5);gy0=gy0-sz0*(step( vec4f(0.0),gy0)-0.5);var gx1: vec4f=ixy1*(1.0/7.0);var gy1: vec4f=fract(floor(gx1)*(1.0/7.0))-0.5;gx1=fract(gx1);var gz1: vec4f= vec4f(0.5)-abs(gx1)-abs(gy1);var sz1: vec4f=step(gz1, vec4f(0.0));gx1=gx1-sz1*(step( vec4f(0.0),gx1)-0.5);gy1=gy1-sz1*(step( vec4f(0.0),gy1)-0.5);var g000: vec3f= vec3f(gx0.x,gy0.x,gz0.x);var g100: vec3f= vec3f(gx0.y,gy0.y,gz0.y);var g010: vec3f= vec3f(gx0.z,gy0.z,gz0.z);var g110: vec3f= vec3f(gx0.w,gy0.w,gz0.w);var g001: vec3f= vec3f(gx1.x,gy1.x,gz1.x);var g101: vec3f= vec3f(gx1.y,gy1.y,gz1.y);var g011: vec3f= vec3f(gx1.z,gy1.z,gz1.z);var g111: vec3f= vec3f(gx1.w,gy1.w,gz1.w);var norm0: vec4f=taylorInvSqrt( vec4f(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));g000=g000*norm0.x;g010=g010*norm0.y;g100=g100*norm0.z;g110=g110*norm0.w;var norm1: vec4f=taylorInvSqrt( vec4f(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));g001=g001*norm1.x;g011=g011*norm1.y;g101=g101*norm1.z;g111=g111*norm1.w;var n000: f32=dot(g000,Pf0);var n100: f32=dot(g100, vec3f(Pf1.x,Pf0.yz));var n010: f32=dot(g010, vec3f(Pf0.x,Pf1.y,Pf0.z));var n110: f32=dot(g110, vec3f(Pf1.xy,Pf0.z));var n001: f32=dot(g001, vec3f(Pf0.xy,Pf1.z));var n101: f32=dot(g101, vec3f(Pf1.x,Pf0.y,Pf1.z));var n011: f32=dot(g011, vec3f(Pf0.x,Pf1.yz));var n111: f32=dot(g111,Pf1);var fade_xyz: vec3f=fade(Pf0);var n_z: vec4f=mix( vec4f(n000,n100,n010,n110), vec4f(n001,n101,n011,n111), vec4f(fade_xyz.z));var n_yz: vec2f=mix(n_z.xy,n_z.zw, vec2f(fade_xyz.y));var n_xyz: f32=mix(n_yz.x,n_yz.y,fade_xyz.x);return 2.2*n_xyz;}\n/* END FUNCTION */\nfn turbulence(p: vec3f)->f32 {var w: f32=100.0;var t: f32=-.5;for (var f: f32=1.0; f<=10.0; f=f+1.0){var power: f32=pow(2.0,f);t=t+abs(pnoise( vec3f(power*p), vec3f(10.0,10.0,10.0))/power);}\nreturn t;}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#ifdef NORMAL\nvertexOutputs.noise=10.0*-.10*turbulence(.5*vertexInputs.normal+uniforms.time*1.15);var b: f32=uniforms.lowFrequencySpeed*5.0*pnoise(0.05*vertexInputs.position+ vec3f(uniforms.time*1.025), vec3f(100.0));var displacement: f32=-1.5*vertexOutputs.noise+b;var newPosition: vec3f=vertexInputs.position+vertexInputs.normal*displacement;vertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(newPosition,1.0);var worldPos: vec4f=finalWorld* vec4f(newPosition,1.0);vertexOutputs.vPositionW= worldPos.xyz;vertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1967
+ i.ShaderStore.ShadersStoreWGSL[Ei] || (i.ShaderStore.ShadersStoreWGSL[Ei] = Li);
1968
+ var Pi = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
1957
1969
  try {
1958
- for (var Li_1 = __values(Li), Li_1_1 = Li_1.next(); !Li_1_1.done; Li_1_1 = Li_1.next()) {
1959
- var e_110 = Li_1_1.value;
1960
- i.ShaderStore.IncludesShadersStoreWGSL[e_110.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_110.name] = e_110.shader);
1970
+ for (var Pi_1 = __values(Pi), Pi_1_1 = Pi_1.next(); !Pi_1_1.done; Pi_1_1 = Pi_1.next()) {
1971
+ var e_111 = Pi_1_1.value;
1972
+ i.ShaderStore.IncludesShadersStoreWGSL[e_111.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_111.name] = e_111.shader);
1961
1973
  }
1962
1974
  }
1963
1975
  catch (e_23_1) { e_23 = { error: e_23_1 }; }
1964
1976
  finally {
1965
1977
  try {
1966
- if (Li_1_1 && !Li_1_1.done && (_0 = Li_1.return)) _0.call(Li_1);
1978
+ if (Pi_1_1 && !Pi_1_1.done && (_0 = Pi_1.return)) _0.call(Pi_1);
1967
1979
  }
1968
1980
  finally { if (e_23) throw e_23.error; }
1969
1981
  }
1970
- var Pi = { __proto__: null, lavaVertexShaderWGSL: { name: Ci, shader: Ei } };
1971
- var Ii = "lavaPixelShader", Di = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;uniform time: f32;uniform speed: f32;uniform movingSpeed: f32;uniform fogColor: vec3f;var noiseTextureSampler: sampler;var noiseTexture: texture_2d<f32>;uniform fogDensity: f32;varying noise: f32;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0]\n#include<lightUboDeclaration>[1]\n#include<lightUboDeclaration>[2]\n#include<lightUboDeclaration>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfn random(scale: vec3f,seed: f32)->f32 {return fract(sin(dot(fragmentInputs.position.xyz+seed,scale))*43758.5453+seed);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nvar noiseTex: vec4f=textureSample(noiseTexture,noiseTextureSampler,fragmentInputs.vDiffuseUV);var T1: vec2f=fragmentInputs.vDiffuseUV+ vec2f(1.5,-1.5)*uniforms.time*0.02;var T2: vec2f=fragmentInputs.vDiffuseUV+ vec2f(-0.5,2.0)*uniforms.time*0.01*uniforms.speed;T1=vec2f(T1.x+noiseTex.x*2.0,T1.y+noiseTex.y*2.0);T2=vec2f(T2.x-noiseTex.y*0.2-uniforms.time*0.001*uniforms.movingSpeed,T2.y+noiseTex.z*0.2+uniforms.time*0.002*uniforms.movingSpeed);var p: f32=textureSample(noiseTexture,noiseTextureSampler,T1*3.0).a;var lavaColor: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,T2*4.0);var temp: vec4f=lavaColor*( vec4f(p,p,p,p)*2.)+(lavaColor*lavaColor-0.1);baseColor=temp;var depth: f32=fragmentInputs.position.z*4.0;let LOG2: f32=1.442695;var fogFactor: f32=exp2(-uniforms.fogDensity*uniforms.fogDensity*depth*depth*LOG2);fogFactor=1.0-clamp(fogFactor,0.0,1.0);baseColor=mix(baseColor, vec4f(uniforms.fogColor,baseColor.w), vec4f(fogFactor));diffuseColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef UNLIT\nvar diffuseBase: vec3f= vec3f(1.,1.,1.);\n#else\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1972
- i.ShaderStore.ShadersStoreWGSL[Ii] || (i.ShaderStore.ShadersStoreWGSL[Ii] = Di);
1973
- var bi = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1982
+ var Ii = { __proto__: null, lavaVertexShaderWGSL: { name: Ei, shader: Li } };
1983
+ var Di = "lavaPixelShader", bi = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;uniform time: f32;uniform speed: f32;uniform movingSpeed: f32;uniform fogColor: vec3f;var noiseTextureSampler: sampler;var noiseTexture: texture_2d<f32>;uniform fogDensity: f32;varying noise: f32;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0]\n#include<lightUboDeclaration>[1]\n#include<lightUboDeclaration>[2]\n#include<lightUboDeclaration>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nfn random(scale: vec3f,seed: f32)->f32 {return fract(sin(dot(fragmentInputs.position.xyz+seed,scale))*43758.5453+seed);}\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nvar noiseTex: vec4f=textureSample(noiseTexture,noiseTextureSampler,fragmentInputs.vDiffuseUV);var T1: vec2f=fragmentInputs.vDiffuseUV+ vec2f(1.5,-1.5)*uniforms.time*0.02;var T2: vec2f=fragmentInputs.vDiffuseUV+ vec2f(-0.5,2.0)*uniforms.time*0.01*uniforms.speed;T1=vec2f(T1.x+noiseTex.x*2.0,T1.y+noiseTex.y*2.0);T2=vec2f(T2.x-noiseTex.y*0.2-uniforms.time*0.001*uniforms.movingSpeed,T2.y+noiseTex.z*0.2+uniforms.time*0.002*uniforms.movingSpeed);var p: f32=textureSample(noiseTexture,noiseTextureSampler,T1*3.0).a;var lavaColor: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,T2*4.0);var temp: vec4f=lavaColor*( vec4f(p,p,p,p)*2.)+(lavaColor*lavaColor-0.1);baseColor=temp;var depth: f32=fragmentInputs.position.z*4.0;let LOG2: f32=1.442695;var fogFactor: f32=exp2(-uniforms.fogDensity*uniforms.fogDensity*depth*depth*LOG2);fogFactor=1.0-clamp(fogFactor,0.0,1.0);baseColor=mix(baseColor, vec4f(uniforms.fogColor,baseColor.w), vec4f(fogFactor));diffuseColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef UNLIT\nvar diffuseBase: vec3f= vec3f(1.,1.,1.);\n#else\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
1984
+ i.ShaderStore.ShadersStoreWGSL[Di] || (i.ShaderStore.ShadersStoreWGSL[Di] = bi);
1985
+ var Ai = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
1974
1986
  try {
1975
- for (var bi_1 = __values(bi), bi_1_1 = bi_1.next(); !bi_1_1.done; bi_1_1 = bi_1.next()) {
1976
- var e_111 = bi_1_1.value;
1977
- i.ShaderStore.IncludesShadersStoreWGSL[e_111.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_111.name] = e_111.shader);
1987
+ for (var Ai_1 = __values(Ai), Ai_1_1 = Ai_1.next(); !Ai_1_1.done; Ai_1_1 = Ai_1.next()) {
1988
+ var e_112 = Ai_1_1.value;
1989
+ i.ShaderStore.IncludesShadersStoreWGSL[e_112.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_112.name] = e_112.shader);
1978
1990
  }
1979
1991
  }
1980
1992
  catch (e_24_1) { e_24 = { error: e_24_1 }; }
1981
1993
  finally {
1982
1994
  try {
1983
- if (bi_1_1 && !bi_1_1.done && (_1 = bi_1.return)) _1.call(bi_1);
1995
+ if (Ai_1_1 && !Ai_1_1.done && (_1 = Ai_1.return)) _1.call(Ai_1);
1984
1996
  }
1985
1997
  finally { if (e_24) throw e_24.error; }
1986
1998
  }
1987
- var Ai = { __proto__: null, lavaPixelShaderWGSL: { name: Ii, shader: Di } };
1988
- var Fi = "mixVertexShader", Oi = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
1989
- i.ShaderStore.ShadersStore[Fi] || (i.ShaderStore.ShadersStore[Fi] = Oi);
1990
- var Ni = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
1999
+ var Fi = { __proto__: null, lavaPixelShaderWGSL: { name: Di, shader: bi } };
2000
+ var Oi = "mixVertexShader", Ri = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2001
+ i.ShaderStore.ShadersStore[Oi] || (i.ShaderStore.ShadersStore[Oi] = Ri);
2002
+ var Mi = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
1991
2003
  try {
1992
- for (var Ni_1 = __values(Ni), Ni_1_1 = Ni_1.next(); !Ni_1_1.done; Ni_1_1 = Ni_1.next()) {
1993
- var e_112 = Ni_1_1.value;
1994
- i.ShaderStore.IncludesShadersStore[e_112.name] || (i.ShaderStore.IncludesShadersStore[e_112.name] = e_112.shader);
2004
+ for (var Mi_1 = __values(Mi), Mi_1_1 = Mi_1.next(); !Mi_1_1.done; Mi_1_1 = Mi_1.next()) {
2005
+ var e_113 = Mi_1_1.value;
2006
+ i.ShaderStore.IncludesShadersStore[e_113.name] || (i.ShaderStore.IncludesShadersStore[e_113.name] = e_113.shader);
1995
2007
  }
1996
2008
  }
1997
2009
  catch (e_25_1) { e_25 = { error: e_25_1 }; }
1998
2010
  finally {
1999
2011
  try {
2000
- if (Ni_1_1 && !Ni_1_1.done && (_2 = Ni_1.return)) _2.call(Ni_1);
2012
+ if (Mi_1_1 && !Mi_1_1.done && (_2 = Mi_1.return)) _2.call(Mi_1);
2001
2013
  }
2002
2014
  finally { if (e_25) throw e_25.error; }
2003
2015
  }
2004
- var Mi = { __proto__: null, mixVertexShader: { name: Fi, shader: Oi } };
2005
- var Ri = "mixPixelShader", yi = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D mixMap1Sampler;uniform vec2 vTextureInfos;\n#ifdef MIXMAP2\nuniform sampler2D mixMap2Sampler;\n#endif\nuniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform sampler2D diffuse4Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;uniform vec2 diffuse4Infos;\n#ifdef MIXMAP2\nuniform sampler2D diffuse5Sampler;uniform sampler2D diffuse6Sampler;uniform sampler2D diffuse7Sampler;uniform sampler2D diffuse8Sampler;uniform vec2 diffuse5Infos;uniform vec2 diffuse6Infos;uniform vec2 diffuse7Infos;uniform vec2 diffuse8Infos;\n#endif\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 finalMixColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvec4 mixColor2=vec4(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nvec4 mixColor=texture2D(mixMap1Sampler,vTextureUV);\n#include<depthPrePass>\nmixColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);vec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);diffuse1Color.rgb*=mixColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);diffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a);\n#ifdef MIXMAP2\nmixColor=texture2D(mixMap2Sampler,vTextureUV);mixColor.rgb*=vTextureInfos.y;vec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);vec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);vec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);vec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);diffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);diffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);diffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a);\n#endif\n#endif\n#ifdef VERTEXCOLOR\nfinalMixColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2006
- i.ShaderStore.ShadersStore[Ri] || (i.ShaderStore.ShadersStore[Ri] = yi);
2007
- var Vi = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2016
+ var Ni = { __proto__: null, mixVertexShader: { name: Oi, shader: Ri } };
2017
+ var yi = "mixPixelShader", Vi = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D mixMap1Sampler;uniform vec2 vTextureInfos;\n#ifdef MIXMAP2\nuniform sampler2D mixMap2Sampler;\n#endif\nuniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform sampler2D diffuse4Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;uniform vec2 diffuse4Infos;\n#ifdef MIXMAP2\nuniform sampler2D diffuse5Sampler;uniform sampler2D diffuse6Sampler;uniform sampler2D diffuse7Sampler;uniform sampler2D diffuse8Sampler;uniform vec2 diffuse5Infos;uniform vec2 diffuse6Infos;uniform vec2 diffuse7Infos;uniform vec2 diffuse8Infos;\n#endif\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 finalMixColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvec4 mixColor2=vec4(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nvec4 mixColor=texture2D(mixMap1Sampler,vTextureUV);\n#include<depthPrePass>\nmixColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);vec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);diffuse1Color.rgb*=mixColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);diffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a);\n#ifdef MIXMAP2\nmixColor=texture2D(mixMap2Sampler,vTextureUV);mixColor.rgb*=vTextureInfos.y;vec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);vec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);vec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);vec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);diffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);diffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);diffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);finalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a);\n#endif\n#endif\n#ifdef VERTEXCOLOR\nfinalMixColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2018
+ i.ShaderStore.ShadersStore[yi] || (i.ShaderStore.ShadersStore[yi] = Vi);
2019
+ var Ui = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2008
2020
  try {
2009
- for (var Vi_1 = __values(Vi), Vi_1_1 = Vi_1.next(); !Vi_1_1.done; Vi_1_1 = Vi_1.next()) {
2010
- var e_113 = Vi_1_1.value;
2011
- i.ShaderStore.IncludesShadersStore[e_113.name] || (i.ShaderStore.IncludesShadersStore[e_113.name] = e_113.shader);
2021
+ for (var Ui_1 = __values(Ui), Ui_1_1 = Ui_1.next(); !Ui_1_1.done; Ui_1_1 = Ui_1.next()) {
2022
+ var e_114 = Ui_1_1.value;
2023
+ i.ShaderStore.IncludesShadersStore[e_114.name] || (i.ShaderStore.IncludesShadersStore[e_114.name] = e_114.shader);
2012
2024
  }
2013
2025
  }
2014
2026
  catch (e_26_1) { e_26 = { error: e_26_1 }; }
2015
2027
  finally {
2016
2028
  try {
2017
- if (Vi_1_1 && !Vi_1_1.done && (_3 = Vi_1.return)) _3.call(Vi_1);
2029
+ if (Ui_1_1 && !Ui_1_1.done && (_3 = Ui_1.return)) _3.call(Ui_1);
2018
2030
  }
2019
2031
  finally { if (e_26) throw e_26.error; }
2020
2032
  }
2021
- var Ui = { __proto__: null, mixPixelShader: { name: Ri, shader: yi } };
2022
- var wi = "mixVertexShader", Gi = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;uniform textureMatrix: mat4x4f;uniform vTextureInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vTextureInfos.x==0.)\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2023
- i.ShaderStore.ShadersStoreWGSL[wi] || (i.ShaderStore.ShadersStoreWGSL[wi] = Gi);
2024
- var Wi = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
2033
+ var wi = { __proto__: null, mixPixelShader: { name: yi, shader: Vi } };
2034
+ var Gi = "mixVertexShader", Wi = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;uniform textureMatrix: mat4x4f;uniform vTextureInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vTextureInfos.x==0.)\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2035
+ i.ShaderStore.ShadersStoreWGSL[Gi] || (i.ShaderStore.ShadersStoreWGSL[Gi] = Wi);
2036
+ var Bi = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
2025
2037
  try {
2026
- for (var Wi_1 = __values(Wi), Wi_1_1 = Wi_1.next(); !Wi_1_1.done; Wi_1_1 = Wi_1.next()) {
2027
- var e_114 = Wi_1_1.value;
2028
- i.ShaderStore.IncludesShadersStoreWGSL[e_114.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_114.name] = e_114.shader);
2038
+ for (var Bi_1 = __values(Bi), Bi_1_1 = Bi_1.next(); !Bi_1_1.done; Bi_1_1 = Bi_1.next()) {
2039
+ var e_115 = Bi_1_1.value;
2040
+ i.ShaderStore.IncludesShadersStoreWGSL[e_115.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_115.name] = e_115.shader);
2029
2041
  }
2030
2042
  }
2031
2043
  catch (e_27_1) { e_27 = { error: e_27_1 }; }
2032
2044
  finally {
2033
2045
  try {
2034
- if (Wi_1_1 && !Wi_1_1.done && (_4 = Wi_1.return)) _4.call(Wi_1);
2046
+ if (Bi_1_1 && !Bi_1_1.done && (_4 = Bi_1.return)) _4.call(Bi_1);
2035
2047
  }
2036
2048
  finally { if (e_27) throw e_27.error; }
2037
2049
  }
2038
- var Bi = { __proto__: null, mixVertexShaderWGSL: { name: wi, shader: Gi } };
2039
- var zi = "mixPixelShader", Hi = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;var mixMap1SamplerSampler: sampler;var mixMap1Sampler: texture_2d<f32>;uniform vTextureInfos: vec2f;\n#ifdef MIXMAP2\nvar mixMap2SamplerSampler: sampler;var mixMap2Sampler: texture_2d<f32>;\n#endif\nvar diffuse1SamplerSampler: sampler;var diffuse1Sampler: texture_2d<f32>;var diffuse2SamplerSampler: sampler;var diffuse2Sampler: texture_2d<f32>;var diffuse3SamplerSampler: sampler;var diffuse3Sampler: texture_2d<f32>;var diffuse4SamplerSampler: sampler;var diffuse4Sampler: texture_2d<f32>;uniform diffuse1Infos: vec2f;uniform diffuse2Infos: vec2f;uniform diffuse3Infos: vec2f;uniform diffuse4Infos: vec2f;\n#ifdef MIXMAP2\nvar diffuse5SamplerSampler: sampler;var diffuse5Sampler: texture_2d<f32>;var diffuse6SamplerSampler: sampler;var diffuse6Sampler: texture_2d<f32>;var diffuse7SamplerSampler: sampler;var diffuse7Sampler: texture_2d<f32>;var diffuse8SamplerSampler: sampler;var diffuse8Sampler: texture_2d<f32>;uniform diffuse5Infos: vec2f;uniform diffuse6Infos: vec2f;uniform diffuse7Infos: vec2f;uniform diffuse8Infos: vec2f;\n#endif\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var finalMixColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvar mixColor2: vec4f= vec4f(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\nvar alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nvar mixColor: vec4f=textureSample(mixMap1Sampler,mixMap1SamplerSampler,fragmentInputs.vTextureUV);\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nmixColor=vec4f(mixColor.rgb*uniforms.vTextureInfos.y,mixColor.a);var diffuse1Color: vec4f=textureSample(diffuse1Sampler,diffuse1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos);var diffuse2Color: vec4f=textureSample(diffuse2Sampler,diffuse2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos);var diffuse3Color: vec4f=textureSample(diffuse3Sampler,diffuse3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos);var diffuse4Color: vec4f=textureSample(diffuse4Sampler,diffuse4SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse4Infos);diffuse1Color=vec4f(diffuse1Color.rgb*mixColor.r,diffuse1Color.a);diffuse2Color=vec4f(mix(diffuse1Color.rgb,diffuse2Color.rgb,vec3f(mixColor.g)),diffuse2Color.a);diffuse3Color=vec4f(mix(diffuse2Color.rgb,diffuse3Color.rgb,vec3f(mixColor.b)),diffuse3Color.a);finalMixColor=vec4f(mix(diffuse3Color.rgb,diffuse4Color.rgb,vec3f(1.0-mixColor.a)),finalMixColor.a);\n#ifdef MIXMAP2\nmixColor=textureSample(mixMap2Sampler,mixMap2SamplerSampler,fragmentInputs.vTextureUV);mixColor=vec4f(mixColor.rgb*uniforms.vTextureInfos.y,mixColor.a);var diffuse5Color: vec4f=textureSample(diffuse5Sampler,diffuse5SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse5Infos);var diffuse6Color: vec4f=textureSample(diffuse6Sampler,diffuse6SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse6Infos);var diffuse7Color: vec4f=textureSample(diffuse7Sampler,diffuse7SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse7Infos);var diffuse8Color: vec4f=textureSample(diffuse8Sampler,diffuse8SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse8Infos);diffuse5Color=vec4f(mix(finalMixColor.rgb,diffuse5Color.rgb,vec3f(mixColor.r)),diffuse5Color.a);diffuse6Color=vec4f(mix(diffuse5Color.rgb,diffuse6Color.rgb,vec3f(mixColor.g)),diffuse6Color.a);diffuse7Color=vec4f(mix(diffuse6Color.rgb,diffuse7Color.rgb,vec3f(mixColor.b)),diffuse7Color.a);finalMixColor=vec4f(mix(diffuse7Color.rgb,diffuse8Color.rgb,vec3f(1.0-mixColor.a)),finalMixColor.a);\n#endif\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nfinalMixColor=vec4f(finalMixColor.rgb*fragmentInputs.vColor.rgb,finalMixColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,vec3f(0.0),vec3f(1.0));var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2040
- i.ShaderStore.ShadersStoreWGSL[zi] || (i.ShaderStore.ShadersStoreWGSL[zi] = Hi);
2041
- var ki = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2050
+ var zi = { __proto__: null, mixVertexShaderWGSL: { name: Gi, shader: Wi } };
2051
+ var Hi = "mixPixelShader", ki = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;var mixMap1SamplerSampler: sampler;var mixMap1Sampler: texture_2d<f32>;uniform vTextureInfos: vec2f;\n#ifdef MIXMAP2\nvar mixMap2SamplerSampler: sampler;var mixMap2Sampler: texture_2d<f32>;\n#endif\nvar diffuse1SamplerSampler: sampler;var diffuse1Sampler: texture_2d<f32>;var diffuse2SamplerSampler: sampler;var diffuse2Sampler: texture_2d<f32>;var diffuse3SamplerSampler: sampler;var diffuse3Sampler: texture_2d<f32>;var diffuse4SamplerSampler: sampler;var diffuse4Sampler: texture_2d<f32>;uniform diffuse1Infos: vec2f;uniform diffuse2Infos: vec2f;uniform diffuse3Infos: vec2f;uniform diffuse4Infos: vec2f;\n#ifdef MIXMAP2\nvar diffuse5SamplerSampler: sampler;var diffuse5Sampler: texture_2d<f32>;var diffuse6SamplerSampler: sampler;var diffuse6Sampler: texture_2d<f32>;var diffuse7SamplerSampler: sampler;var diffuse7Sampler: texture_2d<f32>;var diffuse8SamplerSampler: sampler;var diffuse8Sampler: texture_2d<f32>;uniform diffuse5Infos: vec2f;uniform diffuse6Infos: vec2f;uniform diffuse7Infos: vec2f;uniform diffuse8Infos: vec2f;\n#endif\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var finalMixColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvar mixColor2: vec4f= vec4f(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\nvar alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nvar mixColor: vec4f=textureSample(mixMap1Sampler,mixMap1SamplerSampler,fragmentInputs.vTextureUV);\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nmixColor=vec4f(mixColor.rgb*uniforms.vTextureInfos.y,mixColor.a);var diffuse1Color: vec4f=textureSample(diffuse1Sampler,diffuse1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos);var diffuse2Color: vec4f=textureSample(diffuse2Sampler,diffuse2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos);var diffuse3Color: vec4f=textureSample(diffuse3Sampler,diffuse3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos);var diffuse4Color: vec4f=textureSample(diffuse4Sampler,diffuse4SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse4Infos);diffuse1Color=vec4f(diffuse1Color.rgb*mixColor.r,diffuse1Color.a);diffuse2Color=vec4f(mix(diffuse1Color.rgb,diffuse2Color.rgb,vec3f(mixColor.g)),diffuse2Color.a);diffuse3Color=vec4f(mix(diffuse2Color.rgb,diffuse3Color.rgb,vec3f(mixColor.b)),diffuse3Color.a);finalMixColor=vec4f(mix(diffuse3Color.rgb,diffuse4Color.rgb,vec3f(1.0-mixColor.a)),finalMixColor.a);\n#ifdef MIXMAP2\nmixColor=textureSample(mixMap2Sampler,mixMap2SamplerSampler,fragmentInputs.vTextureUV);mixColor=vec4f(mixColor.rgb*uniforms.vTextureInfos.y,mixColor.a);var diffuse5Color: vec4f=textureSample(diffuse5Sampler,diffuse5SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse5Infos);var diffuse6Color: vec4f=textureSample(diffuse6Sampler,diffuse6SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse6Infos);var diffuse7Color: vec4f=textureSample(diffuse7Sampler,diffuse7SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse7Infos);var diffuse8Color: vec4f=textureSample(diffuse8Sampler,diffuse8SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse8Infos);diffuse5Color=vec4f(mix(finalMixColor.rgb,diffuse5Color.rgb,vec3f(mixColor.r)),diffuse5Color.a);diffuse6Color=vec4f(mix(diffuse5Color.rgb,diffuse6Color.rgb,vec3f(mixColor.g)),diffuse6Color.a);diffuse7Color=vec4f(mix(diffuse6Color.rgb,diffuse7Color.rgb,vec3f(mixColor.b)),diffuse7Color.a);finalMixColor=vec4f(mix(diffuse7Color.rgb,diffuse8Color.rgb,vec3f(1.0-mixColor.a)),finalMixColor.a);\n#endif\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef VERTEXCOLOR\nfinalMixColor=vec4f(finalMixColor.rgb*fragmentInputs.vColor.rgb,finalMixColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor*finalMixColor.rgb,vec3f(0.0),vec3f(1.0));var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2052
+ i.ShaderStore.ShadersStoreWGSL[Hi] || (i.ShaderStore.ShadersStoreWGSL[Hi] = ki);
2053
+ var Xi = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2042
2054
  try {
2043
- for (var ki_1 = __values(ki), ki_1_1 = ki_1.next(); !ki_1_1.done; ki_1_1 = ki_1.next()) {
2044
- var e_115 = ki_1_1.value;
2045
- i.ShaderStore.IncludesShadersStoreWGSL[e_115.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_115.name] = e_115.shader);
2055
+ for (var Xi_1 = __values(Xi), Xi_1_1 = Xi_1.next(); !Xi_1_1.done; Xi_1_1 = Xi_1.next()) {
2056
+ var e_116 = Xi_1_1.value;
2057
+ i.ShaderStore.IncludesShadersStoreWGSL[e_116.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_116.name] = e_116.shader);
2046
2058
  }
2047
2059
  }
2048
2060
  catch (e_28_1) { e_28 = { error: e_28_1 }; }
2049
2061
  finally {
2050
2062
  try {
2051
- if (ki_1_1 && !ki_1_1.done && (_5 = ki_1.return)) _5.call(ki_1);
2063
+ if (Xi_1_1 && !Xi_1_1.done && (_5 = Xi_1.return)) _5.call(Xi_1);
2052
2064
  }
2053
2065
  finally { if (e_28) throw e_28.error; }
2054
2066
  }
2055
- var Xi = { __proto__: null, mixPixelShaderWGSL: { name: zi, shader: Hi } };
2056
- var ji = "normalVertexShader", Zi = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2057
- i.ShaderStore.ShadersStore[ji] || (i.ShaderStore.ShadersStore[ji] = Zi);
2058
- var Yi = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex];
2067
+ var ji = { __proto__: null, mixPixelShaderWGSL: { name: Hi, shader: ki } };
2068
+ var Yi = "normalVertexShader", Zi = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2069
+ i.ShaderStore.ShadersStore[Yi] || (i.ShaderStore.ShadersStore[Yi] = Zi);
2070
+ var Ki = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex];
2059
2071
  try {
2060
- for (var Yi_1 = __values(Yi), Yi_1_1 = Yi_1.next(); !Yi_1_1.done; Yi_1_1 = Yi_1.next()) {
2061
- var e_116 = Yi_1_1.value;
2062
- i.ShaderStore.IncludesShadersStore[e_116.name] || (i.ShaderStore.IncludesShadersStore[e_116.name] = e_116.shader);
2072
+ for (var Ki_1 = __values(Ki), Ki_1_1 = Ki_1.next(); !Ki_1_1.done; Ki_1_1 = Ki_1.next()) {
2073
+ var e_117 = Ki_1_1.value;
2074
+ i.ShaderStore.IncludesShadersStore[e_117.name] || (i.ShaderStore.IncludesShadersStore[e_117.name] = e_117.shader);
2063
2075
  }
2064
2076
  }
2065
2077
  catch (e_29_1) { e_29 = { error: e_29_1 }; }
2066
2078
  finally {
2067
2079
  try {
2068
- if (Yi_1_1 && !Yi_1_1.done && (_6 = Yi_1.return)) _6.call(Yi_1);
2080
+ if (Ki_1_1 && !Ki_1_1.done && (_6 = Ki_1.return)) _6.call(Ki_1);
2069
2081
  }
2070
2082
  finally { if (e_29) throw e_29.error; }
2071
2083
  }
2072
- var Ki = { __proto__: null, normalVertexShader: { name: ji, shader: Zi } };
2073
- var qi = "normalPixelShader", Qi = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef LIGHTING\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef NORMAL\nbaseColor=mix(baseColor,vec4(vNormalW,1.0),0.5);\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef LIGHTING\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse= baseColor.rgb;\n#endif\nvec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
2074
- i.ShaderStore.ShadersStore[qi] || (i.ShaderStore.ShadersStore[qi] = Qi);
2075
- var Ji = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2084
+ var qi = { __proto__: null, normalVertexShader: { name: Yi, shader: Zi } };
2085
+ var Qi = "normalPixelShader", Ji = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef LIGHTING\n#include<helperFunctions>\n#include<__decl__lightFragment>[0]\n#include<__decl__lightFragment>[1]\n#include<__decl__lightFragment>[2]\n#include<__decl__lightFragment>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef NORMAL\nbaseColor=mix(baseColor,vec4(vNormalW,1.0),0.5);\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef LIGHTING\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse= baseColor.rgb;\n#endif\nvec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
2086
+ i.ShaderStore.ShadersStore[Qi] || (i.ShaderStore.ShadersStore[Qi] = Ji);
2087
+ var $i = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2076
2088
  try {
2077
- for (var Ji_1 = __values(Ji), Ji_1_1 = Ji_1.next(); !Ji_1_1.done; Ji_1_1 = Ji_1.next()) {
2078
- var e_117 = Ji_1_1.value;
2079
- i.ShaderStore.IncludesShadersStore[e_117.name] || (i.ShaderStore.IncludesShadersStore[e_117.name] = e_117.shader);
2089
+ for (var $i_1 = __values($i), $i_1_1 = $i_1.next(); !$i_1_1.done; $i_1_1 = $i_1.next()) {
2090
+ var e_118 = $i_1_1.value;
2091
+ i.ShaderStore.IncludesShadersStore[e_118.name] || (i.ShaderStore.IncludesShadersStore[e_118.name] = e_118.shader);
2080
2092
  }
2081
2093
  }
2082
2094
  catch (e_30_1) { e_30 = { error: e_30_1 }; }
2083
2095
  finally {
2084
2096
  try {
2085
- if (Ji_1_1 && !Ji_1_1.done && (_7 = Ji_1.return)) _7.call(Ji_1);
2097
+ if ($i_1_1 && !$i_1_1.done && (_7 = $i_1.return)) _7.call($i_1);
2086
2098
  }
2087
2099
  finally { if (e_30) throw e_30.error; }
2088
2100
  }
2089
- var $i = { __proto__: null, normalPixelShader: { name: qi, shader: Qi } };
2090
- var et = "normalVertexShader", it = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2091
- i.ShaderStore.ShadersStoreWGSL[et] || (i.ShaderStore.ShadersStoreWGSL[et] = it);
2092
- var tt = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL];
2101
+ var et = { __proto__: null, normalPixelShader: { name: Qi, shader: Ji } };
2102
+ var it = "normalVertexShader", tt = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2103
+ i.ShaderStore.ShadersStoreWGSL[it] || (i.ShaderStore.ShadersStoreWGSL[it] = tt);
2104
+ var nt = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL];
2093
2105
  try {
2094
- for (var tt_1 = __values(tt), tt_1_1 = tt_1.next(); !tt_1_1.done; tt_1_1 = tt_1.next()) {
2095
- var e_118 = tt_1_1.value;
2096
- i.ShaderStore.IncludesShadersStoreWGSL[e_118.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_118.name] = e_118.shader);
2106
+ for (var nt_1 = __values(nt), nt_1_1 = nt_1.next(); !nt_1_1.done; nt_1_1 = nt_1.next()) {
2107
+ var e_119 = nt_1_1.value;
2108
+ i.ShaderStore.IncludesShadersStoreWGSL[e_119.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_119.name] = e_119.shader);
2097
2109
  }
2098
2110
  }
2099
2111
  catch (e_31_1) { e_31 = { error: e_31_1 }; }
2100
2112
  finally {
2101
2113
  try {
2102
- if (tt_1_1 && !tt_1_1.done && (_8 = tt_1.return)) _8.call(tt_1);
2114
+ if (nt_1_1 && !nt_1_1.done && (_8 = nt_1.return)) _8.call(nt_1);
2103
2115
  }
2104
2116
  finally { if (e_31) throw e_31.error; }
2105
2117
  }
2106
- var nt = { __proto__: null, normalVertexShaderWGSL: { name: et, shader: it } };
2107
- var rt = "normalPixelShader", at = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef LIGHTING\n#include<helperFunctions>\n#include<lightUboDeclaration>[0]\n#include<lightUboDeclaration>[1]\n#include<lightUboDeclaration>[2]\n#include<lightUboDeclaration>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef NORMAL\nbaseColor=mix(baseColor, vec4f(fragmentInputs.vNormalW,1.0),0.5);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef LIGHTING\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\nvar finalDiffuse: vec3f= baseColor.rgb;\n#endif\nvar color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2108
- i.ShaderStore.ShadersStoreWGSL[rt] || (i.ShaderStore.ShadersStoreWGSL[rt] = at);
2109
- var st = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2118
+ var rt = { __proto__: null, normalVertexShaderWGSL: { name: it, shader: tt } };
2119
+ var at = "normalPixelShader", st = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef LIGHTING\n#include<helperFunctions>\n#include<lightUboDeclaration>[0]\n#include<lightUboDeclaration>[1]\n#include<lightUboDeclaration>[2]\n#include<lightUboDeclaration>[3]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#endif\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#ifdef NORMAL\nbaseColor=mix(baseColor, vec4f(fragmentInputs.vNormalW,1.0),0.5);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef LIGHTING\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\nvar finalDiffuse: vec3f= baseColor.rgb;\n#endif\nvar color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2120
+ i.ShaderStore.ShadersStoreWGSL[at] || (i.ShaderStore.ShadersStoreWGSL[at] = st);
2121
+ var ot = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2110
2122
  try {
2111
- for (var st_1 = __values(st), st_1_1 = st_1.next(); !st_1_1.done; st_1_1 = st_1.next()) {
2112
- var e_119 = st_1_1.value;
2113
- i.ShaderStore.IncludesShadersStoreWGSL[e_119.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_119.name] = e_119.shader);
2123
+ for (var ot_1 = __values(ot), ot_1_1 = ot_1.next(); !ot_1_1.done; ot_1_1 = ot_1.next()) {
2124
+ var e_120 = ot_1_1.value;
2125
+ i.ShaderStore.IncludesShadersStoreWGSL[e_120.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_120.name] = e_120.shader);
2114
2126
  }
2115
2127
  }
2116
2128
  catch (e_32_1) { e_32 = { error: e_32_1 }; }
2117
2129
  finally {
2118
2130
  try {
2119
- if (st_1_1 && !st_1_1.done && (_9 = st_1.return)) _9.call(st_1);
2131
+ if (ot_1_1 && !ot_1_1.done && (_9 = ot_1.return)) _9.call(ot_1);
2120
2132
  }
2121
2133
  finally { if (e_32) throw e_32.error; }
2122
2134
  }
2123
- var ot = { __proto__: null, normalPixelShaderWGSL: { name: rt, shader: at } };
2124
- var ft = "shadowOnlyVertexShader", lt = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<__decl__sceneVertex>\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2125
- i.ShaderStore.ShadersStore[ft] || (i.ShaderStore.ShadersStore[ft] = lt);
2126
- var ut = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.sceneVertexDeclaration, i.sceneUboDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex];
2135
+ var ft = { __proto__: null, normalPixelShaderWGSL: { name: at, shader: st } };
2136
+ var lt = "shadowOnlyVertexShader", ut = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<__decl__sceneVertex>\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2137
+ i.ShaderStore.ShadersStore[lt] || (i.ShaderStore.ShadersStore[lt] = ut);
2138
+ var dt = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.sceneVertexDeclaration, i.sceneUboDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex];
2127
2139
  try {
2128
- for (var ut_1 = __values(ut), ut_1_1 = ut_1.next(); !ut_1_1.done; ut_1_1 = ut_1.next()) {
2129
- var e_120 = ut_1_1.value;
2130
- i.ShaderStore.IncludesShadersStore[e_120.name] || (i.ShaderStore.IncludesShadersStore[e_120.name] = e_120.shader);
2140
+ for (var dt_1 = __values(dt), dt_1_1 = dt_1.next(); !dt_1_1.done; dt_1_1 = dt_1.next()) {
2141
+ var e_121 = dt_1_1.value;
2142
+ i.ShaderStore.IncludesShadersStore[e_121.name] || (i.ShaderStore.IncludesShadersStore[e_121.name] = e_121.shader);
2131
2143
  }
2132
2144
  }
2133
2145
  catch (e_33_1) { e_33 = { error: e_33_1 }; }
2134
2146
  finally {
2135
2147
  try {
2136
- if (ut_1_1 && !ut_1_1.done && (_10 = ut_1.return)) _10.call(ut_1);
2148
+ if (dt_1_1 && !dt_1_1.done && (_10 = dt_1.return)) _10.call(dt_1);
2137
2149
  }
2138
2150
  finally { if (e_33) throw e_33.error; }
2139
2151
  }
2140
- var dt = { __proto__: null, shadowOnlyVertexShader: { name: ft, shader: lt } };
2141
- var ct = "shadowOnlyPixelShader", ht = "precision highp float;\n#include<__decl__sceneFragment>\nuniform float alpha;uniform vec3 shadowColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..1]\nvec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
2142
- i.ShaderStore.ShadersStore[ct] || (i.ShaderStore.ShadersStore[ct] = ht);
2143
- var mt = [i.sceneFragmentDeclaration, i.sceneUboDeclaration, i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2152
+ var ct = { __proto__: null, shadowOnlyVertexShader: { name: lt, shader: ut } };
2153
+ var ht = "shadowOnlyPixelShader", mt = "precision highp float;\n#include<__decl__sceneFragment>\nuniform float alpha;uniform vec3 shadowColor;\n#define ADDITIONAL_FRAGMENT_DECLARATION\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#include<lightFragment>[0..1]\n#define CUSTOM_FRAGMENT_BEFORE_LIGHT_COMPOSITION\nvec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
2154
+ i.ShaderStore.ShadersStore[ht] || (i.ShaderStore.ShadersStore[ht] = mt);
2155
+ var vt = [i.sceneFragmentDeclaration, i.sceneUboDeclaration, i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2144
2156
  try {
2145
- for (var mt_1 = __values(mt), mt_1_1 = mt_1.next(); !mt_1_1.done; mt_1_1 = mt_1.next()) {
2146
- var e_121 = mt_1_1.value;
2147
- i.ShaderStore.IncludesShadersStore[e_121.name] || (i.ShaderStore.IncludesShadersStore[e_121.name] = e_121.shader);
2157
+ for (var vt_1 = __values(vt), vt_1_1 = vt_1.next(); !vt_1_1.done; vt_1_1 = vt_1.next()) {
2158
+ var e_122 = vt_1_1.value;
2159
+ i.ShaderStore.IncludesShadersStore[e_122.name] || (i.ShaderStore.IncludesShadersStore[e_122.name] = e_122.shader);
2148
2160
  }
2149
2161
  }
2150
2162
  catch (e_34_1) { e_34 = { error: e_34_1 }; }
2151
2163
  finally {
2152
2164
  try {
2153
- if (mt_1_1 && !mt_1_1.done && (_11 = mt_1.return)) _11.call(mt_1);
2165
+ if (vt_1_1 && !vt_1_1.done && (_11 = vt_1.return)) _11.call(vt_1);
2154
2166
  }
2155
2167
  finally { if (e_34) throw e_34.error; }
2156
2168
  }
2157
- var vt = { __proto__: null, shadowOnlyPixelShader: { name: ct, shader: ht } };
2158
- var gt = "shadowOnlyVertexShader", pt = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=scene.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2159
- i.ShaderStore.ShadersStoreWGSL[gt] || (i.ShaderStore.ShadersStoreWGSL[gt] = pt);
2160
- var St = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.sceneUboDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL];
2169
+ var gt = { __proto__: null, shadowOnlyPixelShader: { name: ht, shader: mt } };
2170
+ var pt = "shadowOnlyVertexShader", St = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=scene.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2171
+ i.ShaderStore.ShadersStoreWGSL[pt] || (i.ShaderStore.ShadersStoreWGSL[pt] = St);
2172
+ var xt = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.sceneUboDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL];
2161
2173
  try {
2162
- for (var St_1 = __values(St), St_1_1 = St_1.next(); !St_1_1.done; St_1_1 = St_1.next()) {
2163
- var e_122 = St_1_1.value;
2164
- i.ShaderStore.IncludesShadersStoreWGSL[e_122.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_122.name] = e_122.shader);
2174
+ for (var xt_1 = __values(xt), xt_1_1 = xt_1.next(); !xt_1_1.done; xt_1_1 = xt_1.next()) {
2175
+ var e_123 = xt_1_1.value;
2176
+ i.ShaderStore.IncludesShadersStoreWGSL[e_123.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_123.name] = e_123.shader);
2165
2177
  }
2166
2178
  }
2167
2179
  catch (e_35_1) { e_35 = { error: e_35_1 }; }
2168
2180
  finally {
2169
2181
  try {
2170
- if (St_1_1 && !St_1_1.done && (_12 = St_1.return)) _12.call(St_1);
2182
+ if (xt_1_1 && !xt_1_1.done && (_12 = xt_1.return)) _12.call(xt_1);
2171
2183
  }
2172
2184
  finally { if (e_35) throw e_35.error; }
2173
2185
  }
2174
- var xt = { __proto__: null, shadowOnlyVertexShaderWGSL: { name: gt, shader: pt } };
2175
- var Tt = "shadowOnlyPixelShader", _t = "#include<sceneUboDeclaration>\nuniform alpha: f32;uniform shadowColor: vec3f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0..1]\nvar color: vec4f= vec4f(uniforms.shadowColor,(1.0-clamp(shadow,0.,1.))*uniforms.alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2176
- i.ShaderStore.ShadersStoreWGSL[Tt] || (i.ShaderStore.ShadersStoreWGSL[Tt] = _t);
2177
- var Ct = [i.sceneUboDeclarationWGSL, i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL];
2186
+ var Tt = { __proto__: null, shadowOnlyVertexShaderWGSL: { name: pt, shader: St } };
2187
+ var _t = "shadowOnlyPixelShader", Ct = "#include<sceneUboDeclaration>\nuniform alpha: f32;uniform shadowColor: vec3f;\n#define ADDITIONAL_UBO_DECLARATION\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#include<lightFragment>[0..1]\n#define CUSTOM_FRAGMENT_BEFORE_LIGHT_COMPOSITION\nvar color: vec4f= vec4f(uniforms.shadowColor,(1.0-clamp(shadow,0.,1.))*uniforms.alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2188
+ i.ShaderStore.ShadersStoreWGSL[_t] || (i.ShaderStore.ShadersStoreWGSL[_t] = Ct);
2189
+ var Et = [i.sceneUboDeclarationWGSL, i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL];
2178
2190
  try {
2179
- for (var Ct_1 = __values(Ct), Ct_1_1 = Ct_1.next(); !Ct_1_1.done; Ct_1_1 = Ct_1.next()) {
2180
- var e_123 = Ct_1_1.value;
2181
- i.ShaderStore.IncludesShadersStoreWGSL[e_123.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_123.name] = e_123.shader);
2191
+ for (var Et_1 = __values(Et), Et_1_1 = Et_1.next(); !Et_1_1.done; Et_1_1 = Et_1.next()) {
2192
+ var e_124 = Et_1_1.value;
2193
+ i.ShaderStore.IncludesShadersStoreWGSL[e_124.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_124.name] = e_124.shader);
2182
2194
  }
2183
2195
  }
2184
2196
  catch (e_36_1) { e_36 = { error: e_36_1 }; }
2185
2197
  finally {
2186
2198
  try {
2187
- if (Ct_1_1 && !Ct_1_1.done && (_13 = Ct_1.return)) _13.call(Ct_1);
2199
+ if (Et_1_1 && !Et_1_1.done && (_13 = Et_1.return)) _13.call(Et_1);
2188
2200
  }
2189
2201
  finally { if (e_36) throw e_36.error; }
2190
2202
  }
2191
- var Et = { __proto__: null, shadowOnlyPixelShaderWGSL: { name: Tt, shader: _t } };
2192
- var Lt = "simpleVertexShader", Pt = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2193
- i.ShaderStore.ShadersStore[Lt] || (i.ShaderStore.ShadersStore[Lt] = Pt);
2194
- var It = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
2203
+ var Lt = { __proto__: null, shadowOnlyPixelShaderWGSL: { name: _t, shader: Ct } };
2204
+ var Pt = "simpleVertexShader", It = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2205
+ i.ShaderStore.ShadersStore[Pt] || (i.ShaderStore.ShadersStore[Pt] = It);
2206
+ var Dt = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
2195
2207
  try {
2196
- for (var It_1 = __values(It), It_1_1 = It_1.next(); !It_1_1.done; It_1_1 = It_1.next()) {
2197
- var e_124 = It_1_1.value;
2198
- i.ShaderStore.IncludesShadersStore[e_124.name] || (i.ShaderStore.IncludesShadersStore[e_124.name] = e_124.shader);
2208
+ for (var Dt_1 = __values(Dt), Dt_1_1 = Dt_1.next(); !Dt_1_1.done; Dt_1_1 = Dt_1.next()) {
2209
+ var e_125 = Dt_1_1.value;
2210
+ i.ShaderStore.IncludesShadersStore[e_125.name] || (i.ShaderStore.IncludesShadersStore[e_125.name] = e_125.shader);
2199
2211
  }
2200
2212
  }
2201
2213
  catch (e_37_1) { e_37 = { error: e_37_1 }; }
2202
2214
  finally {
2203
2215
  try {
2204
- if (It_1_1 && !It_1_1.done && (_14 = It_1.return)) _14.call(It_1);
2216
+ if (Dt_1_1 && !Dt_1_1.done && (_14 = Dt_1.return)) _14.call(Dt_1);
2205
2217
  }
2206
2218
  finally { if (e_37) throw e_37.error; }
2207
2219
  }
2208
- var Dt = { __proto__: null, simpleVertexShader: { name: Lt, shader: Pt } };
2209
- var bt = "simplePixelShader", At = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
2210
- i.ShaderStore.ShadersStore[bt] || (i.ShaderStore.ShadersStore[bt] = At);
2211
- var Ft = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2220
+ var bt = { __proto__: null, simpleVertexShader: { name: Pt, shader: It } };
2221
+ var At = "simplePixelShader", Ft = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}";
2222
+ i.ShaderStore.ShadersStore[At] || (i.ShaderStore.ShadersStore[At] = Ft);
2223
+ var Ot = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2212
2224
  try {
2213
- for (var Ft_1 = __values(Ft), Ft_1_1 = Ft_1.next(); !Ft_1_1.done; Ft_1_1 = Ft_1.next()) {
2214
- var e_125 = Ft_1_1.value;
2215
- i.ShaderStore.IncludesShadersStore[e_125.name] || (i.ShaderStore.IncludesShadersStore[e_125.name] = e_125.shader);
2225
+ for (var Ot_1 = __values(Ot), Ot_1_1 = Ot_1.next(); !Ot_1_1.done; Ot_1_1 = Ot_1.next()) {
2226
+ var e_126 = Ot_1_1.value;
2227
+ i.ShaderStore.IncludesShadersStore[e_126.name] || (i.ShaderStore.IncludesShadersStore[e_126.name] = e_126.shader);
2216
2228
  }
2217
2229
  }
2218
2230
  catch (e_38_1) { e_38 = { error: e_38_1 }; }
2219
2231
  finally {
2220
2232
  try {
2221
- if (Ft_1_1 && !Ft_1_1.done && (_15 = Ft_1.return)) _15.call(Ft_1);
2233
+ if (Ot_1_1 && !Ot_1_1.done && (_15 = Ot_1.return)) _15.call(Ot_1);
2222
2234
  }
2223
2235
  finally { if (e_38) throw e_38.error; }
2224
2236
  }
2225
- var Ot = { __proto__: null, simplePixelShader: { name: bt, shader: At } };
2226
- var Nt = "simpleVertexShader", Mt = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2227
- i.ShaderStore.ShadersStoreWGSL[Nt] || (i.ShaderStore.ShadersStoreWGSL[Nt] = Mt);
2228
- var Rt = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
2237
+ var Rt = { __proto__: null, simplePixelShader: { name: At, shader: Ft } };
2238
+ var Mt = "simpleVertexShader", Nt = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;uniform diffuseMatrix: mat4x4f;uniform vDiffuseInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vDiffuseInfos.x==0.)\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vDiffuseUV=(uniforms.diffuseMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2239
+ i.ShaderStore.ShadersStoreWGSL[Mt] || (i.ShaderStore.ShadersStoreWGSL[Mt] = Nt);
2240
+ var yt = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
2229
2241
  try {
2230
- for (var Rt_1 = __values(Rt), Rt_1_1 = Rt_1.next(); !Rt_1_1.done; Rt_1_1 = Rt_1.next()) {
2231
- var e_126 = Rt_1_1.value;
2232
- i.ShaderStore.IncludesShadersStoreWGSL[e_126.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_126.name] = e_126.shader);
2242
+ for (var yt_1 = __values(yt), yt_1_1 = yt_1.next(); !yt_1_1.done; yt_1_1 = yt_1.next()) {
2243
+ var e_127 = yt_1_1.value;
2244
+ i.ShaderStore.IncludesShadersStoreWGSL[e_127.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_127.name] = e_127.shader);
2233
2245
  }
2234
2246
  }
2235
2247
  catch (e_39_1) { e_39 = { error: e_39_1 }; }
2236
2248
  finally {
2237
2249
  try {
2238
- if (Rt_1_1 && !Rt_1_1.done && (_16 = Rt_1.return)) _16.call(Rt_1);
2250
+ if (yt_1_1 && !yt_1_1.done && (_16 = yt_1.return)) _16.call(yt_1);
2239
2251
  }
2240
2252
  finally { if (e_39) throw e_39.error; }
2241
2253
  }
2242
- var yt = { __proto__: null, simpleVertexShaderWGSL: { name: Nt, shader: Mt } };
2243
- var Vt = "simplePixelShader", Ut = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2244
- i.ShaderStore.ShadersStoreWGSL[Vt] || (i.ShaderStore.ShadersStoreWGSL[Vt] = Ut);
2245
- var wt = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2254
+ var Vt = { __proto__: null, simpleVertexShaderWGSL: { name: Mt, shader: Nt } };
2255
+ var Ut = "simplePixelShader", wt = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;varying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vDiffuseUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;uniform vDiffuseInfos: vec2f;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var glossiness: f32=0.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2256
+ i.ShaderStore.ShadersStoreWGSL[Ut] || (i.ShaderStore.ShadersStoreWGSL[Ut] = wt);
2257
+ var Gt = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2246
2258
  try {
2247
- for (var wt_1 = __values(wt), wt_1_1 = wt_1.next(); !wt_1_1.done; wt_1_1 = wt_1.next()) {
2248
- var e_127 = wt_1_1.value;
2249
- i.ShaderStore.IncludesShadersStoreWGSL[e_127.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_127.name] = e_127.shader);
2259
+ for (var Gt_1 = __values(Gt), Gt_1_1 = Gt_1.next(); !Gt_1_1.done; Gt_1_1 = Gt_1.next()) {
2260
+ var e_128 = Gt_1_1.value;
2261
+ i.ShaderStore.IncludesShadersStoreWGSL[e_128.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_128.name] = e_128.shader);
2250
2262
  }
2251
2263
  }
2252
2264
  catch (e_40_1) { e_40 = { error: e_40_1 }; }
2253
2265
  finally {
2254
2266
  try {
2255
- if (wt_1_1 && !wt_1_1.done && (_17 = wt_1.return)) _17.call(wt_1);
2267
+ if (Gt_1_1 && !Gt_1_1.done && (_17 = Gt_1.return)) _17.call(Gt_1);
2256
2268
  }
2257
2269
  finally { if (e_40) throw e_40.error; }
2258
2270
  }
2259
- var Gt = { __proto__: null, simplePixelShaderWGSL: { name: Vt, shader: Ut } };
2260
- var Wt = "skyVertexShader", Bt = "precision highp float;attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\nuniform mat4 world;uniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\ngl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos);\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2261
- i.ShaderStore.ShadersStore[Wt] || (i.ShaderStore.ShadersStore[Wt] = Bt);
2262
- var zt = [i.logDepthDeclaration, i.clipPlaneVertexDeclaration, i.fogVertexDeclaration, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex];
2271
+ var Wt = { __proto__: null, simplePixelShaderWGSL: { name: Ut, shader: wt } };
2272
+ var Bt = "skyVertexShader", zt = "precision highp float;attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\nuniform mat4 world;uniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\ngl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos);\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2273
+ i.ShaderStore.ShadersStore[Bt] || (i.ShaderStore.ShadersStore[Bt] = zt);
2274
+ var Ht = [i.logDepthDeclaration, i.clipPlaneVertexDeclaration, i.fogVertexDeclaration, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex];
2263
2275
  try {
2264
- for (var zt_1 = __values(zt), zt_1_1 = zt_1.next(); !zt_1_1.done; zt_1_1 = zt_1.next()) {
2265
- var e_128 = zt_1_1.value;
2266
- i.ShaderStore.IncludesShadersStore[e_128.name] || (i.ShaderStore.IncludesShadersStore[e_128.name] = e_128.shader);
2276
+ for (var Ht_1 = __values(Ht), Ht_1_1 = Ht_1.next(); !Ht_1_1.done; Ht_1_1 = Ht_1.next()) {
2277
+ var e_129 = Ht_1_1.value;
2278
+ i.ShaderStore.IncludesShadersStore[e_129.name] || (i.ShaderStore.IncludesShadersStore[e_129.name] = e_129.shader);
2267
2279
  }
2268
2280
  }
2269
2281
  catch (e_41_1) { e_41 = { error: e_41_1 }; }
2270
2282
  finally {
2271
2283
  try {
2272
- if (zt_1_1 && !zt_1_1.done && (_18 = zt_1.return)) _18.call(zt_1);
2284
+ if (Ht_1_1 && !Ht_1_1.done && (_18 = Ht_1.return)) _18.call(Ht_1);
2273
2285
  }
2274
2286
  finally { if (e_41) throw e_41.error; }
2275
2287
  }
2276
- var Ht = { __proto__: null, skyVertexShader: { name: Wt, shader: Bt } };
2277
- var kt = "skyPixelShader", Xt = "precision highp float;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform vec3 cameraPosition;uniform vec3 cameraOffset;uniform vec3 up;uniform float luminance;uniform float turbidity;uniform float rayleigh;uniform float mieCoefficient;uniform float mieDirectionalG;uniform vec3 sunPosition;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst float e=2.71828182845904523536028747135266249775724709369995957;const float pi=3.141592653589793238462643383279502884197169;const float n=1.0003;const float N=2.545E25;const float pn=0.035;const vec3 lambda=vec3(680E-9,550E-9,450E-9);const vec3 K=vec3(0.686,0.678,0.666);const float v=4.0;const float rayleighZenithLength=8.4E3;const float mieZenithLength=1.25E3;const float EE=1000.0;const float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;const float cutoffAngle=pi/1.95;const float steepness=1.5;vec3 totalRayleigh(vec3 lambda)\n{return (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));}\nvec3 simplifiedRayleigh()\n{return 0.0005/vec3(94,40,18);}\nfloat rayleighPhase(float cosTheta)\n{ \nreturn (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nvec3 totalMie(vec3 lambda,vec3 K,float T)\n{float c=(0.2*T )*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;}\nfloat hgPhase(float cosTheta,float g)\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfloat sunIntensity(float zenithAngleCos)\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nfloat A=0.15;float B=0.50;float C=0.10;float D=0.20;float EEE=0.02;float F=0.30;float W=1000.0;vec3 Uncharted2Tonemap(vec3 x)\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);float rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));vec3 sunDirection=normalize(sunPosition);float sunE=sunIntensity(dot(sunDirection,up));vec3 betaR=simplifiedRayleigh()*rayleighCoefficient;vec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;float zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));float sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));float sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));vec3 Fex=exp(-(betaR*sR+betaM*sM));float cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);float rPhase=rayleighPhase(cosTheta*0.5+0.5);vec3 betaRTheta=betaR*rPhase;float mPhase=hgPhase(cosTheta,mieDirectionalG);vec3 betaMTheta=betaM*mPhase;vec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));Lin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));vec3 direction=normalize(vPositionW-cameraPosition);float theta=acos(direction.y);float phi=atan(direction.z,direction.x);vec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);vec3 L0=vec3(0.1)*Fex;float sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0+=(sunE*19000.0*Fex)*sundisk;vec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));vec3 texColor=(Lin+L0);texColor*=0.04 ;texColor+=vec3(0.0,0.001,0.0025)*0.3;float g_fMaxLuminance=1.0;float fLumScaled=0.1/luminance; \nfloat fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled); \nfloat ExposureBias=fLumCompressed;vec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);vec3 retColor=curr*whiteScale;/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat alpha=1.0;\n#ifdef VERTEXCOLOR\nretColor.rgb*=vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#if DITHER\nretColor.rgb+=dither(gl_FragCoord.xy,0.5);\n#endif\nvec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2278
- i.ShaderStore.ShadersStore[kt] || (i.ShaderStore.ShadersStore[kt] = Xt);
2279
- var jt = [i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.helperFunctions, i.clipPlaneFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2288
+ var kt = { __proto__: null, skyVertexShader: { name: Bt, shader: zt } };
2289
+ var Xt = "skyPixelShader", jt = "precision highp float;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform vec3 cameraPosition;uniform vec3 cameraOffset;uniform vec3 up;uniform float luminance;uniform float turbidity;uniform float rayleigh;uniform float mieCoefficient;uniform float mieDirectionalG;uniform vec3 sunPosition;uniform float cloudiness;\n#ifdef SKY_RAW_HDR_OUTPUT\nuniform float maxColorValue;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst float e=2.71828182845904523536028747135266249775724709369995957;const float pi=3.141592653589793238462643383279502884197169;const float n=1.0003;const float N=2.545E25;const float pn=0.035;const vec3 lambda=vec3(680E-9,550E-9,450E-9);const vec3 K=vec3(0.686,0.678,0.666);const float v=4.0;const float rayleighZenithLength=8.4E3;const float mieZenithLength=1.25E3;const float EE=1000.0;const float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;const float cutoffAngle=pi/1.95;const float steepness=1.5;const float CLOUD_TAU_MAX=15.0;const float CLOUD_G=0.5;const float CLOUD_G_BACK=-0.5;const float CLOUD_BACK_WEIGHT=0.2;vec3 totalRayleigh(vec3 lambda)\n{return (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));}\nvec3 simplifiedRayleigh()\n{return 0.0005/vec3(94,40,18);}\nfloat rayleighPhase(float cosTheta)\n{ \nreturn (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nvec3 totalMie(vec3 lambda,vec3 K,float T)\n{float c=(0.2*T )*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;}\nfloat hgPhase(float cosTheta,float g)\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfloat cloudPhase(float cosTheta,float gForward)\n{return mix(hgPhase(cosTheta,gForward),hgPhase(cosTheta,CLOUD_G_BACK),CLOUD_BACK_WEIGHT);}\nfloat sunIntensity(float zenithAngleCos)\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nfloat A=0.15;float B=0.50;float C=0.10;float D=0.20;float EEE=0.02;float F=0.30;float W=1000.0;vec3 Uncharted2Tonemap(vec3 x)\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);float rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));vec3 sunDirection=normalize(sunPosition);float sunE=sunIntensity(dot(sunDirection,up));vec3 betaR=simplifiedRayleigh()*rayleighCoefficient;vec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;float zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));float sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));float sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));vec3 Fex=exp(-(betaR*sR+betaM*sM));float cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);float rPhase=rayleighPhase(cosTheta*0.5+0.5);vec3 betaRTheta=betaR*rPhase;float mPhase=hgPhase(cosTheta,mieDirectionalG);vec3 betaMTheta=betaM*mPhase;vec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));Lin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));vec3 direction=normalize(vPositionW-cameraPosition);float theta=acos(direction.y);float phi=atan(direction.z,direction.x);vec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);vec3 L0=vec3(0.1)*Fex;float sundiskTerm;if (cloudiness>0.0) {float cloudTau=cloudiness*CLOUD_TAU_MAX;float cloudT=exp(-cloudTau);float cloudG=CLOUD_G*cloudT;float omegaSun=2.0*pi*(1.0-sunAngularDiameterCos);float sharpDisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);sundiskTerm=cloudT*sharpDisk+(1.0-cloudT)*omegaSun*cloudPhase(cosTheta,cloudG);} else {sundiskTerm=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);}\nL0+=(sunE*19000.0*Fex)*sundiskTerm;vec3 texColor=(Lin+L0);texColor*=0.04 ;texColor+=vec3(0.0,0.001,0.0025)*0.3;\n#ifdef SKY_RAW_HDR_OUTPUT\nvec3 retColor=texColor*luminance;\n#else\nvec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));float g_fMaxLuminance=1.0;float fLumScaled=0.1/luminance;float fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled);float ExposureBias=fLumCompressed;vec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);vec3 retColor=curr*whiteScale;\n#endif\n/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat alpha=1.0;\n#ifdef VERTEXCOLOR\nretColor.rgb*=vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#if DITHER\nretColor.rgb+=dither(gl_FragCoord.xy,0.5);\n#endif\n#ifdef SKY_RAW_HDR_OUTPUT\nvec4 color=vec4(clamp(retColor.rgb,0.0,maxColorValue),alpha);\n#else\nvec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#ifndef SKY_RAW_HDR_OUTPUT\n#include<imageProcessingCompatibility>\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2290
+ i.ShaderStore.ShadersStore[Xt] || (i.ShaderStore.ShadersStore[Xt] = jt);
2291
+ var Yt = [i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.helperFunctions, i.clipPlaneFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2280
2292
  try {
2281
- for (var jt_1 = __values(jt), jt_1_1 = jt_1.next(); !jt_1_1.done; jt_1_1 = jt_1.next()) {
2282
- var e_129 = jt_1_1.value;
2283
- i.ShaderStore.IncludesShadersStore[e_129.name] || (i.ShaderStore.IncludesShadersStore[e_129.name] = e_129.shader);
2293
+ for (var Yt_1 = __values(Yt), Yt_1_1 = Yt_1.next(); !Yt_1_1.done; Yt_1_1 = Yt_1.next()) {
2294
+ var e_130 = Yt_1_1.value;
2295
+ i.ShaderStore.IncludesShadersStore[e_130.name] || (i.ShaderStore.IncludesShadersStore[e_130.name] = e_130.shader);
2284
2296
  }
2285
2297
  }
2286
2298
  catch (e_42_1) { e_42 = { error: e_42_1 }; }
2287
2299
  finally {
2288
2300
  try {
2289
- if (jt_1_1 && !jt_1_1.done && (_19 = jt_1.return)) _19.call(jt_1);
2301
+ if (Yt_1_1 && !Yt_1_1.done && (_19 = Yt_1.return)) _19.call(Yt_1);
2290
2302
  }
2291
2303
  finally { if (e_42) throw e_42.error; }
2292
2304
  }
2293
- var Zt = { __proto__: null, skyPixelShader: { name: kt, shader: Xt } };
2294
- var Yt = "skyVertexShader", Kt = "attribute position: vec3f;\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\nuniform world: mat4x4f;uniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=uniforms.viewProjection*uniforms.world* vec4f(vertexInputs.position,1.0);var worldPos: vec4f=uniforms.world* vec4f(vertexInputs.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvertexOutputs.vColor=vertexInputs.color;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2295
- i.ShaderStore.ShadersStoreWGSL[Yt] || (i.ShaderStore.ShadersStoreWGSL[Yt] = Kt);
2296
- var qt = [i.logDepthDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.fogVertexDeclarationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL];
2305
+ var Zt = { __proto__: null, skyPixelShader: { name: Xt, shader: jt } };
2306
+ var Kt = "skyVertexShader", qt = "attribute position: vec3f;\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\nuniform world: mat4x4f;uniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=uniforms.viewProjection*uniforms.world* vec4f(vertexInputs.position,1.0);var worldPos: vec4f=uniforms.world* vec4f(vertexInputs.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvertexOutputs.vColor=vertexInputs.color;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2307
+ i.ShaderStore.ShadersStoreWGSL[Kt] || (i.ShaderStore.ShadersStoreWGSL[Kt] = qt);
2308
+ var Qt = [i.logDepthDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.fogVertexDeclarationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL];
2297
2309
  try {
2298
- for (var qt_1 = __values(qt), qt_1_1 = qt_1.next(); !qt_1_1.done; qt_1_1 = qt_1.next()) {
2299
- var e_130 = qt_1_1.value;
2300
- i.ShaderStore.IncludesShadersStoreWGSL[e_130.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_130.name] = e_130.shader);
2310
+ for (var Qt_1 = __values(Qt), Qt_1_1 = Qt_1.next(); !Qt_1_1.done; Qt_1_1 = Qt_1.next()) {
2311
+ var e_131 = Qt_1_1.value;
2312
+ i.ShaderStore.IncludesShadersStoreWGSL[e_131.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_131.name] = e_131.shader);
2301
2313
  }
2302
2314
  }
2303
2315
  catch (e_43_1) { e_43 = { error: e_43_1 }; }
2304
2316
  finally {
2305
2317
  try {
2306
- if (qt_1_1 && !qt_1_1.done && (_20 = qt_1.return)) _20.call(qt_1);
2318
+ if (Qt_1_1 && !Qt_1_1.done && (_20 = Qt_1.return)) _20.call(Qt_1);
2307
2319
  }
2308
2320
  finally { if (e_43) throw e_43.error; }
2309
2321
  }
2310
- var Qt = { __proto__: null, skyVertexShaderWGSL: { name: Yt, shader: Kt } };
2311
- var Jt = "skyPixelShader", $t = "varying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform cameraPosition: vec3f;uniform cameraOffset: vec3f;uniform up: vec3f;uniform luminance: f32;uniform turbidity: f32;uniform rayleigh: f32;uniform mieCoefficient: f32;uniform mieDirectionalG: f32;uniform sunPosition: vec3f;\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst ce: f32=2.71828182845904523536028747135266249775724709369995957;const pi: f32=3.141592653589793238462643383279502884197169;const cn: f32=1.0003;const cN: f32=2.545E25;const pn: f32=0.035;const lambda: vec3f= vec3f(680E-9,550E-9,450E-9);const cK: vec3f= vec3f(0.686,0.678,0.666);const cv: f32=4.0;const rayleighZenithLength: f32=8.4E3;const mieZenithLength: f32=1.25E3;const EE: f32=1000.0;const sunAngularDiameterCos: f32=0.999956676946448443553574619906976478926848692873900859324;const cutoffAngle: f32=pi/1.95;const steepness: f32=1.5;fn totalRayleigh(lambdaIn: vec3f)->vec3f\n{return (8.0*pow(pi,3.0)*pow(pow(cn,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*cN*pow(lambdaIn, vec3f(4.0))*(6.0-7.0*pn));}\nfn simplifiedRayleigh()->vec3f\n{return vec3f(0.0005)/ vec3f(94,40,18);}\nfn rayleighPhase(cosTheta: f32)->f32\n{return (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nfn totalMie(lambdaIn: vec3f,KIn: vec3f,T: f32)->vec3f\n{var c: f32=(0.2*T)*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambdaIn, vec3f(cv-2.0))*KIn;}\nfn hgPhase(cosTheta: f32,g: f32)->f32\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfn sunIntensity(zenithAngleCos: f32)->f32\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nconst A: f32=0.15;const B: f32=0.50;const C: f32=0.10;const D: f32=0.20;const EEE: f32=0.02;const F: f32=0.30;const W: f32=1000.0;fn Uncharted2Tonemap(x: vec3f)->vec3f\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n* Sky Color\n*/\nvar sunfade: f32=1.0-clamp(1.0-exp((uniforms.sunPosition.y/450000.0)),0.0,1.0);var rayleighCoefficient: f32=uniforms.rayleigh-(1.0*(1.0-sunfade));var sunDirection: vec3f=normalize(uniforms.sunPosition);var sunE: f32=sunIntensity(dot(sunDirection,uniforms.up));var betaR: vec3f=simplifiedRayleigh()*rayleighCoefficient;var betaM: vec3f=totalMie(lambda,cK,uniforms.turbidity)*uniforms.mieCoefficient;var zenithAngle: f32=acos(max(0.0,dot(uniforms.up,normalize(fragmentInputs.vPositionW-uniforms.cameraPosition+uniforms.cameraOffset))));var sR: f32=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));var sM: f32=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));var Fex: vec3f=exp(-(betaR*sR+betaM*sM));var cosTheta: f32=dot(normalize(fragmentInputs.vPositionW-uniforms.cameraPosition),sunDirection);var rPhase: f32=rayleighPhase(cosTheta*0.5+0.5);var betaRTheta: vec3f=betaR*rPhase;var mPhase: f32=hgPhase(cosTheta,uniforms.mieDirectionalG);var betaMTheta: vec3f=betaM*mPhase;var Lin: vec3f=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex), vec3f(1.5));Lin=Lin*mix( vec3f(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex, vec3f(1.0/2.0)), vec3f(clamp(pow(1.0-dot(uniforms.up,sunDirection),5.0),0.0,1.0)));var direction: vec3f=normalize(fragmentInputs.vPositionW-uniforms.cameraPosition);var theta: f32=acos(direction.y);var phi: f32=atan2(direction.z,direction.x);var uv: vec2f= vec2f(phi,theta)/ vec2f(2.0*pi,pi)+ vec2f(0.5,0.0);var L0: vec3f= vec3f(0.1)*Fex;var sundisk: f32=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0=L0+(sunE*19000.0*Fex)*sundisk;var whiteScale: vec3f=1.0/Uncharted2Tonemap( vec3f(W));var texColor: vec3f=(Lin+L0);texColor=texColor*0.04;texColor=texColor+ vec3f(0.0,0.001,0.0025)*0.3;var g_fMaxLuminance: f32=1.0;var fLumScaled: f32=0.1/uniforms.luminance;var fLumCompressed: f32=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled);var ExposureBias: f32=fLumCompressed;var curr: vec3f=Uncharted2Tonemap((log2(2.0/pow(uniforms.luminance,4.0)))*texColor);var retColor: vec3f=curr*whiteScale;var alpha: f32=1.0;\n#ifdef VERTEXCOLOR\nretColor=retColor.rgb*fragmentInputs.vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#if DITHER\nretColor=retColor.rgb+dither(fragmentInputs.position.xy,0.5);\n#endif\nvar color: vec4f=clamp( vec4f(retColor.rgb,alpha), vec4f(0.0), vec4f(1.0));\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2312
- i.ShaderStore.ShadersStoreWGSL[Jt] || (i.ShaderStore.ShadersStoreWGSL[Jt] = $t);
2313
- var en = [i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.helperFunctionsWGSL, i.clipPlaneFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2322
+ var Jt = { __proto__: null, skyVertexShaderWGSL: { name: Kt, shader: qt } };
2323
+ var $t = "skyPixelShader", en = "varying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform cameraPosition: vec3f;uniform cameraOffset: vec3f;uniform up: vec3f;uniform luminance: f32;uniform turbidity: f32;uniform rayleigh: f32;uniform mieCoefficient: f32;uniform mieDirectionalG: f32;uniform sunPosition: vec3f;uniform cloudiness: f32;\n#ifdef SKY_RAW_HDR_OUTPUT\nuniform maxColorValue: f32;\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst ce: f32=2.71828182845904523536028747135266249775724709369995957;const pi: f32=3.141592653589793238462643383279502884197169;const cn: f32=1.0003;const cN: f32=2.545E25;const pn: f32=0.035;const lambda: vec3f= vec3f(680E-9,550E-9,450E-9);const cK: vec3f= vec3f(0.686,0.678,0.666);const cv: f32=4.0;const rayleighZenithLength: f32=8.4E3;const mieZenithLength: f32=1.25E3;const EE: f32=1000.0;const sunAngularDiameterCos: f32=0.999956676946448443553574619906976478926848692873900859324;const cutoffAngle: f32=pi/1.95;const steepness: f32=1.5;const CLOUD_TAU_MAX: f32=15.0;const CLOUD_G: f32=0.5;const CLOUD_G_BACK: f32=-0.5;const CLOUD_BACK_WEIGHT: f32=0.2;fn totalRayleigh(lambdaIn: vec3f)->vec3f\n{return (8.0*pow(pi,3.0)*pow(pow(cn,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*cN*pow(lambdaIn, vec3f(4.0))*(6.0-7.0*pn));}\nfn simplifiedRayleigh()->vec3f\n{return vec3f(0.0005)/ vec3f(94,40,18);}\nfn rayleighPhase(cosTheta: f32)->f32\n{return (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nfn totalMie(lambdaIn: vec3f,KIn: vec3f,T: f32)->vec3f\n{var c: f32=(0.2*T)*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambdaIn, vec3f(cv-2.0))*KIn;}\nfn hgPhase(cosTheta: f32,g: f32)->f32\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfn cloudPhase(cosTheta: f32,gForward: f32)->f32\n{return mix(hgPhase(cosTheta,gForward),hgPhase(cosTheta,CLOUD_G_BACK),CLOUD_BACK_WEIGHT);}\nfn sunIntensity(zenithAngleCos: f32)->f32\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nconst A: f32=0.15;const B: f32=0.50;const C: f32=0.10;const D: f32=0.20;const EEE: f32=0.02;const F: f32=0.30;const W: f32=1000.0;fn Uncharted2Tonemap(x: vec3f)->vec3f\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n* Sky Color\n*/\nvar sunfade: f32=1.0-clamp(1.0-exp((uniforms.sunPosition.y/450000.0)),0.0,1.0);var rayleighCoefficient: f32=uniforms.rayleigh-(1.0*(1.0-sunfade));var sunDirection: vec3f=normalize(uniforms.sunPosition);var sunE: f32=sunIntensity(dot(sunDirection,uniforms.up));var betaR: vec3f=simplifiedRayleigh()*rayleighCoefficient;var betaM: vec3f=totalMie(lambda,cK,uniforms.turbidity)*uniforms.mieCoefficient;var zenithAngle: f32=acos(max(0.0,dot(uniforms.up,normalize(fragmentInputs.vPositionW-uniforms.cameraPosition+uniforms.cameraOffset))));var sR: f32=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));var sM: f32=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));var Fex: vec3f=exp(-(betaR*sR+betaM*sM));var cosTheta: f32=dot(normalize(fragmentInputs.vPositionW-uniforms.cameraPosition),sunDirection);var rPhase: f32=rayleighPhase(cosTheta*0.5+0.5);var betaRTheta: vec3f=betaR*rPhase;var mPhase: f32=hgPhase(cosTheta,uniforms.mieDirectionalG);var betaMTheta: vec3f=betaM*mPhase;var Lin: vec3f=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex), vec3f(1.5));Lin=Lin*mix( vec3f(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex, vec3f(1.0/2.0)), vec3f(clamp(pow(1.0-dot(uniforms.up,sunDirection),5.0),0.0,1.0)));var direction: vec3f=normalize(fragmentInputs.vPositionW-uniforms.cameraPosition);var theta: f32=acos(direction.y);var phi: f32=atan2(direction.z,direction.x);var uv: vec2f= vec2f(phi,theta)/ vec2f(2.0*pi,pi)+ vec2f(0.5,0.0);var L0: vec3f= vec3f(0.1)*Fex;var sundiskTerm: f32=0.0;if (uniforms.cloudiness>0.0) {var cloudTau: f32=uniforms.cloudiness*CLOUD_TAU_MAX;var cloudT: f32=exp(-cloudTau);var cloudG: f32=CLOUD_G*cloudT;var omegaSun: f32=2.0*pi*(1.0-sunAngularDiameterCos);var sharpDisk: f32=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);sundiskTerm=cloudT*sharpDisk+(1.0-cloudT)*omegaSun*cloudPhase(cosTheta,cloudG);} else {sundiskTerm=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);}\nL0=L0+(sunE*19000.0*Fex)*sundiskTerm;var texColor: vec3f=(Lin+L0);texColor=texColor*0.04;texColor=texColor+ vec3f(0.0,0.001,0.0025)*0.3;\n#ifdef SKY_RAW_HDR_OUTPUT\nvar retColor: vec3f=texColor*uniforms.luminance;\n#else\nvar whiteScale: vec3f=1.0/Uncharted2Tonemap( vec3f(W));var g_fMaxLuminance: f32=1.0;var fLumScaled: f32=0.1/uniforms.luminance;var fLumCompressed: f32=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled);var ExposureBias: f32=fLumCompressed;var curr: vec3f=Uncharted2Tonemap((log2(2.0/pow(uniforms.luminance,4.0)))*texColor);var retColor: vec3f=curr*whiteScale;\n#endif\nvar alpha: f32=1.0;\n#ifdef VERTEXCOLOR\nretColor=retColor.rgb*fragmentInputs.vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#if DITHER\nretColor=retColor.rgb+dither(fragmentInputs.position.xy,0.5);\n#endif\n#ifdef SKY_RAW_HDR_OUTPUT\nvar color: vec4f= vec4f(clamp(retColor.rgb, vec3f(0.0), vec3f(uniforms.maxColorValue)),alpha);\n#else\nvar color: vec4f=clamp( vec4f(retColor.rgb,alpha), vec4f(0.0), vec4f(1.0));\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#ifndef SKY_RAW_HDR_OUTPUT\n#include<imageProcessingCompatibility>\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2324
+ i.ShaderStore.ShadersStoreWGSL[$t] || (i.ShaderStore.ShadersStoreWGSL[$t] = en);
2325
+ var tn = [i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.helperFunctionsWGSL, i.clipPlaneFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2314
2326
  try {
2315
- for (var en_1 = __values(en), en_1_1 = en_1.next(); !en_1_1.done; en_1_1 = en_1.next()) {
2316
- var e_131 = en_1_1.value;
2317
- i.ShaderStore.IncludesShadersStoreWGSL[e_131.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_131.name] = e_131.shader);
2327
+ for (var tn_1 = __values(tn), tn_1_1 = tn_1.next(); !tn_1_1.done; tn_1_1 = tn_1.next()) {
2328
+ var e_132 = tn_1_1.value;
2329
+ i.ShaderStore.IncludesShadersStoreWGSL[e_132.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_132.name] = e_132.shader);
2318
2330
  }
2319
2331
  }
2320
2332
  catch (e_44_1) { e_44 = { error: e_44_1 }; }
2321
2333
  finally {
2322
2334
  try {
2323
- if (en_1_1 && !en_1_1.done && (_21 = en_1.return)) _21.call(en_1);
2335
+ if (tn_1_1 && !tn_1_1.done && (_21 = tn_1.return)) _21.call(tn_1);
2324
2336
  }
2325
2337
  finally { if (e_44) throw e_44.error; }
2326
2338
  }
2327
- var tn = { __proto__: null, skyPixelShaderWGSL: { name: Jt, shader: $t } };
2328
- var nn = "terrainVertexShader", rn = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2329
- i.ShaderStore.ShadersStore[nn] || (i.ShaderStore.ShadersStore[nn] = rn);
2330
- var an = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.logDepthDeclaration, i.clipPlaneVertexDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
2339
+ var nn = { __proto__: null, skyPixelShaderWGSL: { name: $t, shader: en } };
2340
+ var rn = "terrainVertexShader", an = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2341
+ i.ShaderStore.ShadersStore[rn] || (i.ShaderStore.ShadersStore[rn] = an);
2342
+ var sn = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.logDepthDeclaration, i.clipPlaneVertexDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
2331
2343
  try {
2332
- for (var an_1 = __values(an), an_1_1 = an_1.next(); !an_1_1.done; an_1_1 = an_1.next()) {
2333
- var e_132 = an_1_1.value;
2334
- i.ShaderStore.IncludesShadersStore[e_132.name] || (i.ShaderStore.IncludesShadersStore[e_132.name] = e_132.shader);
2344
+ for (var sn_1 = __values(sn), sn_1_1 = sn_1.next(); !sn_1_1.done; sn_1_1 = sn_1.next()) {
2345
+ var e_133 = sn_1_1.value;
2346
+ i.ShaderStore.IncludesShadersStore[e_133.name] || (i.ShaderStore.IncludesShadersStore[e_133.name] = e_133.shader);
2335
2347
  }
2336
2348
  }
2337
2349
  catch (e_45_1) { e_45 = { error: e_45_1 }; }
2338
2350
  finally {
2339
2351
  try {
2340
- if (an_1_1 && !an_1_1.done && (_22 = an_1.return)) _22.call(an_1);
2352
+ if (sn_1_1 && !sn_1_1.done && (_22 = sn_1.return)) _22.call(sn_1);
2341
2353
  }
2342
2354
  finally { if (e_45) throw e_45.error; }
2343
2355
  }
2344
- var sn = { __proto__: null, terrainVertexShader: { name: nn, shader: rn } };
2345
- var on = "terrainPixelShader", fn = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);}\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(textureSampler,vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2346
- i.ShaderStore.ShadersStore[on] || (i.ShaderStore.ShadersStore[on] = fn);
2347
- var ln = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2356
+ var on = { __proto__: null, terrainVertexShader: { name: rn, shader: an } };
2357
+ var fn = "terrainPixelShader", ln = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);}\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(textureSampler,vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2358
+ i.ShaderStore.ShadersStore[fn] || (i.ShaderStore.ShadersStore[fn] = ln);
2359
+ var un = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2348
2360
  try {
2349
- for (var ln_1 = __values(ln), ln_1_1 = ln_1.next(); !ln_1_1.done; ln_1_1 = ln_1.next()) {
2350
- var e_133 = ln_1_1.value;
2351
- i.ShaderStore.IncludesShadersStore[e_133.name] || (i.ShaderStore.IncludesShadersStore[e_133.name] = e_133.shader);
2361
+ for (var un_1 = __values(un), un_1_1 = un_1.next(); !un_1_1.done; un_1_1 = un_1.next()) {
2362
+ var e_134 = un_1_1.value;
2363
+ i.ShaderStore.IncludesShadersStore[e_134.name] || (i.ShaderStore.IncludesShadersStore[e_134.name] = e_134.shader);
2352
2364
  }
2353
2365
  }
2354
2366
  catch (e_46_1) { e_46 = { error: e_46_1 }; }
2355
2367
  finally {
2356
2368
  try {
2357
- if (ln_1_1 && !ln_1_1.done && (_23 = ln_1.return)) _23.call(ln_1);
2369
+ if (un_1_1 && !un_1_1.done && (_23 = un_1.return)) _23.call(un_1);
2358
2370
  }
2359
2371
  finally { if (e_46) throw e_46.error; }
2360
2372
  }
2361
- var un = { __proto__: null, terrainPixelShader: { name: on, shader: fn } };
2362
- var dn = "terrainVertexShader", cn = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;uniform textureMatrix: mat4x4f;uniform vTextureInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vTextureInfos.x==0.)\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2363
- i.ShaderStore.ShadersStoreWGSL[dn] || (i.ShaderStore.ShadersStoreWGSL[dn] = cn);
2364
- var hn = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.logDepthDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
2373
+ var dn = { __proto__: null, terrainPixelShader: { name: fn, shader: ln } };
2374
+ var cn = "terrainVertexShader", hn = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;uniform textureMatrix: mat4x4f;uniform vTextureInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef DIFFUSE\nif (uniforms.vTextureInfos.x==0.)\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv,1.0,0.0)).xy;}\nelse\n{vertexOutputs.vTextureUV=(uniforms.textureMatrix* vec4f(uv2,1.0,0.0)).xy;}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2375
+ i.ShaderStore.ShadersStoreWGSL[cn] || (i.ShaderStore.ShadersStoreWGSL[cn] = hn);
2376
+ var mn = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.logDepthDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
2365
2377
  try {
2366
- for (var hn_1 = __values(hn), hn_1_1 = hn_1.next(); !hn_1_1.done; hn_1_1 = hn_1.next()) {
2367
- var e_134 = hn_1_1.value;
2368
- i.ShaderStore.IncludesShadersStoreWGSL[e_134.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_134.name] = e_134.shader);
2378
+ for (var mn_1 = __values(mn), mn_1_1 = mn_1.next(); !mn_1_1.done; mn_1_1 = mn_1.next()) {
2379
+ var e_135 = mn_1_1.value;
2380
+ i.ShaderStore.IncludesShadersStoreWGSL[e_135.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_135.name] = e_135.shader);
2369
2381
  }
2370
2382
  }
2371
2383
  catch (e_47_1) { e_47 = { error: e_47_1 }; }
2372
2384
  finally {
2373
2385
  try {
2374
- if (hn_1_1 && !hn_1_1.done && (_24 = hn_1.return)) _24.call(hn_1);
2386
+ if (mn_1_1 && !mn_1_1.done && (_24 = mn_1.return)) _24.call(mn_1);
2375
2387
  }
2376
2388
  finally { if (e_47) throw e_47.error; }
2377
2389
  }
2378
- var mn = { __proto__: null, terrainVertexShaderWGSL: { name: dn, shader: cn } };
2379
- var vn = "terrainPixelShader", gn = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform vTextureInfos: vec2f;var diffuse1SamplerSampler: sampler;var diffuse1Sampler: texture_2d<f32>;var diffuse2SamplerSampler: sampler;var diffuse2Sampler: texture_2d<f32>;var diffuse3SamplerSampler: sampler;var diffuse3Sampler: texture_2d<f32>;uniform diffuse1Infos: vec2f;uniform diffuse2Infos: vec2f;uniform diffuse3Infos: vec2f;\n#endif\n#ifdef BUMP\nvar bump1SamplerSampler: sampler;var bump1Sampler: texture_2d<f32>;var bump2SamplerSampler: sampler;var bump2Sampler: texture_2d<f32>;var bump3SamplerSampler: sampler;var bump3Sampler: texture_2d<f32>;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\nfn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f)->mat3x3f\n{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var binormal: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;var invmax: f32=inverseSqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3x3f(tangent*invmax,binormal*invmax,normal);}\nfn perturbNormal(viewDir: vec3f,mixColor: vec3f)->vec3f\n{var bump1Color: vec3f=textureSample(bump1Sampler,bump1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos).xyz;var bump2Color: vec3f=textureSample(bump2Sampler,bump2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos).xyz;var bump3Color: vec3f=textureSample(bump3Sampler,bump3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos).xyz;bump1Color=bump1Color.rgb*mixColor.r;bump2Color=mix(bump1Color.rgb,bump2Color.rgb,vec3f(mixColor.g));var map: vec3f=mix(bump2Color.rgb,bump3Color.rgb,vec3f(mixColor.b));map=map*255./127.-128./127.;var TBN: mat3x3f=cotangent_frame(fragmentInputs.vNormalW*uniforms.vTextureInfos.y,-viewDir,fragmentInputs.vTextureUV);return normalize(TBN*map);}\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\nvar alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vTextureInfos.y,baseColor.a);var diffuse1Color: vec4f=textureSample(diffuse1Sampler,diffuse1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos);var diffuse2Color: vec4f=textureSample(diffuse2Sampler,diffuse2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos);var diffuse3Color: vec4f=textureSample(diffuse3Sampler,diffuse3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos);diffuse1Color=vec4f(diffuse1Color.rgb*baseColor.r,diffuse1Color.a);diffuse2Color=vec4f(mix(diffuse1Color.rgb,diffuse2Color.rgb,vec3f(baseColor.g)),diffuse2Color.a);baseColor=vec4f(mix(diffuse2Color.rgb,diffuse3Color.rgb,vec3f(baseColor.b)),baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor*baseColor.rgb,vec3f(0.0),vec3f(1.0));var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2380
- i.ShaderStore.ShadersStoreWGSL[vn] || (i.ShaderStore.ShadersStoreWGSL[vn] = gn);
2381
- var pn = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2390
+ var vn = { __proto__: null, terrainVertexShaderWGSL: { name: cn, shader: hn } };
2391
+ var gn = "terrainPixelShader", pn = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform vTextureInfos: vec2f;var diffuse1SamplerSampler: sampler;var diffuse1Sampler: texture_2d<f32>;var diffuse2SamplerSampler: sampler;var diffuse2Sampler: texture_2d<f32>;var diffuse3SamplerSampler: sampler;var diffuse3Sampler: texture_2d<f32>;uniform diffuse1Infos: vec2f;uniform diffuse2Infos: vec2f;uniform diffuse3Infos: vec2f;\n#endif\n#ifdef BUMP\nvar bump1SamplerSampler: sampler;var bump1Sampler: texture_2d<f32>;var bump2SamplerSampler: sampler;var bump2Sampler: texture_2d<f32>;var bump3SamplerSampler: sampler;var bump3Sampler: texture_2d<f32>;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\nfn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f)->mat3x3f\n{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var binormal: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;var invmax: f32=inverseSqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3x3f(tangent*invmax,binormal*invmax,normal);}\nfn perturbNormal(viewDir: vec3f,mixColor: vec3f)->vec3f\n{var bump1Color: vec3f=textureSample(bump1Sampler,bump1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos).xyz;var bump2Color: vec3f=textureSample(bump2Sampler,bump2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos).xyz;var bump3Color: vec3f=textureSample(bump3Sampler,bump3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos).xyz;bump1Color=bump1Color.rgb*mixColor.r;bump2Color=mix(bump1Color.rgb,bump2Color.rgb,vec3f(mixColor.g));var map: vec3f=mix(bump2Color.rgb,bump3Color.rgb,vec3f(mixColor.b));map=map*255./127.-128./127.;var TBN: mat3x3f=cotangent_frame(fragmentInputs.vNormalW*uniforms.vTextureInfos.y,-viewDir,fragmentInputs.vTextureUV);return normalize(TBN*map);}\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\nvar alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\nbaseColor=vec4f(baseColor.rgb*uniforms.vTextureInfos.y,baseColor.a);var diffuse1Color: vec4f=textureSample(diffuse1Sampler,diffuse1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos);var diffuse2Color: vec4f=textureSample(diffuse2Sampler,diffuse2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos);var diffuse3Color: vec4f=textureSample(diffuse3Sampler,diffuse3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos);diffuse1Color=vec4f(diffuse1Color.rgb*baseColor.r,diffuse1Color.a);diffuse2Color=vec4f(mix(diffuse1Color.rgb,diffuse2Color.rgb,vec3f(baseColor.g)),diffuse2Color.a);baseColor=vec4f(mix(diffuse2Color.rgb,diffuse3Color.rgb,vec3f(baseColor.b)),baseColor.a);\n#endif\n#endif\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor*baseColor.rgb,vec3f(0.0),vec3f(1.0));var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2392
+ i.ShaderStore.ShadersStoreWGSL[gn] || (i.ShaderStore.ShadersStoreWGSL[gn] = pn);
2393
+ var Sn = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2382
2394
  try {
2383
- for (var pn_1 = __values(pn), pn_1_1 = pn_1.next(); !pn_1_1.done; pn_1_1 = pn_1.next()) {
2384
- var e_135 = pn_1_1.value;
2385
- i.ShaderStore.IncludesShadersStoreWGSL[e_135.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_135.name] = e_135.shader);
2395
+ for (var Sn_1 = __values(Sn), Sn_1_1 = Sn_1.next(); !Sn_1_1.done; Sn_1_1 = Sn_1.next()) {
2396
+ var e_136 = Sn_1_1.value;
2397
+ i.ShaderStore.IncludesShadersStoreWGSL[e_136.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_136.name] = e_136.shader);
2386
2398
  }
2387
2399
  }
2388
2400
  catch (e_48_1) { e_48 = { error: e_48_1 }; }
2389
2401
  finally {
2390
2402
  try {
2391
- if (pn_1_1 && !pn_1_1.done && (_25 = pn_1.return)) _25.call(pn_1);
2403
+ if (Sn_1_1 && !Sn_1_1.done && (_25 = Sn_1.return)) _25.call(Sn_1);
2392
2404
  }
2393
2405
  finally { if (e_48) throw e_48.error; }
2394
2406
  }
2395
- var Sn = { __proto__: null, terrainPixelShaderWGSL: { name: vn, shader: gn } };
2396
- var xn = "triplanarVertexShader", Tn = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\nvec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2397
- i.ShaderStore.ShadersStore[xn] || (i.ShaderStore.ShadersStore[xn] = Tn);
2398
- var _n = [i.helperFunctions, i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
2407
+ var xn = { __proto__: null, terrainPixelShaderWGSL: { name: gn, shader: pn } };
2408
+ var Tn = "triplanarVertexShader", _n = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\nvec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2409
+ i.ShaderStore.ShadersStore[Tn] || (i.ShaderStore.ShadersStore[Tn] = _n);
2410
+ var Cn = [i.helperFunctions, i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.logDepthDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.logDepthVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing];
2399
2411
  try {
2400
- for (var _n_1 = __values(_n), _n_1_1 = _n_1.next(); !_n_1_1.done; _n_1_1 = _n_1.next()) {
2401
- var e_136 = _n_1_1.value;
2402
- i.ShaderStore.IncludesShadersStore[e_136.name] || (i.ShaderStore.IncludesShadersStore[e_136.name] = e_136.shader);
2412
+ for (var Cn_1 = __values(Cn), Cn_1_1 = Cn_1.next(); !Cn_1_1.done; Cn_1_1 = Cn_1.next()) {
2413
+ var e_137 = Cn_1_1.value;
2414
+ i.ShaderStore.IncludesShadersStore[e_137.name] || (i.ShaderStore.IncludesShadersStore[e_137.name] = e_137.shader);
2403
2415
  }
2404
2416
  }
2405
2417
  catch (e_49_1) { e_49 = { error: e_49_1 }; }
2406
2418
  finally {
2407
2419
  try {
2408
- if (_n_1_1 && !_n_1_1.done && (_26 = _n_1.return)) _26.call(_n_1);
2420
+ if (Cn_1_1 && !Cn_1_1.done && (_26 = Cn_1.return)) _26.call(Cn_1);
2409
2421
  }
2410
2422
  finally { if (e_49) throw e_49.error; }
2411
2423
  }
2412
- var Cn = { __proto__: null, triplanarVertexShader: { name: xn, shader: Tn } };
2413
- var En = "triplanarPixelShader", Ln = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=tangentSpace[2];\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW;\n#ifdef DIFFUSEX\nbaseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nnormalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2414
- i.ShaderStore.ShadersStore[En] || (i.ShaderStore.ShadersStore[En] = Ln);
2415
- var Pn = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.logDepthDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2424
+ var En = { __proto__: null, triplanarVertexShader: { name: Tn, shader: _n } };
2425
+ var Ln = "triplanarPixelShader", Pn = "precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=tangentSpace[2];\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW;\n#ifdef DIFFUSEX\nbaseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nnormalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2426
+ i.ShaderStore.ShadersStore[Ln] || (i.ShaderStore.ShadersStore[Ln] = Pn);
2427
+ var In = [i.helperFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.logDepthDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.depthPrePass, i.lightFragment, i.logDepthFragment, i.fogFragment, i.imageProcessingCompatibility];
2416
2428
  try {
2417
- for (var Pn_1 = __values(Pn), Pn_1_1 = Pn_1.next(); !Pn_1_1.done; Pn_1_1 = Pn_1.next()) {
2418
- var e_137 = Pn_1_1.value;
2419
- i.ShaderStore.IncludesShadersStore[e_137.name] || (i.ShaderStore.IncludesShadersStore[e_137.name] = e_137.shader);
2429
+ for (var In_1 = __values(In), In_1_1 = In_1.next(); !In_1_1.done; In_1_1 = In_1.next()) {
2430
+ var e_138 = In_1_1.value;
2431
+ i.ShaderStore.IncludesShadersStore[e_138.name] || (i.ShaderStore.IncludesShadersStore[e_138.name] = e_138.shader);
2420
2432
  }
2421
2433
  }
2422
2434
  catch (e_50_1) { e_50 = { error: e_50_1 }; }
2423
2435
  finally {
2424
2436
  try {
2425
- if (Pn_1_1 && !Pn_1_1.done && (_27 = Pn_1.return)) _27.call(Pn_1);
2437
+ if (In_1_1 && !In_1_1.done && (_27 = In_1.return)) _27.call(In_1);
2426
2438
  }
2427
2439
  finally { if (e_50) throw e_50.error; }
2428
2440
  }
2429
- var In = { __proto__: null, triplanarPixelShader: { name: En, shader: Ln } };
2430
- var Dn = "triplanarVertexShader", bn = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;\n#endif\nuniform tileSize: f32;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSEX\nvertexOutputs.vTextureUVX=worldPos.zy/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEY\nvertexOutputs.vTextureUVY=worldPos.xz/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEZ\nvertexOutputs.vTextureUVZ=worldPos.xy/uniforms.tileSize;\n#endif\n#ifdef NORMAL\nvar xtan: vec3f= vec3f(0,0,1);var xbin: vec3f= vec3f(0,1,0);var ytan: vec3f= vec3f(1,0,0);var ybin: vec3f= vec3f(0,0,1);var ztan: vec3f= vec3f(1,0,0);var zbin: vec3f= vec3f(0,1,0);var normalizedNormal: vec3f=normalize(vertexInputs.normal);normalizedNormal=normalizedNormal*normalizedNormal;var worldBinormal: vec3f=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);var worldTangent: vec3f=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);var worldNormal: vec3f=normalize((normalWorld*normalize(vertexInputs.normal)).xyz);vertexOutputs.tangentSpace0=worldTangent;vertexOutputs.tangentSpace1=worldBinormal;vertexOutputs.tangentSpace2=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2431
- i.ShaderStore.ShadersStoreWGSL[Dn] || (i.ShaderStore.ShadersStoreWGSL[Dn] = bn);
2432
- var An = [i.helperFunctionsWGSL, i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
2441
+ var Dn = { __proto__: null, triplanarPixelShader: { name: Ln, shader: Pn } };
2442
+ var bn = "triplanarVertexShader", An = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;\n#endif\nuniform tileSize: f32;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSEX\nvertexOutputs.vTextureUVX=worldPos.zy/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEY\nvertexOutputs.vTextureUVY=worldPos.xz/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEZ\nvertexOutputs.vTextureUVZ=worldPos.xy/uniforms.tileSize;\n#endif\n#ifdef NORMAL\nvar xtan: vec3f= vec3f(0,0,1);var xbin: vec3f= vec3f(0,1,0);var ytan: vec3f= vec3f(1,0,0);var ybin: vec3f= vec3f(0,0,1);var ztan: vec3f= vec3f(1,0,0);var zbin: vec3f= vec3f(0,1,0);var normalizedNormal: vec3f=normalize(vertexInputs.normal);normalizedNormal=normalizedNormal*normalizedNormal;var worldBinormal: vec3f=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);var worldTangent: vec3f=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);var worldNormal: vec3f=normalize((normalWorld*normalize(vertexInputs.normal)).xyz);vertexOutputs.tangentSpace0=worldTangent;vertexOutputs.tangentSpace1=worldBinormal;vertexOutputs.tangentSpace2=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2443
+ i.ShaderStore.ShadersStoreWGSL[bn] || (i.ShaderStore.ShadersStoreWGSL[bn] = An);
2444
+ var Fn = [i.helperFunctionsWGSL, i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.logDepthVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL];
2433
2445
  try {
2434
- for (var An_1 = __values(An), An_1_1 = An_1.next(); !An_1_1.done; An_1_1 = An_1.next()) {
2435
- var e_138 = An_1_1.value;
2436
- i.ShaderStore.IncludesShadersStoreWGSL[e_138.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_138.name] = e_138.shader);
2446
+ for (var Fn_1 = __values(Fn), Fn_1_1 = Fn_1.next(); !Fn_1_1.done; Fn_1_1 = Fn_1.next()) {
2447
+ var e_139 = Fn_1_1.value;
2448
+ i.ShaderStore.IncludesShadersStoreWGSL[e_139.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_139.name] = e_139.shader);
2437
2449
  }
2438
2450
  }
2439
2451
  catch (e_51_1) { e_51 = { error: e_51_1 }; }
2440
2452
  finally {
2441
2453
  try {
2442
- if (An_1_1 && !An_1_1.done && (_28 = An_1.return)) _28.call(An_1);
2454
+ if (Fn_1_1 && !Fn_1_1.done && (_28 = Fn_1.return)) _28.call(Fn_1);
2443
2455
  }
2444
2456
  finally { if (e_51) throw e_51.error; }
2445
2457
  }
2446
- var Fn = { __proto__: null, triplanarVertexShaderWGSL: { name: Dn, shader: bn } };
2447
- var On = "triplanarPixelShader", Nn = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;var diffuseSamplerXSampler: sampler;var diffuseSamplerX: texture_2d<f32>;\n#ifdef BUMPX\nvar normalSamplerXSampler: sampler;var normalSamplerX: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;var diffuseSamplerYSampler: sampler;var diffuseSamplerY: texture_2d<f32>;\n#ifdef BUMPY\nvar normalSamplerYSampler: sampler;var normalSamplerY: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;var diffuseSamplerZSampler: sampler;var diffuseSamplerZ: texture_2d<f32>;\n#ifdef BUMPZ\nvar normalSamplerZSampler: sampler;var normalSamplerZ: texture_2d<f32>;\n#endif\n#endif\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(0.,0.,0.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=fragmentInputs.tangentSpace2;\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar baseNormal: vec4f= vec4f(0.0,0.0,0.0,1.0);normalW=normalW*normalW;\n#ifdef DIFFUSEX\nbaseColor=baseColor+textureSample(diffuseSamplerX,diffuseSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal=baseNormal+textureSample(normalSamplerX,normalSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor=baseColor+textureSample(diffuseSamplerY,diffuseSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal=baseNormal+textureSample(normalSamplerY,normalSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor=baseColor+textureSample(diffuseSamplerZ,diffuseSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal=baseNormal+textureSample(normalSamplerZ,normalSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nvar tangentSpace: mat3x3f=mat3x3f(fragmentInputs.tangentSpace0,fragmentInputs.tangentSpace1,fragmentInputs.tangentSpace2);normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2448
- i.ShaderStore.ShadersStoreWGSL[On] || (i.ShaderStore.ShadersStoreWGSL[On] = Nn);
2449
- var Mn = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2458
+ var On = { __proto__: null, triplanarVertexShaderWGSL: { name: bn, shader: An } };
2459
+ var Rn = "triplanarPixelShader", Mn = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;var diffuseSamplerXSampler: sampler;var diffuseSamplerX: texture_2d<f32>;\n#ifdef BUMPX\nvar normalSamplerXSampler: sampler;var normalSamplerX: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;var diffuseSamplerYSampler: sampler;var diffuseSamplerY: texture_2d<f32>;\n#ifdef BUMPY\nvar normalSamplerYSampler: sampler;var normalSamplerY: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;var diffuseSamplerZSampler: sampler;var diffuseSamplerZ: texture_2d<f32>;\n#ifdef BUMPZ\nvar normalSamplerZSampler: sampler;var normalSamplerZ: texture_2d<f32>;\n#endif\n#endif\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(0.,0.,0.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=fragmentInputs.tangentSpace2;\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar baseNormal: vec4f= vec4f(0.0,0.0,0.0,1.0);normalW=normalW*normalW;\n#ifdef DIFFUSEX\nbaseColor=baseColor+textureSample(diffuseSamplerX,diffuseSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal=baseNormal+textureSample(normalSamplerX,normalSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor=baseColor+textureSample(diffuseSamplerY,diffuseSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal=baseNormal+textureSample(normalSamplerY,normalSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor=baseColor+textureSample(diffuseSamplerZ,diffuseSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal=baseNormal+textureSample(normalSamplerZ,normalSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nvar tangentSpace: mat3x3f=mat3x3f(fragmentInputs.tangentSpace0,fragmentInputs.tangentSpace1,fragmentInputs.tangentSpace2);normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";
2460
+ i.ShaderStore.ShadersStoreWGSL[Rn] || (i.ShaderStore.ShadersStoreWGSL[Rn] = Mn);
2461
+ var Nn = [i.helperFunctionsWGSL, i.lightUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.depthPrePassWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL, i.imageProcessingCompatibilityWGSL];
2450
2462
  try {
2451
- for (var Mn_1 = __values(Mn), Mn_1_1 = Mn_1.next(); !Mn_1_1.done; Mn_1_1 = Mn_1.next()) {
2452
- var e_139 = Mn_1_1.value;
2453
- i.ShaderStore.IncludesShadersStoreWGSL[e_139.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_139.name] = e_139.shader);
2463
+ for (var Nn_1 = __values(Nn), Nn_1_1 = Nn_1.next(); !Nn_1_1.done; Nn_1_1 = Nn_1.next()) {
2464
+ var e_140 = Nn_1_1.value;
2465
+ i.ShaderStore.IncludesShadersStoreWGSL[e_140.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_140.name] = e_140.shader);
2454
2466
  }
2455
2467
  }
2456
2468
  catch (e_52_1) { e_52 = { error: e_52_1 }; }
2457
2469
  finally {
2458
2470
  try {
2459
- if (Mn_1_1 && !Mn_1_1.done && (_29 = Mn_1.return)) _29.call(Mn_1);
2471
+ if (Nn_1_1 && !Nn_1_1.done && (_29 = Nn_1.return)) _29.call(Nn_1);
2460
2472
  }
2461
2473
  finally { if (e_52) throw e_52.error; }
2462
2474
  }
2463
- var Rn = { __proto__: null, triplanarPixelShaderWGSL: { name: On, shader: Nn } };
2464
- var yn = "waterVertexShader", Vn = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;uniform vec2 vNormalInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef BUMP\nif (vNormalInfos.x==0.)\n{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));\n#endif\n}\nelse\n{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvec3 p=worldPos.xyz;\n#else\nvec3 p=position;\n#endif\nfloat newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY);\n#ifdef USE_WORLD_COORDINATES\ngl_Position=viewProjection*vec4(p,1.0);\n#else\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#endif\n#ifdef REFLECTION\nvRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2465
- i.ShaderStore.ShadersStore[yn] || (i.ShaderStore.ShadersStore[yn] = Vn);
2466
- var Un = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.logDepthDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
2475
+ var yn = { __proto__: null, triplanarPixelShaderWGSL: { name: Rn, shader: Mn } };
2476
+ var Vn = "waterVertexShader", Un = "precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;uniform vec2 vNormalInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef BUMP\nif (vNormalInfos.x==0.)\n{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));\n#endif\n}\nelse\n{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvec3 p=worldPos.xyz;\n#else\nvec3 p=position;\n#endif\nfloat newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY);\n#ifdef USE_WORLD_COORDINATES\ngl_Position=viewProjection*vec4(p,1.0);\n#else\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#endif\n#ifdef REFLECTION\nvRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2477
+ i.ShaderStore.ShadersStore[Vn] || (i.ShaderStore.ShadersStore[Vn] = Un);
2478
+ var wn = [i.bonesDeclaration, i.bakedVertexAnimationDeclaration, i.instancesDeclaration, i.clipPlaneVertexDeclaration, i.fogVertexDeclaration, i.lightFragmentDeclaration, i.lightUboDeclaration, i.logDepthDeclaration, i.instancesVertex, i.bonesVertex, i.bakedVertexAnimation, i.clipPlaneVertex, i.fogVertex, i.shadowsVertex, i.vertexColorMixing, i.logDepthVertex];
2467
2479
  try {
2468
- for (var Un_1 = __values(Un), Un_1_1 = Un_1.next(); !Un_1_1.done; Un_1_1 = Un_1.next()) {
2469
- var e_140 = Un_1_1.value;
2470
- i.ShaderStore.IncludesShadersStore[e_140.name] || (i.ShaderStore.IncludesShadersStore[e_140.name] = e_140.shader);
2480
+ for (var wn_1 = __values(wn), wn_1_1 = wn_1.next(); !wn_1_1.done; wn_1_1 = wn_1.next()) {
2481
+ var e_141 = wn_1_1.value;
2482
+ i.ShaderStore.IncludesShadersStore[e_141.name] || (i.ShaderStore.IncludesShadersStore[e_141.name] = e_141.shader);
2471
2483
  }
2472
2484
  }
2473
2485
  catch (e_53_1) { e_53 = { error: e_53_1 }; }
2474
2486
  finally {
2475
2487
  try {
2476
- if (Un_1_1 && !Un_1_1.done && (_30 = Un_1.return)) _30.call(Un_1);
2488
+ if (wn_1_1 && !wn_1_1.done && (_30 = wn_1.return)) _30.call(wn_1);
2477
2489
  }
2478
2490
  finally { if (e_53) throw e_53.error; }
2479
2491
  }
2480
- var wn = { __proto__: null, waterVertexShader: { name: yn, shader: Vn } };
2481
- var Gn = "waterPixelShader", Wn = "#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform sampler2D normalSampler;uniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));\n#else\nbaseColor=texture2D(normalSampler,vNormalUV);\n#endif\nvec3 bumpColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nbaseColor.rgb*=vNormalInfos.y;\n#else\nvec3 bumpColor=vec3(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec2 perturbation=bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#else \n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation;vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#endif\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2482
- i.ShaderStore.ShadersStore[Gn] || (i.ShaderStore.ShadersStore[Gn] = Wn);
2483
- var Bn = [i.helperFunctions, i.imageProcessingDeclaration, i.imageProcessingFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.lightFragment, i.logDepthFragment, i.fogFragment];
2492
+ var Gn = { __proto__: null, waterVertexShader: { name: Vn, shader: Un } };
2493
+ var Wn = "waterPixelShader", Bn = "#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform sampler2D normalSampler;uniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));\n#else\nbaseColor=texture2D(normalSampler,vNormalUV);\n#endif\nvec3 bumpColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nbaseColor.rgb*=vNormalInfos.y;\n#else\nvec3 bumpColor=vec3(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec2 perturbation=bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#else \n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation;vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#endif\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2494
+ i.ShaderStore.ShadersStore[Wn] || (i.ShaderStore.ShadersStore[Wn] = Bn);
2495
+ var zn = [i.helperFunctions, i.imageProcessingDeclaration, i.imageProcessingFunctions, i.lightFragmentDeclaration, i.lightUboDeclaration, i.lightsFragmentFunctions, i.shadowsFragmentFunctions, i.clipPlaneFragmentDeclaration, i.logDepthDeclaration, i.fogFragmentDeclaration, i.clipPlaneFragment, i.lightFragment, i.logDepthFragment, i.fogFragment];
2484
2496
  try {
2485
- for (var Bn_1 = __values(Bn), Bn_1_1 = Bn_1.next(); !Bn_1_1.done; Bn_1_1 = Bn_1.next()) {
2486
- var e_141 = Bn_1_1.value;
2487
- i.ShaderStore.IncludesShadersStore[e_141.name] || (i.ShaderStore.IncludesShadersStore[e_141.name] = e_141.shader);
2497
+ for (var zn_1 = __values(zn), zn_1_1 = zn_1.next(); !zn_1_1.done; zn_1_1 = zn_1.next()) {
2498
+ var e_142 = zn_1_1.value;
2499
+ i.ShaderStore.IncludesShadersStore[e_142.name] || (i.ShaderStore.IncludesShadersStore[e_142.name] = e_142.shader);
2488
2500
  }
2489
2501
  }
2490
2502
  catch (e_54_1) { e_54 = { error: e_54_1 }; }
2491
2503
  finally {
2492
2504
  try {
2493
- if (Bn_1_1 && !Bn_1_1.done && (_31 = Bn_1.return)) _31.call(Bn_1);
2505
+ if (zn_1_1 && !zn_1_1.done && (_31 = zn_1.return)) _31.call(zn_1);
2494
2506
  }
2495
2507
  finally { if (e_54) throw e_54.error; }
2496
2508
  }
2497
- var zn = { __proto__: null, waterPixelShader: { name: Gn, shader: Wn } };
2498
- var Hn = "waterVertexShader", kn = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef BUMP\nvarying vNormalUV: vec2f;\n#ifdef BUMPSUPERIMPOSE\nvarying vNormalUV2: vec2f;\n#endif\nuniform normalMatrix: mat4x4f;uniform vNormalInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform reflectionViewProjection: mat4x4f;uniform windDirection: vec2f;uniform waveLength: f32;uniform time: f32;uniform windForce: f32;uniform waveHeight: f32;uniform waveSpeed: f32;uniform waveCount: f32;varying vRefractionMapTexCoord: vec3f;varying vReflectionMapTexCoord: vec3f;\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef BUMP\nif (uniforms.vNormalInfos.x==0.)\n{vertexOutputs.vNormalUV=(uniforms.normalMatrix* vec4f((uv*1.0)/uniforms.waveLength+uniforms.time*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#ifdef BUMPSUPERIMPOSE\nvertexOutputs.vNormalUV2=(uniforms.normalMatrix* vec4f((uv*0.721)/uniforms.waveLength+uniforms.time*1.2*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#endif\n}\nelse\n{vertexOutputs.vNormalUV=(uniforms.normalMatrix* vec4f((uv2*1.0)/uniforms.waveLength+uniforms.time*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#ifdef BUMPSUPERIMPOSE\nvertexOutputs.vNormalUV2=(uniforms.normalMatrix* vec4f((uv2*0.721)/uniforms.waveLength+uniforms.time*1.2*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\nvar finalWaveCount: f32=1.0/(uniforms.waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvar p: vec3f=worldPos.xyz;\n#else\nvar p: vec3f=vertexInputs.position;\n#endif\nvar newY: f32=(sin(((p.x/finalWaveCount)+uniforms.time*uniforms.waveSpeed))*uniforms.waveHeight*uniforms.windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+uniforms.time*uniforms.waveSpeed))*uniforms.waveHeight*uniforms.windDirection.y*5.0);p.y=p.y+abs(newY);\n#ifdef USE_WORLD_COORDINATES\nvertexOutputs.position=uniforms.viewProjection* vec4f(p,1.0);\n#else\nvertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(p,1.0);\n#endif\n#ifdef REFLECTION\nvertexOutputs.vRefractionMapTexCoord=vec3f(\n0.5*(vertexOutputs.position.w+vertexOutputs.position.x),\n0.5*(vertexOutputs.position.w+vertexOutputs.position.y),\nvertexOutputs.position.w\n);worldPos=uniforms.reflectionViewProjection*finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.vReflectionMapTexCoord=vec3f(\n0.5*(worldPos.w+worldPos.x),\n0.5*(worldPos.w+worldPos.y),\nworldPos.w\n);\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2499
- i.ShaderStore.ShadersStoreWGSL[Hn] || (i.ShaderStore.ShadersStoreWGSL[Hn] = kn);
2500
- var Xn = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
2509
+ var Hn = { __proto__: null, waterPixelShader: { name: Wn, shader: Bn } };
2510
+ var kn = "waterVertexShader", Xn = "attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef BUMP\nvarying vNormalUV: vec2f;\n#ifdef BUMPSUPERIMPOSE\nvarying vNormalUV2: vec2f;\n#endif\nuniform normalMatrix: mat4x4f;uniform vNormalInfos: vec2f;\n#endif\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform reflectionViewProjection: mat4x4f;uniform windDirection: vec2f;uniform waveLength: f32;uniform time: f32;uniform windForce: f32;uniform waveHeight: f32;uniform waveSpeed: f32;uniform waveCount: f32;varying vRefractionMapTexCoord: vec3f;varying vReflectionMapTexCoord: vec3f;\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef NORMAL\nvertexOutputs.vNormalW=normalize(( finalWorld* vec4f(vertexInputs.normal,0.0)).xyz);\n#endif\n#ifndef UV1\nvar uv: vec2f= vec2f(0.,0.);\n#else\nvar uv: vec2f=vertexInputs.uv;\n#endif\n#ifndef UV2\nvar uv2: vec2f= vec2f(0.,0.);\n#else\nvar uv2: vec2f=vertexInputs.uv2;\n#endif\n#ifdef BUMP\nif (uniforms.vNormalInfos.x==0.)\n{vertexOutputs.vNormalUV=(uniforms.normalMatrix* vec4f((uv*1.0)/uniforms.waveLength+uniforms.time*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#ifdef BUMPSUPERIMPOSE\nvertexOutputs.vNormalUV2=(uniforms.normalMatrix* vec4f((uv*0.721)/uniforms.waveLength+uniforms.time*1.2*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#endif\n}\nelse\n{vertexOutputs.vNormalUV=(uniforms.normalMatrix* vec4f((uv2*1.0)/uniforms.waveLength+uniforms.time*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#ifdef BUMPSUPERIMPOSE\nvertexOutputs.vNormalUV2=(uniforms.normalMatrix* vec4f((uv2*0.721)/uniforms.waveLength+uniforms.time*1.2*uniforms.windForce*uniforms.windDirection,1.0,0.0)).xy;\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\nvar finalWaveCount: f32=1.0/(uniforms.waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvar p: vec3f=worldPos.xyz;\n#else\nvar p: vec3f=vertexInputs.position;\n#endif\nvar newY: f32=(sin(((p.x/finalWaveCount)+uniforms.time*uniforms.waveSpeed))*uniforms.waveHeight*uniforms.windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+uniforms.time*uniforms.waveSpeed))*uniforms.waveHeight*uniforms.windDirection.y*5.0);p.y=p.y+abs(newY);\n#ifdef USE_WORLD_COORDINATES\nvertexOutputs.position=uniforms.viewProjection* vec4f(p,1.0);\n#else\nvertexOutputs.position=uniforms.viewProjection*finalWorld* vec4f(p,1.0);\n#endif\n#ifdef REFLECTION\nvertexOutputs.vRefractionMapTexCoord=vec3f(\n0.5*(vertexOutputs.position.w+vertexOutputs.position.x),\n0.5*(vertexOutputs.position.w+vertexOutputs.position.y),\nvertexOutputs.position.w\n);worldPos=uniforms.reflectionViewProjection*finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.vReflectionMapTexCoord=vec3f(\n0.5*(worldPos.w+worldPos.x),\n0.5*(worldPos.w+worldPos.y),\nworldPos.w\n);\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";
2511
+ i.ShaderStore.ShadersStoreWGSL[kn] || (i.ShaderStore.ShadersStoreWGSL[kn] = Xn);
2512
+ var jn = [i.bonesDeclarationWGSL, i.bakedVertexAnimationDeclarationWGSL, i.instancesDeclarationWGSL, i.clipPlaneVertexDeclarationWGSL, i.fogVertexDeclarationWGSL, i.lightVxFragmentDeclarationWGSL, i.lightVxUboDeclarationWGSL, i.logDepthDeclarationWGSL, i.instancesVertexWGSL, i.bonesVertexWGSL, i.bakedVertexAnimationWGSL, i.clipPlaneVertexWGSL, i.fogVertexWGSL, i.shadowsVertexWGSL, i.vertexColorMixingWGSL, i.logDepthVertexWGSL];
2501
2513
  try {
2502
- for (var Xn_1 = __values(Xn), Xn_1_1 = Xn_1.next(); !Xn_1_1.done; Xn_1_1 = Xn_1.next()) {
2503
- var e_142 = Xn_1_1.value;
2504
- i.ShaderStore.IncludesShadersStoreWGSL[e_142.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_142.name] = e_142.shader);
2514
+ for (var jn_1 = __values(jn), jn_1_1 = jn_1.next(); !jn_1_1.done; jn_1_1 = jn_1.next()) {
2515
+ var e_143 = jn_1_1.value;
2516
+ i.ShaderStore.IncludesShadersStoreWGSL[e_143.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_143.name] = e_143.shader);
2505
2517
  }
2506
2518
  }
2507
2519
  catch (e_55_1) { e_55 = { error: e_55_1 }; }
2508
2520
  finally {
2509
2521
  try {
2510
- if (Xn_1_1 && !Xn_1_1.done && (_32 = Xn_1.return)) _32.call(Xn_1);
2522
+ if (jn_1_1 && !jn_1_1.done && (_32 = jn_1.return)) _32.call(jn_1);
2511
2523
  }
2512
2524
  finally { if (e_55) throw e_55.error; }
2513
2525
  }
2514
- var jn = { __proto__: null, waterVertexShaderWGSL: { name: Hn, shader: kn } };
2515
- var Zn = "waterPixelShader", Yn = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vNormalUV: vec2f;\n#ifdef BUMPSUPERIMPOSE\nvarying vNormalUV2: vec2f;\n#endif\nvar normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;uniform vNormalInfos: vec2f;\n#endif\nvar refractionSamplerSampler: sampler;var refractionSampler: texture_2d<f32>;var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;const LOG2: f32=1.442695;uniform cameraPosition: vec3f;uniform waterColor: vec4f;uniform colorBlendFactor: f32;uniform waterColor2: vec4f;uniform colorBlendFactor2: f32;uniform bumpHeight: f32;uniform time: f32;varying vRefractionMapTexCoord: vec3f;varying vReflectionMapTexCoord: vec3f;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*textureSample(normalSampler,normalSamplerSampler,fragmentInputs.vNormalUV)+0.4*textureSample(normalSampler,normalSamplerSampler, vec2f(fragmentInputs.vNormalUV2.x,fragmentInputs.vNormalUV2.y));\n#else\nbaseColor=textureSample(normalSampler,normalSamplerSampler,fragmentInputs.vNormalUV);\n#endif\nvar bumpColor: vec3f=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\nbaseColor=vec4f(baseColor.rgb*uniforms.vNormalInfos.y,baseColor.a);\n#else\nvar bumpColor: vec3f= vec3f(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar perturbation: vec2f=uniforms.bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW+ vec3f(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#endif\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);var perturbation: vec2f=uniforms.bumpHeight*( vec2f(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvar projectedRefractionTexCoords: vec2f=clamp(fragmentInputs.vRefractionMapTexCoord.xy/fragmentInputs.vRefractionMapTexCoord.z+perturbation*0.5, vec2f(0.0), vec2f(1.0));var refractiveColor: vec4f=textureSample(refractionSampler,refractionSamplerSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor=vec4f(toGammaSpace(refractiveColor.rgb),refractiveColor.a);\n#endif\nvar projectedReflectionTexCoords: vec2f= vec2f(\nfragmentInputs.vReflectionMapTexCoord.x/fragmentInputs.vReflectionMapTexCoord.z+perturbation.x*0.3,\nfragmentInputs.vReflectionMapTexCoord.y/fragmentInputs.vReflectionMapTexCoord.z+perturbation.y\n);var reflectiveColor: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor=vec4f(toGammaSpace(reflectiveColor.rgb),reflectiveColor.a);\n#endif\nvar upVector: vec3f= vec3f(0.0,1.0,0.0);var fresnelTerm: f32=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);var IfresnelTerm: f32=1.0-fresnelTerm;refractiveColor=uniforms.colorBlendFactor*uniforms.waterColor+(1.0-uniforms.colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*uniforms.colorBlendFactor2*uniforms.waterColor+(1.0-uniforms.colorBlendFactor2*IfresnelTerm)*reflectiveColor;var combinedColor: vec4f=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvar finalDiffuse: vec3f=clamp(baseColor.rgb,vec3f(0.0),vec3f(1.0));\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#else \n#ifdef REFLECTION\nvar projectedRefractionTexCoords: vec2f=clamp(fragmentInputs.vRefractionMapTexCoord.xy/fragmentInputs.vRefractionMapTexCoord.z+perturbation, vec2f(0.0), vec2f(1.0));var refractiveColor: vec4f=textureSample(refractionSampler,refractionSamplerSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor=vec4f(toGammaSpace(refractiveColor.rgb),refractiveColor.a);\n#endif\nvar projectedReflectionTexCoords: vec2f=fragmentInputs.vReflectionMapTexCoord.xy/fragmentInputs.vReflectionMapTexCoord.z+perturbation;var reflectiveColor: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor=vec4f(toGammaSpace(reflectiveColor.rgb),reflectiveColor.a);\n#endif\nvar upVector: vec3f= vec3f(0.0,1.0,0.0);var fresnelTerm: f32=max(dot(viewDirectionW,upVector),0.0);var combinedColor: vec4f=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=uniforms.colorBlendFactor*uniforms.waterColor+(1.0-uniforms.colorBlendFactor)*combinedColor;\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvar finalDiffuse: vec3f=clamp(baseColor.rgb,vec3f(0.0),vec3f(1.0));\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#endif\nvar color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);\n#elif defined(IMAGEPROCESSING)\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);\n#endif\nfragmentOutputs.color=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2516
- i.ShaderStore.ShadersStoreWGSL[Zn] || (i.ShaderStore.ShadersStoreWGSL[Zn] = Yn);
2517
- var Kn = [i.helperFunctionsWGSL, i.imageProcessingDeclarationWGSL, i.imageProcessingFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL];
2526
+ var Yn = { __proto__: null, waterVertexShaderWGSL: { name: kn, shader: Xn } };
2527
+ var Zn = "waterPixelShader", Kn = "uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vNormalUV: vec2f;\n#ifdef BUMPSUPERIMPOSE\nvarying vNormalUV2: vec2f;\n#endif\nvar normalSamplerSampler: sampler;var normalSampler: texture_2d<f32>;uniform vNormalInfos: vec2f;\n#endif\nvar refractionSamplerSampler: sampler;var refractionSampler: texture_2d<f32>;var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;const LOG2: f32=1.442695;uniform cameraPosition: vec3f;uniform waterColor: vec4f;uniform colorBlendFactor: f32;uniform waterColor2: vec4f;uniform colorBlendFactor2: f32;uniform bumpHeight: f32;uniform time: f32;varying vRefractionMapTexCoord: vec3f;varying vReflectionMapTexCoord: vec3f;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*textureSample(normalSampler,normalSamplerSampler,fragmentInputs.vNormalUV)+0.4*textureSample(normalSampler,normalSamplerSampler, vec2f(fragmentInputs.vNormalUV2.x,fragmentInputs.vNormalUV2.y));\n#else\nbaseColor=textureSample(normalSampler,normalSamplerSampler,fragmentInputs.vNormalUV);\n#endif\nvar bumpColor: vec3f=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\nbaseColor=vec4f(baseColor.rgb*uniforms.vNormalInfos.y,baseColor.a);\n#else\nvar bumpColor: vec3f= vec3f(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef NORMAL\nvar perturbation: vec2f=uniforms.bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW+ vec3f(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#endif\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);var perturbation: vec2f=uniforms.bumpHeight*( vec2f(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvar projectedRefractionTexCoords: vec2f=clamp(fragmentInputs.vRefractionMapTexCoord.xy/fragmentInputs.vRefractionMapTexCoord.z+perturbation*0.5, vec2f(0.0), vec2f(1.0));var refractiveColor: vec4f=textureSample(refractionSampler,refractionSamplerSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor=vec4f(toGammaSpace(refractiveColor.rgb),refractiveColor.a);\n#endif\nvar projectedReflectionTexCoords: vec2f= vec2f(\nfragmentInputs.vReflectionMapTexCoord.x/fragmentInputs.vReflectionMapTexCoord.z+perturbation.x*0.3,\nfragmentInputs.vReflectionMapTexCoord.y/fragmentInputs.vReflectionMapTexCoord.z+perturbation.y\n);var reflectiveColor: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor=vec4f(toGammaSpace(reflectiveColor.rgb),reflectiveColor.a);\n#endif\nvar upVector: vec3f= vec3f(0.0,1.0,0.0);var fresnelTerm: f32=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);var IfresnelTerm: f32=1.0-fresnelTerm;refractiveColor=uniforms.colorBlendFactor*uniforms.waterColor+(1.0-uniforms.colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*uniforms.colorBlendFactor2*uniforms.waterColor+(1.0-uniforms.colorBlendFactor2*IfresnelTerm)*reflectiveColor;var combinedColor: vec4f=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvar finalDiffuse: vec3f=clamp(baseColor.rgb,vec3f(0.0),vec3f(1.0));\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#else \n#ifdef REFLECTION\nvar projectedRefractionTexCoords: vec2f=clamp(fragmentInputs.vRefractionMapTexCoord.xy/fragmentInputs.vRefractionMapTexCoord.z+perturbation, vec2f(0.0), vec2f(1.0));var refractiveColor: vec4f=textureSample(refractionSampler,refractionSamplerSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor=vec4f(toGammaSpace(refractiveColor.rgb),refractiveColor.a);\n#endif\nvar projectedReflectionTexCoords: vec2f=fragmentInputs.vReflectionMapTexCoord.xy/fragmentInputs.vReflectionMapTexCoord.z+perturbation;var reflectiveColor: vec4f=textureSample(reflectionSampler,reflectionSamplerSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor=vec4f(toGammaSpace(reflectiveColor.rgb),reflectiveColor.a);\n#endif\nvar upVector: vec3f= vec3f(0.0,1.0,0.0);var fresnelTerm: f32=max(dot(viewDirectionW,upVector),0.0);var combinedColor: vec4f=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=uniforms.colorBlendFactor*uniforms.waterColor+(1.0-uniforms.colorBlendFactor)*combinedColor;\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvar finalDiffuse: vec3f=clamp(baseColor.rgb,vec3f(0.0),vec3f(1.0));\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#endif\nvar color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);\n#elif defined(IMAGEPROCESSING)\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);\n#endif\nfragmentOutputs.color=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";
2528
+ i.ShaderStore.ShadersStoreWGSL[Zn] || (i.ShaderStore.ShadersStoreWGSL[Zn] = Kn);
2529
+ var qn = [i.helperFunctionsWGSL, i.imageProcessingDeclarationWGSL, i.imageProcessingFunctionsWGSL, i.lightUboDeclarationWGSL, i.lightsFragmentFunctionsWGSL, i.shadowsFragmentFunctionsWGSL, i.clipPlaneFragmentDeclarationWGSL, i.logDepthDeclarationWGSL, i.fogFragmentDeclarationWGSL, i.clipPlaneFragmentWGSL, i.lightFragmentWGSL, i.logDepthFragmentWGSL, i.fogFragmentWGSL];
2518
2530
  try {
2519
- for (var Kn_1 = __values(Kn), Kn_1_1 = Kn_1.next(); !Kn_1_1.done; Kn_1_1 = Kn_1.next()) {
2520
- var e_143 = Kn_1_1.value;
2521
- i.ShaderStore.IncludesShadersStoreWGSL[e_143.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_143.name] = e_143.shader);
2531
+ for (var qn_1 = __values(qn), qn_1_1 = qn_1.next(); !qn_1_1.done; qn_1_1 = qn_1.next()) {
2532
+ var e_144 = qn_1_1.value;
2533
+ i.ShaderStore.IncludesShadersStoreWGSL[e_144.name] || (i.ShaderStore.IncludesShadersStoreWGSL[e_144.name] = e_144.shader);
2522
2534
  }
2523
2535
  }
2524
2536
  catch (e_56_1) { e_56 = { error: e_56_1 }; }
2525
2537
  finally {
2526
2538
  try {
2527
- if (Kn_1_1 && !Kn_1_1.done && (_33 = Kn_1.return)) _33.call(Kn_1);
2539
+ if (qn_1_1 && !qn_1_1.done && (_33 = qn_1.return)) _33.call(qn_1);
2528
2540
  }
2529
2541
  finally { if (e_56) throw e_56.error; }
2530
2542
  }
2531
- var qn = { __proto__: null, waterPixelShaderWGSL: { name: Zn, shader: Yn } };
2532
- e.CellMaterial = o, e.CustomMaterial = u, e.CustomShaderStructure = f, e.FireMaterial = v, e.FurMaterial = p, e.GradientMaterial = x, e.GridMaterial = _, e.LavaMaterial = E, e.MixMaterial = P, e.NormalMaterial = D, e.PBRCustomMaterial = h, e.ShaderAlbedoParts = d, e.ShaderAlebdoParts = c, e.ShaderSpecialParts = l, e.ShadowOnlyMaterial = A, e.SimpleMaterial = O, e.SkyMaterial = M, e.TerrainMaterial = y, e.TriPlanarMaterial = U, e.WaterMaterial = G;
2543
+ var Qn = { __proto__: null, waterPixelShaderWGSL: { name: Zn, shader: Kn } };
2544
+ e.CellMaterial = o, e.CustomMaterial = u, e.CustomShaderStructure = f, e.FireMaterial = v, e.FurMaterial = p, e.GradientMaterial = x, e.GridMaterial = _, e.LavaMaterial = E, e.MixMaterial = P, e.NormalMaterial = D, e.PBRCustomMaterial = h, e.ShaderAlbedoParts = d, e.ShaderAlebdoParts = c, e.ShaderSpecialParts = l, e.ShadowOnlyMaterial = A, e.SimpleMaterial = O, e.SkyMaterial = N, e.TerrainMaterial = V, e.TriPlanarMaterial = w, e.WaterMaterial = W, e._MaxColorValueForRenderTarget = M;
2533
2545
  });