Path: blob/main/projects/temple-run-2/assets/babylonjs/babylonjs.materials.js
1834 views
(function webpackUniversalModuleDefinition(root, factory) {1if(typeof exports === 'object' && typeof module === 'object')2module.exports = factory(require("babylonjs"));3else if(typeof define === 'function' && define.amd)4define("babylonjs-materials", ["babylonjs"], factory);5else if(typeof exports === 'object')6exports["babylonjs-materials"] = factory(require("babylonjs"));7else8root["MATERIALS"] = factory(root["BABYLON"]);9})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {10return /******/ (function(modules) { // webpackBootstrap11/******/ // The module cache12/******/ var installedModules = {};13/******/14/******/ // The require function15/******/ function __webpack_require__(moduleId) {16/******/17/******/ // Check if module is in cache18/******/ if(installedModules[moduleId]) {19/******/ return installedModules[moduleId].exports;20/******/ }21/******/ // Create a new module (and put it into the cache)22/******/ var module = installedModules[moduleId] = {23/******/ i: moduleId,24/******/ l: false,25/******/ exports: {}26/******/ };27/******/28/******/ // Execute the module function29/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);30/******/31/******/ // Flag the module as loaded32/******/ module.l = true;33/******/34/******/ // Return the exports of the module35/******/ return module.exports;36/******/ }37/******/38/******/39/******/ // expose the modules object (__webpack_modules__)40/******/ __webpack_require__.m = modules;41/******/42/******/ // expose the module cache43/******/ __webpack_require__.c = installedModules;44/******/45/******/ // define getter function for harmony exports46/******/ __webpack_require__.d = function(exports, name, getter) {47/******/ if(!__webpack_require__.o(exports, name)) {48/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });49/******/ }50/******/ };51/******/52/******/ // define __esModule on exports53/******/ __webpack_require__.r = function(exports) {54/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {55/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });56/******/ }57/******/ Object.defineProperty(exports, '__esModule', { value: true });58/******/ };59/******/60/******/ // create a fake namespace object61/******/ // mode & 1: value is a module id, require it62/******/ // mode & 2: merge all properties of value into the ns63/******/ // mode & 4: return value when already ns object64/******/ // mode & 8|1: behave like require65/******/ __webpack_require__.t = function(value, mode) {66/******/ if(mode & 1) value = __webpack_require__(value);67/******/ if(mode & 8) return value;68/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;69/******/ var ns = Object.create(null);70/******/ __webpack_require__.r(ns);71/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });72/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));73/******/ return ns;74/******/ };75/******/76/******/ // getDefaultExport function for compatibility with non-harmony modules77/******/ __webpack_require__.n = function(module) {78/******/ var getter = module && module.__esModule ?79/******/ function getDefault() { return module['default']; } :80/******/ function getModuleExports() { return module; };81/******/ __webpack_require__.d(getter, 'a', getter);82/******/ return getter;83/******/ };84/******/85/******/ // Object.prototype.hasOwnProperty.call86/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };87/******/88/******/ // __webpack_public_path__89/******/ __webpack_require__.p = "";90/******/91/******/92/******/ // Load entry module and return exports93/******/ return __webpack_require__(__webpack_require__.s = "./legacy/legacy.ts");94/******/ })95/************************************************************************/96/******/ ({9798/***/ "../../node_modules/tslib/tslib.es6.js":99/*!***********************************************************!*\100!*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!101\***********************************************************/102/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */103/***/ (function(module, __webpack_exports__, __webpack_require__) {104105"use strict";106__webpack_require__.r(__webpack_exports__);107/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });108/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });109/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });110/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });111/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });112/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });113/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });114/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });115/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });116/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });117/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });118/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });119/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });120/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });121/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArray", function() { return __spreadArray; });122/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });123/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });124/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });125/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });126/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });127/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });128/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });129/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });130/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });131/*! *****************************************************************************132Copyright (c) Microsoft Corporation.133134Permission to use, copy, modify, and/or distribute this software for any135purpose with or without fee is hereby granted.136137THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH138REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY139AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,140INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM141LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR142OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR143PERFORMANCE OF THIS SOFTWARE.144***************************************************************************** */145/* global Reflect, Promise */146147var extendStatics = function(d, b) {148extendStatics = Object.setPrototypeOf ||149({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||150function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };151return extendStatics(d, b);152};153154function __extends(d, b) {155if (typeof b !== "function" && b !== null)156throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");157extendStatics(d, b);158function __() { this.constructor = d; }159d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());160}161162var __assign = function() {163__assign = Object.assign || function __assign(t) {164for (var s, i = 1, n = arguments.length; i < n; i++) {165s = arguments[i];166for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];167}168return t;169}170return __assign.apply(this, arguments);171}172173function __rest(s, e) {174var t = {};175for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)176t[p] = s[p];177if (s != null && typeof Object.getOwnPropertySymbols === "function")178for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {179if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))180t[p[i]] = s[p[i]];181}182return t;183}184185function __decorate(decorators, target, key, desc) {186var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;187if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);188else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;189return c > 3 && r && Object.defineProperty(target, key, r), r;190}191192function __param(paramIndex, decorator) {193return function (target, key) { decorator(target, key, paramIndex); }194}195196function __metadata(metadataKey, metadataValue) {197if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);198}199200function __awaiter(thisArg, _arguments, P, generator) {201function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }202return new (P || (P = Promise))(function (resolve, reject) {203function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }204function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }205function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }206step((generator = generator.apply(thisArg, _arguments || [])).next());207});208}209210function __generator(thisArg, body) {211var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;212return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;213function verb(n) { return function (v) { return step([n, v]); }; }214function step(op) {215if (f) throw new TypeError("Generator is already executing.");216while (_) try {217if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;218if (y = 0, t) op = [op[0] & 2, t.value];219switch (op[0]) {220case 0: case 1: t = op; break;221case 4: _.label++; return { value: op[1], done: false };222case 5: _.label++; y = op[1]; op = [0]; continue;223case 7: op = _.ops.pop(); _.trys.pop(); continue;224default:225if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }226if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }227if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }228if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }229if (t[2]) _.ops.pop();230_.trys.pop(); continue;231}232op = body.call(thisArg, _);233} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }234if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };235}236}237238var __createBinding = Object.create ? (function(o, m, k, k2) {239if (k2 === undefined) k2 = k;240Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });241}) : (function(o, m, k, k2) {242if (k2 === undefined) k2 = k;243o[k2] = m[k];244});245246function __exportStar(m, o) {247for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);248}249250function __values(o) {251var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;252if (m) return m.call(o);253if (o && typeof o.length === "number") return {254next: function () {255if (o && i >= o.length) o = void 0;256return { value: o && o[i++], done: !o };257}258};259throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");260}261262function __read(o, n) {263var m = typeof Symbol === "function" && o[Symbol.iterator];264if (!m) return o;265var i = m.call(o), r, ar = [], e;266try {267while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);268}269catch (error) { e = { error: error }; }270finally {271try {272if (r && !r.done && (m = i["return"])) m.call(i);273}274finally { if (e) throw e.error; }275}276return ar;277}278279/** @deprecated */280function __spread() {281for (var ar = [], i = 0; i < arguments.length; i++)282ar = ar.concat(__read(arguments[i]));283return ar;284}285286/** @deprecated */287function __spreadArrays() {288for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;289for (var r = Array(s), k = 0, i = 0; i < il; i++)290for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)291r[k] = a[j];292return r;293}294295function __spreadArray(to, from, pack) {296if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {297if (ar || !(i in from)) {298if (!ar) ar = Array.prototype.slice.call(from, 0, i);299ar[i] = from[i];300}301}302return to.concat(ar || Array.prototype.slice.call(from));303}304305function __await(v) {306return this instanceof __await ? (this.v = v, this) : new __await(v);307}308309function __asyncGenerator(thisArg, _arguments, generator) {310if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");311var g = generator.apply(thisArg, _arguments || []), i, q = [];312return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;313function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }314function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }315function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }316function fulfill(value) { resume("next", value); }317function reject(value) { resume("throw", value); }318function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }319}320321function __asyncDelegator(o) {322var i, p;323return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;324function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }325}326327function __asyncValues(o) {328if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");329var m = o[Symbol.asyncIterator], i;330return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);331function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }332function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }333}334335function __makeTemplateObject(cooked, raw) {336if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }337return cooked;338};339340var __setModuleDefault = Object.create ? (function(o, v) {341Object.defineProperty(o, "default", { enumerable: true, value: v });342}) : function(o, v) {343o["default"] = v;344};345346function __importStar(mod) {347if (mod && mod.__esModule) return mod;348var result = {};349if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);350__setModuleDefault(result, mod);351return result;352}353354function __importDefault(mod) {355return (mod && mod.__esModule) ? mod : { default: mod };356}357358function __classPrivateFieldGet(receiver, state, kind, f) {359if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");360if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");361return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);362}363364function __classPrivateFieldSet(receiver, state, value, kind, f) {365if (kind === "m") throw new TypeError("Private method is not writable");366if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");367if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");368return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;369}370371372/***/ }),373374/***/ "../../node_modules/webpack/buildin/global.js":375/*!***********************************!*\376!*** (webpack)/buildin/global.js ***!377\***********************************/378/*! no static exports found */379/***/ (function(module, exports) {380381var g;382383// This works in non-strict mode384g = (function() {385return this;386})();387388try {389// This works if eval is allowed (see CSP)390g = g || new Function("return this")();391} catch (e) {392// This works if the window reference is available393if (typeof window === "object") g = window;394}395396// g can still be undefined, but nothing to do about it...397// We return undefined, instead of nothing here, so it's398// easier to handle this case. if(!global) { ...}399400module.exports = g;401402403/***/ }),404405/***/ "./cell/cell.fragment.ts":406/*!*******************************!*\407!*** ./cell/cell.fragment.ts ***!408\*******************************/409/*! exports provided: cellPixelShader */410/***/ (function(module, __webpack_exports__, __webpack_require__) {411412"use strict";413__webpack_require__.r(__webpack_exports__);414/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellPixelShader", function() { return cellPixelShader; });415/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");416/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);417418419420421422423424425426427428429430var name = 'cellPixelShader';431var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n\nvec3 computeCustomDiffuseLighting(lightingInfo info,vec3 diffuseBase,float shadow)\n{\ndiffuseBase=info.diffuse*shadow;\n#ifdef CELLBASIC\nfloat level=1.0;\nif (info.ndl<0.5)\nlevel=0.5;\ndiffuseBase.rgb*vec3(level,level,level);\n#else\nfloat ToonThresholds[4];\nToonThresholds[0]=0.95;\nToonThresholds[1]=0.5;\nToonThresholds[2]=0.2;\nToonThresholds[3]=0.03;\nfloat ToonBrightnessLevels[5];\nToonBrightnessLevels[0]=1.0;\nToonBrightnessLevels[1]=0.8;\nToonBrightnessLevels[2]=0.6;\nToonBrightnessLevels[3]=0.35;\nToonBrightnessLevels[4]=0.2;\nif (info.ndl>ToonThresholds[0])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[0];\n}\nelse if (info.ndl>ToonThresholds[1])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[1];\n}\nelse if (info.ndl>ToonThresholds[2])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[2];\n}\nelse if (info.ndl>ToonThresholds[3])\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[3];\n}\nelse\n{\ndiffuseBase.rgb*=ToonBrightnessLevels[4];\n}\n#endif\nreturn max(diffuseBase,vec3(0.2));\n}\nvoid main(void)\n{\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat 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\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nlightingInfo info;\nvec3 diffuseBase=vec3(0.,0.,0.);\nfloat shadow=1.;\nfloat glossiness=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";432babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;433/** @hidden */434var cellPixelShader = { name: name, shader: shader };435436437/***/ }),438439/***/ "./cell/cell.vertex.ts":440/*!*****************************!*\441!*** ./cell/cell.vertex.ts ***!442\*****************************/443/*! exports provided: cellVertexShader */444/***/ (function(module, __webpack_exports__, __webpack_require__) {445446"use strict";447__webpack_require__.r(__webpack_exports__);448/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellVertexShader", function() { return cellVertexShader; });449/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");450/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);451452453454455456457458459460461462463var name = 'cellVertexShader';464var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";465babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;466/** @hidden */467var cellVertexShader = { name: name, shader: shader };468469470/***/ }),471472/***/ "./cell/cellMaterial.ts":473/*!******************************!*\474!*** ./cell/cellMaterial.ts ***!475\******************************/476/*! exports provided: CellMaterial */477/***/ (function(module, __webpack_exports__, __webpack_require__) {478479"use strict";480__webpack_require__.r(__webpack_exports__);481/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return CellMaterial; });482/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");483/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");484/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);485/* harmony import */ var _cell_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cell.fragment */ "./cell/cell.fragment.ts");486/* harmony import */ var _cell_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cell.vertex */ "./cell/cell.vertex.ts");487488489490491492493494495496497498499500var CellMaterialDefines = /** @class */ (function (_super) {501Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CellMaterialDefines, _super);502function CellMaterialDefines() {503var _this = _super.call(this) || this;504_this.DIFFUSE = false;505_this.CLIPPLANE = false;506_this.CLIPPLANE2 = false;507_this.CLIPPLANE3 = false;508_this.CLIPPLANE4 = false;509_this.CLIPPLANE5 = false;510_this.CLIPPLANE6 = false;511_this.ALPHATEST = false;512_this.POINTSIZE = false;513_this.FOG = false;514_this.NORMAL = false;515_this.UV1 = false;516_this.UV2 = false;517_this.VERTEXCOLOR = false;518_this.VERTEXALPHA = false;519_this.NUM_BONE_INFLUENCERS = 0;520_this.BonesPerMesh = 0;521_this.INSTANCES = false;522_this.NDOTL = true;523_this.CUSTOMUSERLIGHTING = true;524_this.CELLBASIC = true;525_this.DEPTHPREPASS = false;526_this.IMAGEPROCESSINGPOSTPROCESS = false;527_this.rebuild();528return _this;529}530return CellMaterialDefines;531}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));532var CellMaterial = /** @class */ (function (_super) {533Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CellMaterial, _super);534function CellMaterial(name, scene) {535var _this = _super.call(this, name, scene) || this;536_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);537_this._computeHighLevel = false;538_this._disableLighting = false;539_this._maxSimultaneousLights = 4;540return _this;541}542CellMaterial.prototype.needAlphaBlending = function () {543return (this.alpha < 1.0);544};545CellMaterial.prototype.needAlphaTesting = function () {546return false;547};548CellMaterial.prototype.getAlphaTestTexture = function () {549return null;550};551// Methods552CellMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {553if (this.isFrozen) {554if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {555return true;556}557}558if (!subMesh._materialDefines) {559subMesh.materialDefines = new CellMaterialDefines();560}561var defines = subMesh._materialDefines;562var scene = this.getScene();563if (this._isReadyForSubMesh(subMesh)) {564return true;565}566var engine = scene.getEngine();567// Textures568if (defines._areTexturesDirty) {569defines._needUVs = false;570if (scene.texturesEnabled) {571if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {572if (!this._diffuseTexture.isReady()) {573return false;574}575else {576defines._needUVs = true;577defines.DIFFUSE = true;578}579}580}581}582// High level583defines.CELLBASIC = !this.computeHighLevel;584// Misc.585babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);586// Lights587defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);588// Values that need to be evaluated on every frame589babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);590// Attribs591babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);592// Get correct effect593if (defines.isDirty) {594defines.markAsProcessed();595scene.resetCachedMaterial();596// Fallbacks597var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();598if (defines.FOG) {599fallbacks.addFallback(1, "FOG");600}601babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);602if (defines.NUM_BONE_INFLUENCERS > 0) {603fallbacks.addCPUSkinningFallback(0, mesh);604}605defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;606//Attributes607var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];608if (defines.NORMAL) {609attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);610}611if (defines.UV1) {612attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);613}614if (defines.UV2) {615attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);616}617if (defines.VERTEXCOLOR) {618attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);619}620babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);621babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);622var shaderName = "cell";623var join = defines.toString();624var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor",625"vFogInfos", "vFogColor", "pointSize",626"vDiffuseInfos",627"mBones",628"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix"629];630var samplers = ["diffuseSampler"];631var uniformBuffers = new Array();632babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({633uniformsNames: uniforms,634uniformBuffersNames: uniformBuffers,635samplers: samplers,636defines: defines,637maxSimultaneousLights: this.maxSimultaneousLights638});639subMesh.setEffect(scene.getEngine().createEffect(shaderName, {640attributes: attribs,641uniformsNames: uniforms,642uniformBuffersNames: uniformBuffers,643samplers: samplers,644defines: join,645fallbacks: fallbacks,646onCompiled: this.onCompiled,647onError: this.onError,648indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights - 1 }649}, engine), defines, this._materialContext);650}651if (!subMesh.effect || !subMesh.effect.isReady()) {652return false;653}654defines._renderId = scene.getRenderId();655subMesh.effect._wasPreviouslyReady = true;656return true;657};658CellMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {659var scene = this.getScene();660var defines = subMesh._materialDefines;661if (!defines) {662return;663}664var effect = subMesh.effect;665if (!effect) {666return;667}668this._activeEffect = effect;669// Matrices670this.bindOnlyWorldMatrix(world);671this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());672// Bones673babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);674if (this._mustRebind(scene, effect)) {675// Textures676if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {677this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);678this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);679this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix());680}681// Clip plane682babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);683// Point size684if (this.pointsCloud) {685this._activeEffect.setFloat("pointSize", this.pointSize);686}687scene.bindEyePosition(effect);688}689this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);690// Lights691if (scene.lightsEnabled && !this.disableLighting) {692babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this._maxSimultaneousLights);693}694// View695if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {696this._activeEffect.setMatrix("view", scene.getViewMatrix());697}698// Fog699babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);700this._afterBind(mesh, this._activeEffect);701};702CellMaterial.prototype.getAnimatables = function () {703var results = [];704if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) {705results.push(this._diffuseTexture);706}707return results;708};709CellMaterial.prototype.getActiveTextures = function () {710var activeTextures = _super.prototype.getActiveTextures.call(this);711if (this._diffuseTexture) {712activeTextures.push(this._diffuseTexture);713}714return activeTextures;715};716CellMaterial.prototype.hasTexture = function (texture) {717if (_super.prototype.hasTexture.call(this, texture)) {718return true;719}720return this._diffuseTexture === texture;721};722CellMaterial.prototype.dispose = function (forceDisposeEffect) {723if (this._diffuseTexture) {724this._diffuseTexture.dispose();725}726_super.prototype.dispose.call(this, forceDisposeEffect);727};728CellMaterial.prototype.getClassName = function () {729return "CellMaterial";730};731CellMaterial.prototype.clone = function (name) {732var _this = this;733return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new CellMaterial(name, _this.getScene()); }, this);734};735CellMaterial.prototype.serialize = function () {736var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);737serializationObject.customType = "BABYLON.CellMaterial";738return serializationObject;739};740// Statics741CellMaterial.Parse = function (source, scene, rootUrl) {742return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new CellMaterial(source.name, scene); }, source, scene, rootUrl);743};744Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([745Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture")746], CellMaterial.prototype, "_diffuseTexture", void 0);747Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([748Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")749], CellMaterial.prototype, "diffuseTexture", void 0);750Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([751Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])("diffuse")752], CellMaterial.prototype, "diffuseColor", void 0);753Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([754Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("computeHighLevel")755], CellMaterial.prototype, "_computeHighLevel", void 0);756Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([757Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")758], CellMaterial.prototype, "computeHighLevel", void 0);759Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([760Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")761], CellMaterial.prototype, "_disableLighting", void 0);762Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([763Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")764], CellMaterial.prototype, "disableLighting", void 0);765Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([766Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")767], CellMaterial.prototype, "_maxSimultaneousLights", void 0);768Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([769Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")770], CellMaterial.prototype, "maxSimultaneousLights", void 0);771return CellMaterial;772}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));773774babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.CellMaterial"] = CellMaterial;775776777/***/ }),778779/***/ "./cell/index.ts":780/*!***********************!*\781!*** ./cell/index.ts ***!782\***********************/783/*! exports provided: CellMaterial */784/***/ (function(module, __webpack_exports__, __webpack_require__) {785786"use strict";787__webpack_require__.r(__webpack_exports__);788/* harmony import */ var _cellMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cellMaterial */ "./cell/cellMaterial.ts");789/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return _cellMaterial__WEBPACK_IMPORTED_MODULE_0__["CellMaterial"]; });790791792793794/***/ }),795796/***/ "./custom/customMaterial.ts":797/*!**********************************!*\798!*** ./custom/customMaterial.ts ***!799\**********************************/800/*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial */801/***/ (function(module, __webpack_exports__, __webpack_require__) {802803"use strict";804__webpack_require__.r(__webpack_exports__);805/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return CustomShaderStructure; });806/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return ShaderSpecialParts; });807/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return CustomMaterial; });808/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");809/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");810/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__);811812813814815var CustomShaderStructure = /** @class */ (function () {816function CustomShaderStructure() {817}818return CustomShaderStructure;819}());820821var ShaderSpecialParts = /** @class */ (function () {822function ShaderSpecialParts() {823}824return ShaderSpecialParts;825}());826827var CustomMaterial = /** @class */ (function (_super) {828Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CustomMaterial, _super);829function CustomMaterial(name, scene) {830var _this = _super.call(this, name, scene) || this;831_this.CustomParts = new ShaderSpecialParts();832_this.customShaderNameResolve = _this.Builder;833_this.FragmentShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["defaultPixelShader"];834_this.VertexShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["defaultVertexShader"];835return _this;836}837CustomMaterial.prototype.AttachAfterBind = function (mesh, effect) {838if (this._newUniformInstances) {839for (var el in this._newUniformInstances) {840var ea = el.toString().split('-');841if (ea[0] == 'vec2') {842effect.setVector2(ea[1], this._newUniformInstances[el]);843}844else if (ea[0] == 'vec3') {845effect.setVector3(ea[1], this._newUniformInstances[el]);846}847else if (ea[0] == 'vec4') {848effect.setVector4(ea[1], this._newUniformInstances[el]);849}850else if (ea[0] == 'mat4') {851effect.setMatrix(ea[1], this._newUniformInstances[el]);852}853else if (ea[0] == 'float') {854effect.setFloat(ea[1], this._newUniformInstances[el]);855}856}857}858if (this._newSamplerInstances) {859for (var el in this._newSamplerInstances) {860var ea = el.toString().split('-');861if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {862effect.setTexture(ea[1], this._newSamplerInstances[el]);863}864}865}866};867CustomMaterial.prototype.ReviewUniform = function (name, arr) {868if (name == "uniform" && this._newUniforms) {869for (var ind = 0; ind < this._newUniforms.length; ind++) {870if (this._customUniform[ind].indexOf('sampler') == -1) {871arr.push(this._newUniforms[ind]);872}873}874}875if (name == "sampler" && this._newUniforms) {876for (var ind = 0; ind < this._newUniforms.length; ind++) {877if (this._customUniform[ind].indexOf('sampler') != -1) {878arr.push(this._newUniforms[ind]);879}880}881}882return arr;883};884CustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines, attributes) {885var _this = this;886if (attributes && this._customAttributes && this._customAttributes.length > 0) {887attributes.push.apply(attributes, this._customAttributes);888}889this.ReviewUniform("uniform", uniforms);890this.ReviewUniform("sampler", samplers);891if (this._isCreatedShader) {892return this._createdShaderName;893}894this._isCreatedShader = false;895CustomMaterial.ShaderIndexer++;896var name = "custom_" + CustomMaterial.ShaderIndexer;897var fn_afterBind = this._afterBind.bind(this);898this._afterBind = function (m, e) {899if (!e) {900return;901}902_this.AttachAfterBind(m, e);903try {904fn_afterBind(m, e);905}906catch (e) { }907};908babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = this.VertexShader909.replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : ""))910.replace('#define CUSTOM_VERTEX_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : ""))911.replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : ""))912.replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : ""))913.replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : ""))914.replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""));915if (this.CustomParts.Vertex_After_WorldPosComputed) {916babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"].replace('#define CUSTOM_VERTEX_UPDATE_WORLDPOS', this.CustomParts.Vertex_After_WorldPosComputed);917}918babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = this.FragmentShader919.replace('#define CUSTOM_FRAGMENT_BEGIN', (this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : ""))920.replace('#define CUSTOM_FRAGMENT_MAIN_BEGIN', (this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : ""))921.replace('#define CUSTOM_FRAGMENT_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : ""))922.replace('#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE', (this.CustomParts.Fragment_Custom_Diffuse ? this.CustomParts.Fragment_Custom_Diffuse : ""))923.replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : ""))924.replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : ""))925.replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : ""));926if (this.CustomParts.Fragment_Before_Fog) {927babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"].replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', this.CustomParts.Fragment_Before_Fog);928}929this._isCreatedShader = true;930this._createdShaderName = name;931return name;932};933CustomMaterial.prototype.AddUniform = function (name, kind, param) {934if (!this._customUniform) {935this._customUniform = new Array();936this._newUniforms = new Array();937this._newSamplerInstances = {};938this._newUniformInstances = {};939}940if (param) {941if (kind.indexOf("sampler") != -1) {942this._newSamplerInstances[kind + "-" + name] = param;943}944else {945this._newUniformInstances[kind + "-" + name] = param;946}947}948this._customUniform.push("uniform " + kind + " " + name + ";");949this._newUniforms.push(name);950return this;951};952CustomMaterial.prototype.AddAttribute = function (name) {953if (!this._customAttributes) {954this._customAttributes = [];955}956this._customAttributes.push(name);957return this;958};959CustomMaterial.prototype.Fragment_Begin = function (shaderPart) {960this.CustomParts.Fragment_Begin = shaderPart;961return this;962};963CustomMaterial.prototype.Fragment_Definitions = function (shaderPart) {964this.CustomParts.Fragment_Definitions = shaderPart;965return this;966};967CustomMaterial.prototype.Fragment_MainBegin = function (shaderPart) {968this.CustomParts.Fragment_MainBegin = shaderPart;969return this;970};971CustomMaterial.prototype.Fragment_Custom_Diffuse = function (shaderPart) {972this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace("result", "diffuseColor");973return this;974};975CustomMaterial.prototype.Fragment_Custom_Alpha = function (shaderPart) {976this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha");977return this;978};979CustomMaterial.prototype.Fragment_Before_Lights = function (shaderPart) {980this.CustomParts.Fragment_Before_Lights = shaderPart;981return this;982};983CustomMaterial.prototype.Fragment_Before_Fog = function (shaderPart) {984this.CustomParts.Fragment_Before_Fog = shaderPart;985return this;986};987CustomMaterial.prototype.Fragment_Before_FragColor = function (shaderPart) {988this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color");989return this;990};991CustomMaterial.prototype.Vertex_Begin = function (shaderPart) {992this.CustomParts.Vertex_Begin = shaderPart;993return this;994};995CustomMaterial.prototype.Vertex_Definitions = function (shaderPart) {996this.CustomParts.Vertex_Definitions = shaderPart;997return this;998};999CustomMaterial.prototype.Vertex_MainBegin = function (shaderPart) {1000this.CustomParts.Vertex_MainBegin = shaderPart;1001return this;1002};1003CustomMaterial.prototype.Vertex_Before_PositionUpdated = function (shaderPart) {1004this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated");1005return this;1006};1007CustomMaterial.prototype.Vertex_Before_NormalUpdated = function (shaderPart) {1008this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated");1009return this;1010};1011CustomMaterial.prototype.Vertex_After_WorldPosComputed = function (shaderPart) {1012this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;1013return this;1014};1015CustomMaterial.prototype.Vertex_MainEnd = function (shaderPart) {1016this.CustomParts.Vertex_MainEnd = shaderPart;1017return this;1018};1019CustomMaterial.ShaderIndexer = 1;1020return CustomMaterial;1021}(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]));10221023babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.CustomMaterial"] = CustomMaterial;102410251026/***/ }),10271028/***/ "./custom/index.ts":1029/*!*************************!*\1030!*** ./custom/index.ts ***!1031\*************************/1032/*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial */1033/***/ (function(module, __webpack_exports__, __webpack_require__) {10341035"use strict";1036__webpack_require__.r(__webpack_exports__);1037/* harmony import */ var _customMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./customMaterial */ "./custom/customMaterial.ts");1038/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["CustomShaderStructure"]; });10391040/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["ShaderSpecialParts"]; });10411042/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["CustomMaterial"]; });10431044/* harmony import */ var _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pbrCustomMaterial */ "./custom/pbrCustomMaterial.ts");1045/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__["ShaderAlebdoParts"]; });10461047/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__["PBRCustomMaterial"]; });104810491050105110521053/***/ }),10541055/***/ "./custom/pbrCustomMaterial.ts":1056/*!*************************************!*\1057!*** ./custom/pbrCustomMaterial.ts ***!1058\*************************************/1059/*! exports provided: ShaderAlebdoParts, PBRCustomMaterial */1060/***/ (function(module, __webpack_exports__, __webpack_require__) {10611062"use strict";1063__webpack_require__.r(__webpack_exports__);1064/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return ShaderAlebdoParts; });1065/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return PBRCustomMaterial; });1066/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");1067/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");1068/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__);106910701071107210731074var ShaderAlebdoParts = /** @class */ (function () {1075function ShaderAlebdoParts() {1076}1077return ShaderAlebdoParts;1078}());10791080var PBRCustomMaterial = /** @class */ (function (_super) {1081Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PBRCustomMaterial, _super);1082function PBRCustomMaterial(name, scene) {1083var _this = _super.call(this, name, scene) || this;1084_this.CustomParts = new ShaderAlebdoParts();1085_this.customShaderNameResolve = _this.Builder;1086_this.FragmentShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["pbrPixelShader"];1087_this.VertexShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["pbrVertexShader"];1088_this.FragmentShader = _this.FragmentShader.replace(/#include<pbrBlockAlbedoOpacity>/g, babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].IncludesShadersStore["pbrBlockAlbedoOpacity"]);1089_this.FragmentShader = _this.FragmentShader.replace(/#include<pbrBlockReflectivity>/g, babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].IncludesShadersStore["pbrBlockReflectivity"]);1090_this.FragmentShader = _this.FragmentShader.replace(/#include<pbrBlockFinalColorComposition>/g, babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].IncludesShadersStore["pbrBlockFinalColorComposition"]);1091return _this;1092}1093PBRCustomMaterial.prototype.AttachAfterBind = function (mesh, effect) {1094if (this._newUniformInstances) {1095for (var el in this._newUniformInstances) {1096var ea = el.toString().split('-');1097if (ea[0] == 'vec2') {1098effect.setVector2(ea[1], this._newUniformInstances[el]);1099}1100else if (ea[0] == 'vec3') {1101effect.setVector3(ea[1], this._newUniformInstances[el]);1102}1103else if (ea[0] == 'vec4') {1104effect.setVector4(ea[1], this._newUniformInstances[el]);1105}1106else if (ea[0] == 'mat4') {1107effect.setMatrix(ea[1], this._newUniformInstances[el]);1108}1109else if (ea[0] == 'float') {1110effect.setFloat(ea[1], this._newUniformInstances[el]);1111}1112}1113}1114if (this._newSamplerInstances) {1115for (var el in this._newSamplerInstances) {1116var ea = el.toString().split('-');1117if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {1118effect.setTexture(ea[1], this._newSamplerInstances[el]);1119}1120}1121}1122};1123PBRCustomMaterial.prototype.ReviewUniform = function (name, arr) {1124if (name == "uniform" && this._newUniforms) {1125for (var ind = 0; ind < this._newUniforms.length; ind++) {1126if (this._customUniform[ind].indexOf('sampler') == -1) {1127arr.push(this._newUniforms[ind]);1128}1129}1130}1131if (name == "sampler" && this._newUniforms) {1132for (var ind = 0; ind < this._newUniforms.length; ind++) {1133if (this._customUniform[ind].indexOf('sampler') != -1) {1134arr.push(this._newUniforms[ind]);1135}1136}1137}1138return arr;1139};1140PBRCustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines, attributes, options) {1141var _this = this;1142if (options) {1143var currentProcessing_1 = options.processFinalCode;1144options.processFinalCode = function (type, code) {1145if (type === "vertex") {1146return currentProcessing_1 ? currentProcessing_1(type, code) : code;1147}1148var sci = new babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["ShaderCodeInliner"](code);1149sci.inlineToken = "#define pbr_inline";1150sci.processCode();1151return currentProcessing_1 ? currentProcessing_1(type, sci.code) : sci.code;1152};1153}1154if (attributes && this._customAttributes && this._customAttributes.length > 0) {1155attributes.push.apply(attributes, this._customAttributes);1156}1157this.ReviewUniform("uniform", uniforms);1158this.ReviewUniform("sampler", samplers);1159if (this._isCreatedShader) {1160return this._createdShaderName;1161}1162this._isCreatedShader = false;1163PBRCustomMaterial.ShaderIndexer++;1164var name = "custom_" + PBRCustomMaterial.ShaderIndexer;1165var fn_afterBind = this._afterBind.bind(this);1166this._afterBind = function (m, e) {1167if (!e) {1168return;1169}1170_this.AttachAfterBind(m, e);1171try {1172fn_afterBind(m, e);1173}1174catch (e) { }1175};1176babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = this.VertexShader1177.replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : ""))1178.replace('#define CUSTOM_VERTEX_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : ""))1179.replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : ""))1180.replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : ""))1181.replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : ""))1182.replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""));1183if (this.CustomParts.Vertex_After_WorldPosComputed) {1184babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"].replace('#define CUSTOM_VERTEX_UPDATE_WORLDPOS', this.CustomParts.Vertex_After_WorldPosComputed);1185}1186babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = this.FragmentShader1187.replace('#define CUSTOM_FRAGMENT_BEGIN', (this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : ""))1188.replace('#define CUSTOM_FRAGMENT_MAIN_BEGIN', (this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : ""))1189.replace('#define CUSTOM_FRAGMENT_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : ""))1190.replace('#define CUSTOM_FRAGMENT_UPDATE_ALBEDO', (this.CustomParts.Fragment_Custom_Albedo ? this.CustomParts.Fragment_Custom_Albedo : ""))1191.replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : ""))1192.replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : ""))1193.replace('#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS', (this.CustomParts.Fragment_Custom_MetallicRoughness ? this.CustomParts.Fragment_Custom_MetallicRoughness : ""))1194.replace('#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE', (this.CustomParts.Fragment_Custom_MicroSurface ? this.CustomParts.Fragment_Custom_MicroSurface : ""))1195.replace('#define CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION', (this.CustomParts.Fragment_Before_FinalColorComposition ? this.CustomParts.Fragment_Before_FinalColorComposition : ""))1196.replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : ""));1197if (this.CustomParts.Fragment_Before_Fog) {1198babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"].replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', this.CustomParts.Fragment_Before_Fog);1199}1200this._isCreatedShader = true;1201this._createdShaderName = name;1202return name;1203};1204PBRCustomMaterial.prototype.AddUniform = function (name, kind, param) {1205if (!this._customUniform) {1206this._customUniform = new Array();1207this._newUniforms = new Array();1208this._newSamplerInstances = {};1209this._newUniformInstances = {};1210}1211if (param) {1212if (kind.indexOf("sampler") != -1) {1213this._newSamplerInstances[kind + "-" + name] = param;1214}1215else {1216this._newUniformInstances[kind + "-" + name] = param;1217}1218}1219this._customUniform.push("uniform " + kind + " " + name + ";");1220this._newUniforms.push(name);1221return this;1222};1223PBRCustomMaterial.prototype.AddAttribute = function (name) {1224if (!this._customAttributes) {1225this._customAttributes = [];1226}1227this._customAttributes.push(name);1228return this;1229};1230PBRCustomMaterial.prototype.Fragment_Begin = function (shaderPart) {1231this.CustomParts.Fragment_Begin = shaderPart;1232return this;1233};1234PBRCustomMaterial.prototype.Fragment_Definitions = function (shaderPart) {1235this.CustomParts.Fragment_Definitions = shaderPart;1236return this;1237};1238PBRCustomMaterial.prototype.Fragment_MainBegin = function (shaderPart) {1239this.CustomParts.Fragment_MainBegin = shaderPart;1240return this;1241};1242PBRCustomMaterial.prototype.Fragment_Custom_Albedo = function (shaderPart) {1243this.CustomParts.Fragment_Custom_Albedo = shaderPart.replace("result", "surfaceAlbedo");1244return this;1245};1246PBRCustomMaterial.prototype.Fragment_Custom_Alpha = function (shaderPart) {1247this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha");1248return this;1249};1250PBRCustomMaterial.prototype.Fragment_Before_Lights = function (shaderPart) {1251this.CustomParts.Fragment_Before_Lights = shaderPart;1252return this;1253};1254PBRCustomMaterial.prototype.Fragment_Custom_MetallicRoughness = function (shaderPart) {1255this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart;1256return this;1257};1258PBRCustomMaterial.prototype.Fragment_Custom_MicroSurface = function (shaderPart) {1259this.CustomParts.Fragment_Custom_MicroSurface = shaderPart;1260return this;1261};1262PBRCustomMaterial.prototype.Fragment_Before_Fog = function (shaderPart) {1263this.CustomParts.Fragment_Before_Fog = shaderPart;1264return this;1265};1266PBRCustomMaterial.prototype.Fragment_Before_FinalColorComposition = function (shaderPart) {1267this.CustomParts.Fragment_Before_FinalColorComposition = shaderPart;1268return this;1269};1270PBRCustomMaterial.prototype.Fragment_Before_FragColor = function (shaderPart) {1271this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color");1272return this;1273};1274PBRCustomMaterial.prototype.Vertex_Begin = function (shaderPart) {1275this.CustomParts.Vertex_Begin = shaderPart;1276return this;1277};1278PBRCustomMaterial.prototype.Vertex_Definitions = function (shaderPart) {1279this.CustomParts.Vertex_Definitions = shaderPart;1280return this;1281};1282PBRCustomMaterial.prototype.Vertex_MainBegin = function (shaderPart) {1283this.CustomParts.Vertex_MainBegin = shaderPart;1284return this;1285};1286PBRCustomMaterial.prototype.Vertex_Before_PositionUpdated = function (shaderPart) {1287this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated");1288return this;1289};1290PBRCustomMaterial.prototype.Vertex_Before_NormalUpdated = function (shaderPart) {1291this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated");1292return this;1293};1294PBRCustomMaterial.prototype.Vertex_After_WorldPosComputed = function (shaderPart) {1295this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;1296return this;1297};1298PBRCustomMaterial.prototype.Vertex_MainEnd = function (shaderPart) {1299this.CustomParts.Vertex_MainEnd = shaderPart;1300return this;1301};1302PBRCustomMaterial.ShaderIndexer = 1;1303return PBRCustomMaterial;1304}(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["PBRMaterial"]));13051306babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.PBRCustomMaterial"] = PBRCustomMaterial;130713081309/***/ }),13101311/***/ "./fire/fire.fragment.ts":1312/*!*******************************!*\1313!*** ./fire/fire.fragment.ts ***!1314\*******************************/1315/*! exports provided: firePixelShader */1316/***/ (function(module, __webpack_exports__, __webpack_require__) {13171318"use strict";1319__webpack_require__.r(__webpack_exports__);1320/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firePixelShader", function() { return firePixelShader; });1321/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");1322/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);13231324132513261327132813291330var name = 'firePixelShader';1331var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n\nuniform sampler2D distortionSampler;\nuniform sampler2D opacitySampler;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;\nvarying vec2 vDistortionCoords2;\nvarying vec2 vDistortionCoords3;\n#endif\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvec4 bx2(vec4 x)\n{\nreturn vec4(2.0)*x-vec4(1.0);\n}\nvoid main(void) {\n\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\n\nfloat alpha=1.0;\n#ifdef DIFFUSE\n\nconst float distortionAmount0=0.092;\nconst float distortionAmount1=0.092;\nconst float distortionAmount2=0.092;\nvec2 heightAttenuation=vec2(0.3,0.39);\nvec4 noise0=texture2D(distortionSampler,vDistortionCoords1);\nvec4 noise1=texture2D(distortionSampler,vDistortionCoords2);\nvec4 noise2=texture2D(distortionSampler,vDistortionCoords3);\nvec4 noiseSum=bx2(noise0)*distortionAmount0+bx2(noise1)*distortionAmount1+bx2(noise2)*distortionAmount2;\nvec4 perturbedBaseCoords=vec4(vDiffuseUV,0.0,1.0)+noiseSum*(vDiffuseUV.y*heightAttenuation.x+heightAttenuation.y);\nvec4 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;\nbaseColor*=opacityColor;\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(1.0,1.0,1.0);\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n\nvec4 color=vec4(baseColor.rgb,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";1332babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;1333/** @hidden */1334var firePixelShader = { name: name, shader: shader };133513361337/***/ }),13381339/***/ "./fire/fire.vertex.ts":1340/*!*****************************!*\1341!*** ./fire/fire.vertex.ts ***!1342\*****************************/1343/*! exports provided: fireVertexShader */1344/***/ (function(module, __webpack_exports__, __webpack_require__) {13451346"use strict";1347__webpack_require__.r(__webpack_exports__);1348/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fireVertexShader", function() { return fireVertexShader; });1349/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");1350/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);1351135213531354135513561357135813591360var name = 'fireVertexShader';1361var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n\nuniform float time;\nuniform float speed;\n#ifdef DIFFUSE\nvarying vec2 vDistortionCoords1;\nvarying vec2 vDistortionCoords2;\nvarying vec2 vDistortionCoords3;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n\n#ifdef DIFFUSE\nvDiffuseUV=uv;\nvDiffuseUV.y-=0.2;\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n#ifdef DIFFUSE\n\nvec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;\nvDistortionCoords1.x=uv.x;\nvDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;\nvDistortionCoords2.x=uv.x;\nvDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;\nvDistortionCoords3.x=uv.x;\nvDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;\n#endif\n}\n";1362babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;1363/** @hidden */1364var fireVertexShader = { name: name, shader: shader };136513661367/***/ }),13681369/***/ "./fire/fireMaterial.ts":1370/*!******************************!*\1371!*** ./fire/fireMaterial.ts ***!1372\******************************/1373/*! exports provided: FireMaterial */1374/***/ (function(module, __webpack_exports__, __webpack_require__) {13751376"use strict";1377__webpack_require__.r(__webpack_exports__);1378/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return FireMaterial; });1379/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");1380/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");1381/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);1382/* harmony import */ var _fire_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire.fragment */ "./fire/fire.fragment.ts");1383/* harmony import */ var _fire_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fire.vertex */ "./fire/fire.vertex.ts");1384138513861387138813891390139113921393139413951396139713981399var FireMaterialDefines = /** @class */ (function (_super) {1400Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FireMaterialDefines, _super);1401function FireMaterialDefines() {1402var _this = _super.call(this) || this;1403_this.DIFFUSE = false;1404_this.CLIPPLANE = false;1405_this.CLIPPLANE2 = false;1406_this.CLIPPLANE3 = false;1407_this.CLIPPLANE4 = false;1408_this.CLIPPLANE5 = false;1409_this.CLIPPLANE6 = false;1410_this.ALPHATEST = false;1411_this.DEPTHPREPASS = false;1412_this.POINTSIZE = false;1413_this.FOG = false;1414_this.UV1 = false;1415_this.VERTEXCOLOR = false;1416_this.VERTEXALPHA = false;1417_this.BonesPerMesh = 0;1418_this.NUM_BONE_INFLUENCERS = 0;1419_this.INSTANCES = false;1420_this.IMAGEPROCESSINGPOSTPROCESS = false;1421_this.rebuild();1422return _this;1423}1424return FireMaterialDefines;1425}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));1426var FireMaterial = /** @class */ (function (_super) {1427Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FireMaterial, _super);1428function FireMaterial(name, scene) {1429var _this = _super.call(this, name, scene) || this;1430_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);1431_this.speed = 1.0;1432_this._scaledDiffuse = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"]();1433_this._lastTime = 0;1434return _this;1435}1436FireMaterial.prototype.needAlphaBlending = function () {1437return false;1438};1439FireMaterial.prototype.needAlphaTesting = function () {1440return true;1441};1442FireMaterial.prototype.getAlphaTestTexture = function () {1443return null;1444};1445// Methods1446FireMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {1447if (this.isFrozen) {1448if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {1449return true;1450}1451}1452if (!subMesh._materialDefines) {1453subMesh.materialDefines = new FireMaterialDefines();1454}1455var defines = subMesh._materialDefines;1456var scene = this.getScene();1457if (this._isReadyForSubMesh(subMesh)) {1458return true;1459}1460var engine = scene.getEngine();1461// Textures1462if (defines._areTexturesDirty) {1463defines._needUVs = false;1464if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {1465if (!this._diffuseTexture.isReady()) {1466return false;1467}1468else {1469defines._needUVs = true;1470defines.DIFFUSE = true;1471}1472}1473}1474defines.ALPHATEST = this._opacityTexture ? true : false;1475// Misc.1476if (defines._areMiscDirty) {1477defines.POINTSIZE = (this.pointsCloud || scene.forcePointsCloud);1478defines.FOG = (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE && this.fogEnabled);1479}1480// Values that need to be evaluated on every frame1481babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);1482// Attribs1483babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true);1484// Get correct effect1485if (defines.isDirty) {1486defines.markAsProcessed();1487scene.resetCachedMaterial();1488// Fallbacks1489var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();1490if (defines.FOG) {1491fallbacks.addFallback(1, "FOG");1492}1493if (defines.NUM_BONE_INFLUENCERS > 0) {1494fallbacks.addCPUSkinningFallback(0, mesh);1495}1496defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;1497//Attributes1498var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];1499if (defines.UV1) {1500attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);1501}1502if (defines.VERTEXCOLOR) {1503attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);1504}1505babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);1506babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);1507// Legacy browser patch1508var shaderName = "fire";1509var join = defines.toString();1510subMesh.setEffect(scene.getEngine().createEffect(shaderName, {1511attributes: attribs,1512uniformsNames: ["world", "view", "viewProjection", "vEyePosition",1513"vFogInfos", "vFogColor", "pointSize",1514"vDiffuseInfos",1515"mBones",1516"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix",1517// Fire1518"time", "speed"1519],1520uniformBuffersNames: [],1521samplers: ["diffuseSampler",1522// Fire1523"distortionSampler", "opacitySampler"1524],1525defines: join,1526fallbacks: fallbacks,1527onCompiled: this.onCompiled,1528onError: this.onError,1529indexParameters: null,1530maxSimultaneousLights: 4,1531transformFeedbackVaryings: null1532}, engine), defines, this._materialContext);1533}1534if (!subMesh.effect || !subMesh.effect.isReady()) {1535return false;1536}1537defines._renderId = scene.getRenderId();1538subMesh.effect._wasPreviouslyReady = true;1539return true;1540};1541FireMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {1542var scene = this.getScene();1543var defines = subMesh._materialDefines;1544if (!defines) {1545return;1546}1547var effect = subMesh.effect;1548if (!effect) {1549return;1550}1551this._activeEffect = effect;1552// Matrices1553this.bindOnlyWorldMatrix(world);1554this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());1555// Bones1556babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);1557if (this._mustRebind(scene, effect)) {1558// Textures1559if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {1560this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);1561this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);1562this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix());1563this._activeEffect.setTexture("distortionSampler", this._distortionTexture);1564this._activeEffect.setTexture("opacitySampler", this._opacityTexture);1565}1566// Clip plane1567babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);1568// Point size1569if (this.pointsCloud) {1570this._activeEffect.setFloat("pointSize", this.pointSize);1571}1572scene.bindEyePosition(effect);1573}1574this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * mesh.visibility);1575// View1576if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {1577this._activeEffect.setMatrix("view", scene.getViewMatrix());1578}1579// Fog1580babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);1581// Time1582this._lastTime += scene.getEngine().getDeltaTime();1583this._activeEffect.setFloat("time", this._lastTime);1584// Speed1585this._activeEffect.setFloat("speed", this.speed);1586this._afterBind(mesh, this._activeEffect);1587};1588FireMaterial.prototype.getAnimatables = function () {1589var results = [];1590if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) {1591results.push(this._diffuseTexture);1592}1593if (this._distortionTexture && this._distortionTexture.animations && this._distortionTexture.animations.length > 0) {1594results.push(this._distortionTexture);1595}1596if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) {1597results.push(this._opacityTexture);1598}1599return results;1600};1601FireMaterial.prototype.getActiveTextures = function () {1602var activeTextures = _super.prototype.getActiveTextures.call(this);1603if (this._diffuseTexture) {1604activeTextures.push(this._diffuseTexture);1605}1606if (this._distortionTexture) {1607activeTextures.push(this._distortionTexture);1608}1609if (this._opacityTexture) {1610activeTextures.push(this._opacityTexture);1611}1612return activeTextures;1613};1614FireMaterial.prototype.hasTexture = function (texture) {1615if (_super.prototype.hasTexture.call(this, texture)) {1616return true;1617}1618if (this._diffuseTexture === texture) {1619return true;1620}1621if (this._distortionTexture === texture) {1622return true;1623}1624if (this._opacityTexture === texture) {1625return true;1626}1627return false;1628};1629FireMaterial.prototype.getClassName = function () {1630return "FireMaterial";1631};1632FireMaterial.prototype.dispose = function (forceDisposeEffect) {1633if (this._diffuseTexture) {1634this._diffuseTexture.dispose();1635}1636if (this._distortionTexture) {1637this._distortionTexture.dispose();1638}1639_super.prototype.dispose.call(this, forceDisposeEffect);1640};1641FireMaterial.prototype.clone = function (name) {1642var _this = this;1643return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FireMaterial(name, _this.getScene()); }, this);1644};1645FireMaterial.prototype.serialize = function () {1646var serializationObject = _super.prototype.serialize.call(this);1647serializationObject.customType = "BABYLON.FireMaterial";1648serializationObject.diffuseColor = this.diffuseColor.asArray();1649serializationObject.speed = this.speed;1650if (this._diffuseTexture) {1651serializationObject._diffuseTexture = this._diffuseTexture.serialize();1652}1653if (this._distortionTexture) {1654serializationObject._distortionTexture = this._distortionTexture.serialize();1655}1656if (this._opacityTexture) {1657serializationObject._opacityTexture = this._opacityTexture.serialize();1658}1659return serializationObject;1660};1661FireMaterial.Parse = function (source, scene, rootUrl) {1662var material = new FireMaterial(source.name, scene);1663material.diffuseColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(source.diffuseColor);1664material.speed = source.speed;1665material.alpha = source.alpha;1666material.id = source.id;1667babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Tags"].AddTagsTo(material, source.tags);1668material.backFaceCulling = source.backFaceCulling;1669material.wireframe = source.wireframe;1670if (source._diffuseTexture) {1671material._diffuseTexture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].Parse(source._diffuseTexture, scene, rootUrl);1672}1673if (source._distortionTexture) {1674material._distortionTexture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].Parse(source._distortionTexture, scene, rootUrl);1675}1676if (source._opacityTexture) {1677material._opacityTexture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].Parse(source._opacityTexture, scene, rootUrl);1678}1679return material;1680};1681Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1682Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture")1683], FireMaterial.prototype, "_diffuseTexture", void 0);1684Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1685Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")1686], FireMaterial.prototype, "diffuseTexture", void 0);1687Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1688Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("distortionTexture")1689], FireMaterial.prototype, "_distortionTexture", void 0);1690Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1691Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")1692], FireMaterial.prototype, "distortionTexture", void 0);1693Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1694Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("opacityTexture")1695], FireMaterial.prototype, "_opacityTexture", void 0);1696Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1697Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")1698], FireMaterial.prototype, "opacityTexture", void 0);1699Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1700Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])("diffuse")1701], FireMaterial.prototype, "diffuseColor", void 0);1702Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([1703Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()1704], FireMaterial.prototype, "speed", void 0);1705return FireMaterial;1706}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));17071708babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.FireMaterial"] = FireMaterial;170917101711/***/ }),17121713/***/ "./fire/index.ts":1714/*!***********************!*\1715!*** ./fire/index.ts ***!1716\***********************/1717/*! exports provided: FireMaterial */1718/***/ (function(module, __webpack_exports__, __webpack_require__) {17191720"use strict";1721__webpack_require__.r(__webpack_exports__);1722/* harmony import */ var _fireMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fireMaterial */ "./fire/fireMaterial.ts");1723/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return _fireMaterial__WEBPACK_IMPORTED_MODULE_0__["FireMaterial"]; });17241725172617271728/***/ }),17291730/***/ "./fur/fur.fragment.ts":1731/*!*****************************!*\1732!*** ./fur/fur.fragment.ts ***!1733\*****************************/1734/*! exports provided: furPixelShader */1735/***/ (function(module, __webpack_exports__, __webpack_require__) {17361737"use strict";1738__webpack_require__.r(__webpack_exports__);1739/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furPixelShader", function() { return furPixelShader; });1740/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");1741/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);17421743174417451746174717481749175017511752175317541755var name = 'furPixelShader';1756var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nuniform vec4 furColor;\nuniform float furLength;\nvarying vec3 vPositionW;\nvarying float vfur_length;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n\n#ifdef HIGHLEVEL\nuniform float furOffset;\nuniform float furOcclusion;\nuniform sampler2D furTexture;\nvarying vec2 vFurUV;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<fogFragmentDeclaration>\n#include<clipPlaneFragmentDeclaration>\nfloat Rand(vec3 rv) {\nfloat x=dot(rv,vec3(12.9898,78.233,24.65487));\nreturn fract(sin(x)*43758.5453);\n}\nvoid main(void) {\n\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=furColor;\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat 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\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef HIGHLEVEL\n\nvec4 furTextureColor=texture2D(furTexture,vec2(vFurUV.x,vFurUV.y));\nif (furTextureColor.a<=0.0 || furTextureColor.g<furOffset) {\ndiscard;\n}\nfloat occlusion=mix(0.0,furTextureColor.b*1.2,furOffset);\nbaseColor=vec4(baseColor.xyz*max(occlusion,furOcclusion),1.1-furOffset);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase.rgb*baseColor.rgb,0.0,1.0);\n\n#ifdef HIGHLEVEL\nvec4 color=vec4(finalDiffuse,alpha);\n#else\nfloat r=vfur_length/furLength*0.5;\nvec4 color=vec4(finalDiffuse*(0.5+r),alpha);\n#endif\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";1757babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;1758/** @hidden */1759var furPixelShader = { name: name, shader: shader };176017611762/***/ }),17631764/***/ "./fur/fur.vertex.ts":1765/*!***************************!*\1766!*** ./fur/fur.vertex.ts ***!1767\***************************/1768/*! exports provided: furVertexShader */1769/***/ (function(module, __webpack_exports__, __webpack_require__) {17701771"use strict";1772__webpack_require__.r(__webpack_exports__);1773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "furVertexShader", function() { return furVertexShader; });1774/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");1775/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);1776177717781779178017811782178317841785178617871788var name = 'furVertexShader';1789var shader = "precision highp float;\n\nattribute vec3 position;\nattribute 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\nuniform float furLength;\nuniform float furAngle;\n#ifdef HIGHLEVEL\nuniform float furOffset;\nuniform vec3 furGravity;\nuniform float furTime;\nuniform float furSpacing;\nuniform 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;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\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<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nfloat Rand(vec3 rv) {\nfloat x=dot(rv,vec3(12.9898,78.233,24.65487));\nreturn fract(sin(x)*43758.5453);\n}\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\n\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);\nvec3 tangent2=vec3(-normal.z,0,normal.x);\nr=Rand(tangent1*r);\nfloat J=(2.0+4.0*r);\nr=Rand(tangent2*r);\nfloat K=(2.0+2.0*r);\ntangent1=tangent1*J+tangent2*K;\ntangent1=normalize(tangent1);\nvec3 newPosition=position+normal*vfur_length*cos(furAngle)+tangent1*vfur_length*sin(furAngle);\n#ifdef HIGHLEVEL\n\nvec3 forceDirection=vec3(0.0,0.0,0.0);\nforceDirection.x=sin(furTime+position.x*0.05)*0.2;\nforceDirection.y=cos(furTime*0.7+position.y*0.04)*0.2;\nforceDirection.z=sin(furTime*0.7+position.z*0.04)*0.2;\nvec3 displacement=vec3(0.0,0.0,0.0);\ndisplacement=furGravity+forceDirection;\nfloat displacementFactor=pow(furOffset,3.0);\nvec3 aNormal=normal;\naNormal.xyz+=displacement*displacementFactor;\nnewPosition=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\n\ngl_Position=viewProjection*finalWorld*vec4(newPosition,1.0);\nvec4 worldPos=finalWorld*vec4(newPosition,1.0);\nvPositionW=vec3(worldPos);\n\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{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#ifdef HIGHLEVEL\nvFurUV=vDiffuseUV*furDensity;\n#endif\n#else\n#ifdef HIGHLEVEL\nvFurUV=uv*furDensity;\n#endif\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";1790babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;1791/** @hidden */1792var furVertexShader = { name: name, shader: shader };179317941795/***/ }),17961797/***/ "./fur/furMaterial.ts":1798/*!****************************!*\1799!*** ./fur/furMaterial.ts ***!1800\****************************/1801/*! exports provided: FurMaterial */1802/***/ (function(module, __webpack_exports__, __webpack_require__) {18031804"use strict";1805__webpack_require__.r(__webpack_exports__);1806/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return FurMaterial; });1807/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");1808/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");1809/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);1810/* harmony import */ var _fur_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fur.fragment */ "./fur/fur.fragment.ts");1811/* harmony import */ var _fur_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fur.vertex */ "./fur/fur.vertex.ts");181218131814181518161817181818191820182118221823182418251826182718281829var FurMaterialDefines = /** @class */ (function (_super) {1830Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FurMaterialDefines, _super);1831function FurMaterialDefines() {1832var _this = _super.call(this) || this;1833_this.DIFFUSE = false;1834_this.HEIGHTMAP = false;1835_this.CLIPPLANE = false;1836_this.CLIPPLANE2 = false;1837_this.CLIPPLANE3 = false;1838_this.CLIPPLANE4 = false;1839_this.CLIPPLANE5 = false;1840_this.CLIPPLANE6 = false;1841_this.ALPHATEST = false;1842_this.DEPTHPREPASS = false;1843_this.POINTSIZE = false;1844_this.FOG = false;1845_this.NORMAL = false;1846_this.UV1 = false;1847_this.UV2 = false;1848_this.VERTEXCOLOR = false;1849_this.VERTEXALPHA = false;1850_this.NUM_BONE_INFLUENCERS = 0;1851_this.BonesPerMesh = 0;1852_this.INSTANCES = false;1853_this.HIGHLEVEL = false;1854_this.IMAGEPROCESSINGPOSTPROCESS = false;1855_this.rebuild();1856return _this;1857}1858return FurMaterialDefines;1859}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));1860var FurMaterial = /** @class */ (function (_super) {1861Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(FurMaterial, _super);1862function FurMaterial(name, scene) {1863var _this = _super.call(this, name, scene) || this;1864_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);1865_this.furLength = 1;1866_this.furAngle = 0;1867_this.furColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.44, 0.21, 0.02);1868_this.furOffset = 0.0;1869_this.furSpacing = 12;1870_this.furGravity = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 0, 0);1871_this.furSpeed = 100;1872_this.furDensity = 20;1873_this.furOcclusion = 0.0;1874_this._disableLighting = false;1875_this._maxSimultaneousLights = 4;1876_this.highLevelFur = true;1877_this._furTime = 0;1878return _this;1879}1880Object.defineProperty(FurMaterial.prototype, "furTime", {1881get: function () {1882return this._furTime;1883},1884set: function (furTime) {1885this._furTime = furTime;1886},1887enumerable: false,1888configurable: true1889});1890FurMaterial.prototype.needAlphaBlending = function () {1891return (this.alpha < 1.0);1892};1893FurMaterial.prototype.needAlphaTesting = function () {1894return false;1895};1896FurMaterial.prototype.getAlphaTestTexture = function () {1897return null;1898};1899FurMaterial.prototype.updateFur = function () {1900for (var i = 1; i < this._meshes.length; i++) {1901var offsetFur = this._meshes[i].material;1902offsetFur.furLength = this.furLength;1903offsetFur.furAngle = this.furAngle;1904offsetFur.furGravity = this.furGravity;1905offsetFur.furSpacing = this.furSpacing;1906offsetFur.furSpeed = this.furSpeed;1907offsetFur.furColor = this.furColor;1908offsetFur.diffuseTexture = this.diffuseTexture;1909offsetFur.furTexture = this.furTexture;1910offsetFur.highLevelFur = this.highLevelFur;1911offsetFur.furTime = this.furTime;1912offsetFur.furDensity = this.furDensity;1913}1914};1915// Methods1916FurMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {1917if (this.isFrozen) {1918if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {1919return true;1920}1921}1922if (!subMesh._materialDefines) {1923subMesh.materialDefines = new FurMaterialDefines();1924}1925var defines = subMesh._materialDefines;1926var scene = this.getScene();1927if (this._isReadyForSubMesh(subMesh)) {1928return true;1929}1930var engine = scene.getEngine();1931// Textures1932if (defines._areTexturesDirty) {1933if (scene.texturesEnabled) {1934if (this.diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {1935if (!this.diffuseTexture.isReady()) {1936return false;1937}1938else {1939defines._needUVs = true;1940defines.DIFFUSE = true;1941}1942}1943if (this.heightTexture && engine.getCaps().maxVertexTextureImageUnits) {1944if (!this.heightTexture.isReady()) {1945return false;1946}1947else {1948defines._needUVs = true;1949defines.HEIGHTMAP = true;1950}1951}1952}1953}1954// High level1955if (this.highLevelFur !== defines.HIGHLEVEL) {1956defines.HIGHLEVEL = true;1957defines.markAsUnprocessed();1958}1959// Misc.1960babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);1961// Lights1962defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);1963// Values that need to be evaluated on every frame1964babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);1965// Attribs1966babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);1967// Get correct effect1968if (defines.isDirty) {1969defines.markAsProcessed();1970scene.resetCachedMaterial();1971// Fallbacks1972var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();1973if (defines.FOG) {1974fallbacks.addFallback(1, "FOG");1975}1976babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);1977if (defines.NUM_BONE_INFLUENCERS > 0) {1978fallbacks.addCPUSkinningFallback(0, mesh);1979}1980defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;1981//Attributes1982var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];1983if (defines.NORMAL) {1984attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);1985}1986if (defines.UV1) {1987attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);1988}1989if (defines.UV2) {1990attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);1991}1992if (defines.VERTEXCOLOR) {1993attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);1994}1995babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);1996babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);1997// Legacy browser patch1998var shaderName = "fur";1999var join = defines.toString();2000var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor",2001"vFogInfos", "vFogColor", "pointSize",2002"vDiffuseInfos",2003"mBones",2004"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix",2005"furLength", "furAngle", "furColor", "furOffset", "furGravity", "furTime", "furSpacing", "furDensity", "furOcclusion"2006];2007var samplers = ["diffuseSampler",2008"heightTexture", "furTexture"2009];2010var uniformBuffers = new Array();2011babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({2012uniformsNames: uniforms,2013uniformBuffersNames: uniformBuffers,2014samplers: samplers,2015defines: defines,2016maxSimultaneousLights: this.maxSimultaneousLights2017});2018subMesh.setEffect(scene.getEngine().createEffect(shaderName, {2019attributes: attribs,2020uniformsNames: uniforms,2021uniformBuffersNames: uniformBuffers,2022samplers: samplers,2023defines: join,2024fallbacks: fallbacks,2025onCompiled: this.onCompiled,2026onError: this.onError,2027indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }2028}, engine), defines, this._materialContext);2029}2030if (!subMesh.effect || !subMesh.effect.isReady()) {2031return false;2032}2033defines._renderId = scene.getRenderId();2034subMesh.effect._wasPreviouslyReady = true;2035return true;2036};2037FurMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {2038var scene = this.getScene();2039var defines = subMesh._materialDefines;2040if (!defines) {2041return;2042}2043var effect = subMesh.effect;2044if (!effect) {2045return;2046}2047this._activeEffect = effect;2048// Matrices2049this.bindOnlyWorldMatrix(world);2050this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());2051// Bones2052babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);2053if (scene.getCachedMaterial() !== this) {2054// Textures2055if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {2056this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);2057this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);2058this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix());2059}2060if (this._heightTexture) {2061this._activeEffect.setTexture("heightTexture", this._heightTexture);2062}2063// Clip plane2064babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);2065// Point size2066if (this.pointsCloud) {2067this._activeEffect.setFloat("pointSize", this.pointSize);2068}2069scene.bindEyePosition(effect);2070}2071this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);2072if (scene.lightsEnabled && !this.disableLighting) {2073babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);2074}2075// View2076if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {2077this._activeEffect.setMatrix("view", scene.getViewMatrix());2078}2079// Fog2080babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);2081this._activeEffect.setFloat("furLength", this.furLength);2082this._activeEffect.setFloat("furAngle", this.furAngle);2083this._activeEffect.setColor4("furColor", this.furColor, 1.0);2084if (this.highLevelFur) {2085this._activeEffect.setVector3("furGravity", this.furGravity);2086this._activeEffect.setFloat("furOffset", this.furOffset);2087this._activeEffect.setFloat("furSpacing", this.furSpacing);2088this._activeEffect.setFloat("furDensity", this.furDensity);2089this._activeEffect.setFloat("furOcclusion", this.furOcclusion);2090this._furTime += this.getScene().getEngine().getDeltaTime() / this.furSpeed;2091this._activeEffect.setFloat("furTime", this._furTime);2092this._activeEffect.setTexture("furTexture", this.furTexture);2093}2094this._afterBind(mesh, this._activeEffect);2095};2096FurMaterial.prototype.getAnimatables = function () {2097var results = [];2098if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) {2099results.push(this.diffuseTexture);2100}2101if (this.heightTexture && this.heightTexture.animations && this.heightTexture.animations.length > 0) {2102results.push(this.heightTexture);2103}2104return results;2105};2106FurMaterial.prototype.getActiveTextures = function () {2107var activeTextures = _super.prototype.getActiveTextures.call(this);2108if (this._diffuseTexture) {2109activeTextures.push(this._diffuseTexture);2110}2111if (this._heightTexture) {2112activeTextures.push(this._heightTexture);2113}2114return activeTextures;2115};2116FurMaterial.prototype.hasTexture = function (texture) {2117if (_super.prototype.hasTexture.call(this, texture)) {2118return true;2119}2120if (this.diffuseTexture === texture) {2121return true;2122}2123if (this._heightTexture === texture) {2124return true;2125}2126return false;2127};2128FurMaterial.prototype.dispose = function (forceDisposeEffect) {2129if (this.diffuseTexture) {2130this.diffuseTexture.dispose();2131}2132if (this._meshes) {2133for (var i = 1; i < this._meshes.length; i++) {2134var mat = this._meshes[i].material;2135if (mat) {2136mat.dispose(forceDisposeEffect);2137}2138this._meshes[i].dispose();2139}2140}2141_super.prototype.dispose.call(this, forceDisposeEffect);2142};2143FurMaterial.prototype.clone = function (name) {2144var _this = this;2145return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FurMaterial(name, _this.getScene()); }, this);2146};2147FurMaterial.prototype.serialize = function () {2148var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);2149serializationObject.customType = "BABYLON.FurMaterial";2150if (this._meshes) {2151serializationObject.sourceMeshName = this._meshes[0].name;2152serializationObject.quality = this._meshes.length;2153}2154return serializationObject;2155};2156FurMaterial.prototype.getClassName = function () {2157return "FurMaterial";2158};2159// Statics2160FurMaterial.Parse = function (source, scene, rootUrl) {2161var material = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new FurMaterial(source.name, scene); }, source, scene, rootUrl);2162if (source.sourceMeshName && material.highLevelFur) {2163scene.executeWhenReady(function () {2164var sourceMesh = scene.getMeshByName(source.sourceMeshName);2165if (sourceMesh) {2166var furTexture = FurMaterial.GenerateTexture("Fur Texture", scene);2167material.furTexture = furTexture;2168FurMaterial.FurifyMesh(sourceMesh, source.quality);2169}2170});2171}2172return material;2173};2174FurMaterial.GenerateTexture = function (name, scene) {2175// Generate fur textures2176var texture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["DynamicTexture"]("FurTexture " + name, 256, scene, true);2177var context = texture.getContext();2178for (var i = 0; i < 20000; ++i) {2179context.fillStyle = "rgba(255, " + Math.floor(Math.random() * 255) + ", " + Math.floor(Math.random() * 255) + ", 1)";2180context.fillRect((Math.random() * texture.getSize().width), (Math.random() * texture.getSize().height), 2, 2);2181}2182texture.update(false);2183texture.wrapU = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE;2184texture.wrapV = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].WRAP_ADDRESSMODE;2185return texture;2186};2187// Creates and returns an array of meshes used as shells for the Fur Material2188// that can be disposed later in your code2189// The quality is in interval [0, 100]2190FurMaterial.FurifyMesh = function (sourceMesh, quality) {2191var meshes = [sourceMesh];2192var mat = sourceMesh.material;2193var i;2194if (!(mat instanceof FurMaterial)) {2195throw "The material of the source mesh must be a Fur Material";2196}2197for (i = 1; i < quality; i++) {2198var offsetFur = new FurMaterial(mat.name + i, sourceMesh.getScene());2199sourceMesh.getScene().materials.pop();2200babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Tags"].EnableFor(offsetFur);2201babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Tags"].AddTagsTo(offsetFur, "furShellMaterial");2202offsetFur.furLength = mat.furLength;2203offsetFur.furAngle = mat.furAngle;2204offsetFur.furGravity = mat.furGravity;2205offsetFur.furSpacing = mat.furSpacing;2206offsetFur.furSpeed = mat.furSpeed;2207offsetFur.furColor = mat.furColor;2208offsetFur.diffuseTexture = mat.diffuseTexture;2209offsetFur.furOffset = i / quality;2210offsetFur.furTexture = mat.furTexture;2211offsetFur.highLevelFur = mat.highLevelFur;2212offsetFur.furTime = mat.furTime;2213offsetFur.furDensity = mat.furDensity;2214var offsetMesh = sourceMesh.clone(sourceMesh.name + i);2215offsetMesh.material = offsetFur;2216offsetMesh.skeleton = sourceMesh.skeleton;2217offsetMesh.position = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();2218meshes.push(offsetMesh);2219}2220for (i = 1; i < meshes.length; i++) {2221meshes[i].parent = sourceMesh;2222}2223sourceMesh.material._meshes = meshes;2224return meshes;2225};2226Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2227Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture")2228], FurMaterial.prototype, "_diffuseTexture", void 0);2229Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2230Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")2231], FurMaterial.prototype, "diffuseTexture", void 0);2232Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2233Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("heightTexture")2234], FurMaterial.prototype, "_heightTexture", void 0);2235Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2236Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")2237], FurMaterial.prototype, "heightTexture", void 0);2238Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2239Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()2240], FurMaterial.prototype, "diffuseColor", void 0);2241Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2242Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2243], FurMaterial.prototype, "furLength", void 0);2244Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2245Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2246], FurMaterial.prototype, "furAngle", void 0);2247Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2248Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()2249], FurMaterial.prototype, "furColor", void 0);2250Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2251Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2252], FurMaterial.prototype, "furOffset", void 0);2253Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2254Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2255], FurMaterial.prototype, "furSpacing", void 0);2256Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2257Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])()2258], FurMaterial.prototype, "furGravity", void 0);2259Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2260Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2261], FurMaterial.prototype, "furSpeed", void 0);2262Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2263Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2264], FurMaterial.prototype, "furDensity", void 0);2265Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2266Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2267], FurMaterial.prototype, "furOcclusion", void 0);2268Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2269Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")2270], FurMaterial.prototype, "_disableLighting", void 0);2271Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2272Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")2273], FurMaterial.prototype, "disableLighting", void 0);2274Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2275Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")2276], FurMaterial.prototype, "_maxSimultaneousLights", void 0);2277Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2278Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")2279], FurMaterial.prototype, "maxSimultaneousLights", void 0);2280Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2281Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2282], FurMaterial.prototype, "highLevelFur", void 0);2283Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2284Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2285], FurMaterial.prototype, "furTime", null);2286return FurMaterial;2287}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));22882289babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.FurMaterial"] = FurMaterial;229022912292/***/ }),22932294/***/ "./fur/index.ts":2295/*!**********************!*\2296!*** ./fur/index.ts ***!2297\**********************/2298/*! exports provided: FurMaterial */2299/***/ (function(module, __webpack_exports__, __webpack_require__) {23002301"use strict";2302__webpack_require__.r(__webpack_exports__);2303/* harmony import */ var _furMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./furMaterial */ "./fur/furMaterial.ts");2304/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return _furMaterial__WEBPACK_IMPORTED_MODULE_0__["FurMaterial"]; });23052306230723082309/***/ }),23102311/***/ "./gradient/gradient.fragment.ts":2312/*!***************************************!*\2313!*** ./gradient/gradient.fragment.ts ***!2314\***************************************/2315/*! exports provided: gradientPixelShader */2316/***/ (function(module, __webpack_exports__, __webpack_require__) {23172318"use strict";2319__webpack_require__.r(__webpack_exports__);2320/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientPixelShader", function() { return gradientPixelShader; });2321/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");2322/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);23232324232523262327232823292330233123322333233423352336var name = 'gradientPixelShader';2337var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\n\nuniform vec4 topColor;\nuniform vec4 bottomColor;\nuniform float offset;\nuniform float scale;\nuniform float smoothness;\n\nvarying vec3 vPositionW;\nvarying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\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\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\nfloat h=vPosition.y*scale+offset;\nfloat mysmoothness=clamp(smoothness,0.01,max(smoothness,10.));\nvec4 baseColor=mix(bottomColor,topColor,max(pow(max(h,0.0),mysmoothness),0.0));\n\nvec3 diffuseColor=baseColor.rgb;\n\nfloat 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\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef EMISSIVE\nvec3 diffuseBase=baseColor.rgb;\n#else\nvec3 diffuseBase=vec3(0.,0.,0.);\n#endif\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}\n";2338babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;2339/** @hidden */2340var gradientPixelShader = { name: name, shader: shader };234123422343/***/ }),23442345/***/ "./gradient/gradient.vertex.ts":2346/*!*************************************!*\2347!*** ./gradient/gradient.vertex.ts ***!2348\*************************************/2349/*! exports provided: gradientVertexShader */2350/***/ (function(module, __webpack_exports__, __webpack_require__) {23512352"use strict";2353__webpack_require__.r(__webpack_exports__);2354/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gradientVertexShader", function() { return gradientVertexShader; });2355/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");2356/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);2357235823592360236123622363236423652366236723682369var name = 'gradientVertexShader';2370var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\nvarying vec3 vPosition;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\nvPosition=position;\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";2371babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;2372/** @hidden */2373var gradientVertexShader = { name: name, shader: shader };237423752376/***/ }),23772378/***/ "./gradient/gradientMaterial.ts":2379/*!**************************************!*\2380!*** ./gradient/gradientMaterial.ts ***!2381\**************************************/2382/*! exports provided: GradientMaterial */2383/***/ (function(module, __webpack_exports__, __webpack_require__) {23842385"use strict";2386__webpack_require__.r(__webpack_exports__);2387/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return GradientMaterial; });2388/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");2389/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");2390/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);2391/* harmony import */ var _gradient_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gradient.fragment */ "./gradient/gradient.fragment.ts");2392/* harmony import */ var _gradient_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gradient.vertex */ "./gradient/gradient.vertex.ts");2393239423952396239723982399240024012402240324042405var GradientMaterialDefines = /** @class */ (function (_super) {2406Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GradientMaterialDefines, _super);2407function GradientMaterialDefines() {2408var _this = _super.call(this) || this;2409_this.EMISSIVE = false;2410_this.CLIPPLANE = false;2411_this.CLIPPLANE2 = false;2412_this.CLIPPLANE3 = false;2413_this.CLIPPLANE4 = false;2414_this.CLIPPLANE5 = false;2415_this.CLIPPLANE6 = false;2416_this.ALPHATEST = false;2417_this.DEPTHPREPASS = false;2418_this.POINTSIZE = false;2419_this.FOG = false;2420_this.NORMAL = false;2421_this.UV1 = false;2422_this.UV2 = false;2423_this.VERTEXCOLOR = false;2424_this.VERTEXALPHA = false;2425_this.NUM_BONE_INFLUENCERS = 0;2426_this.BonesPerMesh = 0;2427_this.INSTANCES = false;2428_this.IMAGEPROCESSINGPOSTPROCESS = false;2429_this.rebuild();2430return _this;2431}2432return GradientMaterialDefines;2433}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));2434var GradientMaterial = /** @class */ (function (_super) {2435Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GradientMaterial, _super);2436function GradientMaterial(name, scene) {2437var _this = _super.call(this, name, scene) || this;2438_this._maxSimultaneousLights = 4;2439// The gradient top color, red by default2440_this.topColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 0, 0);2441_this.topColorAlpha = 1.0;2442// The gradient top color, blue by default2443_this.bottomColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 1);2444_this.bottomColorAlpha = 1.0;2445// Gradient offset2446_this.offset = 0;2447_this.scale = 1.0;2448_this.smoothness = 1.0;2449_this._disableLighting = false;2450return _this;2451}2452GradientMaterial.prototype.needAlphaBlending = function () {2453return (this.alpha < 1.0 || this.topColorAlpha < 1.0 || this.bottomColorAlpha < 1.0);2454};2455GradientMaterial.prototype.needAlphaTesting = function () {2456return true;2457};2458GradientMaterial.prototype.getAlphaTestTexture = function () {2459return null;2460};2461// Methods2462GradientMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {2463if (this.isFrozen) {2464if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {2465return true;2466}2467}2468if (!subMesh._materialDefines) {2469subMesh.materialDefines = new GradientMaterialDefines();2470}2471var defines = subMesh._materialDefines;2472var scene = this.getScene();2473if (this._isReadyForSubMesh(subMesh)) {2474return true;2475}2476var engine = scene.getEngine();2477babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);2478babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);2479defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);2480defines.EMISSIVE = this._disableLighting;2481// Attribs2482babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true);2483// Get correct effect2484if (defines.isDirty) {2485defines.markAsProcessed();2486scene.resetCachedMaterial();2487// Fallbacks2488var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();2489if (defines.FOG) {2490fallbacks.addFallback(1, "FOG");2491}2492babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks);2493if (defines.NUM_BONE_INFLUENCERS > 0) {2494fallbacks.addCPUSkinningFallback(0, mesh);2495}2496defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;2497//Attributes2498var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];2499if (defines.NORMAL) {2500attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);2501}2502if (defines.UV1) {2503attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);2504}2505if (defines.UV2) {2506attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);2507}2508if (defines.VERTEXCOLOR) {2509attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);2510}2511babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);2512babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);2513// Legacy browser patch2514var shaderName = "gradient";2515var join = defines.toString();2516var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType",2517"vFogInfos", "vFogColor", "pointSize",2518"mBones",2519"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6",2520"topColor", "bottomColor", "offset", "smoothness", "scale"2521];2522var samplers = [];2523var uniformBuffers = new Array();2524babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({2525uniformsNames: uniforms,2526uniformBuffersNames: uniformBuffers,2527samplers: samplers,2528defines: defines,2529maxSimultaneousLights: 42530});2531subMesh.setEffect(scene.getEngine().createEffect(shaderName, {2532attributes: attribs,2533uniformsNames: uniforms,2534uniformBuffersNames: uniformBuffers,2535samplers: samplers,2536defines: join,2537fallbacks: fallbacks,2538onCompiled: this.onCompiled,2539onError: this.onError,2540indexParameters: { maxSimultaneousLights: 4 }2541}, engine), defines, this._materialContext);2542}2543if (!subMesh.effect || !subMesh.effect.isReady()) {2544return false;2545}2546defines._renderId = scene.getRenderId();2547subMesh.effect._wasPreviouslyReady = true;2548return true;2549};2550GradientMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {2551var scene = this.getScene();2552var defines = subMesh._materialDefines;2553if (!defines) {2554return;2555}2556var effect = subMesh.effect;2557if (!effect) {2558return;2559}2560this._activeEffect = effect;2561// Matrices2562this.bindOnlyWorldMatrix(world);2563this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());2564// Bones2565babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, effect);2566if (this._mustRebind(scene, effect)) {2567// Clip plane2568babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(effect, scene);2569// Point size2570if (this.pointsCloud) {2571this._activeEffect.setFloat("pointSize", this.pointSize);2572}2573scene.bindEyePosition(effect);2574}2575if (scene.lightsEnabled && !this.disableLighting) {2576babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);2577}2578// View2579if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {2580this._activeEffect.setMatrix("view", scene.getViewMatrix());2581}2582// Fog2583babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);2584this._activeEffect.setColor4("topColor", this.topColor, this.topColorAlpha);2585this._activeEffect.setColor4("bottomColor", this.bottomColor, this.bottomColorAlpha);2586this._activeEffect.setFloat("offset", this.offset);2587this._activeEffect.setFloat("scale", this.scale);2588this._activeEffect.setFloat("smoothness", this.smoothness);2589this._afterBind(mesh, this._activeEffect);2590};2591GradientMaterial.prototype.getAnimatables = function () {2592return [];2593};2594GradientMaterial.prototype.dispose = function (forceDisposeEffect) {2595_super.prototype.dispose.call(this, forceDisposeEffect);2596};2597GradientMaterial.prototype.clone = function (name) {2598var _this = this;2599return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new GradientMaterial(name, _this.getScene()); }, this);2600};2601GradientMaterial.prototype.serialize = function () {2602var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);2603serializationObject.customType = "BABYLON.GradientMaterial";2604return serializationObject;2605};2606GradientMaterial.prototype.getClassName = function () {2607return "GradientMaterial";2608};2609// Statics2610GradientMaterial.Parse = function (source, scene, rootUrl) {2611return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new GradientMaterial(source.name, scene); }, source, scene, rootUrl);2612};2613Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2614Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")2615], GradientMaterial.prototype, "_maxSimultaneousLights", void 0);2616Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2617Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")2618], GradientMaterial.prototype, "maxSimultaneousLights", void 0);2619Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2620Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()2621], GradientMaterial.prototype, "topColor", void 0);2622Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2623Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2624], GradientMaterial.prototype, "topColorAlpha", void 0);2625Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2626Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()2627], GradientMaterial.prototype, "bottomColor", void 0);2628Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2629Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2630], GradientMaterial.prototype, "bottomColorAlpha", void 0);2631Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2632Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2633], GradientMaterial.prototype, "offset", void 0);2634Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2635Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2636], GradientMaterial.prototype, "scale", void 0);2637Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2638Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2639], GradientMaterial.prototype, "smoothness", void 0);2640Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2641Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")2642], GradientMaterial.prototype, "_disableLighting", void 0);2643Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2644Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")2645], GradientMaterial.prototype, "disableLighting", void 0);2646return GradientMaterial;2647}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));26482649babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.GradientMaterial"] = GradientMaterial;265026512652/***/ }),26532654/***/ "./gradient/index.ts":2655/*!***************************!*\2656!*** ./gradient/index.ts ***!2657\***************************/2658/*! exports provided: GradientMaterial */2659/***/ (function(module, __webpack_exports__, __webpack_require__) {26602661"use strict";2662__webpack_require__.r(__webpack_exports__);2663/* harmony import */ var _gradientMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gradientMaterial */ "./gradient/gradientMaterial.ts");2664/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return _gradientMaterial__WEBPACK_IMPORTED_MODULE_0__["GradientMaterial"]; });26652666266726682669/***/ }),26702671/***/ "./grid/grid.fragment.ts":2672/*!*******************************!*\2673!*** ./grid/grid.fragment.ts ***!2674\*******************************/2675/*! exports provided: gridPixelShader */2676/***/ (function(module, __webpack_exports__, __webpack_require__) {26772678"use strict";2679__webpack_require__.r(__webpack_exports__);2680/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridPixelShader", function() { return gridPixelShader; });2681/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");2682/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);26832684268526862687var name = 'gridPixelShader';2688var shader = "#extension GL_OES_standard_derivatives : enable\n#define SQRT2 1.41421356\n#define PI 3.14159\nprecision highp float;\nuniform float visibility;\nuniform vec3 mainColor;\nuniform vec3 lineColor;\nuniform vec4 gridControl;\nuniform vec3 gridOffset;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\n#include<fogFragmentDeclaration>\n\n#ifdef OPACITY\nvarying vec2 vOpacityUV;\nuniform sampler2D opacitySampler;\nuniform vec2 vOpacityInfos;\n#endif\nfloat getDynamicVisibility(float position) {\n\nfloat majorGridFrequency=gridControl.y;\nif (floor(position+0.5) == floor(position/majorGridFrequency+0.5)*majorGridFrequency)\n{\nreturn 1.0;\n}\nreturn gridControl.z;\n}\nfloat getAnisotropicAttenuation(float differentialLength) {\nconst float maxNumberOfLines=10.0;\nreturn clamp(1.0/(differentialLength+1.0)-1.0/maxNumberOfLines,0.0,1.0);\n}\nfloat isPointOnLine(float position,float differentialLength) {\nfloat fractionPartOfPosition=position-floor(position+0.5);\nfractionPartOfPosition/=differentialLength;\nfractionPartOfPosition=clamp(fractionPartOfPosition,-1.,1.);\nfloat result=0.5+0.5*cos(fractionPartOfPosition*PI);\nreturn result;\n}\nfloat contributionOnAxis(float position) {\nfloat differentialLength=length(vec2(dFdx(position),dFdy(position)));\ndifferentialLength*=SQRT2;\n\nfloat result=isPointOnLine(position,differentialLength);\n\nfloat dynamicVisibility=getDynamicVisibility(position);\nresult*=dynamicVisibility;\n\nfloat anisotropicAttenuation=getAnisotropicAttenuation(differentialLength);\nresult*=anisotropicAttenuation;\nreturn result;\n}\nfloat normalImpactOnAxis(float x) {\nfloat normalImpact=clamp(1.0-3.0*abs(x*x*x),0.0,1.0);\nreturn normalImpact;\n}\nvoid main(void) {\n\nfloat gridRatio=gridControl.x;\nvec3 gridPos=(vPosition+gridOffset.xyz)/gridRatio;\n\nfloat x=contributionOnAxis(gridPos.x);\nfloat y=contributionOnAxis(gridPos.y);\nfloat z=contributionOnAxis(gridPos.z);\n\nvec3 normal=normalize(vNormal);\nx*=normalImpactOnAxis(normal.x);\ny*=normalImpactOnAxis(normal.y);\nz*=normalImpactOnAxis(normal.z);\n\nfloat grid=clamp(x+y+z,0.,1.);\n\nvec3 color=mix(mainColor,lineColor,grid);\n#ifdef FOG\n#include<fogFragment>\n#endif\nfloat opacity=1.0;\n#ifdef TRANSPARENT\nopacity=clamp(grid,0.08,gridControl.w*grid);\n#endif\n#ifdef OPACITY\nopacity*=texture2D(opacitySampler,vOpacityUV).a;\n#endif\n\ngl_FragColor=vec4(color.rgb,opacity*visibility);\n#ifdef TRANSPARENT\n#ifdef PREMULTIPLYALPHA\ngl_FragColor.rgb*=opacity;\n#endif\n#else\n#endif\n#include<imageProcessingCompatibility>\n}";2689babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;2690/** @hidden */2691var gridPixelShader = { name: name, shader: shader };269226932694/***/ }),26952696/***/ "./grid/grid.vertex.ts":2697/*!*****************************!*\2698!*** ./grid/grid.vertex.ts ***!2699\*****************************/2700/*! exports provided: gridVertexShader */2701/***/ (function(module, __webpack_exports__, __webpack_require__) {27022703"use strict";2704__webpack_require__.r(__webpack_exports__);2705/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gridVertexShader", function() { return gridVertexShader; });2706/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");2707/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);270827092710271127122713var name = 'gridVertexShader';2714var shader = "precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#include<instancesDeclaration>\n\nuniform mat4 projection;\nuniform mat4 view;\n\nvarying vec3 vPosition;\nvarying vec3 vNormal;\n#include<fogVertexDeclaration>\n#ifdef OPACITY\nvarying vec2 vOpacityUV;\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\nvoid main(void) {\n#include<instancesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#include<fogVertex>\nvec4 cameraSpacePosition=view*worldPos;\ngl_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{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\nvPosition=position;\nvNormal=normal;\n}";2715babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;2716/** @hidden */2717var gridVertexShader = { name: name, shader: shader };271827192720/***/ }),27212722/***/ "./grid/gridMaterial.ts":2723/*!******************************!*\2724!*** ./grid/gridMaterial.ts ***!2725\******************************/2726/*! exports provided: GridMaterial */2727/***/ (function(module, __webpack_exports__, __webpack_require__) {27282729"use strict";2730__webpack_require__.r(__webpack_exports__);2731/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return GridMaterial; });2732/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");2733/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");2734/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);2735/* harmony import */ var _grid_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grid.fragment */ "./grid/grid.fragment.ts");2736/* harmony import */ var _grid_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./grid.vertex */ "./grid/grid.vertex.ts");2737273827392740274127422743274427452746274727482749var GridMaterialDefines = /** @class */ (function (_super) {2750Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GridMaterialDefines, _super);2751function GridMaterialDefines() {2752var _this = _super.call(this) || this;2753_this.OPACITY = false;2754_this.TRANSPARENT = false;2755_this.FOG = false;2756_this.PREMULTIPLYALPHA = false;2757_this.UV1 = false;2758_this.UV2 = false;2759_this.INSTANCES = false;2760_this.THIN_INSTANCES = false;2761_this.IMAGEPROCESSINGPOSTPROCESS = false;2762_this.rebuild();2763return _this;2764}2765return GridMaterialDefines;2766}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));2767/**2768* The grid materials allows you to wrap any shape with a grid.2769* Colors are customizable.2770*/2771var GridMaterial = /** @class */ (function (_super) {2772Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(GridMaterial, _super);2773/**2774* constructor2775* @param name The name given to the material in order to identify it afterwards.2776* @param scene The scene the material is used in.2777*/2778function GridMaterial(name, scene) {2779var _this = _super.call(this, name, scene) || this;2780/**2781* Main color of the grid (e.g. between lines)2782*/2783_this.mainColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();2784/**2785* Color of the grid lines.2786*/2787_this.lineColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Teal();2788/**2789* The scale of the grid compared to unit.2790*/2791_this.gridRatio = 1.0;2792/**2793* Allows setting an offset for the grid lines.2794*/2795_this.gridOffset = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();2796/**2797* The frequency of thicker lines.2798*/2799_this.majorUnitFrequency = 10;2800/**2801* The visibility of minor units in the grid.2802*/2803_this.minorUnitVisibility = 0.33;2804/**2805* The grid opacity outside of the lines.2806*/2807_this.opacity = 1.0;2808/**2809* Determine RBG output is premultiplied by alpha value.2810*/2811_this.preMultiplyAlpha = false;2812_this._gridControl = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector4"](_this.gridRatio, _this.majorUnitFrequency, _this.minorUnitVisibility, _this.opacity);2813return _this;2814}2815/**2816* Returns wehter or not the grid requires alpha blending.2817*/2818GridMaterial.prototype.needAlphaBlending = function () {2819return this.opacity < 1.0 || this._opacityTexture && this._opacityTexture.isReady();2820};2821GridMaterial.prototype.needAlphaBlendingForMesh = function (mesh) {2822return mesh.visibility < 1.0 || this.needAlphaBlending();2823};2824GridMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {2825if (this.isFrozen) {2826if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {2827return true;2828}2829}2830if (!subMesh._materialDefines) {2831subMesh.materialDefines = new GridMaterialDefines();2832}2833var defines = subMesh._materialDefines;2834var scene = this.getScene();2835if (this._isReadyForSubMesh(subMesh)) {2836return true;2837}2838if (defines.TRANSPARENT !== (this.opacity < 1.0)) {2839defines.TRANSPARENT = !defines.TRANSPARENT;2840defines.markAsUnprocessed();2841}2842if (defines.PREMULTIPLYALPHA != this.preMultiplyAlpha) {2843defines.PREMULTIPLYALPHA = !defines.PREMULTIPLYALPHA;2844defines.markAsUnprocessed();2845}2846// Textures2847if (defines._areTexturesDirty) {2848defines._needUVs = false;2849if (scene.texturesEnabled) {2850if (this._opacityTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].OpacityTextureEnabled) {2851if (!this._opacityTexture.isReady()) {2852return false;2853}2854else {2855defines._needUVs = true;2856defines.OPACITY = true;2857}2858}2859}2860}2861babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, false, this.fogEnabled, false, defines);2862// Values that need to be evaluated on every frame2863babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, scene.getEngine(), defines, !!useInstances);2864// Get correct effect2865if (defines.isDirty) {2866defines.markAsProcessed();2867scene.resetCachedMaterial();2868// Attributes2869babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, false);2870var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind];2871if (defines.UV1) {2872attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);2873}2874if (defines.UV2) {2875attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);2876}2877defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;2878babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);2879// Defines2880var join = defines.toString();2881subMesh.setEffect(scene.getEngine().createEffect("grid", attribs, ["projection", "mainColor", "lineColor", "gridControl", "gridOffset", "vFogInfos", "vFogColor", "world", "view",2882"opacityMatrix", "vOpacityInfos", "visibility"], ["opacitySampler"], join, undefined, this.onCompiled, this.onError), defines, this._materialContext);2883}2884if (!subMesh.effect || !subMesh.effect.isReady()) {2885return false;2886}2887defines._renderId = scene.getRenderId();2888subMesh.effect._wasPreviouslyReady = true;2889return true;2890};2891GridMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {2892var scene = this.getScene();2893var defines = subMesh._materialDefines;2894if (!defines) {2895return;2896}2897var effect = subMesh.effect;2898if (!effect) {2899return;2900}2901this._activeEffect = effect;2902this._activeEffect.setFloat("visibility", mesh.visibility);2903// Matrices2904if (!defines.INSTANCES || defines.THIN_INSTANCE) {2905this.bindOnlyWorldMatrix(world);2906}2907this._activeEffect.setMatrix("view", scene.getViewMatrix());2908this._activeEffect.setMatrix("projection", scene.getProjectionMatrix());2909// Uniforms2910if (this._mustRebind(scene, effect)) {2911this._activeEffect.setColor3("mainColor", this.mainColor);2912this._activeEffect.setColor3("lineColor", this.lineColor);2913this._activeEffect.setVector3("gridOffset", this.gridOffset);2914this._gridControl.x = this.gridRatio;2915this._gridControl.y = Math.round(this.majorUnitFrequency);2916this._gridControl.z = this.minorUnitVisibility;2917this._gridControl.w = this.opacity;2918this._activeEffect.setVector4("gridControl", this._gridControl);2919if (this._opacityTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].OpacityTextureEnabled) {2920this._activeEffect.setTexture("opacitySampler", this._opacityTexture);2921this._activeEffect.setFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level);2922this._activeEffect.setMatrix("opacityMatrix", this._opacityTexture.getTextureMatrix());2923}2924}2925// Fog2926babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);2927this._afterBind(mesh, this._activeEffect);2928};2929/**2930* Dispose the material and its associated resources.2931* @param forceDisposeEffect will also dispose the used effect when true2932*/2933GridMaterial.prototype.dispose = function (forceDisposeEffect) {2934_super.prototype.dispose.call(this, forceDisposeEffect);2935};2936GridMaterial.prototype.clone = function (name) {2937var _this = this;2938return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new GridMaterial(name, _this.getScene()); }, this);2939};2940GridMaterial.prototype.serialize = function () {2941var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);2942serializationObject.customType = "BABYLON.GridMaterial";2943return serializationObject;2944};2945GridMaterial.prototype.getClassName = function () {2946return "GridMaterial";2947};2948GridMaterial.Parse = function (source, scene, rootUrl) {2949return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new GridMaterial(source.name, scene); }, source, scene, rootUrl);2950};2951Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2952Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()2953], GridMaterial.prototype, "mainColor", void 0);2954Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2955Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()2956], GridMaterial.prototype, "lineColor", void 0);2957Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2958Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2959], GridMaterial.prototype, "gridRatio", void 0);2960Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2961Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])()2962], GridMaterial.prototype, "gridOffset", void 0);2963Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2964Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2965], GridMaterial.prototype, "majorUnitFrequency", void 0);2966Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2967Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2968], GridMaterial.prototype, "minorUnitVisibility", void 0);2969Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2970Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2971], GridMaterial.prototype, "opacity", void 0);2972Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2973Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()2974], GridMaterial.prototype, "preMultiplyAlpha", void 0);2975Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2976Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("opacityTexture")2977], GridMaterial.prototype, "_opacityTexture", void 0);2978Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([2979Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")2980], GridMaterial.prototype, "opacityTexture", void 0);2981return GridMaterial;2982}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));29832984babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.GridMaterial"] = GridMaterial;298529862987/***/ }),29882989/***/ "./grid/index.ts":2990/*!***********************!*\2991!*** ./grid/index.ts ***!2992\***********************/2993/*! exports provided: GridMaterial */2994/***/ (function(module, __webpack_exports__, __webpack_require__) {29952996"use strict";2997__webpack_require__.r(__webpack_exports__);2998/* harmony import */ var _gridMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gridMaterial */ "./grid/gridMaterial.ts");2999/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return _gridMaterial__WEBPACK_IMPORTED_MODULE_0__["GridMaterial"]; });30003001300230033004/***/ }),30053006/***/ "./index.ts":3007/*!******************!*\3008!*** ./index.ts ***!3009\******************/3010/*! exports provided: CellMaterial, CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial, FireMaterial, FurMaterial, GradientMaterial, GridMaterial, LavaMaterial, MixMaterial, NormalMaterial, ShadowOnlyMaterial, SimpleMaterial, SkyMaterial, TerrainMaterial, TriPlanarMaterial, WaterMaterial */3011/***/ (function(module, __webpack_exports__, __webpack_require__) {30123013"use strict";3014__webpack_require__.r(__webpack_exports__);3015/* harmony import */ var _cell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cell */ "./cell/index.ts");3016/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return _cell__WEBPACK_IMPORTED_MODULE_0__["CellMaterial"]; });30173018/* harmony import */ var _custom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./custom */ "./custom/index.ts");3019/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["CustomShaderStructure"]; });30203021/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["ShaderSpecialParts"]; });30223023/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["CustomMaterial"]; });30243025/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["ShaderAlebdoParts"]; });30263027/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _custom__WEBPACK_IMPORTED_MODULE_1__["PBRCustomMaterial"]; });30283029/* harmony import */ var _fire__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire */ "./fire/index.ts");3030/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return _fire__WEBPACK_IMPORTED_MODULE_2__["FireMaterial"]; });30313032/* harmony import */ var _fur__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fur */ "./fur/index.ts");3033/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return _fur__WEBPACK_IMPORTED_MODULE_3__["FurMaterial"]; });30343035/* harmony import */ var _gradient__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gradient */ "./gradient/index.ts");3036/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return _gradient__WEBPACK_IMPORTED_MODULE_4__["GradientMaterial"]; });30373038/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./grid */ "./grid/index.ts");3039/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return _grid__WEBPACK_IMPORTED_MODULE_5__["GridMaterial"]; });30403041/* harmony import */ var _lava__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lava */ "./lava/index.ts");3042/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return _lava__WEBPACK_IMPORTED_MODULE_6__["LavaMaterial"]; });30433044/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mix */ "./mix/index.ts");3045/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return _mix__WEBPACK_IMPORTED_MODULE_7__["MixMaterial"]; });30463047/* harmony import */ var _normal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./normal */ "./normal/index.ts");3048/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return _normal__WEBPACK_IMPORTED_MODULE_8__["NormalMaterial"]; });30493050/* harmony import */ var _shadowOnly__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./shadowOnly */ "./shadowOnly/index.ts");3051/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _shadowOnly__WEBPACK_IMPORTED_MODULE_9__["ShadowOnlyMaterial"]; });30523053/* harmony import */ var _simple__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./simple */ "./simple/index.ts");3054/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return _simple__WEBPACK_IMPORTED_MODULE_10__["SimpleMaterial"]; });30553056/* harmony import */ var _sky__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./sky */ "./sky/index.ts");3057/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return _sky__WEBPACK_IMPORTED_MODULE_11__["SkyMaterial"]; });30583059/* harmony import */ var _terrain__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./terrain */ "./terrain/index.ts");3060/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return _terrain__WEBPACK_IMPORTED_MODULE_12__["TerrainMaterial"]; });30613062/* harmony import */ var _triPlanar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./triPlanar */ "./triPlanar/index.ts");3063/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return _triPlanar__WEBPACK_IMPORTED_MODULE_13__["TriPlanarMaterial"]; });30643065/* harmony import */ var _water__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./water */ "./water/index.ts");3066/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return _water__WEBPACK_IMPORTED_MODULE_14__["WaterMaterial"]; });3067306830693070307130723073307430753076307730783079308030813082308330843085/***/ }),30863087/***/ "./lava/index.ts":3088/*!***********************!*\3089!*** ./lava/index.ts ***!3090\***********************/3091/*! exports provided: LavaMaterial */3092/***/ (function(module, __webpack_exports__, __webpack_require__) {30933094"use strict";3095__webpack_require__.r(__webpack_exports__);3096/* harmony import */ var _lavaMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lavaMaterial */ "./lava/lavaMaterial.ts");3097/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return _lavaMaterial__WEBPACK_IMPORTED_MODULE_0__["LavaMaterial"]; });30983099310031013102/***/ }),31033104/***/ "./lava/lava.fragment.ts":3105/*!*******************************!*\3106!*** ./lava/lava.fragment.ts ***!3107\*******************************/3108/*! exports provided: lavaPixelShader */3109/***/ (function(module, __webpack_exports__, __webpack_require__) {31103111"use strict";3112__webpack_require__.r(__webpack_exports__);3113/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaPixelShader", function() { return lavaPixelShader; });3114/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");3115/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);31163117311831193120312131223123312431253126312731283129var name = 'lavaPixelShader';3130var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n\nuniform float time;\nuniform float speed;\nuniform float movingSpeed;\nuniform vec3 fogColor;\nuniform sampler2D noiseTexture;\nuniform float fogDensity;\n\nvarying float noise;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\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\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nfloat random( vec3 scale,float seed ){\nreturn fract( sin( dot( gl_FragCoord.xyz+seed,scale ) )*43758.5453+seed ) ;\n}\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\n\nvec4 noiseTex=texture2D( noiseTexture,vDiffuseUV );\nvec2 T1=vDiffuseUV+vec2( 1.5,-1.5 )*time*0.02;\nvec2 T2=vDiffuseUV+vec2( -0.5,2.0 )*time*0.01*speed;\nT1.x+=noiseTex.x*2.0;\nT1.y+=noiseTex.y*2.0;\nT2.x-=noiseTex.y*0.2+time*0.001*movingSpeed;\nT2.y+=noiseTex.z*0.2+time*0.002*movingSpeed;\nfloat p=texture2D( noiseTexture,T1*3.0 ).a;\nvec4 lavaColor=texture2D( diffuseSampler,T2*4.0);\nvec4 temp=lavaColor*( vec4( p,p,p,p )*2. )+( lavaColor*lavaColor-0.1 );\nbaseColor=temp;\nfloat depth=gl_FragCoord.z*4.0;\nconst float LOG2=1.442695;\nfloat fogFactor=exp2(-fogDensity*fogDensity*depth*depth*LOG2 );\nfogFactor=1.0-clamp( fogFactor,0.0,1.0 );\nbaseColor=mix( baseColor,vec4( fogColor,baseColor.w ),fogFactor );\ndiffuseColor=baseColor.rgb;\n\n\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\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\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include<lightFragment>[0]\n#include<lightFragment>[1]\n#include<lightFragment>[2]\n#include<lightFragment>[3]\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";3131babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;3132/** @hidden */3133var lavaPixelShader = { name: name, shader: shader };313431353136/***/ }),31373138/***/ "./lava/lava.vertex.ts":3139/*!*****************************!*\3140!*** ./lava/lava.vertex.ts ***!3141\*****************************/3142/*! exports provided: lavaVertexShader */3143/***/ (function(module, __webpack_exports__, __webpack_require__) {31443145"use strict";3146__webpack_require__.r(__webpack_exports__);3147/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lavaVertexShader", function() { return lavaVertexShader; });3148/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");3149/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);3150315131523153315431553156315731583159316031613162var name = 'lavaVertexShader';3163var shader = "precision highp float;\n\nuniform float time;\nuniform float lowFrequencySpeed;\n\nvarying float noise;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n\n\nvec3 mod289(vec3 x)\n{\nreturn x-floor(x*(1.0/289.0))*289.0;\n}\nvec4 mod289(vec4 x)\n{\nreturn x-floor(x*(1.0/289.0))*289.0;\n}\nvec4 permute(vec4 x)\n{\nreturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r)\n{\nreturn 1.79284291400159-0.85373472095314*r;\n}\nvec3 fade(vec3 t) {\nreturn t*t*t*(t*(t*6.0-15.0)+10.0);\n}\n\nfloat pnoise(vec3 P,vec3 rep)\n{\nvec3 Pi0=mod(floor(P),rep);\nvec3 Pi1=mod(Pi0+vec3(1.0),rep);\nPi0=mod289(Pi0);\nPi1=mod289(Pi1);\nvec3 Pf0=fract(P);\nvec3 Pf1=Pf0-vec3(1.0);\nvec4 ix=vec4(Pi0.x,Pi1.x,Pi0.x,Pi1.x);\nvec4 iy=vec4(Pi0.yy,Pi1.yy);\nvec4 iz0=Pi0.zzzz;\nvec4 iz1=Pi1.zzzz;\nvec4 ixy=permute(permute(ix)+iy);\nvec4 ixy0=permute(ixy+iz0);\nvec4 ixy1=permute(ixy+iz1);\nvec4 gx0=ixy0*(1.0/7.0);\nvec4 gy0=fract(floor(gx0)*(1.0/7.0))-0.5;\ngx0=fract(gx0);\nvec4 gz0=vec4(0.5)-abs(gx0)-abs(gy0);\nvec4 sz0=step(gz0,vec4(0.0));\ngx0-=sz0*(step(0.0,gx0)-0.5);\ngy0-=sz0*(step(0.0,gy0)-0.5);\nvec4 gx1=ixy1*(1.0/7.0);\nvec4 gy1=fract(floor(gx1)*(1.0/7.0))-0.5;\ngx1=fract(gx1);\nvec4 gz1=vec4(0.5)-abs(gx1)-abs(gy1);\nvec4 sz1=step(gz1,vec4(0.0));\ngx1-=sz1*(step(0.0,gx1)-0.5);\ngy1-=sz1*(step(0.0,gy1)-0.5);\nvec3 g000=vec3(gx0.x,gy0.x,gz0.x);\nvec3 g100=vec3(gx0.y,gy0.y,gz0.y);\nvec3 g010=vec3(gx0.z,gy0.z,gz0.z);\nvec3 g110=vec3(gx0.w,gy0.w,gz0.w);\nvec3 g001=vec3(gx1.x,gy1.x,gz1.x);\nvec3 g101=vec3(gx1.y,gy1.y,gz1.y);\nvec3 g011=vec3(gx1.z,gy1.z,gz1.z);\nvec3 g111=vec3(gx1.w,gy1.w,gz1.w);\nvec4 norm0=taylorInvSqrt(vec4(dot(g000,g000),dot(g010,g010),dot(g100,g100),dot(g110,g110)));\ng000*=norm0.x;\ng010*=norm0.y;\ng100*=norm0.z;\ng110*=norm0.w;\nvec4 norm1=taylorInvSqrt(vec4(dot(g001,g001),dot(g011,g011),dot(g101,g101),dot(g111,g111)));\ng001*=norm1.x;\ng011*=norm1.y;\ng101*=norm1.z;\ng111*=norm1.w;\nfloat n000=dot(g000,Pf0);\nfloat n100=dot(g100,vec3(Pf1.x,Pf0.yz));\nfloat n010=dot(g010,vec3(Pf0.x,Pf1.y,Pf0.z));\nfloat n110=dot(g110,vec3(Pf1.xy,Pf0.z));\nfloat n001=dot(g001,vec3(Pf0.xy,Pf1.z));\nfloat n101=dot(g101,vec3(Pf1.x,Pf0.y,Pf1.z));\nfloat n011=dot(g011,vec3(Pf0.x,Pf1.yz));\nfloat n111=dot(g111,Pf1);\nvec3 fade_xyz=fade(Pf0);\nvec4 n_z=mix(vec4(n000,n100,n010,n110),vec4(n001,n101,n011,n111),fade_xyz.z);\nvec2 n_yz=mix(n_z.xy,n_z.zw,fade_xyz.y);\nfloat n_xyz=mix(n_yz.x,n_yz.y,fade_xyz.x);\nreturn 2.2*n_xyz;\n}\n\nfloat turbulence( vec3 p ) {\nfloat w=100.0;\nfloat t=-.5;\nfor (float f=1.0 ; f<=10.0 ; f++ ){\nfloat power=pow( 2.0,f );\nt+=abs( pnoise( vec3( power*p ),vec3( 10.0,10.0,10.0 ) )/power );\n}\nreturn t;\n}\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef NORMAL\n\nnoise=10.0*-.10*turbulence( .5*normal+time*1.15 );\n\nfloat b=lowFrequencySpeed*5.0*pnoise( 0.05*position +vec3(time*1.025),vec3( 100.0 ) );\n\nfloat displacement =-1.5*noise+b;\n\nvec3 newPosition=position+normal*displacement;\ngl_Position=viewProjection*finalWorld*vec4( newPosition,1.0 );\nvec4 worldPos=finalWorld*vec4(newPosition,1.0);\nvPositionW=vec3(worldPos);\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}";3164babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;3165/** @hidden */3166var lavaVertexShader = { name: name, shader: shader };316731683169/***/ }),31703171/***/ "./lava/lavaMaterial.ts":3172/*!******************************!*\3173!*** ./lava/lavaMaterial.ts ***!3174\******************************/3175/*! exports provided: LavaMaterial */3176/***/ (function(module, __webpack_exports__, __webpack_require__) {31773178"use strict";3179__webpack_require__.r(__webpack_exports__);3180/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return LavaMaterial; });3181/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");3182/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");3183/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);3184/* harmony import */ var _lava_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lava.fragment */ "./lava/lava.fragment.ts");3185/* harmony import */ var _lava_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lava.vertex */ "./lava/lava.vertex.ts");31863187318831893190319131923193319431953196319731983199var LavaMaterialDefines = /** @class */ (function (_super) {3200Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LavaMaterialDefines, _super);3201function LavaMaterialDefines() {3202var _this = _super.call(this) || this;3203_this.DIFFUSE = false;3204_this.CLIPPLANE = false;3205_this.CLIPPLANE2 = false;3206_this.CLIPPLANE3 = false;3207_this.CLIPPLANE4 = false;3208_this.CLIPPLANE5 = false;3209_this.CLIPPLANE6 = false;3210_this.ALPHATEST = false;3211_this.DEPTHPREPASS = false;3212_this.POINTSIZE = false;3213_this.FOG = false;3214_this.LIGHT0 = false;3215_this.LIGHT1 = false;3216_this.LIGHT2 = false;3217_this.LIGHT3 = false;3218_this.SPOTLIGHT0 = false;3219_this.SPOTLIGHT1 = false;3220_this.SPOTLIGHT2 = false;3221_this.SPOTLIGHT3 = false;3222_this.HEMILIGHT0 = false;3223_this.HEMILIGHT1 = false;3224_this.HEMILIGHT2 = false;3225_this.HEMILIGHT3 = false;3226_this.DIRLIGHT0 = false;3227_this.DIRLIGHT1 = false;3228_this.DIRLIGHT2 = false;3229_this.DIRLIGHT3 = false;3230_this.POINTLIGHT0 = false;3231_this.POINTLIGHT1 = false;3232_this.POINTLIGHT2 = false;3233_this.POINTLIGHT3 = false;3234_this.SHADOW0 = false;3235_this.SHADOW1 = false;3236_this.SHADOW2 = false;3237_this.SHADOW3 = false;3238_this.SHADOWS = false;3239_this.SHADOWESM0 = false;3240_this.SHADOWESM1 = false;3241_this.SHADOWESM2 = false;3242_this.SHADOWESM3 = false;3243_this.SHADOWPOISSON0 = false;3244_this.SHADOWPOISSON1 = false;3245_this.SHADOWPOISSON2 = false;3246_this.SHADOWPOISSON3 = false;3247_this.SHADOWPCF0 = false;3248_this.SHADOWPCF1 = false;3249_this.SHADOWPCF2 = false;3250_this.SHADOWPCF3 = false;3251_this.SHADOWPCSS0 = false;3252_this.SHADOWPCSS1 = false;3253_this.SHADOWPCSS2 = false;3254_this.SHADOWPCSS3 = false;3255_this.NORMAL = false;3256_this.UV1 = false;3257_this.UV2 = false;3258_this.VERTEXCOLOR = false;3259_this.VERTEXALPHA = false;3260_this.NUM_BONE_INFLUENCERS = 0;3261_this.BonesPerMesh = 0;3262_this.INSTANCES = false;3263_this.UNLIT = false;3264_this.IMAGEPROCESSINGPOSTPROCESS = false;3265_this.rebuild();3266return _this;3267}3268return LavaMaterialDefines;3269}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));3270var LavaMaterial = /** @class */ (function (_super) {3271Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LavaMaterial, _super);3272function LavaMaterial(name, scene) {3273var _this = _super.call(this, name, scene) || this;3274_this.speed = 1;3275_this.movingSpeed = 1;3276_this.lowFrequencySpeed = 1;3277_this.fogDensity = 0.15;3278_this._lastTime = 0;3279_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);3280_this._disableLighting = false;3281_this._unlit = false;3282_this._maxSimultaneousLights = 4;3283_this._scaledDiffuse = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"]();3284return _this;3285}3286LavaMaterial.prototype.needAlphaBlending = function () {3287return (this.alpha < 1.0);3288};3289LavaMaterial.prototype.needAlphaTesting = function () {3290return false;3291};3292LavaMaterial.prototype.getAlphaTestTexture = function () {3293return null;3294};3295// Methods3296LavaMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {3297if (this.isFrozen) {3298if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {3299return true;3300}3301}3302if (!subMesh._materialDefines) {3303subMesh.materialDefines = new LavaMaterialDefines();3304}3305var defines = subMesh._materialDefines;3306var scene = this.getScene();3307if (this._isReadyForSubMesh(subMesh)) {3308return true;3309}3310var engine = scene.getEngine();3311// Textures3312if (defines._areTexturesDirty) {3313defines._needUVs = false;3314if (scene.texturesEnabled) {3315if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {3316if (!this._diffuseTexture.isReady()) {3317return false;3318}3319else {3320defines._needUVs = true;3321defines.DIFFUSE = true;3322}3323}3324}3325}3326// Misc.3327babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);3328// Lights3329defines._needNormals = true;3330babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);3331// Values that need to be evaluated on every frame3332babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);3333// Attribs3334babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);3335// Get correct effect3336if (defines.isDirty) {3337defines.markAsProcessed();3338scene.resetCachedMaterial();3339// Fallbacks3340var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();3341if (defines.FOG) {3342fallbacks.addFallback(1, "FOG");3343}3344babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks);3345if (defines.NUM_BONE_INFLUENCERS > 0) {3346fallbacks.addCPUSkinningFallback(0, mesh);3347}3348defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;3349//Attributes3350var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];3351if (defines.NORMAL) {3352attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);3353}3354if (defines.UV1) {3355attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);3356}3357if (defines.UV2) {3358attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);3359}3360if (defines.VERTEXCOLOR) {3361attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);3362}3363babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);3364babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);3365// Legacy browser patch3366var shaderName = "lava";3367var join = defines.toString();3368var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor",3369"vFogInfos", "vFogColor", "pointSize",3370"vDiffuseInfos",3371"mBones",3372"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix",3373"time", "speed", "movingSpeed",3374"fogColor", "fogDensity", "lowFrequencySpeed"3375];3376var samplers = ["diffuseSampler",3377"noiseTexture"3378];3379var uniformBuffers = new Array();3380babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({3381uniformsNames: uniforms,3382uniformBuffersNames: uniformBuffers,3383samplers: samplers,3384defines: defines,3385maxSimultaneousLights: this.maxSimultaneousLights3386});3387subMesh.setEffect(scene.getEngine().createEffect(shaderName, {3388attributes: attribs,3389uniformsNames: uniforms,3390uniformBuffersNames: uniformBuffers,3391samplers: samplers,3392defines: join,3393fallbacks: fallbacks,3394onCompiled: this.onCompiled,3395onError: this.onError,3396indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }3397}, engine), defines, this._materialContext);3398}3399if (!subMesh.effect || !subMesh.effect.isReady()) {3400return false;3401}3402defines._renderId = scene.getRenderId();3403subMesh.effect._wasPreviouslyReady = true;3404return true;3405};3406LavaMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {3407var scene = this.getScene();3408var defines = subMesh._materialDefines;3409if (!defines) {3410return;3411}3412var effect = subMesh.effect;3413if (!effect) {3414return;3415}3416this._activeEffect = effect;3417defines.UNLIT = this._unlit;3418// Matrices3419this.bindOnlyWorldMatrix(world);3420this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());3421// Bones3422babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);3423if (this._mustRebind(scene, effect)) {3424// Textures3425if (this.diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {3426this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);3427this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);3428this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix());3429}3430if (this.noiseTexture) {3431this._activeEffect.setTexture("noiseTexture", this.noiseTexture);3432}3433// Clip plane3434babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);3435// Point size3436if (this.pointsCloud) {3437this._activeEffect.setFloat("pointSize", this.pointSize);3438}3439scene.bindEyePosition(effect);3440}3441this._activeEffect.setColor4("vDiffuseColor", this._scaledDiffuse, this.alpha * mesh.visibility);3442if (scene.lightsEnabled && !this.disableLighting) {3443babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines);3444}3445// View3446if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {3447this._activeEffect.setMatrix("view", scene.getViewMatrix());3448}3449// Fog3450babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);3451this._lastTime += scene.getEngine().getDeltaTime();3452this._activeEffect.setFloat("time", this._lastTime * this.speed / 1000);3453if (!this.fogColor) {3454this.fogColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();3455}3456this._activeEffect.setColor3("fogColor", this.fogColor);3457this._activeEffect.setFloat("fogDensity", this.fogDensity);3458this._activeEffect.setFloat("lowFrequencySpeed", this.lowFrequencySpeed);3459this._activeEffect.setFloat("movingSpeed", this.movingSpeed);3460this._afterBind(mesh, this._activeEffect);3461};3462LavaMaterial.prototype.getAnimatables = function () {3463var results = [];3464if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) {3465results.push(this.diffuseTexture);3466}3467if (this.noiseTexture && this.noiseTexture.animations && this.noiseTexture.animations.length > 0) {3468results.push(this.noiseTexture);3469}3470return results;3471};3472LavaMaterial.prototype.getActiveTextures = function () {3473var activeTextures = _super.prototype.getActiveTextures.call(this);3474if (this._diffuseTexture) {3475activeTextures.push(this._diffuseTexture);3476}3477return activeTextures;3478};3479LavaMaterial.prototype.hasTexture = function (texture) {3480if (_super.prototype.hasTexture.call(this, texture)) {3481return true;3482}3483if (this.diffuseTexture === texture) {3484return true;3485}3486return false;3487};3488LavaMaterial.prototype.dispose = function (forceDisposeEffect) {3489if (this.diffuseTexture) {3490this.diffuseTexture.dispose();3491}3492if (this.noiseTexture) {3493this.noiseTexture.dispose();3494}3495_super.prototype.dispose.call(this, forceDisposeEffect);3496};3497LavaMaterial.prototype.clone = function (name) {3498var _this = this;3499return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new LavaMaterial(name, _this.getScene()); }, this);3500};3501LavaMaterial.prototype.serialize = function () {3502var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);3503serializationObject.customType = "BABYLON.LavaMaterial";3504return serializationObject;3505};3506LavaMaterial.prototype.getClassName = function () {3507return "LavaMaterial";3508};3509// Statics3510LavaMaterial.Parse = function (source, scene, rootUrl) {3511return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new LavaMaterial(source.name, scene); }, source, scene, rootUrl);3512};3513Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3514Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture")3515], LavaMaterial.prototype, "_diffuseTexture", void 0);3516Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3517Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")3518], LavaMaterial.prototype, "diffuseTexture", void 0);3519Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3520Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])()3521], LavaMaterial.prototype, "noiseTexture", void 0);3522Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3523Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()3524], LavaMaterial.prototype, "fogColor", void 0);3525Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3526Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()3527], LavaMaterial.prototype, "speed", void 0);3528Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3529Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()3530], LavaMaterial.prototype, "movingSpeed", void 0);3531Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3532Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()3533], LavaMaterial.prototype, "lowFrequencySpeed", void 0);3534Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3535Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()3536], LavaMaterial.prototype, "fogDensity", void 0);3537Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3538Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()3539], LavaMaterial.prototype, "diffuseColor", void 0);3540Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3541Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")3542], LavaMaterial.prototype, "_disableLighting", void 0);3543Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3544Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")3545], LavaMaterial.prototype, "disableLighting", void 0);3546Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3547Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("unlit")3548], LavaMaterial.prototype, "_unlit", void 0);3549Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3550Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")3551], LavaMaterial.prototype, "unlit", void 0);3552Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3553Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")3554], LavaMaterial.prototype, "_maxSimultaneousLights", void 0);3555Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([3556Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")3557], LavaMaterial.prototype, "maxSimultaneousLights", void 0);3558return LavaMaterial;3559}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));35603561babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.LavaMaterial"] = LavaMaterial;356235633564/***/ }),35653566/***/ "./legacy/legacy.ts":3567/*!**************************!*\3568!*** ./legacy/legacy.ts ***!3569\**************************/3570/*! exports provided: CellMaterial, CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial, FireMaterial, FurMaterial, GradientMaterial, GridMaterial, LavaMaterial, MixMaterial, NormalMaterial, ShadowOnlyMaterial, SimpleMaterial, SkyMaterial, TerrainMaterial, TriPlanarMaterial, WaterMaterial */3571/***/ (function(module, __webpack_exports__, __webpack_require__) {35723573"use strict";3574__webpack_require__.r(__webpack_exports__);3575/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./index.ts");3576/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CellMaterial"]; });35773578/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CustomShaderStructure"]; });35793580/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ShaderSpecialParts"]; });35813582/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CustomMaterial"]; });35833584/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ShaderAlebdoParts"]; });35853586/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["PBRCustomMaterial"]; });35873588/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FireMaterial"]; });35893590/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FurMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FurMaterial"]; });35913592/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GradientMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["GradientMaterial"]; });35933594/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["GridMaterial"]; });35953596/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LavaMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["LavaMaterial"]; });35973598/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["MixMaterial"]; });35993600/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["NormalMaterial"]; });36013602/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ShadowOnlyMaterial"]; });36033604/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["SimpleMaterial"]; });36053606/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["SkyMaterial"]; });36073608/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TerrainMaterial"]; });36093610/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TriPlanarMaterial"]; });36113612/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["WaterMaterial"]; });361336143615/**3616* Legacy support, defining window.BABYLON.GridMaterial... (global variable).3617*3618* This is the entry point for the UMD module.3619* The entry point for a future ESM package should be index.ts3620*/3621var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);3622if (typeof globalObject !== "undefined") {3623globalObject.BABYLON = globalObject.BABYLON || {};3624for (var mat in _index__WEBPACK_IMPORTED_MODULE_0__) {3625globalObject.BABYLON[mat] = _index__WEBPACK_IMPORTED_MODULE_0__[mat];3626}3627}362836293630/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))36313632/***/ }),36333634/***/ "./mix/index.ts":3635/*!**********************!*\3636!*** ./mix/index.ts ***!3637\**********************/3638/*! exports provided: MixMaterial */3639/***/ (function(module, __webpack_exports__, __webpack_require__) {36403641"use strict";3642__webpack_require__.r(__webpack_exports__);3643/* harmony import */ var _mixMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mixMaterial */ "./mix/mixMaterial.ts");3644/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return _mixMaterial__WEBPACK_IMPORTED_MODULE_0__["MixMaterial"]; });36453646364736483649/***/ }),36503651/***/ "./mix/mix.fragment.ts":3652/*!*****************************!*\3653!*** ./mix/mix.fragment.ts ***!3654\*****************************/3655/*! exports provided: mixPixelShader */3656/***/ (function(module, __webpack_exports__, __webpack_require__) {36573658"use strict";3659__webpack_require__.r(__webpack_exports__);3660/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixPixelShader", function() { return mixPixelShader; });3661/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");3662/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);36633664366536663667366836693670367136723673367436753676var name = 'mixPixelShader';3677var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform sampler2D mixMap1Sampler;\nuniform vec2 vTextureInfos;\n#ifdef MIXMAP2\nuniform sampler2D mixMap2Sampler;\n#endif\nuniform sampler2D diffuse1Sampler;\nuniform sampler2D diffuse2Sampler;\nuniform sampler2D diffuse3Sampler;\nuniform sampler2D diffuse4Sampler;\nuniform vec2 diffuse1Infos;\nuniform vec2 diffuse2Infos;\nuniform vec2 diffuse3Infos;\nuniform vec2 diffuse4Infos;\n#ifdef MIXMAP2\nuniform sampler2D diffuse5Sampler;\nuniform sampler2D diffuse6Sampler;\nuniform sampler2D diffuse7Sampler;\nuniform sampler2D diffuse8Sampler;\nuniform vec2 diffuse5Infos;\nuniform vec2 diffuse6Infos;\nuniform vec2 diffuse7Infos;\nuniform vec2 diffuse8Infos;\n#endif\n#endif\n\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 finalMixColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef MIXMAP2\nvec4 mixColor2=vec4(1.,1.,1.,1.);\n#endif\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n\nfloat alpha=vDiffuseColor.a;\n\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;\nvec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);\nvec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);\nvec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);\nvec4 diffuse4Color=texture2D(diffuse4Sampler,vTextureUV*diffuse4Infos);\ndiffuse1Color.rgb*=mixColor.r;\ndiffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,mixColor.g);\ndiffuse3Color.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,mixColor.b);\nfinalMixColor.rgb=mix(diffuse3Color.rgb,diffuse4Color.rgb,1.0-mixColor.a);\n#ifdef MIXMAP2\nmixColor=texture2D(mixMap2Sampler,vTextureUV);\nmixColor.rgb*=vTextureInfos.y;\nvec4 diffuse5Color=texture2D(diffuse5Sampler,vTextureUV*diffuse5Infos);\nvec4 diffuse6Color=texture2D(diffuse6Sampler,vTextureUV*diffuse6Infos);\nvec4 diffuse7Color=texture2D(diffuse7Sampler,vTextureUV*diffuse7Infos);\nvec4 diffuse8Color=texture2D(diffuse8Sampler,vTextureUV*diffuse8Infos);\ndiffuse5Color.rgb=mix(finalMixColor.rgb,diffuse5Color.rgb,mixColor.r);\ndiffuse6Color.rgb=mix(diffuse5Color.rgb,diffuse6Color.rgb,mixColor.g);\ndiffuse7Color.rgb=mix(diffuse6Color.rgb,diffuse7Color.rgb,mixColor.b);\nfinalMixColor.rgb=mix(diffuse7Color.rgb,diffuse8Color.rgb,1.0-mixColor.a);\n#endif\n#endif\n#ifdef VERTEXCOLOR\nfinalMixColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\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);\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}\n";3678babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;3679/** @hidden */3680var mixPixelShader = { name: name, shader: shader };368136823683/***/ }),36843685/***/ "./mix/mix.vertex.ts":3686/*!***************************!*\3687!*** ./mix/mix.vertex.ts ***!3688\***************************/3689/*! exports provided: mixVertexShader */3690/***/ (function(module, __webpack_exports__, __webpack_require__) {36913692"use strict";3693__webpack_require__.r(__webpack_exports__);3694/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixVertexShader", function() { return mixVertexShader; });3695/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");3696/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);3697369836993700370137023703370437053706370737083709var name = 'mixVertexShader';3710var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform mat4 textureMatrix;\nuniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";3711babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;3712/** @hidden */3713var mixVertexShader = { name: name, shader: shader };371437153716/***/ }),37173718/***/ "./mix/mixMaterial.ts":3719/*!****************************!*\3720!*** ./mix/mixMaterial.ts ***!3721\****************************/3722/*! exports provided: MixMaterial */3723/***/ (function(module, __webpack_exports__, __webpack_require__) {37243725"use strict";3726__webpack_require__.r(__webpack_exports__);3727/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixMaterial", function() { return MixMaterial; });3728/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");3729/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");3730/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);3731/* harmony import */ var _mix_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mix.fragment */ "./mix/mix.fragment.ts");3732/* harmony import */ var _mix_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix.vertex */ "./mix/mix.vertex.ts");37333734373537363737373837393740374137423743374437453746var MixMaterialDefines = /** @class */ (function (_super) {3747Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MixMaterialDefines, _super);3748function MixMaterialDefines() {3749var _this = _super.call(this) || this;3750_this.DIFFUSE = false;3751_this.CLIPPLANE = false;3752_this.CLIPPLANE2 = false;3753_this.CLIPPLANE3 = false;3754_this.CLIPPLANE4 = false;3755_this.CLIPPLANE5 = false;3756_this.CLIPPLANE6 = false;3757_this.ALPHATEST = false;3758_this.DEPTHPREPASS = false;3759_this.POINTSIZE = false;3760_this.FOG = false;3761_this.SPECULARTERM = false;3762_this.NORMAL = false;3763_this.UV1 = false;3764_this.UV2 = false;3765_this.VERTEXCOLOR = false;3766_this.VERTEXALPHA = false;3767_this.NUM_BONE_INFLUENCERS = 0;3768_this.BonesPerMesh = 0;3769_this.INSTANCES = false;3770_this.MIXMAP2 = false;3771_this.IMAGEPROCESSINGPOSTPROCESS = false;3772_this.rebuild();3773return _this;3774}3775return MixMaterialDefines;3776}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));3777var MixMaterial = /** @class */ (function (_super) {3778Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(MixMaterial, _super);3779function MixMaterial(name, scene) {3780var _this = _super.call(this, name, scene) || this;3781/**3782* Uniforms3783*/3784_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);3785_this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 0);3786_this.specularPower = 64;3787_this._disableLighting = false;3788_this._maxSimultaneousLights = 4;3789return _this;3790}3791MixMaterial.prototype.needAlphaBlending = function () {3792return (this.alpha < 1.0);3793};3794MixMaterial.prototype.needAlphaTesting = function () {3795return false;3796};3797MixMaterial.prototype.getAlphaTestTexture = function () {3798return null;3799};3800// Methods3801MixMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {3802if (this.isFrozen) {3803if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {3804return true;3805}3806}3807if (!subMesh._materialDefines) {3808subMesh.materialDefines = new MixMaterialDefines();3809}3810var defines = subMesh._materialDefines;3811var scene = this.getScene();3812if (this._isReadyForSubMesh(subMesh)) {3813return true;3814}3815var engine = scene.getEngine();3816// Textures3817if (scene.texturesEnabled) {3818if (!this._mixTexture1 || !this._mixTexture1.isReady()) {3819return false;3820}3821defines._needUVs = true;3822if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {3823if (!this._diffuseTexture1 || !this._diffuseTexture1.isReady()) {3824return false;3825}3826defines.DIFFUSE = true;3827if (!this._diffuseTexture2 || !this._diffuseTexture2.isReady()) {3828return false;3829}3830if (!this._diffuseTexture3 || !this._diffuseTexture3.isReady()) {3831return false;3832}3833if (!this._diffuseTexture4 || !this._diffuseTexture4.isReady()) {3834return false;3835}3836if (this._mixTexture2) {3837if (!this._mixTexture2.isReady()) {3838return false;3839}3840defines.MIXMAP2 = true;3841if (!this._diffuseTexture5 || !this._diffuseTexture5.isReady()) {3842return false;3843}3844if (!this._diffuseTexture6 || !this._diffuseTexture6.isReady()) {3845return false;3846}3847if (!this._diffuseTexture7 || !this._diffuseTexture7.isReady()) {3848return false;3849}3850if (!this._diffuseTexture8 || !this._diffuseTexture8.isReady()) {3851return false;3852}3853}3854}3855}3856// Misc.3857babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);3858// Lights3859defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);3860// Values that need to be evaluated on every frame3861babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);3862// Attribs3863babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);3864// Get correct effect3865if (defines.isDirty) {3866defines.markAsProcessed();3867scene.resetCachedMaterial();3868// Fallbacks3869var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();3870if (defines.FOG) {3871fallbacks.addFallback(1, "FOG");3872}3873babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);3874if (defines.NUM_BONE_INFLUENCERS > 0) {3875fallbacks.addCPUSkinningFallback(0, mesh);3876}3877defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;3878//Attributes3879var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];3880if (defines.NORMAL) {3881attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);3882}3883if (defines.UV1) {3884attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);3885}3886if (defines.UV2) {3887attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);3888}3889if (defines.VERTEXCOLOR) {3890attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);3891}3892babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);3893babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);3894// Legacy browser patch3895var shaderName = "mix";3896var join = defines.toString();3897var uniforms = [3898"world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",3899"vFogInfos", "vFogColor", "pointSize",3900"vTextureInfos",3901"mBones",3902"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "textureMatrix",3903"diffuse1Infos", "diffuse2Infos", "diffuse3Infos", "diffuse4Infos",3904"diffuse5Infos", "diffuse6Infos", "diffuse7Infos", "diffuse8Infos"3905];3906var samplers = [3907"mixMap1Sampler", "mixMap2Sampler",3908"diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler", "diffuse4Sampler",3909"diffuse5Sampler", "diffuse6Sampler", "diffuse7Sampler", "diffuse8Sampler"3910];3911var uniformBuffers = new Array();3912babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({3913uniformsNames: uniforms,3914uniformBuffersNames: uniformBuffers,3915samplers: samplers,3916defines: defines,3917maxSimultaneousLights: this.maxSimultaneousLights3918});3919subMesh.setEffect(scene.getEngine().createEffect(shaderName, {3920attributes: attribs,3921uniformsNames: uniforms,3922uniformBuffersNames: uniformBuffers,3923samplers: samplers,3924defines: join,3925fallbacks: fallbacks,3926onCompiled: this.onCompiled,3927onError: this.onError,3928indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }3929}, engine), defines, this._materialContext);3930}3931if (!subMesh.effect || !subMesh.effect.isReady()) {3932return false;3933}3934defines._renderId = scene.getRenderId();3935subMesh.effect._wasPreviouslyReady = true;3936return true;3937};3938MixMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {3939var scene = this.getScene();3940var defines = subMesh._materialDefines;3941if (!defines) {3942return;3943}3944var effect = subMesh.effect;3945if (!effect) {3946return;3947}3948this._activeEffect = effect;3949// Matrices3950this.bindOnlyWorldMatrix(world);3951this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());3952// Bones3953babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);3954if (this._mustRebind(scene, effect)) {3955// Textures3956if (this._mixTexture1) {3957this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1);3958this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level);3959this._activeEffect.setMatrix("textureMatrix", this._mixTexture1.getTextureMatrix());3960if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {3961if (this._diffuseTexture1) {3962this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1);3963this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale);3964}3965if (this._diffuseTexture2) {3966this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2);3967this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale);3968}3969if (this._diffuseTexture3) {3970this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3);3971this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale);3972}3973if (this._diffuseTexture4) {3974this._activeEffect.setTexture("diffuse4Sampler", this._diffuseTexture4);3975this._activeEffect.setFloat2("diffuse4Infos", this._diffuseTexture4.uScale, this._diffuseTexture4.vScale);3976}3977}3978}3979if (this._mixTexture2) {3980this._activeEffect.setTexture("mixMap2Sampler", this._mixTexture2);3981if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {3982if (this._diffuseTexture5) {3983this._activeEffect.setTexture("diffuse5Sampler", this._diffuseTexture5);3984this._activeEffect.setFloat2("diffuse5Infos", this._diffuseTexture5.uScale, this._diffuseTexture5.vScale);3985}3986if (this._diffuseTexture6) {3987this._activeEffect.setTexture("diffuse6Sampler", this._diffuseTexture6);3988this._activeEffect.setFloat2("diffuse6Infos", this._diffuseTexture6.uScale, this._diffuseTexture6.vScale);3989}3990if (this._diffuseTexture7) {3991this._activeEffect.setTexture("diffuse7Sampler", this._diffuseTexture7);3992this._activeEffect.setFloat2("diffuse7Infos", this._diffuseTexture7.uScale, this._diffuseTexture7.vScale);3993}3994if (this._diffuseTexture8) {3995this._activeEffect.setTexture("diffuse8Sampler", this._diffuseTexture8);3996this._activeEffect.setFloat2("diffuse8Infos", this._diffuseTexture8.uScale, this._diffuseTexture8.vScale);3997}3998}3999}4000// Clip plane4001babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);4002// Point size4003if (this.pointsCloud) {4004this._activeEffect.setFloat("pointSize", this.pointSize);4005}4006scene.bindEyePosition(effect);4007}4008this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);4009if (defines.SPECULARTERM) {4010this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);4011}4012if (scene.lightsEnabled && !this.disableLighting) {4013babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);4014}4015// View4016if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {4017this._activeEffect.setMatrix("view", scene.getViewMatrix());4018}4019// Fog4020babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);4021this._afterBind(mesh, this._activeEffect);4022};4023MixMaterial.prototype.getAnimatables = function () {4024var results = [];4025if (this._mixTexture1 && this._mixTexture1.animations && this._mixTexture1.animations.length > 0) {4026results.push(this._mixTexture1);4027}4028if (this._mixTexture2 && this._mixTexture2.animations && this._mixTexture2.animations.length > 0) {4029results.push(this._mixTexture2);4030}4031return results;4032};4033MixMaterial.prototype.getActiveTextures = function () {4034var activeTextures = _super.prototype.getActiveTextures.call(this);4035// Mix map 14036if (this._mixTexture1) {4037activeTextures.push(this._mixTexture1);4038}4039if (this._diffuseTexture1) {4040activeTextures.push(this._diffuseTexture1);4041}4042if (this._diffuseTexture2) {4043activeTextures.push(this._diffuseTexture2);4044}4045if (this._diffuseTexture3) {4046activeTextures.push(this._diffuseTexture3);4047}4048if (this._diffuseTexture4) {4049activeTextures.push(this._diffuseTexture4);4050}4051// Mix map 24052if (this._mixTexture2) {4053activeTextures.push(this._mixTexture2);4054}4055if (this._diffuseTexture5) {4056activeTextures.push(this._diffuseTexture5);4057}4058if (this._diffuseTexture6) {4059activeTextures.push(this._diffuseTexture6);4060}4061if (this._diffuseTexture7) {4062activeTextures.push(this._diffuseTexture7);4063}4064if (this._diffuseTexture8) {4065activeTextures.push(this._diffuseTexture8);4066}4067return activeTextures;4068};4069MixMaterial.prototype.hasTexture = function (texture) {4070if (_super.prototype.hasTexture.call(this, texture)) {4071return true;4072}4073// Mix map 14074if (this._mixTexture1 === texture) {4075return true;4076}4077if (this._diffuseTexture1 === texture) {4078return true;4079}4080if (this._diffuseTexture2 === texture) {4081return true;4082}4083if (this._diffuseTexture3 === texture) {4084return true;4085}4086if (this._diffuseTexture4 === texture) {4087return true;4088}4089// Mix map 24090if (this._mixTexture2 === texture) {4091return true;4092}4093if (this._diffuseTexture5 === texture) {4094return true;4095}4096if (this._diffuseTexture6 === texture) {4097return true;4098}4099if (this._diffuseTexture7 === texture) {4100return true;4101}4102if (this._diffuseTexture8 === texture) {4103return true;4104}4105return false;4106};4107MixMaterial.prototype.dispose = function (forceDisposeEffect) {4108if (this._mixTexture1) {4109this._mixTexture1.dispose();4110}4111_super.prototype.dispose.call(this, forceDisposeEffect);4112};4113MixMaterial.prototype.clone = function (name) {4114var _this = this;4115return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MixMaterial(name, _this.getScene()); }, this);4116};4117MixMaterial.prototype.serialize = function () {4118var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);4119serializationObject.customType = "BABYLON.MixMaterial";4120return serializationObject;4121};4122MixMaterial.prototype.getClassName = function () {4123return "MixMaterial";4124};4125// Statics4126MixMaterial.Parse = function (source, scene, rootUrl) {4127return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new MixMaterial(source.name, scene); }, source, scene, rootUrl);4128};4129Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4130Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("mixTexture1")4131], MixMaterial.prototype, "_mixTexture1", void 0);4132Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4133Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4134], MixMaterial.prototype, "mixTexture1", void 0);4135Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4136Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("mixTexture2")4137], MixMaterial.prototype, "_mixTexture2", void 0);4138Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4139Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4140], MixMaterial.prototype, "mixTexture2", void 0);4141Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4142Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture1")4143], MixMaterial.prototype, "_diffuseTexture1", void 0);4144Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4145Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4146], MixMaterial.prototype, "diffuseTexture1", void 0);4147Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4148Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture2")4149], MixMaterial.prototype, "_diffuseTexture2", void 0);4150Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4151Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4152], MixMaterial.prototype, "diffuseTexture2", void 0);4153Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4154Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture3")4155], MixMaterial.prototype, "_diffuseTexture3", void 0);4156Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4157Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4158], MixMaterial.prototype, "diffuseTexture3", void 0);4159Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4160Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture4")4161], MixMaterial.prototype, "_diffuseTexture4", void 0);4162Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4163Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4164], MixMaterial.prototype, "diffuseTexture4", void 0);4165Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4166Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture1")4167], MixMaterial.prototype, "_diffuseTexture5", void 0);4168Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4169Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4170], MixMaterial.prototype, "diffuseTexture5", void 0);4171Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4172Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture2")4173], MixMaterial.prototype, "_diffuseTexture6", void 0);4174Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4175Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4176], MixMaterial.prototype, "diffuseTexture6", void 0);4177Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4178Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture3")4179], MixMaterial.prototype, "_diffuseTexture7", void 0);4180Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4181Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4182], MixMaterial.prototype, "diffuseTexture7", void 0);4183Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4184Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture4")4185], MixMaterial.prototype, "_diffuseTexture8", void 0);4186Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4187Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4188], MixMaterial.prototype, "diffuseTexture8", void 0);4189Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4190Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()4191], MixMaterial.prototype, "diffuseColor", void 0);4192Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4193Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()4194], MixMaterial.prototype, "specularColor", void 0);4195Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4196Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()4197], MixMaterial.prototype, "specularPower", void 0);4198Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4199Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")4200], MixMaterial.prototype, "_disableLighting", void 0);4201Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4202Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")4203], MixMaterial.prototype, "disableLighting", void 0);4204Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4205Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")4206], MixMaterial.prototype, "_maxSimultaneousLights", void 0);4207Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4208Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")4209], MixMaterial.prototype, "maxSimultaneousLights", void 0);4210return MixMaterial;4211}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));42124213babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.MixMaterial"] = MixMaterial;421442154216/***/ }),42174218/***/ "./normal/index.ts":4219/*!*************************!*\4220!*** ./normal/index.ts ***!4221\*************************/4222/*! exports provided: NormalMaterial */4223/***/ (function(module, __webpack_exports__, __webpack_require__) {42244225"use strict";4226__webpack_require__.r(__webpack_exports__);4227/* harmony import */ var _normalMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalMaterial */ "./normal/normalMaterial.ts");4228/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return _normalMaterial__WEBPACK_IMPORTED_MODULE_0__["NormalMaterial"]; });42294230423142324233/***/ }),42344235/***/ "./normal/normal.fragment.ts":4236/*!***********************************!*\4237!*** ./normal/normal.fragment.ts ***!4238\***********************************/4239/*! exports provided: normalPixelShader */4240/***/ (function(module, __webpack_exports__, __webpack_require__) {42414242"use strict";4243__webpack_require__.r(__webpack_exports__);4244/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalPixelShader", function() { return normalPixelShader; });4245/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");4246/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);42474248424942504251425242534254425542564257425842594260var name = 'normalPixelShader';4261var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef LIGHTING\n\n#include<helperFunctions>\n\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\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat 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\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef LIGHTING\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=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\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";4262babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;4263/** @hidden */4264var normalPixelShader = { name: name, shader: shader };426542664267/***/ }),42684269/***/ "./normal/normal.vertex.ts":4270/*!*********************************!*\4271!*** ./normal/normal.vertex.ts ***!4272\*********************************/4273/*! exports provided: normalVertexShader */4274/***/ (function(module, __webpack_exports__, __webpack_require__) {42754276"use strict";4277__webpack_require__.r(__webpack_exports__);4278/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalVertexShader", function() { return normalVertexShader; });4279/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");4280/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);4281428242834284428542864287428842894290429142924293var name = 'normalVertexShader';4294var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";4295babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;4296/** @hidden */4297var normalVertexShader = { name: name, shader: shader };429842994300/***/ }),43014302/***/ "./normal/normalMaterial.ts":4303/*!**********************************!*\4304!*** ./normal/normalMaterial.ts ***!4305\**********************************/4306/*! exports provided: NormalMaterial */4307/***/ (function(module, __webpack_exports__, __webpack_require__) {43084309"use strict";4310__webpack_require__.r(__webpack_exports__);4311/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalMaterial", function() { return NormalMaterial; });4312/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");4313/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");4314/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);4315/* harmony import */ var _normal_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normal.fragment */ "./normal/normal.fragment.ts");4316/* harmony import */ var _normal_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./normal.vertex */ "./normal/normal.vertex.ts");43174318431943204321432243234324432543264327432843294330var NormalMaterialDefines = /** @class */ (function (_super) {4331Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NormalMaterialDefines, _super);4332function NormalMaterialDefines() {4333var _this = _super.call(this) || this;4334_this.DIFFUSE = false;4335_this.CLIPPLANE = false;4336_this.CLIPPLANE2 = false;4337_this.CLIPPLANE3 = false;4338_this.CLIPPLANE4 = false;4339_this.CLIPPLANE5 = false;4340_this.CLIPPLANE6 = false;4341_this.ALPHATEST = false;4342_this.DEPTHPREPASS = false;4343_this.POINTSIZE = false;4344_this.FOG = false;4345_this.LIGHT0 = false;4346_this.LIGHT1 = false;4347_this.LIGHT2 = false;4348_this.LIGHT3 = false;4349_this.SPOTLIGHT0 = false;4350_this.SPOTLIGHT1 = false;4351_this.SPOTLIGHT2 = false;4352_this.SPOTLIGHT3 = false;4353_this.HEMILIGHT0 = false;4354_this.HEMILIGHT1 = false;4355_this.HEMILIGHT2 = false;4356_this.HEMILIGHT3 = false;4357_this.DIRLIGHT0 = false;4358_this.DIRLIGHT1 = false;4359_this.DIRLIGHT2 = false;4360_this.DIRLIGHT3 = false;4361_this.POINTLIGHT0 = false;4362_this.POINTLIGHT1 = false;4363_this.POINTLIGHT2 = false;4364_this.POINTLIGHT3 = false;4365_this.SHADOW0 = false;4366_this.SHADOW1 = false;4367_this.SHADOW2 = false;4368_this.SHADOW3 = false;4369_this.SHADOWS = false;4370_this.SHADOWESM0 = false;4371_this.SHADOWESM1 = false;4372_this.SHADOWESM2 = false;4373_this.SHADOWESM3 = false;4374_this.SHADOWPOISSON0 = false;4375_this.SHADOWPOISSON1 = false;4376_this.SHADOWPOISSON2 = false;4377_this.SHADOWPOISSON3 = false;4378_this.SHADOWPCF0 = false;4379_this.SHADOWPCF1 = false;4380_this.SHADOWPCF2 = false;4381_this.SHADOWPCF3 = false;4382_this.SHADOWPCSS0 = false;4383_this.SHADOWPCSS1 = false;4384_this.SHADOWPCSS2 = false;4385_this.SHADOWPCSS3 = false;4386_this.NORMAL = false;4387_this.UV1 = false;4388_this.UV2 = false;4389_this.NUM_BONE_INFLUENCERS = 0;4390_this.BonesPerMesh = 0;4391_this.INSTANCES = false;4392_this.LIGHTING = false;4393_this.IMAGEPROCESSINGPOSTPROCESS = false;4394_this.rebuild();4395return _this;4396}4397return NormalMaterialDefines;4398}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));4399var NormalMaterial = /** @class */ (function (_super) {4400Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(NormalMaterial, _super);4401function NormalMaterial(name, scene) {4402var _this = _super.call(this, name, scene) || this;4403_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);4404_this._disableLighting = false;4405_this._maxSimultaneousLights = 4;4406return _this;4407}4408NormalMaterial.prototype.needAlphaBlending = function () {4409return (this.alpha < 1.0);4410};4411NormalMaterial.prototype.needAlphaBlendingForMesh = function (mesh) {4412return this.needAlphaBlending() || (mesh.visibility < 1.0);4413};4414NormalMaterial.prototype.needAlphaTesting = function () {4415return false;4416};4417NormalMaterial.prototype.getAlphaTestTexture = function () {4418return null;4419};4420// Methods4421NormalMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {4422if (this.isFrozen) {4423if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {4424return true;4425}4426}4427if (!subMesh._materialDefines) {4428subMesh.materialDefines = new NormalMaterialDefines();4429}4430var defines = subMesh.materialDefines;4431var scene = this.getScene();4432if (this._isReadyForSubMesh(subMesh)) {4433return true;4434}4435var engine = scene.getEngine();4436// Textures4437if (defines._areTexturesDirty) {4438defines._needUVs = false;4439if (scene.texturesEnabled) {4440if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {4441if (!this._diffuseTexture.isReady()) {4442return false;4443}4444else {4445defines._needUVs = true;4446defines.DIFFUSE = true;4447}4448}4449}4450}4451// Misc.4452babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);4453// Lights4454defines._needNormals = true;4455babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);4456// Values that need to be evaluated on every frame4457babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);4458defines.LIGHTING = !this._disableLighting;4459// Attribs4460babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);4461// Get correct effect4462if (defines.isDirty) {4463defines.markAsProcessed();4464scene.resetCachedMaterial();4465// Fallbacks4466var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();4467if (defines.FOG) {4468fallbacks.addFallback(1, "FOG");4469}4470babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks);4471if (defines.NUM_BONE_INFLUENCERS > 0) {4472fallbacks.addCPUSkinningFallback(0, mesh);4473}4474defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;4475//Attributes4476var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];4477if (defines.NORMAL) {4478attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);4479}4480if (defines.UV1) {4481attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);4482}4483if (defines.UV2) {4484attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);4485}4486babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);4487babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);4488var shaderName = "normal";4489var join = defines.toString();4490var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor",4491"vFogInfos", "vFogColor", "pointSize",4492"vDiffuseInfos",4493"mBones",4494"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix"4495];4496var samplers = ["diffuseSampler"];4497var uniformBuffers = new Array();4498babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({4499uniformsNames: uniforms,4500uniformBuffersNames: uniformBuffers,4501samplers: samplers,4502defines: defines,4503maxSimultaneousLights: 44504});4505subMesh.setEffect(scene.getEngine().createEffect(shaderName, {4506attributes: attribs,4507uniformsNames: uniforms,4508uniformBuffersNames: uniformBuffers,4509samplers: samplers,4510defines: join,4511fallbacks: fallbacks,4512onCompiled: this.onCompiled,4513onError: this.onError,4514indexParameters: { maxSimultaneousLights: 4 }4515}, engine), defines, this._materialContext);4516}4517if (!subMesh.effect || !subMesh.effect.isReady()) {4518return false;4519}4520defines._renderId = scene.getRenderId();4521subMesh.effect._wasPreviouslyReady = true;4522return true;4523};4524NormalMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {4525var scene = this.getScene();4526var defines = subMesh._materialDefines;4527if (!defines) {4528return;4529}4530var effect = subMesh.effect;4531if (!effect) {4532return;4533}4534this._activeEffect = effect;4535// Matrices4536this.bindOnlyWorldMatrix(world);4537this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());4538// Bones4539babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);4540if (this._mustRebind(scene, effect)) {4541// Textures4542if (this.diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {4543this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);4544this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);4545this._activeEffect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix());4546}4547// Clip plane4548babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);4549// Point size4550if (this.pointsCloud) {4551this._activeEffect.setFloat("pointSize", this.pointSize);4552}4553scene.bindEyePosition(effect);4554}4555this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);4556// Lights4557if (scene.lightsEnabled && !this.disableLighting) {4558babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines);4559}4560// View4561if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {4562this._activeEffect.setMatrix("view", scene.getViewMatrix());4563}4564// Fog4565babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);4566this._afterBind(mesh, this._activeEffect);4567};4568NormalMaterial.prototype.getAnimatables = function () {4569var results = [];4570if (this.diffuseTexture && this.diffuseTexture.animations && this.diffuseTexture.animations.length > 0) {4571results.push(this.diffuseTexture);4572}4573return results;4574};4575NormalMaterial.prototype.getActiveTextures = function () {4576var activeTextures = _super.prototype.getActiveTextures.call(this);4577if (this._diffuseTexture) {4578activeTextures.push(this._diffuseTexture);4579}4580return activeTextures;4581};4582NormalMaterial.prototype.hasTexture = function (texture) {4583if (_super.prototype.hasTexture.call(this, texture)) {4584return true;4585}4586if (this.diffuseTexture === texture) {4587return true;4588}4589return false;4590};4591NormalMaterial.prototype.dispose = function (forceDisposeEffect) {4592if (this.diffuseTexture) {4593this.diffuseTexture.dispose();4594}4595_super.prototype.dispose.call(this, forceDisposeEffect);4596};4597NormalMaterial.prototype.clone = function (name) {4598var _this = this;4599return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new NormalMaterial(name, _this.getScene()); }, this);4600};4601NormalMaterial.prototype.serialize = function () {4602var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);4603serializationObject.customType = "BABYLON.NormalMaterial";4604return serializationObject;4605};4606NormalMaterial.prototype.getClassName = function () {4607return "NormalMaterial";4608};4609// Statics4610NormalMaterial.Parse = function (source, scene, rootUrl) {4611return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new NormalMaterial(source.name, scene); }, source, scene, rootUrl);4612};4613Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4614Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture")4615], NormalMaterial.prototype, "_diffuseTexture", void 0);4616Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4617Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")4618], NormalMaterial.prototype, "diffuseTexture", void 0);4619Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4620Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()4621], NormalMaterial.prototype, "diffuseColor", void 0);4622Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4623Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")4624], NormalMaterial.prototype, "_disableLighting", void 0);4625Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4626Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")4627], NormalMaterial.prototype, "disableLighting", void 0);4628Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4629Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")4630], NormalMaterial.prototype, "_maxSimultaneousLights", void 0);4631Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([4632Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")4633], NormalMaterial.prototype, "maxSimultaneousLights", void 0);4634return NormalMaterial;4635}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));46364637babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.NormalMaterial"] = NormalMaterial;463846394640/***/ }),46414642/***/ "./shadowOnly/index.ts":4643/*!*****************************!*\4644!*** ./shadowOnly/index.ts ***!4645\*****************************/4646/*! exports provided: ShadowOnlyMaterial */4647/***/ (function(module, __webpack_exports__, __webpack_require__) {46484649"use strict";4650__webpack_require__.r(__webpack_exports__);4651/* harmony import */ var _shadowOnlyMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shadowOnlyMaterial */ "./shadowOnly/shadowOnlyMaterial.ts");4652/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return _shadowOnlyMaterial__WEBPACK_IMPORTED_MODULE_0__["ShadowOnlyMaterial"]; });46534654465546564657/***/ }),46584659/***/ "./shadowOnly/shadowOnly.fragment.ts":4660/*!*******************************************!*\4661!*** ./shadowOnly/shadowOnly.fragment.ts ***!4662\*******************************************/4663/*! exports provided: shadowOnlyPixelShader */4664/***/ (function(module, __webpack_exports__, __webpack_require__) {46654666"use strict";4667__webpack_require__.r(__webpack_exports__);4668/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyPixelShader", function() { return shadowOnlyPixelShader; });4669/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");4670/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);4671467246734674467546764677467846794680468146824683var name = 'shadowOnlyPixelShader';4684var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform float alpha;\nuniform vec3 shadowColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include<lightFragment>[0..1]\n\nvec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";4685babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;4686/** @hidden */4687var shadowOnlyPixelShader = { name: name, shader: shader };468846894690/***/ }),46914692/***/ "./shadowOnly/shadowOnly.vertex.ts":4693/*!*****************************************!*\4694!*** ./shadowOnly/shadowOnly.vertex.ts ***!4695\*****************************************/4696/*! exports provided: shadowOnlyVertexShader */4697/***/ (function(module, __webpack_exports__, __webpack_require__) {46984699"use strict";4700__webpack_require__.r(__webpack_exports__);4701/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowOnlyVertexShader", function() { return shadowOnlyVertexShader; });4702/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");4703/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);4704470547064707470847094710471147124713471447154716var name = 'shadowOnlyVertexShader';4717var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";4718babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;4719/** @hidden */4720var shadowOnlyVertexShader = { name: name, shader: shader };472147224723/***/ }),47244725/***/ "./shadowOnly/shadowOnlyMaterial.ts":4726/*!******************************************!*\4727!*** ./shadowOnly/shadowOnlyMaterial.ts ***!4728\******************************************/4729/*! exports provided: ShadowOnlyMaterial */4730/***/ (function(module, __webpack_exports__, __webpack_require__) {47314732"use strict";4733__webpack_require__.r(__webpack_exports__);4734/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShadowOnlyMaterial", function() { return ShadowOnlyMaterial; });4735/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");4736/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");4737/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);4738/* harmony import */ var _shadowOnly_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shadowOnly.fragment */ "./shadowOnly/shadowOnly.fragment.ts");4739/* harmony import */ var _shadowOnly_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shadowOnly.vertex */ "./shadowOnly/shadowOnly.vertex.ts");4740474147424743474447454746474747484749475047514752var ShadowOnlyMaterialDefines = /** @class */ (function (_super) {4753Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowOnlyMaterialDefines, _super);4754function ShadowOnlyMaterialDefines() {4755var _this = _super.call(this) || this;4756_this.CLIPPLANE = false;4757_this.CLIPPLANE2 = false;4758_this.CLIPPLANE3 = false;4759_this.CLIPPLANE4 = false;4760_this.CLIPPLANE5 = false;4761_this.CLIPPLANE6 = false;4762_this.POINTSIZE = false;4763_this.FOG = false;4764_this.NORMAL = false;4765_this.NUM_BONE_INFLUENCERS = 0;4766_this.BonesPerMesh = 0;4767_this.INSTANCES = false;4768_this.IMAGEPROCESSINGPOSTPROCESS = false;4769_this.rebuild();4770return _this;4771}4772return ShadowOnlyMaterialDefines;4773}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));4774var ShadowOnlyMaterial = /** @class */ (function (_super) {4775Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ShadowOnlyMaterial, _super);4776function ShadowOnlyMaterial(name, scene) {4777var _this = _super.call(this, name, scene) || this;4778_this._needAlphaBlending = true;4779_this.shadowColor = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();4780return _this;4781}4782ShadowOnlyMaterial.prototype.needAlphaBlending = function () {4783return this._needAlphaBlending;4784};4785ShadowOnlyMaterial.prototype.needAlphaTesting = function () {4786return false;4787};4788ShadowOnlyMaterial.prototype.getAlphaTestTexture = function () {4789return null;4790};4791Object.defineProperty(ShadowOnlyMaterial.prototype, "activeLight", {4792get: function () {4793return this._activeLight;4794},4795set: function (light) {4796this._activeLight = light;4797},4798enumerable: false,4799configurable: true4800});4801ShadowOnlyMaterial.prototype._getFirstShadowLightForMesh = function (mesh) {4802for (var _i = 0, _a = mesh.lightSources; _i < _a.length; _i++) {4803var light = _a[_i];4804if (light.shadowEnabled) {4805return light;4806}4807}4808return null;4809};4810// Methods4811ShadowOnlyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {4812var _a;4813if (this.isFrozen) {4814if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {4815return true;4816}4817}4818if (!subMesh._materialDefines) {4819subMesh.materialDefines = new ShadowOnlyMaterialDefines();4820}4821var defines = subMesh._materialDefines;4822var scene = this.getScene();4823if (this._isReadyForSubMesh(subMesh)) {4824return true;4825}4826var engine = scene.getEngine();4827// Ensure that active light is the first shadow light4828if (this._activeLight) {4829for (var _i = 0, _b = mesh.lightSources; _i < _b.length; _i++) {4830var light = _b[_i];4831if (light.shadowEnabled) {4832if (this._activeLight === light) {4833break; // We are good4834}4835var lightPosition = mesh.lightSources.indexOf(this._activeLight);4836if (lightPosition !== -1) {4837mesh.lightSources.splice(lightPosition, 1);4838mesh.lightSources.splice(0, 0, this._activeLight);4839}4840break;4841}4842}4843}4844babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);4845babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);4846defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, 1);4847var shadowGenerator = (_a = this._getFirstShadowLightForMesh(mesh)) === null || _a === void 0 ? void 0 : _a.getShadowGenerator();4848this._needAlphaBlending = true;4849if (shadowGenerator && shadowGenerator.getClassName && shadowGenerator.getClassName() === 'CascadedShadowGenerator') {4850var csg = shadowGenerator;4851this._needAlphaBlending = !csg.autoCalcDepthBounds;4852}4853// Attribs4854babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, false, true);4855// Get correct effect4856if (defines.isDirty) {4857defines.markAsProcessed();4858scene.resetCachedMaterial();4859// Fallbacks4860var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();4861if (defines.FOG) {4862fallbacks.addFallback(1, "FOG");4863}4864babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, 1);4865if (defines.NUM_BONE_INFLUENCERS > 0) {4866fallbacks.addCPUSkinningFallback(0, mesh);4867}4868defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;4869//Attributes4870var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];4871if (defines.NORMAL) {4872attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);4873}4874babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);4875babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);4876var shaderName = "shadowOnly";4877var join = defines.toString();4878var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType",4879"vFogInfos", "vFogColor", "pointSize", "alpha", "shadowColor",4880"mBones",4881"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6"4882];4883var samplers = new Array();4884var uniformBuffers = new Array();4885babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({4886uniformsNames: uniforms,4887uniformBuffersNames: uniformBuffers,4888samplers: samplers,4889defines: defines,4890maxSimultaneousLights: 14891});4892subMesh.setEffect(scene.getEngine().createEffect(shaderName, {4893attributes: attribs,4894uniformsNames: uniforms,4895uniformBuffersNames: uniformBuffers,4896samplers: samplers,4897defines: join,4898fallbacks: fallbacks,4899onCompiled: this.onCompiled,4900onError: this.onError,4901indexParameters: { maxSimultaneousLights: 1 }4902}, engine), defines, this._materialContext);4903}4904if (!subMesh.effect || !subMesh.effect.isReady()) {4905return false;4906}4907defines._renderId = scene.getRenderId();4908subMesh.effect._wasPreviouslyReady = true;4909return true;4910};4911ShadowOnlyMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {4912var scene = this.getScene();4913var defines = subMesh._materialDefines;4914if (!defines) {4915return;4916}4917var effect = subMesh.effect;4918if (!effect) {4919return;4920}4921this._activeEffect = effect;4922// Matrices4923this.bindOnlyWorldMatrix(world);4924this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());4925// Bones4926babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);4927if (this._mustRebind(scene, effect)) {4928// Clip plane4929babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);4930// Point size4931if (this.pointsCloud) {4932this._activeEffect.setFloat("pointSize", this.pointSize);4933}4934this._activeEffect.setFloat("alpha", this.alpha);4935this._activeEffect.setColor3("shadowColor", this.shadowColor);4936scene.bindEyePosition(effect);4937}4938// Lights4939if (scene.lightsEnabled) {4940babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, 1);4941var light = this._getFirstShadowLightForMesh(mesh);4942if (light) {4943// Make sure the uniforms for this light will be rebound for other materials using this light when rendering the current frame.4944// Indeed, there is an optimization in Light that binds the light uniforms only once per frame for a given light (if using ubo).4945// Doing this way assumes that all uses of this light are the same, meaning all parameters passed to Light._bindLlight4946// are the same, notably useSpecular. However, isReadyForSubMesh (see above) is passing false for this parameter, which may not be4947// the value the other materials may pass.4948light._renderId = -1;4949}4950}4951// View4952if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE || defines["SHADOWCSM0"]) {4953this._activeEffect.setMatrix("view", scene.getViewMatrix());4954}4955// Fog4956babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);4957this._afterBind(mesh, this._activeEffect);4958};4959ShadowOnlyMaterial.prototype.clone = function (name) {4960var _this = this;4961return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new ShadowOnlyMaterial(name, _this.getScene()); }, this);4962};4963ShadowOnlyMaterial.prototype.serialize = function () {4964var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);4965serializationObject.customType = "BABYLON.ShadowOnlyMaterial";4966return serializationObject;4967};4968ShadowOnlyMaterial.prototype.getClassName = function () {4969return "ShadowOnlyMaterial";4970};4971// Statics4972ShadowOnlyMaterial.Parse = function (source, scene, rootUrl) {4973return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new ShadowOnlyMaterial(source.name, scene); }, source, scene, rootUrl);4974};4975return ShadowOnlyMaterial;4976}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));49774978babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.ShadowOnlyMaterial"] = ShadowOnlyMaterial;497949804981/***/ }),49824983/***/ "./simple/index.ts":4984/*!*************************!*\4985!*** ./simple/index.ts ***!4986\*************************/4987/*! exports provided: SimpleMaterial */4988/***/ (function(module, __webpack_exports__, __webpack_require__) {49894990"use strict";4991__webpack_require__.r(__webpack_exports__);4992/* harmony import */ var _simpleMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./simpleMaterial */ "./simple/simpleMaterial.ts");4993/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return _simpleMaterial__WEBPACK_IMPORTED_MODULE_0__["SimpleMaterial"]; });49944995499649974998/***/ }),49995000/***/ "./simple/simple.fragment.ts":5001/*!***********************************!*\5002!*** ./simple/simple.fragment.ts ***!5003\***********************************/5004/*! exports provided: simplePixelShader */5005/***/ (function(module, __webpack_exports__, __webpack_require__) {50065007"use strict";5008__webpack_require__.r(__webpack_exports__);5009/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simplePixelShader", function() { return simplePixelShader; });5010/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");5011/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);50125013501450155016501750185019502050215022502350245025var name = 'simplePixelShader';5026var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform sampler2D diffuseSampler;\nuniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat 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\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;\n\nvec4 color=vec4(finalDiffuse,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}";5027babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;5028/** @hidden */5029var simplePixelShader = { name: name, shader: shader };503050315032/***/ }),50335034/***/ "./simple/simple.vertex.ts":5035/*!*********************************!*\5036!*** ./simple/simple.vertex.ts ***!5037\*********************************/5038/*! exports provided: simpleVertexShader */5039/***/ (function(module, __webpack_exports__, __webpack_require__) {50405041"use strict";5042__webpack_require__.r(__webpack_exports__);5043/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleVertexShader", function() { return simpleVertexShader; });5044/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");5045/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);5046504750485049505050515052505350545055505650575058var name = 'simpleVertexShader';5059var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";5060babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;5061/** @hidden */5062var simpleVertexShader = { name: name, shader: shader };506350645065/***/ }),50665067/***/ "./simple/simpleMaterial.ts":5068/*!**********************************!*\5069!*** ./simple/simpleMaterial.ts ***!5070\**********************************/5071/*! exports provided: SimpleMaterial */5072/***/ (function(module, __webpack_exports__, __webpack_require__) {50735074"use strict";5075__webpack_require__.r(__webpack_exports__);5076/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleMaterial", function() { return SimpleMaterial; });5077/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");5078/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");5079/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);5080/* harmony import */ var _simple_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./simple.fragment */ "./simple/simple.fragment.ts");5081/* harmony import */ var _simple_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simple.vertex */ "./simple/simple.vertex.ts");50825083508450855086508750885089509050915092509350945095var SimpleMaterialDefines = /** @class */ (function (_super) {5096Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SimpleMaterialDefines, _super);5097function SimpleMaterialDefines() {5098var _this = _super.call(this) || this;5099_this.DIFFUSE = false;5100_this.CLIPPLANE = false;5101_this.CLIPPLANE2 = false;5102_this.CLIPPLANE3 = false;5103_this.CLIPPLANE4 = false;5104_this.CLIPPLANE5 = false;5105_this.CLIPPLANE6 = false;5106_this.ALPHATEST = false;5107_this.DEPTHPREPASS = false;5108_this.POINTSIZE = false;5109_this.FOG = false;5110_this.NORMAL = false;5111_this.UV1 = false;5112_this.UV2 = false;5113_this.VERTEXCOLOR = false;5114_this.VERTEXALPHA = false;5115_this.NUM_BONE_INFLUENCERS = 0;5116_this.BonesPerMesh = 0;5117_this.INSTANCES = false;5118_this.IMAGEPROCESSINGPOSTPROCESS = false;5119_this.rebuild();5120return _this;5121}5122return SimpleMaterialDefines;5123}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));5124var SimpleMaterial = /** @class */ (function (_super) {5125Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SimpleMaterial, _super);5126function SimpleMaterial(name, scene) {5127var _this = _super.call(this, name, scene) || this;5128_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);5129_this._disableLighting = false;5130_this._maxSimultaneousLights = 4;5131return _this;5132}5133SimpleMaterial.prototype.needAlphaBlending = function () {5134return (this.alpha < 1.0);5135};5136SimpleMaterial.prototype.needAlphaTesting = function () {5137return false;5138};5139SimpleMaterial.prototype.getAlphaTestTexture = function () {5140return null;5141};5142// Methods5143SimpleMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {5144if (this.isFrozen) {5145if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {5146return true;5147}5148}5149if (!subMesh._materialDefines) {5150subMesh.materialDefines = new SimpleMaterialDefines();5151}5152var defines = subMesh._materialDefines;5153var scene = this.getScene();5154if (this._isReadyForSubMesh(subMesh)) {5155return true;5156}5157var engine = scene.getEngine();5158// Textures5159if (defines._areTexturesDirty) {5160defines._needUVs = false;5161if (scene.texturesEnabled) {5162if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {5163if (!this._diffuseTexture.isReady()) {5164return false;5165}5166else {5167defines._needUVs = true;5168defines.DIFFUSE = true;5169}5170}5171}5172}5173// Misc.5174babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);5175// Lights5176defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);5177// Values that need to be evaluated on every frame5178babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);5179// Attribs5180babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);5181// Get correct effect5182if (defines.isDirty) {5183defines.markAsProcessed();5184scene.resetCachedMaterial();5185// Fallbacks5186var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();5187if (defines.FOG) {5188fallbacks.addFallback(1, "FOG");5189}5190babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);5191if (defines.NUM_BONE_INFLUENCERS > 0) {5192fallbacks.addCPUSkinningFallback(0, mesh);5193}5194defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;5195//Attributes5196var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];5197if (defines.NORMAL) {5198attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);5199}5200if (defines.UV1) {5201attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);5202}5203if (defines.UV2) {5204attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);5205}5206if (defines.VERTEXCOLOR) {5207attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);5208}5209babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);5210babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);5211var shaderName = "simple";5212var join = defines.toString();5213var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor",5214"vFogInfos", "vFogColor", "pointSize",5215"vDiffuseInfos",5216"mBones",5217"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "diffuseMatrix"5218];5219var samplers = ["diffuseSampler"];5220var uniformBuffers = new Array();5221babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({5222uniformsNames: uniforms,5223uniformBuffersNames: uniformBuffers,5224samplers: samplers,5225defines: defines,5226maxSimultaneousLights: this.maxSimultaneousLights5227});5228subMesh.setEffect(scene.getEngine().createEffect(shaderName, {5229attributes: attribs,5230uniformsNames: uniforms,5231uniformBuffersNames: uniformBuffers,5232samplers: samplers,5233defines: join,5234fallbacks: fallbacks,5235onCompiled: this.onCompiled,5236onError: this.onError,5237indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights - 1 }5238}, engine), defines, this._materialContext);5239}5240if (!subMesh.effect || !subMesh.effect.isReady()) {5241return false;5242}5243defines._renderId = scene.getRenderId();5244subMesh.effect._wasPreviouslyReady = true;5245return true;5246};5247SimpleMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {5248var scene = this.getScene();5249var defines = subMesh._materialDefines;5250if (!defines) {5251return;5252}5253var effect = subMesh.effect;5254if (!effect) {5255return;5256}5257this._activeEffect = effect;5258// Matrices5259this.bindOnlyWorldMatrix(world);5260this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());5261// Bones5262babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);5263if (this._mustRebind(scene, effect)) {5264// Textures5265if (this._diffuseTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {5266this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);5267this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);5268this._activeEffect.setMatrix("diffuseMatrix", this._diffuseTexture.getTextureMatrix());5269}5270// Clip plane5271babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);5272// Point size5273if (this.pointsCloud) {5274this._activeEffect.setFloat("pointSize", this.pointSize);5275}5276scene.bindEyePosition(effect);5277}5278this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);5279// Lights5280if (scene.lightsEnabled && !this.disableLighting) {5281babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);5282}5283// View5284if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {5285this._activeEffect.setMatrix("view", scene.getViewMatrix());5286}5287// Fog5288babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);5289this._afterBind(mesh, this._activeEffect);5290};5291SimpleMaterial.prototype.getAnimatables = function () {5292var results = [];5293if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) {5294results.push(this._diffuseTexture);5295}5296return results;5297};5298SimpleMaterial.prototype.getActiveTextures = function () {5299var activeTextures = _super.prototype.getActiveTextures.call(this);5300if (this._diffuseTexture) {5301activeTextures.push(this._diffuseTexture);5302}5303return activeTextures;5304};5305SimpleMaterial.prototype.hasTexture = function (texture) {5306if (_super.prototype.hasTexture.call(this, texture)) {5307return true;5308}5309if (this.diffuseTexture === texture) {5310return true;5311}5312return false;5313};5314SimpleMaterial.prototype.dispose = function (forceDisposeEffect) {5315if (this._diffuseTexture) {5316this._diffuseTexture.dispose();5317}5318_super.prototype.dispose.call(this, forceDisposeEffect);5319};5320SimpleMaterial.prototype.clone = function (name) {5321var _this = this;5322return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new SimpleMaterial(name, _this.getScene()); }, this);5323};5324SimpleMaterial.prototype.serialize = function () {5325var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);5326serializationObject.customType = "BABYLON.SimpleMaterial";5327return serializationObject;5328};5329SimpleMaterial.prototype.getClassName = function () {5330return "SimpleMaterial";5331};5332// Statics5333SimpleMaterial.Parse = function (source, scene, rootUrl) {5334return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new SimpleMaterial(source.name, scene); }, source, scene, rootUrl);5335};5336Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5337Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture")5338], SimpleMaterial.prototype, "_diffuseTexture", void 0);5339Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5340Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")5341], SimpleMaterial.prototype, "diffuseTexture", void 0);5342Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5343Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])("diffuse")5344], SimpleMaterial.prototype, "diffuseColor", void 0);5345Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5346Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")5347], SimpleMaterial.prototype, "_disableLighting", void 0);5348Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5349Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")5350], SimpleMaterial.prototype, "disableLighting", void 0);5351Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5352Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")5353], SimpleMaterial.prototype, "_maxSimultaneousLights", void 0);5354Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5355Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")5356], SimpleMaterial.prototype, "maxSimultaneousLights", void 0);5357return SimpleMaterial;5358}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));53595360babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.SimpleMaterial"] = SimpleMaterial;536153625363/***/ }),53645365/***/ "./sky/index.ts":5366/*!**********************!*\5367!*** ./sky/index.ts ***!5368\**********************/5369/*! exports provided: SkyMaterial */5370/***/ (function(module, __webpack_exports__, __webpack_require__) {53715372"use strict";5373__webpack_require__.r(__webpack_exports__);5374/* harmony import */ var _skyMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./skyMaterial */ "./sky/skyMaterial.ts");5375/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return _skyMaterial__WEBPACK_IMPORTED_MODULE_0__["SkyMaterial"]; });53765377537853795380/***/ }),53815382/***/ "./sky/sky.fragment.ts":5383/*!*****************************!*\5384!*** ./sky/sky.fragment.ts ***!5385\*****************************/5386/*! exports provided: skyPixelShader */5387/***/ (function(module, __webpack_exports__, __webpack_require__) {53885389"use strict";5390__webpack_require__.r(__webpack_exports__);5391/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyPixelShader", function() { return skyPixelShader; });5392/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");5393/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);5394539553965397539853995400var name = 'skyPixelShader';5401var shader = "precision highp float;\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneFragmentDeclaration>\n\nuniform vec3 cameraPosition;\nuniform vec3 cameraOffset;\nuniform vec3 up;\nuniform float luminance;\nuniform float turbidity;\nuniform float rayleigh;\nuniform float mieCoefficient;\nuniform float mieDirectionalG;\nuniform vec3 sunPosition;\n\n#include<fogFragmentDeclaration>\n\nconst float e=2.71828182845904523536028747135266249775724709369995957;\nconst float pi=3.141592653589793238462643383279502884197169;\nconst float n=1.0003;\nconst float N=2.545E25;\nconst float pn=0.035;\nconst vec3 lambda=vec3(680E-9,550E-9,450E-9);\nconst vec3 K=vec3(0.686,0.678,0.666);\nconst float v=4.0;\nconst float rayleighZenithLength=8.4E3;\nconst float mieZenithLength=1.25E3;\nconst float EE=1000.0;\nconst float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;\nconst float cutoffAngle=pi/1.95;\nconst float steepness=1.5;\nvec3 totalRayleigh(vec3 lambda)\n{\nreturn (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));\n}\nvec3 simplifiedRayleigh()\n{\nreturn 0.0005/vec3(94,40,18);\n}\nfloat rayleighPhase(float cosTheta)\n{\nreturn (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));\n}\nvec3 totalMie(vec3 lambda,vec3 K,float T)\n{\nfloat c=(0.2*T )*10E-18;\nreturn 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;\n}\nfloat hgPhase(float cosTheta,float g)\n{\nreturn (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));\n}\nfloat sunIntensity(float zenithAngleCos)\n{\nreturn EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));\n}\nfloat A=0.15;\nfloat B=0.50;\nfloat C=0.10;\nfloat D=0.20;\nfloat EEE=0.02;\nfloat F=0.30;\nfloat W=1000.0;\nvec3 Uncharted2Tonemap(vec3 x)\n{\nreturn ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;\n}\nvoid main(void) {\n\n#include<clipPlaneFragment>\n\nfloat sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);\nfloat rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));\nvec3 sunDirection=normalize(sunPosition);\nfloat sunE=sunIntensity(dot(sunDirection,up));\nvec3 betaR=simplifiedRayleigh()*rayleighCoefficient;\nvec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;\nfloat zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));\nfloat sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));\nfloat sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));\nvec3 Fex=exp(-(betaR*sR+betaM*sM));\nfloat cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);\nfloat rPhase=rayleighPhase(cosTheta*0.5+0.5);\nvec3 betaRTheta=betaR*rPhase;\nfloat mPhase=hgPhase(cosTheta,mieDirectionalG);\nvec3 betaMTheta=betaM*mPhase;\nvec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));\nLin*=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));\nvec3 direction=normalize(vPositionW-cameraPosition);\nfloat theta=acos(direction.y);\nfloat phi=atan(direction.z,direction.x);\nvec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);\nvec3 L0=vec3(0.1)*Fex;\nfloat sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);\nL0+=(sunE*19000.0*Fex)*sundisk;\nvec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));\nvec3 texColor=(Lin+L0);\ntexColor*=0.04 ;\ntexColor+=vec3(0.0,0.001,0.0025)*0.3;\nfloat g_fMaxLuminance=1.0;\nfloat fLumScaled=0.1/luminance;\nfloat fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled);\nfloat ExposureBias=fLumCompressed;\nvec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);\n\n\n\nvec3 retColor=curr*whiteScale;\n\n\nfloat alpha=1.0;\n#ifdef VERTEXCOLOR\nretColor.rgb*=vColor.rgb;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n\nvec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);\n\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}\n";5402babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;5403/** @hidden */5404var skyPixelShader = { name: name, shader: shader };540554065407/***/ }),54085409/***/ "./sky/sky.vertex.ts":5410/*!***************************!*\5411!*** ./sky/sky.vertex.ts ***!5412\***************************/5413/*! exports provided: skyVertexShader */5414/***/ (function(module, __webpack_exports__, __webpack_require__) {54155416"use strict";5417__webpack_require__.r(__webpack_exports__);5418/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skyVertexShader", function() { return skyVertexShader; });5419/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");5420/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);542154225423542454255426var name = 'skyVertexShader';5427var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n\nuniform mat4 world;\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\nvoid main(void) {\ngl_Position=viewProjection*world*vec4(position,1.0);\nvec4 worldPos=world*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";5428babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;5429/** @hidden */5430var skyVertexShader = { name: name, shader: shader };543154325433/***/ }),54345435/***/ "./sky/skyMaterial.ts":5436/*!****************************!*\5437!*** ./sky/skyMaterial.ts ***!5438\****************************/5439/*! exports provided: SkyMaterial */5440/***/ (function(module, __webpack_exports__, __webpack_require__) {54415442"use strict";5443__webpack_require__.r(__webpack_exports__);5444/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkyMaterial", function() { return SkyMaterial; });5445/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");5446/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");5447/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);5448/* harmony import */ var _sky_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sky.fragment */ "./sky/sky.fragment.ts");5449/* harmony import */ var _sky_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sky.vertex */ "./sky/sky.vertex.ts");5450545154525453545454555456545754585459546054615462/** @hidden */5463var SkyMaterialDefines = /** @class */ (function (_super) {5464Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SkyMaterialDefines, _super);5465function SkyMaterialDefines() {5466var _this = _super.call(this) || this;5467_this.CLIPPLANE = false;5468_this.CLIPPLANE2 = false;5469_this.CLIPPLANE3 = false;5470_this.CLIPPLANE4 = false;5471_this.CLIPPLANE5 = false;5472_this.CLIPPLANE6 = false;5473_this.POINTSIZE = false;5474_this.FOG = false;5475_this.VERTEXCOLOR = false;5476_this.VERTEXALPHA = false;5477_this.IMAGEPROCESSINGPOSTPROCESS = false;5478_this.rebuild();5479return _this;5480}5481return SkyMaterialDefines;5482}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));5483/**5484* This is the sky material which allows to create dynamic and texture free effects for skyboxes.5485* @see https://doc.babylonjs.com/extensions/sky5486*/5487var SkyMaterial = /** @class */ (function (_super) {5488Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SkyMaterial, _super);5489/**5490* Instantiates a new sky material.5491* This material allows to create dynamic and texture free5492* effects for skyboxes by taking care of the atmosphere state.5493* @see https://doc.babylonjs.com/extensions/sky5494* @param name Define the name of the material in the scene5495* @param scene Define the scene the material belong to5496*/5497function SkyMaterial(name, scene) {5498var _this = _super.call(this, name, scene) || this;5499/**5500* Defines the overall luminance of sky in interval ]0, 1[.5501*/5502_this.luminance = 1.0;5503/**5504* Defines the amount (scattering) of haze as opposed to molecules in atmosphere.5505*/5506_this.turbidity = 10.0;5507/**5508* Defines the sky appearance (light intensity).5509*/5510_this.rayleigh = 2.0;5511/**5512* Defines the mieCoefficient in interval [0, 0.1] which affects the property .mieDirectionalG.5513*/5514_this.mieCoefficient = 0.005;5515/**5516* Defines the amount of haze particles following the Mie scattering theory.5517*/5518_this.mieDirectionalG = 0.8;5519/**5520* Defines the distance of the sun according to the active scene camera.5521*/5522_this.distance = 500;5523/**5524* Defines the sun inclination, in interval [-0.5, 0.5]. When the inclination is not 0, the sun is said5525* "inclined".5526*/5527_this.inclination = 0.49;5528/**5529* Defines the solar azimuth in interval [0, 1]. The azimuth is the angle in the horizontal plan between5530* an object direction and a reference direction.5531*/5532_this.azimuth = 0.25;5533/**5534* Defines the sun position in the sky on (x,y,z). If the property .useSunPosition is set to false, then5535* the property is overriden by the inclination and the azimuth and can be read at any moment.5536*/5537_this.sunPosition = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 100, 0);5538/**5539* Defines if the sun position should be computed (inclination and azimuth) according to the given5540* .sunPosition property.5541*/5542_this.useSunPosition = false;5543/**5544* Defines an offset vector used to get a horizon offset.5545* @example skyMaterial.cameraOffset.y = camera.globalPosition.y // Set horizon relative to 0 on the Y axis5546*/5547_this.cameraOffset = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();5548/**5549* Defines the vector the skyMaterial should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up())5550*/5551_this.up = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Up();5552// Private members5553_this._cameraPosition = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();5554_this._skyOrientation = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Quaternion"]();5555return _this;5556}5557/**5558* Specifies if the material will require alpha blending5559* @returns a boolean specifying if alpha blending is needed5560*/5561SkyMaterial.prototype.needAlphaBlending = function () {5562return (this.alpha < 1.0);5563};5564/**5565* Specifies if this material should be rendered in alpha test mode5566* @returns false as the sky material doesn't need alpha testing.5567*/5568SkyMaterial.prototype.needAlphaTesting = function () {5569return false;5570};5571/**5572* Get the texture used for alpha test purpose.5573* @returns null as the sky material has no texture.5574*/5575SkyMaterial.prototype.getAlphaTestTexture = function () {5576return null;5577};5578/**5579* Get if the submesh is ready to be used and all its information available.5580* Child classes can use it to update shaders5581* @param mesh defines the mesh to check5582* @param subMesh defines which submesh to check5583* @param useInstances specifies that instances should be used5584* @returns a boolean indicating that the submesh is ready or not5585*/5586SkyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {5587if (this.isFrozen) {5588if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {5589return true;5590}5591}5592if (!subMesh._materialDefines) {5593subMesh.materialDefines = new SkyMaterialDefines();5594}5595var defines = subMesh._materialDefines;5596var scene = this.getScene();5597if (this._isReadyForSubMesh(subMesh)) {5598return true;5599}5600babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, false, defines);5601// Attribs5602babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, false);5603if (defines.IMAGEPROCESSINGPOSTPROCESS !== scene.imageProcessingConfiguration.applyByPostProcess) {5604defines.markAsMiscDirty();5605}5606// Get correct effect5607if (defines.isDirty) {5608defines.markAsProcessed();5609scene.resetCachedMaterial();5610// Fallbacks5611var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();5612if (defines.FOG) {5613fallbacks.addFallback(1, "FOG");5614}5615defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;5616//Attributes5617var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];5618if (defines.VERTEXCOLOR) {5619attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);5620}5621var shaderName = "sky";5622var join = defines.toString();5623subMesh.setEffect(scene.getEngine().createEffect(shaderName, attribs, ["world", "viewProjection", "view",5624"vFogInfos", "vFogColor", "pointSize", "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6",5625"luminance", "turbidity", "rayleigh", "mieCoefficient", "mieDirectionalG", "sunPosition",5626"cameraPosition", "cameraOffset", "up"5627], [], join, fallbacks, this.onCompiled, this.onError), defines, this._materialContext);5628}5629if (!subMesh.effect || !subMesh.effect.isReady()) {5630return false;5631}5632defines._renderId = scene.getRenderId();5633subMesh.effect._wasPreviouslyReady = true;5634return true;5635};5636/**5637* Binds the submesh to this material by preparing the effect and shader to draw5638* @param world defines the world transformation matrix5639* @param mesh defines the mesh containing the submesh5640* @param subMesh defines the submesh to bind the material to5641*/5642SkyMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {5643var scene = this.getScene();5644var defines = subMesh._materialDefines;5645if (!defines) {5646return;5647}5648var effect = subMesh.effect;5649if (!effect) {5650return;5651}5652this._activeEffect = effect;5653// Matrices5654this.bindOnlyWorldMatrix(world);5655this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());5656if (this._mustRebind(scene, effect)) {5657babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);5658// Point size5659if (this.pointsCloud) {5660this._activeEffect.setFloat("pointSize", this.pointSize);5661}5662}5663// View5664if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {5665this._activeEffect.setMatrix("view", scene.getViewMatrix());5666}5667// Fog5668babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);5669// Sky5670var camera = scene.activeCamera;5671if (camera) {5672var cameraWorldMatrix = camera.getWorldMatrix();5673this._cameraPosition.x = cameraWorldMatrix.m[12];5674this._cameraPosition.y = cameraWorldMatrix.m[13];5675this._cameraPosition.z = cameraWorldMatrix.m[14];5676this._activeEffect.setVector3("cameraPosition", this._cameraPosition);5677}5678this._activeEffect.setVector3("cameraOffset", this.cameraOffset);5679this._activeEffect.setVector3("up", this.up);5680if (this.luminance > 0) {5681this._activeEffect.setFloat("luminance", this.luminance);5682}5683this._activeEffect.setFloat("turbidity", this.turbidity);5684this._activeEffect.setFloat("rayleigh", this.rayleigh);5685this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient);5686this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG);5687if (!this.useSunPosition) {5688var theta = Math.PI * (this.inclination - 0.5);5689var phi = 2 * Math.PI * (this.azimuth - 0.5);5690this.sunPosition.x = this.distance * Math.cos(phi);5691this.sunPosition.y = this.distance * Math.sin(phi) * Math.sin(theta);5692this.sunPosition.z = this.distance * Math.sin(phi) * Math.cos(theta);5693babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Quaternion"].FromUnitVectorsToRef(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].UpReadOnly, this.up, this._skyOrientation);5694this.sunPosition.rotateByQuaternionToRef(this._skyOrientation, this.sunPosition);5695}5696this._activeEffect.setVector3("sunPosition", this.sunPosition);5697this._afterBind(mesh, this._activeEffect);5698};5699/**5700* Get the list of animatables in the material.5701* @returns the list of animatables object used in the material5702*/5703SkyMaterial.prototype.getAnimatables = function () {5704return [];5705};5706/**5707* Disposes the material5708* @param forceDisposeEffect specifies if effects should be forcefully disposed5709*/5710SkyMaterial.prototype.dispose = function (forceDisposeEffect) {5711_super.prototype.dispose.call(this, forceDisposeEffect);5712};5713/**5714* Makes a duplicate of the material, and gives it a new name5715* @param name defines the new name for the duplicated material5716* @returns the cloned material5717*/5718SkyMaterial.prototype.clone = function (name) {5719var _this = this;5720return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new SkyMaterial(name, _this.getScene()); }, this);5721};5722/**5723* Serializes this material in a JSON representation5724* @returns the serialized material object5725*/5726SkyMaterial.prototype.serialize = function () {5727var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);5728serializationObject.customType = "BABYLON.SkyMaterial";5729return serializationObject;5730};5731/**5732* Gets the current class name of the material e.g. "SkyMaterial"5733* Mainly use in serialization.5734* @returns the class name5735*/5736SkyMaterial.prototype.getClassName = function () {5737return "SkyMaterial";5738};5739/**5740* Creates a sky material from parsed material data5741* @param source defines the JSON representation of the material5742* @param scene defines the hosting scene5743* @param rootUrl defines the root URL to use to load textures and relative dependencies5744* @returns a new sky material5745*/5746SkyMaterial.Parse = function (source, scene, rootUrl) {5747return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new SkyMaterial(source.name, scene); }, source, scene, rootUrl);5748};5749Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5750Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5751], SkyMaterial.prototype, "luminance", void 0);5752Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5753Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5754], SkyMaterial.prototype, "turbidity", void 0);5755Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5756Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5757], SkyMaterial.prototype, "rayleigh", void 0);5758Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5759Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5760], SkyMaterial.prototype, "mieCoefficient", void 0);5761Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5762Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5763], SkyMaterial.prototype, "mieDirectionalG", void 0);5764Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5765Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5766], SkyMaterial.prototype, "distance", void 0);5767Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5768Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5769], SkyMaterial.prototype, "inclination", void 0);5770Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5771Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5772], SkyMaterial.prototype, "azimuth", void 0);5773Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5774Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])()5775], SkyMaterial.prototype, "sunPosition", void 0);5776Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5777Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()5778], SkyMaterial.prototype, "useSunPosition", void 0);5779Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5780Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])()5781], SkyMaterial.prototype, "cameraOffset", void 0);5782Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([5783Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector3"])()5784], SkyMaterial.prototype, "up", void 0);5785return SkyMaterial;5786}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));57875788babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.SkyMaterial"] = SkyMaterial;578957905791/***/ }),57925793/***/ "./terrain/index.ts":5794/*!**************************!*\5795!*** ./terrain/index.ts ***!5796\**************************/5797/*! exports provided: TerrainMaterial */5798/***/ (function(module, __webpack_exports__, __webpack_require__) {57995800"use strict";5801__webpack_require__.r(__webpack_exports__);5802/* harmony import */ var _terrainMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./terrainMaterial */ "./terrain/terrainMaterial.ts");5803/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return _terrainMaterial__WEBPACK_IMPORTED_MODULE_0__["TerrainMaterial"]; });58045805580658075808/***/ }),58095810/***/ "./terrain/terrain.fragment.ts":5811/*!*************************************!*\5812!*** ./terrain/terrain.fragment.ts ***!5813\*************************************/5814/*! exports provided: terrainPixelShader */5815/***/ (function(module, __webpack_exports__, __webpack_require__) {58165817"use strict";5818__webpack_require__.r(__webpack_exports__);5819/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainPixelShader", function() { return terrainPixelShader; });5820/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");5821/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);58225823582458255826582758285829583058315832583358345835var name = 'terrainPixelShader';5836var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform sampler2D textureSampler;\nuniform vec2 vTextureInfos;\nuniform sampler2D diffuse1Sampler;\nuniform sampler2D diffuse2Sampler;\nuniform sampler2D diffuse3Sampler;\nuniform vec2 diffuse1Infos;\nuniform vec2 diffuse2Infos;\nuniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;\nuniform sampler2D bump2Sampler;\nuniform sampler2D bump3Sampler;\n#endif\n\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));\nreturn mat3(tangent*invmax,binormal*invmax,normal);\n}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{\nvec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;\nvec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;\nvec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;\nbump1Color.rgb*=mixColor.r;\nbump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);\nvec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);\nmap=map*255./127.-128./127.;\nmat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);\nreturn normalize(TBN*map);\n}\n#endif\nvoid main(void) {\n\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n\nfloat alpha=vDiffuseColor.a;\n\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;\nvec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);\nvec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);\nvec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);\ndiffuse1Color.rgb*=baseColor.r;\ndiffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);\nbaseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\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);\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}\n";5837babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;5838/** @hidden */5839var terrainPixelShader = { name: name, shader: shader };584058415842/***/ }),58435844/***/ "./terrain/terrain.vertex.ts":5845/*!***********************************!*\5846!*** ./terrain/terrain.vertex.ts ***!5847\***********************************/5848/*! exports provided: terrainVertexShader */5849/***/ (function(module, __webpack_exports__, __webpack_require__) {58505851"use strict";5852__webpack_require__.r(__webpack_exports__);5853/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "terrainVertexShader", function() { return terrainVertexShader; });5854/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");5855/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);5856585758585859586058615862586358645865586658675868var name = 'terrainVertexShader';5869var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;\nuniform mat4 textureMatrix;\nuniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";5870babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;5871/** @hidden */5872var terrainVertexShader = { name: name, shader: shader };587358745875/***/ }),58765877/***/ "./terrain/terrainMaterial.ts":5878/*!************************************!*\5879!*** ./terrain/terrainMaterial.ts ***!5880\************************************/5881/*! exports provided: TerrainMaterial */5882/***/ (function(module, __webpack_exports__, __webpack_require__) {58835884"use strict";5885__webpack_require__.r(__webpack_exports__);5886/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TerrainMaterial", function() { return TerrainMaterial; });5887/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");5888/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");5889/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);5890/* harmony import */ var _terrain_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./terrain.fragment */ "./terrain/terrain.fragment.ts");5891/* harmony import */ var _terrain_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./terrain.vertex */ "./terrain/terrain.vertex.ts");58925893589458955896589758985899590059015902590359045905var TerrainMaterialDefines = /** @class */ (function (_super) {5906Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TerrainMaterialDefines, _super);5907function TerrainMaterialDefines() {5908var _this = _super.call(this) || this;5909_this.DIFFUSE = false;5910_this.BUMP = false;5911_this.CLIPPLANE = false;5912_this.CLIPPLANE2 = false;5913_this.CLIPPLANE3 = false;5914_this.CLIPPLANE4 = false;5915_this.CLIPPLANE5 = false;5916_this.CLIPPLANE6 = false;5917_this.ALPHATEST = false;5918_this.DEPTHPREPASS = false;5919_this.POINTSIZE = false;5920_this.FOG = false;5921_this.SPECULARTERM = false;5922_this.NORMAL = false;5923_this.UV1 = false;5924_this.UV2 = false;5925_this.VERTEXCOLOR = false;5926_this.VERTEXALPHA = false;5927_this.NUM_BONE_INFLUENCERS = 0;5928_this.BonesPerMesh = 0;5929_this.INSTANCES = false;5930_this.IMAGEPROCESSINGPOSTPROCESS = false;5931_this.rebuild();5932return _this;5933}5934return TerrainMaterialDefines;5935}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));5936var TerrainMaterial = /** @class */ (function (_super) {5937Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TerrainMaterial, _super);5938function TerrainMaterial(name, scene) {5939var _this = _super.call(this, name, scene) || this;5940_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);5941_this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 0);5942_this.specularPower = 64;5943_this._disableLighting = false;5944_this._maxSimultaneousLights = 4;5945return _this;5946}5947TerrainMaterial.prototype.needAlphaBlending = function () {5948return (this.alpha < 1.0);5949};5950TerrainMaterial.prototype.needAlphaTesting = function () {5951return false;5952};5953TerrainMaterial.prototype.getAlphaTestTexture = function () {5954return null;5955};5956// Methods5957TerrainMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {5958if (this.isFrozen) {5959if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {5960return true;5961}5962}5963if (!subMesh._materialDefines) {5964subMesh.materialDefines = new TerrainMaterialDefines();5965}5966var defines = subMesh._materialDefines;5967var scene = this.getScene();5968if (this._isReadyForSubMesh(subMesh)) {5969return true;5970}5971var engine = scene.getEngine();5972// Textures5973if (scene.texturesEnabled) {5974if (!this.mixTexture || !this.mixTexture.isReady()) {5975return false;5976}5977defines._needUVs = true;5978if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {5979if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) {5980return false;5981}5982if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) {5983return false;5984}5985if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) {5986return false;5987}5988defines.DIFFUSE = true;5989}5990if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) {5991if (!this.bumpTexture1.isReady()) {5992return false;5993}5994if (!this.bumpTexture2.isReady()) {5995return false;5996}5997if (!this.bumpTexture3.isReady()) {5998return false;5999}6000defines._needNormals = true;6001defines.BUMP = true;6002}6003}6004// Misc.6005babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);6006// Lights6007defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);6008// Values that need to be evaluated on every frame6009babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);6010// Attribs6011babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);6012// Get correct effect6013if (defines.isDirty) {6014defines.markAsProcessed();6015scene.resetCachedMaterial();6016// Fallbacks6017var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();6018if (defines.FOG) {6019fallbacks.addFallback(1, "FOG");6020}6021babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);6022if (defines.NUM_BONE_INFLUENCERS > 0) {6023fallbacks.addCPUSkinningFallback(0, mesh);6024}6025defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;6026//Attributes6027var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];6028if (defines.NORMAL) {6029attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);6030}6031if (defines.UV1) {6032attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);6033}6034if (defines.UV2) {6035attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);6036}6037if (defines.VERTEXCOLOR) {6038attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);6039}6040babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);6041babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);6042// Legacy browser patch6043var shaderName = "terrain";6044var join = defines.toString();6045var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",6046"vFogInfos", "vFogColor", "pointSize",6047"vTextureInfos",6048"mBones",6049"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "textureMatrix",6050"diffuse1Infos", "diffuse2Infos", "diffuse3Infos"6051];6052var samplers = ["textureSampler", "diffuse1Sampler", "diffuse2Sampler", "diffuse3Sampler",6053"bump1Sampler", "bump2Sampler", "bump3Sampler"6054];6055var uniformBuffers = new Array();6056babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({6057uniformsNames: uniforms,6058uniformBuffersNames: uniformBuffers,6059samplers: samplers,6060defines: defines,6061maxSimultaneousLights: this.maxSimultaneousLights6062});6063subMesh.setEffect(scene.getEngine().createEffect(shaderName, {6064attributes: attribs,6065uniformsNames: uniforms,6066uniformBuffersNames: uniformBuffers,6067samplers: samplers,6068defines: join,6069fallbacks: fallbacks,6070onCompiled: this.onCompiled,6071onError: this.onError,6072indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }6073}, engine), defines, this._materialContext);6074}6075if (!subMesh.effect || !subMesh.effect.isReady()) {6076return false;6077}6078defines._renderId = scene.getRenderId();6079subMesh.effect._wasPreviouslyReady = true;6080return true;6081};6082TerrainMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {6083var scene = this.getScene();6084var defines = subMesh._materialDefines;6085if (!defines) {6086return;6087}6088var effect = subMesh.effect;6089if (!effect) {6090return;6091}6092this._activeEffect = effect;6093// Matrices6094this.bindOnlyWorldMatrix(world);6095this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());6096// Bones6097babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);6098if (this._mustRebind(scene, effect)) {6099// Textures6100if (this.mixTexture) {6101this._activeEffect.setTexture("textureSampler", this._mixTexture);6102this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level);6103this._activeEffect.setMatrix("textureMatrix", this._mixTexture.getTextureMatrix());6104if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {6105if (this._diffuseTexture1) {6106this._activeEffect.setTexture("diffuse1Sampler", this._diffuseTexture1);6107this._activeEffect.setFloat2("diffuse1Infos", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale);6108}6109if (this._diffuseTexture2) {6110this._activeEffect.setTexture("diffuse2Sampler", this._diffuseTexture2);6111this._activeEffect.setFloat2("diffuse2Infos", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale);6112}6113if (this._diffuseTexture3) {6114this._activeEffect.setTexture("diffuse3Sampler", this._diffuseTexture3);6115this._activeEffect.setFloat2("diffuse3Infos", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale);6116}6117}6118if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled && scene.getEngine().getCaps().standardDerivatives) {6119if (this._bumpTexture1) {6120this._activeEffect.setTexture("bump1Sampler", this._bumpTexture1);6121}6122if (this._bumpTexture2) {6123this._activeEffect.setTexture("bump2Sampler", this._bumpTexture2);6124}6125if (this._bumpTexture3) {6126this._activeEffect.setTexture("bump3Sampler", this._bumpTexture3);6127}6128}6129}6130// Clip plane6131babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);6132// Point size6133if (this.pointsCloud) {6134this._activeEffect.setFloat("pointSize", this.pointSize);6135}6136scene.bindEyePosition(effect);6137}6138this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);6139if (defines.SPECULARTERM) {6140this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);6141}6142if (scene.lightsEnabled && !this.disableLighting) {6143babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);6144}6145// View6146if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {6147this._activeEffect.setMatrix("view", scene.getViewMatrix());6148}6149// Fog6150babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);6151this._afterBind(mesh, this._activeEffect);6152};6153TerrainMaterial.prototype.getAnimatables = function () {6154var results = [];6155if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {6156results.push(this.mixTexture);6157}6158return results;6159};6160TerrainMaterial.prototype.getActiveTextures = function () {6161var activeTextures = _super.prototype.getActiveTextures.call(this);6162if (this._mixTexture) {6163activeTextures.push(this._mixTexture);6164}6165if (this._diffuseTexture1) {6166activeTextures.push(this._diffuseTexture1);6167}6168if (this._diffuseTexture2) {6169activeTextures.push(this._diffuseTexture2);6170}6171if (this._diffuseTexture3) {6172activeTextures.push(this._diffuseTexture3);6173}6174if (this._bumpTexture1) {6175activeTextures.push(this._bumpTexture1);6176}6177if (this._bumpTexture2) {6178activeTextures.push(this._bumpTexture2);6179}6180if (this._bumpTexture3) {6181activeTextures.push(this._bumpTexture3);6182}6183return activeTextures;6184};6185TerrainMaterial.prototype.hasTexture = function (texture) {6186if (_super.prototype.hasTexture.call(this, texture)) {6187return true;6188}6189if (this._mixTexture === texture) {6190return true;6191}6192if (this._diffuseTexture1 === texture) {6193return true;6194}6195if (this._diffuseTexture2 === texture) {6196return true;6197}6198if (this._diffuseTexture3 === texture) {6199return true;6200}6201if (this._bumpTexture1 === texture) {6202return true;6203}6204if (this._bumpTexture2 === texture) {6205return true;6206}6207if (this._bumpTexture3 === texture) {6208return true;6209}6210return false;6211};6212TerrainMaterial.prototype.dispose = function (forceDisposeEffect) {6213if (this.mixTexture) {6214this.mixTexture.dispose();6215}6216_super.prototype.dispose.call(this, forceDisposeEffect);6217};6218TerrainMaterial.prototype.clone = function (name) {6219var _this = this;6220return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new TerrainMaterial(name, _this.getScene()); }, this);6221};6222TerrainMaterial.prototype.serialize = function () {6223var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);6224serializationObject.customType = "BABYLON.TerrainMaterial";6225return serializationObject;6226};6227TerrainMaterial.prototype.getClassName = function () {6228return "TerrainMaterial";6229};6230// Statics6231TerrainMaterial.Parse = function (source, scene, rootUrl) {6232return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new TerrainMaterial(source.name, scene); }, source, scene, rootUrl);6233};6234Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6235Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("mixTexture")6236], TerrainMaterial.prototype, "_mixTexture", void 0);6237Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6238Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6239], TerrainMaterial.prototype, "mixTexture", void 0);6240Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6241Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture1")6242], TerrainMaterial.prototype, "_diffuseTexture1", void 0);6243Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6244Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6245], TerrainMaterial.prototype, "diffuseTexture1", void 0);6246Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6247Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture2")6248], TerrainMaterial.prototype, "_diffuseTexture2", void 0);6249Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6250Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6251], TerrainMaterial.prototype, "diffuseTexture2", void 0);6252Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6253Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexture3")6254], TerrainMaterial.prototype, "_diffuseTexture3", void 0);6255Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6256Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6257], TerrainMaterial.prototype, "diffuseTexture3", void 0);6258Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6259Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture1")6260], TerrainMaterial.prototype, "_bumpTexture1", void 0);6261Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6262Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6263], TerrainMaterial.prototype, "bumpTexture1", void 0);6264Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6265Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture2")6266], TerrainMaterial.prototype, "_bumpTexture2", void 0);6267Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6268Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6269], TerrainMaterial.prototype, "bumpTexture2", void 0);6270Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6271Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture3")6272], TerrainMaterial.prototype, "_bumpTexture3", void 0);6273Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6274Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6275], TerrainMaterial.prototype, "bumpTexture3", void 0);6276Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6277Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()6278], TerrainMaterial.prototype, "diffuseColor", void 0);6279Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6280Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()6281], TerrainMaterial.prototype, "specularColor", void 0);6282Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6283Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()6284], TerrainMaterial.prototype, "specularPower", void 0);6285Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6286Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")6287], TerrainMaterial.prototype, "_disableLighting", void 0);6288Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6289Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")6290], TerrainMaterial.prototype, "disableLighting", void 0);6291Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6292Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")6293], TerrainMaterial.prototype, "_maxSimultaneousLights", void 0);6294Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6295Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")6296], TerrainMaterial.prototype, "maxSimultaneousLights", void 0);6297return TerrainMaterial;6298}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));62996300babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.TerrainMaterial"] = TerrainMaterial;630163026303/***/ }),63046305/***/ "./triPlanar/index.ts":6306/*!****************************!*\6307!*** ./triPlanar/index.ts ***!6308\****************************/6309/*! exports provided: TriPlanarMaterial */6310/***/ (function(module, __webpack_exports__, __webpack_require__) {63116312"use strict";6313__webpack_require__.r(__webpack_exports__);6314/* harmony import */ var _triPlanarMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./triPlanarMaterial */ "./triPlanar/triPlanarMaterial.ts");6315/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return _triPlanarMaterial__WEBPACK_IMPORTED_MODULE_0__["TriPlanarMaterial"]; });63166317631863196320/***/ }),63216322/***/ "./triPlanar/triPlanarMaterial.ts":6323/*!****************************************!*\6324!*** ./triPlanar/triPlanarMaterial.ts ***!6325\****************************************/6326/*! exports provided: TriPlanarMaterial */6327/***/ (function(module, __webpack_exports__, __webpack_require__) {63286329"use strict";6330__webpack_require__.r(__webpack_exports__);6331/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriPlanarMaterial", function() { return TriPlanarMaterial; });6332/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");6333/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");6334/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);6335/* harmony import */ var _triplanar_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./triplanar.fragment */ "./triPlanar/triplanar.fragment.ts");6336/* harmony import */ var _triplanar_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./triplanar.vertex */ "./triPlanar/triplanar.vertex.ts");63376338633963406341634263436344634563466347634863496350var TriPlanarMaterialDefines = /** @class */ (function (_super) {6351Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TriPlanarMaterialDefines, _super);6352function TriPlanarMaterialDefines() {6353var _this = _super.call(this) || this;6354_this.DIFFUSEX = false;6355_this.DIFFUSEY = false;6356_this.DIFFUSEZ = false;6357_this.BUMPX = false;6358_this.BUMPY = false;6359_this.BUMPZ = false;6360_this.CLIPPLANE = false;6361_this.CLIPPLANE2 = false;6362_this.CLIPPLANE3 = false;6363_this.CLIPPLANE4 = false;6364_this.CLIPPLANE5 = false;6365_this.CLIPPLANE6 = false;6366_this.ALPHATEST = false;6367_this.DEPTHPREPASS = false;6368_this.POINTSIZE = false;6369_this.FOG = false;6370_this.SPECULARTERM = false;6371_this.NORMAL = false;6372_this.VERTEXCOLOR = false;6373_this.VERTEXALPHA = false;6374_this.NUM_BONE_INFLUENCERS = 0;6375_this.BonesPerMesh = 0;6376_this.INSTANCES = false;6377_this.IMAGEPROCESSINGPOSTPROCESS = false;6378_this.rebuild();6379return _this;6380}6381return TriPlanarMaterialDefines;6382}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));6383var TriPlanarMaterial = /** @class */ (function (_super) {6384Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TriPlanarMaterial, _super);6385function TriPlanarMaterial(name, scene) {6386var _this = _super.call(this, name, scene) || this;6387_this.tileSize = 1;6388_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);6389_this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.2, 0.2, 0.2);6390_this.specularPower = 64;6391_this._disableLighting = false;6392_this._maxSimultaneousLights = 4;6393return _this;6394}6395TriPlanarMaterial.prototype.needAlphaBlending = function () {6396return (this.alpha < 1.0);6397};6398TriPlanarMaterial.prototype.needAlphaTesting = function () {6399return false;6400};6401TriPlanarMaterial.prototype.getAlphaTestTexture = function () {6402return null;6403};6404// Methods6405TriPlanarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {6406if (this.isFrozen) {6407if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {6408return true;6409}6410}6411if (!subMesh._materialDefines) {6412subMesh.materialDefines = new TriPlanarMaterialDefines();6413}6414var defines = subMesh._materialDefines;6415var scene = this.getScene();6416if (this._isReadyForSubMesh(subMesh)) {6417return true;6418}6419var engine = scene.getEngine();6420// Textures6421if (defines._areTexturesDirty) {6422if (scene.texturesEnabled) {6423if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].DiffuseTextureEnabled) {6424var textures = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ];6425var textureDefines = ["DIFFUSEX", "DIFFUSEY", "DIFFUSEZ"];6426for (var i = 0; i < textures.length; i++) {6427if (textures[i]) {6428if (!textures[i].isReady()) {6429return false;6430}6431else {6432defines[textureDefines[i]] = true;6433}6434}6435}6436}6437if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) {6438var textures = [this.normalTextureX, this.normalTextureY, this.normalTextureZ];6439var textureDefines = ["BUMPX", "BUMPY", "BUMPZ"];6440for (var i = 0; i < textures.length; i++) {6441if (textures[i]) {6442if (!textures[i].isReady()) {6443return false;6444}6445else {6446defines[textureDefines[i]] = true;6447}6448}6449}6450}6451}6452}6453// Misc.6454babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);6455// Lights6456defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);6457// Values that need to be evaluated on every frame6458babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);6459// Attribs6460babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);6461// Get correct effect6462if (defines.isDirty) {6463defines.markAsProcessed();6464scene.resetCachedMaterial();6465// Fallbacks6466var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();6467if (defines.FOG) {6468fallbacks.addFallback(1, "FOG");6469}6470babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);6471if (defines.NUM_BONE_INFLUENCERS > 0) {6472fallbacks.addCPUSkinningFallback(0, mesh);6473}6474defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;6475//Attributes6476var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];6477if (defines.NORMAL) {6478attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);6479}6480if (defines.VERTEXCOLOR) {6481attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);6482}6483babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);6484babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);6485// Legacy browser patch6486var shaderName = "triplanar";6487var join = defines.toString();6488var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",6489"vFogInfos", "vFogColor", "pointSize",6490"mBones",6491"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6",6492"tileSize"6493];6494var samplers = ["diffuseSamplerX", "diffuseSamplerY", "diffuseSamplerZ",6495"normalSamplerX", "normalSamplerY", "normalSamplerZ"6496];6497var uniformBuffers = new Array();6498babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({6499uniformsNames: uniforms,6500uniformBuffersNames: uniformBuffers,6501samplers: samplers,6502defines: defines,6503maxSimultaneousLights: this.maxSimultaneousLights6504});6505subMesh.setEffect(scene.getEngine().createEffect(shaderName, {6506attributes: attribs,6507uniformsNames: uniforms,6508uniformBuffersNames: uniformBuffers,6509samplers: samplers,6510defines: join,6511fallbacks: fallbacks,6512onCompiled: this.onCompiled,6513onError: this.onError,6514indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights }6515}, engine), defines, this._materialContext);6516}6517if (!subMesh.effect || !subMesh.effect.isReady()) {6518return false;6519}6520defines._renderId = scene.getRenderId();6521subMesh.effect._wasPreviouslyReady = true;6522return true;6523};6524TriPlanarMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {6525var scene = this.getScene();6526var defines = subMesh._materialDefines;6527if (!defines) {6528return;6529}6530var effect = subMesh.effect;6531if (!effect) {6532return;6533}6534this._activeEffect = effect;6535// Matrices6536this.bindOnlyWorldMatrix(world);6537this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());6538// Bones6539babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);6540this._activeEffect.setFloat("tileSize", this.tileSize);6541if (scene.getCachedMaterial() !== this) {6542// Textures6543if (this.diffuseTextureX) {6544this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX);6545}6546if (this.diffuseTextureY) {6547this._activeEffect.setTexture("diffuseSamplerY", this.diffuseTextureY);6548}6549if (this.diffuseTextureZ) {6550this._activeEffect.setTexture("diffuseSamplerZ", this.diffuseTextureZ);6551}6552if (this.normalTextureX) {6553this._activeEffect.setTexture("normalSamplerX", this.normalTextureX);6554}6555if (this.normalTextureY) {6556this._activeEffect.setTexture("normalSamplerY", this.normalTextureY);6557}6558if (this.normalTextureZ) {6559this._activeEffect.setTexture("normalSamplerZ", this.normalTextureZ);6560}6561// Clip plane6562babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);6563// Point size6564if (this.pointsCloud) {6565this._activeEffect.setFloat("pointSize", this.pointSize);6566}6567scene.bindEyePosition(effect);6568}6569this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);6570if (defines.SPECULARTERM) {6571this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);6572}6573if (scene.lightsEnabled && !this.disableLighting) {6574babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);6575}6576// View6577if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {6578this._activeEffect.setMatrix("view", scene.getViewMatrix());6579}6580// Fog6581babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);6582this._afterBind(mesh, this._activeEffect);6583};6584TriPlanarMaterial.prototype.getAnimatables = function () {6585var results = [];6586if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {6587results.push(this.mixTexture);6588}6589return results;6590};6591TriPlanarMaterial.prototype.getActiveTextures = function () {6592var activeTextures = _super.prototype.getActiveTextures.call(this);6593if (this._diffuseTextureX) {6594activeTextures.push(this._diffuseTextureX);6595}6596if (this._diffuseTextureY) {6597activeTextures.push(this._diffuseTextureY);6598}6599if (this._diffuseTextureZ) {6600activeTextures.push(this._diffuseTextureZ);6601}6602if (this._normalTextureX) {6603activeTextures.push(this._normalTextureX);6604}6605if (this._normalTextureY) {6606activeTextures.push(this._normalTextureY);6607}6608if (this._normalTextureZ) {6609activeTextures.push(this._normalTextureZ);6610}6611return activeTextures;6612};6613TriPlanarMaterial.prototype.hasTexture = function (texture) {6614if (_super.prototype.hasTexture.call(this, texture)) {6615return true;6616}6617if (this._diffuseTextureX === texture) {6618return true;6619}6620if (this._diffuseTextureY === texture) {6621return true;6622}6623if (this._diffuseTextureZ === texture) {6624return true;6625}6626if (this._normalTextureX === texture) {6627return true;6628}6629if (this._normalTextureY === texture) {6630return true;6631}6632if (this._normalTextureZ === texture) {6633return true;6634}6635return false;6636};6637TriPlanarMaterial.prototype.dispose = function (forceDisposeEffect) {6638if (this.mixTexture) {6639this.mixTexture.dispose();6640}6641_super.prototype.dispose.call(this, forceDisposeEffect);6642};6643TriPlanarMaterial.prototype.clone = function (name) {6644var _this = this;6645return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new TriPlanarMaterial(name, _this.getScene()); }, this);6646};6647TriPlanarMaterial.prototype.serialize = function () {6648var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);6649serializationObject.customType = "BABYLON.TriPlanarMaterial";6650return serializationObject;6651};6652TriPlanarMaterial.prototype.getClassName = function () {6653return "TriPlanarMaterial";6654};6655// Statics6656TriPlanarMaterial.Parse = function (source, scene, rootUrl) {6657return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new TriPlanarMaterial(source.name, scene); }, source, scene, rootUrl);6658};6659Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6660Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])()6661], TriPlanarMaterial.prototype, "mixTexture", void 0);6662Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6663Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTextureX")6664], TriPlanarMaterial.prototype, "_diffuseTextureX", void 0);6665Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6666Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6667], TriPlanarMaterial.prototype, "diffuseTextureX", void 0);6668Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6669Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTexturY")6670], TriPlanarMaterial.prototype, "_diffuseTextureY", void 0);6671Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6672Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6673], TriPlanarMaterial.prototype, "diffuseTextureY", void 0);6674Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6675Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("diffuseTextureZ")6676], TriPlanarMaterial.prototype, "_diffuseTextureZ", void 0);6677Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6678Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6679], TriPlanarMaterial.prototype, "diffuseTextureZ", void 0);6680Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6681Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("normalTextureX")6682], TriPlanarMaterial.prototype, "_normalTextureX", void 0);6683Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6684Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6685], TriPlanarMaterial.prototype, "normalTextureX", void 0);6686Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6687Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("normalTextureY")6688], TriPlanarMaterial.prototype, "_normalTextureY", void 0);6689Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6690Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6691], TriPlanarMaterial.prototype, "normalTextureY", void 0);6692Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6693Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("normalTextureZ")6694], TriPlanarMaterial.prototype, "_normalTextureZ", void 0);6695Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6696Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")6697], TriPlanarMaterial.prototype, "normalTextureZ", void 0);6698Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6699Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()6700], TriPlanarMaterial.prototype, "tileSize", void 0);6701Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6702Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()6703], TriPlanarMaterial.prototype, "diffuseColor", void 0);6704Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6705Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()6706], TriPlanarMaterial.prototype, "specularColor", void 0);6707Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6708Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()6709], TriPlanarMaterial.prototype, "specularPower", void 0);6710Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6711Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")6712], TriPlanarMaterial.prototype, "_disableLighting", void 0);6713Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6714Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")6715], TriPlanarMaterial.prototype, "disableLighting", void 0);6716Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6717Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")6718], TriPlanarMaterial.prototype, "_maxSimultaneousLights", void 0);6719Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([6720Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")6721], TriPlanarMaterial.prototype, "maxSimultaneousLights", void 0);6722return TriPlanarMaterial;6723}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));67246725babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.TriPlanarMaterial"] = TriPlanarMaterial;672667276728/***/ }),67296730/***/ "./triPlanar/triplanar.fragment.ts":6731/*!*****************************************!*\6732!*** ./triPlanar/triplanar.fragment.ts ***!6733\*****************************************/6734/*! exports provided: triplanarPixelShader */6735/***/ (function(module, __webpack_exports__, __webpack_require__) {67366737"use strict";6738__webpack_require__.r(__webpack_exports__);6739/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarPixelShader", function() { return triplanarPixelShader; });6740/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");6741/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);67426743674467456746674767486749675067516752675367546755var name = 'triplanarPixelShader';6756var shader = "precision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\nuniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\nuniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\nuniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\nvoid main(void) {\n\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(0.,0.,0.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\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);\nnormalW*=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#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularBase=vec3(0.,0.,0.);\nvec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef VERTEXALPHA\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;\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}\n";6757babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;6758/** @hidden */6759var triplanarPixelShader = { name: name, shader: shader };676067616762/***/ }),67636764/***/ "./triPlanar/triplanar.vertex.ts":6765/*!***************************************!*\6766!*** ./triPlanar/triplanar.vertex.ts ***!6767\***************************************/6768/*! exports provided: triplanarVertexShader */6769/***/ (function(module, __webpack_exports__, __webpack_require__) {67706771"use strict";6772__webpack_require__.r(__webpack_exports__);6773/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "triplanarVertexShader", function() { return triplanarVertexShader; });6774/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");6775/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);6776677767786779678067816782678367846785678667876788var name = 'triplanarVertexShader';6789var shader = "precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform 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\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\nvoid main(void)\n{\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\nvPositionW=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\n\nvec3 xtan=vec3(0,0,1);\nvec3 xbin=vec3(0,1,0);\nvec3 ytan=vec3(1,0,0);\nvec3 ybin=vec3(0,0,1);\nvec3 ztan=vec3(1,0,0);\nvec3 zbin=vec3(0,1,0);\nvec3 normalizedNormal=normalize(normal);\nnormalizedNormal*=normalizedNormal;\nvec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);\nvec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);\nworldTangent=(world*vec4(worldTangent,0.0)).xyz;\nworldBinormal=(world*vec4(worldBinormal,0.0)).xyz;\nvec3 worldNormal=(world*vec4(normalize(normal),0.0)).xyz;\ntangentSpace[0]=worldTangent;\ntangentSpace[1]=worldBinormal;\ntangentSpace[2]=worldNormal;\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n";6790babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;6791/** @hidden */6792var triplanarVertexShader = { name: name, shader: shader };679367946795/***/ }),67966797/***/ "./water/index.ts":6798/*!************************!*\6799!*** ./water/index.ts ***!6800\************************/6801/*! exports provided: WaterMaterial */6802/***/ (function(module, __webpack_exports__, __webpack_require__) {68036804"use strict";6805__webpack_require__.r(__webpack_exports__);6806/* harmony import */ var _waterMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./waterMaterial */ "./water/waterMaterial.ts");6807/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return _waterMaterial__WEBPACK_IMPORTED_MODULE_0__["WaterMaterial"]; });68086809681068116812/***/ }),68136814/***/ "./water/water.fragment.ts":6815/*!*********************************!*\6816!*** ./water/water.fragment.ts ***!6817\*********************************/6818/*! exports provided: waterPixelShader */6819/***/ (function(module, __webpack_exports__, __webpack_require__) {68206821"use strict";6822__webpack_require__.r(__webpack_exports__);6823/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterPixelShader", function() { return waterPixelShader; });6824/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");6825/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);6826682768286829683068316832683368346835683668376838683968406841var name = 'waterPixelShader';6842var shader = "#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;\n\nuniform vec4 vEyePosition;\nuniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform sampler2D normalSampler;\nuniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;\nuniform sampler2D reflectionSampler;\n\nconst float LOG2=1.442695;\nuniform vec3 cameraPosition;\nuniform vec4 waterColor;\nuniform float colorBlendFactor;\nuniform vec4 waterColor2;\nuniform float colorBlendFactor2;\nuniform float bumpHeight;\nuniform float time;\n\nvarying vec3 vRefractionMapTexCoord;\nvarying vec3 vReflectionMapTexCoord;\nvarying vec3 vPosition;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat 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#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\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));\nif (normalW.y<0.0) {\nnormalW.y=-normalW.y;\n}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\nvec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\n\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);\nvec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=clamp(vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n),0.0,1.0);\nvec4 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);\nfloat fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);\nfloat IfresnelTerm=1.0-fresnelTerm;\nrefractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;\nreflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;\nvec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;\nbaseColor=combinedColor;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularBase=vec3(0.,0.,0.);\nvec3 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#ifdef VERTEXALPHA\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\n\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);\nvec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=clamp(vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation,0.0,1.0);\nvec4 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);\nfloat fresnelTerm=max(dot(viewDirectionW,upVector),0.0);\nvec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);\nbaseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularBase=vec3(0.,0.,0.);\nvec3 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#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#endif\n\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n}\n";6843babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;6844/** @hidden */6845var waterPixelShader = { name: name, shader: shader };684668476848/***/ }),68496850/***/ "./water/water.vertex.ts":6851/*!*******************************!*\6852!*** ./water/water.vertex.ts ***!6853\*******************************/6854/*! exports provided: waterVertexShader */6855/***/ (function(module, __webpack_exports__, __webpack_require__) {68566857"use strict";6858__webpack_require__.r(__webpack_exports__);6859/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waterVertexShader", function() { return waterVertexShader; });6860/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/shaderStore */ "babylonjs/Misc/decorators");6861/* harmony import */ var babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);686268636864686568666867686868696870687168726873687468756876var name = 'waterVertexShader';6877var shader = "precision highp float;\n\nattribute 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\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;\nuniform vec2 vNormalInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\n\nuniform mat4 worldReflectionViewProjection;\nuniform vec2 windDirection;\nuniform float waveLength;\nuniform float time;\nuniform float windForce;\nuniform float waveHeight;\nuniform float waveSpeed;\nuniform float waveCount;\n\nvarying vec3 vPosition;\nvarying vec3 vRefractionMapTexCoord;\nvarying vec3 vReflectionMapTexCoord;\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\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{\nvNormalUV=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{\nvNormalUV=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\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\nvec3 p=position;\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);\np.y+=abs(newY);\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#ifdef REFLECTION\nworldPos=viewProjection*finalWorld*vec4(p,1.0);\n\nvPosition=position;\nvRefractionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);\nvRefractionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);\nvRefractionMapTexCoord.z=worldPos.w;\nworldPos=worldReflectionViewProjection*vec4(position,1.0);\nvReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);\nvReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);\nvReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include<logDepthVertex>\n}\n";6878babylonjs_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__["ShaderStore"].ShadersStore[name] = shader;6879/** @hidden */6880var waterVertexShader = { name: name, shader: shader };688168826883/***/ }),68846885/***/ "./water/waterMaterial.ts":6886/*!********************************!*\6887!*** ./water/waterMaterial.ts ***!6888\********************************/6889/*! exports provided: WaterMaterial */6890/***/ (function(module, __webpack_exports__, __webpack_require__) {68916892"use strict";6893__webpack_require__.r(__webpack_exports__);6894/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WaterMaterial", function() { return WaterMaterial; });6895/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");6896/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");6897/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);6898/* harmony import */ var _water_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./water.fragment */ "./water/water.fragment.ts");6899/* harmony import */ var _water_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./water.vertex */ "./water/water.vertex.ts");690069016902690369046905690669076908690969106911691269136914691569166917691869196920var WaterMaterialDefines = /** @class */ (function (_super) {6921Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WaterMaterialDefines, _super);6922function WaterMaterialDefines() {6923var _this = _super.call(this) || this;6924_this.BUMP = false;6925_this.REFLECTION = false;6926_this.CLIPPLANE = false;6927_this.CLIPPLANE2 = false;6928_this.CLIPPLANE3 = false;6929_this.CLIPPLANE4 = false;6930_this.CLIPPLANE5 = false;6931_this.CLIPPLANE6 = false;6932_this.ALPHATEST = false;6933_this.DEPTHPREPASS = false;6934_this.POINTSIZE = false;6935_this.FOG = false;6936_this.NORMAL = false;6937_this.UV1 = false;6938_this.UV2 = false;6939_this.VERTEXCOLOR = false;6940_this.VERTEXALPHA = false;6941_this.NUM_BONE_INFLUENCERS = 0;6942_this.BonesPerMesh = 0;6943_this.INSTANCES = false;6944_this.SPECULARTERM = false;6945_this.LOGARITHMICDEPTH = false;6946_this.USE_REVERSE_DEPTHBUFFER = false;6947_this.FRESNELSEPARATE = false;6948_this.BUMPSUPERIMPOSE = false;6949_this.BUMPAFFECTSREFLECTION = false;6950_this.IMAGEPROCESSING = false;6951_this.VIGNETTE = false;6952_this.VIGNETTEBLENDMODEMULTIPLY = false;6953_this.VIGNETTEBLENDMODEOPAQUE = false;6954_this.TONEMAPPING = false;6955_this.TONEMAPPING_ACES = false;6956_this.CONTRAST = false;6957_this.EXPOSURE = false;6958_this.COLORCURVES = false;6959_this.COLORGRADING = false;6960_this.COLORGRADING3D = false;6961_this.SAMPLER3DGREENDEPTH = false;6962_this.SAMPLER3DBGRMAP = false;6963_this.IMAGEPROCESSINGPOSTPROCESS = false;6964_this.rebuild();6965return _this;6966}6967return WaterMaterialDefines;6968}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialDefines"]));6969var WaterMaterial = /** @class */ (function (_super) {6970Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(WaterMaterial, _super);6971/**6972* Constructor6973*/6974function WaterMaterial(name, scene, renderTargetSize) {6975if (renderTargetSize === void 0) { renderTargetSize = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector2"](512, 512); }6976var _this = _super.call(this, name, scene) || this;6977_this.renderTargetSize = renderTargetSize;6978_this.diffuseColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);6979_this.specularColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0, 0, 0);6980_this.specularPower = 64;6981_this._disableLighting = false;6982_this._maxSimultaneousLights = 4;6983/**6984* Defines the wind force.6985*/6986_this.windForce = 6;6987/**6988* Defines the direction of the wind in the plane (X, Z).6989*/6990_this.windDirection = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector2"](0, 1);6991/**6992* Defines the height of the waves.6993*/6994_this.waveHeight = 0.4;6995/**6996* Defines the bump height related to the bump map.6997*/6998_this.bumpHeight = 0.4;6999/**7000* Defines wether or not: to add a smaller moving bump to less steady waves.7001*/7002_this._bumpSuperimpose = false;7003/**7004* Defines wether or not color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.7005*/7006_this._fresnelSeparate = false;7007/**7008* Defines wether or not bump Wwves modify the reflection.7009*/7010_this._bumpAffectsReflection = false;7011/**7012* Defines the water color blended with the refraction (near).7013*/7014_this.waterColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.1, 0.6);7015/**7016* Defines the blend factor related to the water color.7017*/7018_this.colorBlendFactor = 0.2;7019/**7020* Defines the water color blended with the reflection (far).7021*/7022_this.waterColor2 = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.1, 0.6);7023/**7024* Defines the blend factor related to the water color (reflection, far).7025*/7026_this.colorBlendFactor2 = 0.2;7027/**7028* Defines the maximum length of a wave.7029*/7030_this.waveLength = 0.1;7031/**7032* Defines the waves speed.7033*/7034_this.waveSpeed = 1.0;7035/**7036* Defines the number of times waves are repeated. This is typically used to adjust waves count according to the ground's size where the material is applied on.7037*/7038_this.waveCount = 20;7039/**7040* Sets or gets whether or not automatic clipping should be enabled or not. Setting to true will save performances and7041* will avoid calculating useless pixels in the pixel shader of the water material.7042*/7043_this.disableClipPlane = false;7044_this._renderTargets = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SmartArray"](16);7045/*7046* Private members7047*/7048_this._mesh = null;7049_this._reflectionTransform = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Zero();7050_this._lastTime = 0;7051_this._lastDeltaTime = 0;7052_this._createRenderTargets(scene, renderTargetSize);7053// Create render targets7054_this.getRenderTargetTextures = function () {7055_this._renderTargets.reset();7056_this._renderTargets.push(_this._reflectionRTT);7057_this._renderTargets.push(_this._refractionRTT);7058return _this._renderTargets;7059};7060_this._imageProcessingConfiguration = _this.getScene().imageProcessingConfiguration;7061if (_this._imageProcessingConfiguration) {7062_this._imageProcessingObserver = _this._imageProcessingConfiguration.onUpdateParameters.add(function () {7063_this._markAllSubMeshesAsImageProcessingDirty();7064});7065}7066return _this;7067}7068Object.defineProperty(WaterMaterial.prototype, "hasRenderTargetTextures", {7069/**7070* Gets a boolean indicating that current material needs to register RTT7071*/7072get: function () {7073return true;7074},7075enumerable: false,7076configurable: true7077});7078Object.defineProperty(WaterMaterial.prototype, "useLogarithmicDepth", {7079get: function () {7080return this._useLogarithmicDepth;7081},7082set: function (value) {7083this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;7084this._markAllSubMeshesAsMiscDirty();7085},7086enumerable: false,7087configurable: true7088});7089Object.defineProperty(WaterMaterial.prototype, "refractionTexture", {7090// Get / Set7091get: function () {7092return this._refractionRTT;7093},7094enumerable: false,7095configurable: true7096});7097Object.defineProperty(WaterMaterial.prototype, "reflectionTexture", {7098get: function () {7099return this._reflectionRTT;7100},7101enumerable: false,7102configurable: true7103});7104// Methods7105WaterMaterial.prototype.addToRenderList = function (node) {7106if (this._refractionRTT && this._refractionRTT.renderList) {7107this._refractionRTT.renderList.push(node);7108}7109if (this._reflectionRTT && this._reflectionRTT.renderList) {7110this._reflectionRTT.renderList.push(node);7111}7112};7113WaterMaterial.prototype.enableRenderTargets = function (enable) {7114var refreshRate = enable ? 1 : 0;7115if (this._refractionRTT) {7116this._refractionRTT.refreshRate = refreshRate;7117}7118if (this._reflectionRTT) {7119this._reflectionRTT.refreshRate = refreshRate;7120}7121};7122WaterMaterial.prototype.getRenderList = function () {7123return this._refractionRTT ? this._refractionRTT.renderList : [];7124};7125Object.defineProperty(WaterMaterial.prototype, "renderTargetsEnabled", {7126get: function () {7127return !(this._refractionRTT && this._refractionRTT.refreshRate === 0);7128},7129enumerable: false,7130configurable: true7131});7132WaterMaterial.prototype.needAlphaBlending = function () {7133return (this.alpha < 1.0);7134};7135WaterMaterial.prototype.needAlphaTesting = function () {7136return false;7137};7138WaterMaterial.prototype.getAlphaTestTexture = function () {7139return null;7140};7141WaterMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {7142if (this.isFrozen) {7143if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {7144return true;7145}7146}7147if (!subMesh._materialDefines) {7148subMesh.materialDefines = new WaterMaterialDefines();7149}7150var defines = subMesh._materialDefines;7151var scene = this.getScene();7152if (this._isReadyForSubMesh(subMesh)) {7153return true;7154}7155var engine = scene.getEngine();7156// Textures7157if (defines._areTexturesDirty) {7158defines._needUVs = false;7159if (scene.texturesEnabled) {7160if (this.bumpTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) {7161if (!this.bumpTexture.isReady()) {7162return false;7163}7164else {7165defines._needUVs = true;7166defines.BUMP = true;7167}7168}7169if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].ReflectionTextureEnabled) {7170defines.REFLECTION = true;7171}7172}7173}7174babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);7175babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);7176if (defines._areMiscDirty) {7177if (this._fresnelSeparate) {7178defines.FRESNELSEPARATE = true;7179}7180if (this._bumpSuperimpose) {7181defines.BUMPSUPERIMPOSE = true;7182}7183if (this._bumpAffectsReflection) {7184defines.BUMPAFFECTSREFLECTION = true;7185}7186}7187// Lights7188defines._needNormals = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);7189// Image processing7190if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {7191if (!this._imageProcessingConfiguration.isReady()) {7192return false;7193}7194this._imageProcessingConfiguration.prepareDefines(defines);7195defines.IS_REFLECTION_LINEAR = (this.reflectionTexture != null && !this.reflectionTexture.gammaSpace);7196defines.IS_REFRACTION_LINEAR = (this.refractionTexture != null && !this.refractionTexture.gammaSpace);7197}7198// Attribs7199babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareDefinesForAttributes(mesh, defines, true, true);7200// Configure this7201this._mesh = mesh;7202if (this._waitingRenderList) {7203for (var i = 0; i < this._waitingRenderList.length; i++) {7204this.addToRenderList(scene.getNodeById(this._waitingRenderList[i]));7205}7206this._waitingRenderList = null;7207}7208// Get correct effect7209if (defines.isDirty) {7210defines.markAsProcessed();7211scene.resetCachedMaterial();7212// Fallbacks7213var fallbacks = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["EffectFallbacks"]();7214if (defines.FOG) {7215fallbacks.addFallback(1, "FOG");7216}7217if (defines.LOGARITHMICDEPTH) {7218fallbacks.addFallback(0, "LOGARITHMICDEPTH");7219}7220babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);7221if (defines.NUM_BONE_INFLUENCERS > 0) {7222fallbacks.addCPUSkinningFallback(0, mesh);7223}7224//Attributes7225var attribs = [babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind];7226if (defines.NORMAL) {7227attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);7228}7229if (defines.UV1) {7230attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UVKind);7231}7232if (defines.UV2) {7233attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].UV2Kind);7234}7235if (defines.VERTEXCOLOR) {7236attribs.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].ColorKind);7237}7238babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForBones(attribs, mesh, defines, fallbacks);7239babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareAttributesForInstances(attribs, defines);7240// Legacy browser patch7241var shaderName = "water";7242var join = defines.toString();7243var uniforms = ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vDiffuseColor", "vSpecularColor",7244"vFogInfos", "vFogColor", "pointSize",7245"vNormalInfos",7246"mBones",7247"vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "vClipPlane5", "vClipPlane6", "normalMatrix",7248"logarithmicDepthConstant",7249// Water7250"worldReflectionViewProjection", "windDirection", "waveLength", "time", "windForce",7251"cameraPosition", "bumpHeight", "waveHeight", "waterColor", "waterColor2", "colorBlendFactor", "colorBlendFactor2", "waveSpeed",7252"waveCount"7253];7254var samplers = ["normalSampler",7255// Water7256"refractionSampler", "reflectionSampler"7257];7258var uniformBuffers = new Array();7259if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ImageProcessingConfiguration"]) {7260babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ImageProcessingConfiguration"].PrepareUniforms(uniforms, defines);7261babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ImageProcessingConfiguration"].PrepareSamplers(samplers, defines);7262}7263babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].PrepareUniformsAndSamplersList({7264uniformsNames: uniforms,7265uniformBuffersNames: uniformBuffers,7266samplers: samplers,7267defines: defines,7268maxSimultaneousLights: this.maxSimultaneousLights7269});7270subMesh.setEffect(scene.getEngine().createEffect(shaderName, {7271attributes: attribs,7272uniformsNames: uniforms,7273uniformBuffersNames: uniformBuffers,7274samplers: samplers,7275defines: join,7276fallbacks: fallbacks,7277onCompiled: this.onCompiled,7278onError: this.onError,7279indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights }7280}, engine), defines, this._materialContext);7281}7282if (!subMesh.effect || !subMesh.effect.isReady()) {7283return false;7284}7285defines._renderId = scene.getRenderId();7286subMesh.effect._wasPreviouslyReady = true;7287return true;7288};7289WaterMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {7290var scene = this.getScene();7291var defines = subMesh._materialDefines;7292if (!defines) {7293return;7294}7295var effect = subMesh.effect;7296if (!effect || !this._mesh) {7297return;7298}7299this._activeEffect = effect;7300// Matrices7301this.bindOnlyWorldMatrix(world);7302this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());7303// Bones7304babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindBonesParameters(mesh, this._activeEffect);7305if (this._mustRebind(scene, effect)) {7306// Textures7307if (this.bumpTexture && babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].BumpTextureEnabled) {7308this._activeEffect.setTexture("normalSampler", this.bumpTexture);7309this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);7310this._activeEffect.setMatrix("normalMatrix", this.bumpTexture.getTextureMatrix());7311}7312// Clip plane7313babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindClipPlane(this._activeEffect, scene);7314// Point size7315if (this.pointsCloud) {7316this._activeEffect.setFloat("pointSize", this.pointSize);7317}7318scene.bindEyePosition(effect);7319}7320this._activeEffect.setColor4("vDiffuseColor", this.diffuseColor, this.alpha * mesh.visibility);7321if (defines.SPECULARTERM) {7322this._activeEffect.setColor4("vSpecularColor", this.specularColor, this.specularPower);7323}7324if (scene.lightsEnabled && !this.disableLighting) {7325babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);7326}7327// View7328if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Scene"].FOGMODE_NONE) {7329this._activeEffect.setMatrix("view", scene.getViewMatrix());7330}7331// Fog7332babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindFogParameters(scene, mesh, this._activeEffect);7333// Log. depth7334babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialHelper"].BindLogDepth(defines, this._activeEffect, scene);7335// Water7336if (babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["MaterialFlags"].ReflectionTextureEnabled) {7337this._activeEffect.setTexture("refractionSampler", this._refractionRTT);7338this._activeEffect.setTexture("reflectionSampler", this._reflectionRTT);7339}7340var wrvp = this._mesh.getWorldMatrix().multiply(this._reflectionTransform).multiply(scene.getProjectionMatrix());7341// Add delta time. Prevent adding delta time if it hasn't changed.7342var deltaTime = scene.getEngine().getDeltaTime();7343if (deltaTime !== this._lastDeltaTime) {7344this._lastDeltaTime = deltaTime;7345this._lastTime += this._lastDeltaTime;7346}7347this._activeEffect.setMatrix("worldReflectionViewProjection", wrvp);7348this._activeEffect.setVector2("windDirection", this.windDirection);7349this._activeEffect.setFloat("waveLength", this.waveLength);7350this._activeEffect.setFloat("time", this._lastTime / 100000);7351this._activeEffect.setFloat("windForce", this.windForce);7352this._activeEffect.setFloat("waveHeight", this.waveHeight);7353this._activeEffect.setFloat("bumpHeight", this.bumpHeight);7354this._activeEffect.setColor4("waterColor", this.waterColor, 1.0);7355this._activeEffect.setFloat("colorBlendFactor", this.colorBlendFactor);7356this._activeEffect.setColor4("waterColor2", this.waterColor2, 1.0);7357this._activeEffect.setFloat("colorBlendFactor2", this.colorBlendFactor2);7358this._activeEffect.setFloat("waveSpeed", this.waveSpeed);7359this._activeEffect.setFloat("waveCount", this.waveCount);7360// image processing7361if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {7362this._imageProcessingConfiguration.bind(this._activeEffect);7363}7364this._afterBind(mesh, this._activeEffect);7365};7366WaterMaterial.prototype._createRenderTargets = function (scene, renderTargetSize) {7367var _this = this;7368// Render targets7369this._refractionRTT = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["RenderTargetTexture"](name + "_refraction", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);7370this._refractionRTT.wrapU = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE;7371this._refractionRTT.wrapV = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE;7372this._refractionRTT.ignoreCameraViewport = true;7373this._reflectionRTT = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["RenderTargetTexture"](name + "_reflection", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);7374this._reflectionRTT.wrapU = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE;7375this._reflectionRTT.wrapV = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].TEXTURE_MIRROR_ADDRESSMODE;7376this._reflectionRTT.ignoreCameraViewport = true;7377var isVisible;7378var clipPlane = null;7379var savedViewMatrix;7380var mirrorMatrix = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Matrix"].Zero();7381this._refractionRTT.onBeforeRender = function () {7382if (_this._mesh) {7383isVisible = _this._mesh.isVisible;7384_this._mesh.isVisible = false;7385}7386// Clip plane7387if (!_this.disableClipPlane) {7388clipPlane = scene.clipPlane;7389var positiony = _this._mesh ? _this._mesh.position.y : 0.0;7390scene.clipPlane = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Plane"].FromPositionAndNormal(new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, positiony + 0.05, 0), new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 1, 0));7391}7392};7393this._refractionRTT.onAfterRender = function () {7394if (_this._mesh) {7395_this._mesh.isVisible = isVisible;7396}7397// Clip plane7398if (!_this.disableClipPlane) {7399scene.clipPlane = clipPlane;7400}7401};7402this._reflectionRTT.onBeforeRender = function () {7403if (_this._mesh) {7404isVisible = _this._mesh.isVisible;7405_this._mesh.isVisible = false;7406}7407// Clip plane7408if (!_this.disableClipPlane) {7409clipPlane = scene.clipPlane;7410var positiony = _this._mesh ? _this._mesh.position.y : 0.0;7411scene.clipPlane = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Plane"].FromPositionAndNormal(new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, positiony - 0.05, 0), new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, -1, 0));7412babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Matrix"].ReflectionToRef(scene.clipPlane, mirrorMatrix);7413}7414// Transform7415savedViewMatrix = scene.getViewMatrix();7416mirrorMatrix.multiplyToRef(savedViewMatrix, _this._reflectionTransform);7417scene.setTransformMatrix(_this._reflectionTransform, scene.getProjectionMatrix());7418scene.getEngine().cullBackFaces = false;7419scene._mirroredCameraPosition = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector3"].TransformCoordinates(scene.activeCamera.position, mirrorMatrix);7420};7421this._reflectionRTT.onAfterRender = function () {7422if (_this._mesh) {7423_this._mesh.isVisible = isVisible;7424}7425// Clip plane7426scene.clipPlane = clipPlane;7427// Transform7428scene.setTransformMatrix(savedViewMatrix, scene.getProjectionMatrix());7429scene.getEngine().cullBackFaces = null;7430scene._mirroredCameraPosition = null;7431};7432};7433WaterMaterial.prototype.getAnimatables = function () {7434var results = [];7435if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) {7436results.push(this.bumpTexture);7437}7438if (this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0) {7439results.push(this._reflectionRTT);7440}7441if (this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0) {7442results.push(this._refractionRTT);7443}7444return results;7445};7446WaterMaterial.prototype.getActiveTextures = function () {7447var activeTextures = _super.prototype.getActiveTextures.call(this);7448if (this._bumpTexture) {7449activeTextures.push(this._bumpTexture);7450}7451return activeTextures;7452};7453WaterMaterial.prototype.hasTexture = function (texture) {7454if (_super.prototype.hasTexture.call(this, texture)) {7455return true;7456}7457if (this._bumpTexture === texture) {7458return true;7459}7460return false;7461};7462WaterMaterial.prototype.dispose = function (forceDisposeEffect) {7463if (this.bumpTexture) {7464this.bumpTexture.dispose();7465}7466var index = this.getScene().customRenderTargets.indexOf(this._refractionRTT);7467if (index != -1) {7468this.getScene().customRenderTargets.splice(index, 1);7469}7470index = -1;7471index = this.getScene().customRenderTargets.indexOf(this._reflectionRTT);7472if (index != -1) {7473this.getScene().customRenderTargets.splice(index, 1);7474}7475if (this._reflectionRTT) {7476this._reflectionRTT.dispose();7477}7478if (this._refractionRTT) {7479this._refractionRTT.dispose();7480}7481// Remove image-processing observer7482if (this._imageProcessingConfiguration && this._imageProcessingObserver) {7483this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);7484}7485_super.prototype.dispose.call(this, forceDisposeEffect);7486};7487WaterMaterial.prototype.clone = function (name) {7488var _this = this;7489return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new WaterMaterial(name, _this.getScene()); }, this);7490};7491WaterMaterial.prototype.serialize = function () {7492var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this);7493serializationObject.customType = "BABYLON.WaterMaterial";7494serializationObject.renderList = [];7495if (this._refractionRTT && this._refractionRTT.renderList) {7496for (var i = 0; i < this._refractionRTT.renderList.length; i++) {7497serializationObject.renderList.push(this._refractionRTT.renderList[i].id);7498}7499}7500return serializationObject;7501};7502WaterMaterial.prototype.getClassName = function () {7503return "WaterMaterial";7504};7505// Statics7506WaterMaterial.Parse = function (source, scene, rootUrl) {7507var mat = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new WaterMaterial(source.name, scene); }, source, scene, rootUrl);7508mat._waitingRenderList = source.renderList;7509return mat;7510};7511WaterMaterial.CreateDefaultMesh = function (name, scene) {7512var mesh = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Mesh"].CreateGround(name, 512, 512, 32, scene, false);7513return mesh;7514};7515Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7516Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])("bumpTexture")7517], WaterMaterial.prototype, "_bumpTexture", void 0);7518Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7519Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsTexturesDirty")7520], WaterMaterial.prototype, "bumpTexture", void 0);7521Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7522Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()7523], WaterMaterial.prototype, "diffuseColor", void 0);7524Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7525Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()7526], WaterMaterial.prototype, "specularColor", void 0);7527Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7528Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7529], WaterMaterial.prototype, "specularPower", void 0);7530Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7531Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("disableLighting")7532], WaterMaterial.prototype, "_disableLighting", void 0);7533Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7534Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")7535], WaterMaterial.prototype, "disableLighting", void 0);7536Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7537Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("maxSimultaneousLights")7538], WaterMaterial.prototype, "_maxSimultaneousLights", void 0);7539Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7540Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsLightsDirty")7541], WaterMaterial.prototype, "maxSimultaneousLights", void 0);7542Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7543Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7544], WaterMaterial.prototype, "windForce", void 0);7545Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7546Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector2"])()7547], WaterMaterial.prototype, "windDirection", void 0);7548Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7549Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7550], WaterMaterial.prototype, "waveHeight", void 0);7551Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7552Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7553], WaterMaterial.prototype, "bumpHeight", void 0);7554Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7555Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("bumpSuperimpose")7556], WaterMaterial.prototype, "_bumpSuperimpose", void 0);7557Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7558Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsMiscDirty")7559], WaterMaterial.prototype, "bumpSuperimpose", void 0);7560Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7561Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("fresnelSeparate")7562], WaterMaterial.prototype, "_fresnelSeparate", void 0);7563Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7564Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsMiscDirty")7565], WaterMaterial.prototype, "fresnelSeparate", void 0);7566Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7567Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])("bumpAffectsReflection")7568], WaterMaterial.prototype, "_bumpAffectsReflection", void 0);7569Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7570Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["expandToProperty"])("_markAllSubMeshesAsMiscDirty")7571], WaterMaterial.prototype, "bumpAffectsReflection", void 0);7572Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7573Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()7574], WaterMaterial.prototype, "waterColor", void 0);7575Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7576Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7577], WaterMaterial.prototype, "colorBlendFactor", void 0);7578Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7579Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()7580], WaterMaterial.prototype, "waterColor2", void 0);7581Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7582Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7583], WaterMaterial.prototype, "colorBlendFactor2", void 0);7584Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7585Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7586], WaterMaterial.prototype, "waveLength", void 0);7587Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7588Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7589], WaterMaterial.prototype, "waveSpeed", void 0);7590Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7591Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7592], WaterMaterial.prototype, "waveCount", void 0);7593Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7594Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7595], WaterMaterial.prototype, "disableClipPlane", void 0);7596Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([7597Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()7598], WaterMaterial.prototype, "useLogarithmicDepth", null);7599return WaterMaterial;7600}(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["PushMaterial"]));76017602babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.WaterMaterial"] = WaterMaterial;760376047605/***/ }),76067607/***/ "babylonjs/Misc/decorators":7608/*!****************************************************************************************************!*\7609!*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!7610\****************************************************************************************************/7611/*! no static exports found */7612/***/ (function(module, exports) {76137614module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;76157616/***/ })76177618/******/ });7619});7620//# sourceMappingURL=babylonjs.materials.js.map76217622