babylonjs-materials 8.41.2 → 8.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"babylon.customMaterial.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,sBAAuB,CAAC,aAAcJ,GACnB,iBAAZC,QACdA,QAAQ,uBAAyBD,EAAQG,QAAQ,cAEjDJ,EAAgB,UAAIC,EAAQD,EAAc,QAC3C,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,CAAC,GAOX,OAHAc,EAAoBH,GAAUV,EAAQA,EAAOD,QAASU,GAG/CT,EAAOD,OACf,CCrBAU,EAAoBK,EAAI,CAACf,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EP,EAAoBa,EAAI,WACvB,GAA0B,iBAAfC,WAAyB,OAAOA,WAC3C,IACC,OAAOjB,MAAQ,IAAIkB,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAXC,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBjB,EAAoBQ,EAAI,CAACU,EAAKC,IAAUV,OAAOW,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFnB,EAAoBuB,EAAK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,YAAYmF,0BAA4BW,EAAWvD,QAAQ,SAAU,SACnEpF,IACX,EAOO,YAAAkI,iBAAP,SAAwBS,GAEpB,OADA3I,KAAK6C,YAAYqF,iBAAmBS,EAC7B3I,IACX,EAOO,YAAAqG,aAAP,SAAoBsC,GAEhB,OADA3I,KAAK6C,YAAYwD,aAAesC,EACzB3I,IACX,EAOO,YAAAwG,mBAAP,SAA0BmC,GAEtB,OADA3I,KAAK6C,YAAY2D,mBAAqBmC,EAC/B3I,IACX,EAOO,YAAA0G,iBAAP,SAAwBiC,GAEpB,OADA3I,KAAK6C,YAAY6D,iBAAmBiC,EAC7B3I,IACX,EAOO,YAAA4G,8BAAP,SAAqC+B,GAEjC,OADA3I,KAAK6C,YAAY+D,8BAAgC+B,EAAWvD,QAAQ,SAAU,mBACvEpF,IACX,EAOO,YAAA8G,4BAAP,SAAmC6B,GAE/B,OADA3I,KAAK6C,YAAYiE,4BAA8B6B,EAAWvD,QAAQ,SAAU,iBACrEpF,IACX,EAOO,YAAAkH,8BAAP,SAAqCyB,GAEjC,OADA3I,KAAK6C,YAAYqE,8BAAgCyB,EAC1C3I,IACX,EAOO,YAAAgH,eAAP,SAAsB2B,GAElB,OADA3I,KAAK6C,YAAYmE,eAAiB2B,EAC3B3I,IACX,EAncc,EAAAsD,cAAgB,EAoclC,C,CAxcA,CAAuC,EAAA2G,cA0cvC,IAAApB,eAAc,4BAA6BI,GCnjB3C,IAAMiB,OAAiC,IAAX,EAAAlJ,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjB4J,EACP,IAAK,IAAMxJ,KAAO,EACRwJ,EAAcC,QAAQzJ,GAAa,EAAQA,GCRzD,U","sources":["webpack://MATERIALS/webpack/universalModuleDefinition","webpack://MATERIALS/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://MATERIALS/webpack/bootstrap","webpack://MATERIALS/webpack/runtime/define property getters","webpack://MATERIALS/webpack/runtime/global","webpack://MATERIALS/webpack/runtime/hasOwnProperty shorthand","webpack://MATERIALS/webpack/runtime/make namespace object","webpack://MATERIALS/../../../../node_modules/tslib/tslib.es6.mjs","webpack://MATERIALS/../../../dev/materials/src/custom/customMaterial.ts","webpack://MATERIALS/../../../dev/materials/src/custom/pbrCustomMaterial.ts","webpack://MATERIALS/../../../lts/materials/src/legacy/legacy-custom.ts","webpack://MATERIALS/./src/custom.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-materials\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-materials\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"MATERIALS\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__597__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__597__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport type { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport \"core/Shaders/default.vertex\";\r\nimport \"core/Shaders/default.fragment\";\r\n\r\n/**\r\n * Structure of a custom shader\r\n */\r\nexport class CustomShaderStructure {\r\n /**\r\n * Fragment store\r\n */\r\n public FragmentStore: string;\r\n /**\r\n * Vertex store\r\n */\r\n public VertexStore: string;\r\n\r\n constructor() {}\r\n}\r\n\r\n/**\r\n * Parts of a shader\r\n */\r\nexport class ShaderSpecialParts {\r\n constructor() {}\r\n\r\n /**\r\n * Beginning of the fragment shader\r\n */\r\n public Fragment_Begin: string;\r\n /**\r\n * Variable definitions of the fragment shader\r\n */\r\n public Fragment_Definitions: string;\r\n /**\r\n * Beginning of the fragment main function\r\n */\r\n public Fragment_MainBegin: string;\r\n /**\r\n * End of the fragment main function\r\n */\r\n public Fragment_MainEnd: string;\r\n\r\n /**\r\n * Diffuse color calculation\r\n */\r\n public Fragment_Custom_Diffuse: string;\r\n /**\r\n * Before lightning computations\r\n */\r\n public Fragment_Before_Lights: string;\r\n /**\r\n * Before fog computations\r\n */\r\n public Fragment_Before_Fog: string;\r\n /**\r\n * Alpha calculations\r\n */\r\n public Fragment_Custom_Alpha: string;\r\n /**\r\n * Before frag color is assigned\r\n */\r\n public Fragment_Before_FragColor: string;\r\n /**\r\n * Beginning of the vertex shader\r\n */\r\n public Vertex_Begin: string;\r\n /**\r\n * Variable definitions of the vertex shader\r\n */\r\n public Vertex_Definitions: string;\r\n /**\r\n * Start of the main function of the vertex shader\r\n */\r\n public Vertex_MainBegin: string;\r\n\r\n /**\r\n * Before the world position computation\r\n */\r\n public Vertex_Before_PositionUpdated: string;\r\n\r\n /**\r\n * Before the normal computation\r\n */\r\n public Vertex_Before_NormalUpdated: string;\r\n\r\n /**\r\n * After the world position has been computed\r\n */\r\n public Vertex_After_WorldPosComputed: string;\r\n\r\n /**\r\n * Main end of the vertex shader\r\n */\r\n public Vertex_MainEnd: string;\r\n}\r\n\r\n/**\r\n * Customized material\r\n */\r\nexport class CustomMaterial extends StandardMaterial {\r\n /**\r\n * Index for each created shader\r\n */\r\n public static ShaderIndexer = 1;\r\n /**\r\n * Custom shader structure\r\n */\r\n public CustomParts: ShaderSpecialParts;\r\n /**\r\n * Name of the shader\r\n */\r\n public _createdShaderName: string;\r\n /**\r\n * List of custom uniforms\r\n */\r\n public _customUniform: string[];\r\n /**\r\n * Names of the new uniforms\r\n */\r\n public _newUniforms: string[];\r\n /**\r\n * Instances of the new uniform objects\r\n */\r\n public _newUniformInstances: { [name: string]: any };\r\n /**\r\n * Instances of the new sampler objects\r\n */\r\n public _newSamplerInstances: { [name: string]: Texture };\r\n /**\r\n * List of the custom attributes\r\n */\r\n public _customAttributes: string[];\r\n\r\n /**\r\n * Fragment shader string\r\n */\r\n public FragmentShader: string;\r\n /**\r\n * Vertex shader string\r\n */\r\n public VertexShader: string;\r\n\r\n /**\r\n * Runs after the material is bound to a mesh\r\n * @param mesh mesh bound\r\n * @param effect bound effect used to render\r\n */\r\n public AttachAfterBind(mesh: Mesh | undefined, effect: Effect) {\r\n if (this._newUniformInstances) {\r\n for (const el in this._newUniformInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"vec2\") {\r\n effect.setVector2(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"vec3\") {\r\n if (this._newUniformInstances[el] instanceof Color3) {\r\n effect.setColor3(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector3(ea[1], this._newUniformInstances[el]);\r\n }\r\n } else if (ea[0] == \"vec4\") {\r\n if (this._newUniformInstances[el] instanceof Color4) {\r\n effect.setDirectColor4(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n }\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"mat4\") {\r\n effect.setMatrix(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"float\") {\r\n effect.setFloat(ea[1], this._newUniformInstances[el]);\r\n }\r\n }\r\n }\r\n if (this._newSamplerInstances) {\r\n for (const el in this._newSamplerInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"sampler2D\" && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {\r\n effect.setTexture(ea[1], this._newSamplerInstances[el]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public ReviewUniform(name: string, arr: string[]): string[] {\r\n if (name == \"uniform\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") == -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n if (name == \"sampler\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") != -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n return arr;\r\n }\r\n\r\n /**\r\n * Builds the material\r\n * @param shaderName name of the shader\r\n * @param uniforms list of uniforms\r\n * @param uniformBuffers list of uniform buffers\r\n * @param samplers list of samplers\r\n * @param defines list of defines\r\n * @param attributes list of attributes\r\n * @returns the shader name\r\n */\r\n public Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: MaterialDefines | string[], attributes?: string[]): string {\r\n if (attributes && this._customAttributes && this._customAttributes.length > 0) {\r\n attributes.push(...this._customAttributes);\r\n }\r\n\r\n this.ReviewUniform(\"uniform\", uniforms);\r\n this.ReviewUniform(\"sampler\", samplers);\r\n\r\n const name = this._createdShaderName;\r\n\r\n if (Effect.ShadersStore[name + \"VertexShader\"] && Effect.ShadersStore[name + \"PixelShader\"]) {\r\n return name;\r\n }\r\n Effect.ShadersStore[name + \"VertexShader\"] = this._injectCustomCode(this.VertexShader, \"vertex\");\r\n Effect.ShadersStore[name + \"PixelShader\"] = this._injectCustomCode(this.FragmentShader, \"fragment\");\r\n\r\n return name;\r\n }\r\n\r\n protected _injectCustomCode(code: string, shaderType: string): string {\r\n const customCode = this._getCustomCode(shaderType);\r\n\r\n for (const point in customCode) {\r\n const injectedCode = customCode[point];\r\n\r\n if (injectedCode && injectedCode.length > 0) {\r\n const fullPointName = \"#define \" + point;\r\n code = code.replace(fullPointName, \"\\n\" + injectedCode + \"\\n\" + fullPointName);\r\n }\r\n }\r\n\r\n return code;\r\n }\r\n\r\n protected _getCustomCode(shaderType: string): { [pointName: string]: string } {\r\n if (shaderType === \"vertex\") {\r\n return {\r\n CUSTOM_VERTEX_BEGIN: this.CustomParts.Vertex_Begin,\r\n CUSTOM_VERTEX_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Vertex_Definitions || \"\"),\r\n CUSTOM_VERTEX_MAIN_BEGIN: this.CustomParts.Vertex_MainBegin,\r\n CUSTOM_VERTEX_UPDATE_POSITION: this.CustomParts.Vertex_Before_PositionUpdated,\r\n CUSTOM_VERTEX_UPDATE_NORMAL: this.CustomParts.Vertex_Before_NormalUpdated,\r\n CUSTOM_VERTEX_MAIN_END: this.CustomParts.Vertex_MainEnd,\r\n CUSTOM_VERTEX_UPDATE_WORLDPOS: this.CustomParts.Vertex_After_WorldPosComputed,\r\n };\r\n }\r\n return {\r\n CUSTOM_FRAGMENT_BEGIN: this.CustomParts.Fragment_Begin,\r\n CUSTOM_FRAGMENT_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Fragment_Definitions || \"\"),\r\n CUSTOM_FRAGMENT_MAIN_BEGIN: this.CustomParts.Fragment_MainBegin,\r\n CUSTOM_FRAGMENT_UPDATE_DIFFUSE: this.CustomParts.Fragment_Custom_Diffuse,\r\n CUSTOM_FRAGMENT_UPDATE_ALPHA: this.CustomParts.Fragment_Custom_Alpha,\r\n CUSTOM_FRAGMENT_BEFORE_LIGHTS: this.CustomParts.Fragment_Before_Lights,\r\n CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: this.CustomParts.Fragment_Before_FragColor,\r\n CUSTOM_FRAGMENT_MAIN_END: this.CustomParts.Fragment_MainEnd,\r\n CUSTOM_FRAGMENT_BEFORE_FOG: this.CustomParts.Fragment_Before_Fog,\r\n };\r\n }\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene, true);\r\n this.CustomParts = new ShaderSpecialParts();\r\n this.customShaderNameResolve = this.Builder;\r\n\r\n this.FragmentShader = Effect.ShadersStore[\"defaultPixelShader\"];\r\n this.VertexShader = Effect.ShadersStore[\"defaultVertexShader\"];\r\n\r\n CustomMaterial.ShaderIndexer++;\r\n this._createdShaderName = \"custom_\" + CustomMaterial.ShaderIndexer;\r\n }\r\n\r\n protected override _afterBind(mesh?: Mesh, effect: Nullable<Effect> = null, subMesh?: SubMesh): void {\r\n if (!effect) {\r\n return;\r\n }\r\n this.AttachAfterBind(mesh, effect);\r\n try {\r\n super._afterBind(mesh, effect, subMesh);\r\n } catch (e) {}\r\n }\r\n\r\n /**\r\n * Adds a new uniform to the shader\r\n * @param name the name of the uniform to add\r\n * @param kind the type of the uniform to add\r\n * @param param the value of the uniform to add\r\n * @returns the current material\r\n */\r\n public AddUniform(name: string, kind: string, param: any): CustomMaterial {\r\n if (!this._customUniform) {\r\n this._customUniform = [];\r\n this._newUniforms = [];\r\n this._newSamplerInstances = {};\r\n this._newUniformInstances = {};\r\n }\r\n if (param) {\r\n if (kind.indexOf(\"sampler\") != -1) {\r\n (<any>this._newSamplerInstances)[kind + \"-\" + name] = param;\r\n } else {\r\n (<any>this._newUniformInstances)[kind + \"-\" + name] = param;\r\n }\r\n }\r\n this._customUniform.push(\"uniform \" + kind + \" \" + name + \";\");\r\n this._newUniforms.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a custom attribute\r\n * @param name the name of the attribute\r\n * @returns the current material\r\n */\r\n public AddAttribute(name: string): CustomMaterial {\r\n if (!this._customAttributes) {\r\n this._customAttributes = [];\r\n }\r\n\r\n this._customAttributes.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Begin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Definitions(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainBegin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainEnd(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_MainEnd = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Diffuse portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace(\"result\", \"diffuseColor\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Alpha portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Alpha(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace(\"result\", \"alpha\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Lights portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Lights(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Before_Lights = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Fog portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Fog(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Before_Fog = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_FragColor portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_FragColor(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Before_FragColor = shaderPart.replace(\"result\", \"color\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Begin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Definitions(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainBegin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_PositionUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace(\"result\", \"positionUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_NormalUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace(\"result\", \"normalUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_After_WorldPosComputed portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_After_WorldPosComputed(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainEnd(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_MainEnd = shaderPart;\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CustomMaterial\", CustomMaterial);\r\n","/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport type { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { ShaderCodeInliner } from \"core/Engines/Processors/shaderCodeInliner\";\r\nimport type { ICustomShaderNameResolveOptions } from \"core/Materials/material\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport \"core/Shaders/pbr.vertex\";\r\nimport \"core/Shaders/pbr.fragment\";\r\n\r\n/**\r\n * Albedo parts of the shader\r\n */\r\nexport class ShaderAlbedoParts {\r\n constructor() {}\r\n\r\n /**\r\n * Beginning of the fragment shader\r\n */\r\n public Fragment_Begin: string;\r\n /**\r\n * Fragment definitions\r\n */\r\n public Fragment_Definitions: string;\r\n /**\r\n * Beginning of the main function\r\n */\r\n public Fragment_MainBegin: string;\r\n /**\r\n * End of main function\r\n */\r\n public Fragment_MainEnd: string;\r\n\r\n /**\r\n * Albedo color\r\n */\r\n public Fragment_Custom_Albedo: string;\r\n /**\r\n * Lights\r\n */\r\n public Fragment_Before_Lights: string;\r\n /**\r\n * Metallic and roughness\r\n */\r\n public Fragment_Custom_MetallicRoughness: string;\r\n /**\r\n * Microsurface\r\n */\r\n public Fragment_Custom_MicroSurface: string;\r\n /**\r\n * Fog computations\r\n */\r\n public Fragment_Before_Fog: string;\r\n /**\r\n * Alpha\r\n */\r\n public Fragment_Custom_Alpha: string;\r\n /**\r\n * Color composition\r\n */\r\n public Fragment_Before_FinalColorComposition: string;\r\n /**\r\n * Fragment color\r\n */\r\n public Fragment_Before_FragColor: string;\r\n\r\n /**\r\n * Beginning of vertex shader\r\n */\r\n public Vertex_Begin: string;\r\n /**\r\n * Vertex definitions\r\n */\r\n public Vertex_Definitions: string;\r\n /**\r\n * Vertex main begin\r\n */\r\n public Vertex_MainBegin: string;\r\n\r\n /**\r\n * Vertex before position updated\r\n */\r\n public Vertex_Before_PositionUpdated: string;\r\n\r\n /**\r\n * Vertex before normal updated\r\n */\r\n public Vertex_Before_NormalUpdated: string;\r\n\r\n /**\r\n * Vertex after world pos computed\r\n */\r\n public Vertex_After_WorldPosComputed: string;\r\n\r\n /**\r\n * Vertex main end\r\n */\r\n public Vertex_MainEnd: string;\r\n}\r\n\r\n/**\r\n * @deprecated use ShaderAlbedoParts instead.\r\n */\r\nexport const ShaderAlebdoParts = ShaderAlbedoParts;\r\n\r\nexport class PBRCustomMaterial extends PBRMaterial {\r\n /**\r\n * Index for each created shader\r\n */\r\n public static ShaderIndexer = 1;\r\n /**\r\n * Custom shader structure\r\n */\r\n public CustomParts: ShaderAlbedoParts;\r\n /**\r\n * Name of the shader\r\n */\r\n _createdShaderName: string;\r\n /**\r\n * List of custom uniforms\r\n */\r\n _customUniform: string[];\r\n /**\r\n * Names of the new uniforms\r\n */\r\n _newUniforms: string[];\r\n /**\r\n * Instances of the new uniform objects\r\n */\r\n _newUniformInstances: { [name: string]: any };\r\n /**\r\n * Instances of the new sampler objects\r\n */\r\n _newSamplerInstances: { [name: string]: Texture };\r\n /**\r\n * List of the custom attributes\r\n */\r\n _customAttributes: string[];\r\n\r\n /**\r\n * Fragment shader string\r\n */\r\n public FragmentShader: string;\r\n /**\r\n * Vertex shader string\r\n */\r\n public VertexShader: string;\r\n\r\n /**\r\n * Runs after the material is bound to a mesh\r\n * @param mesh mesh bound\r\n * @param effect bound effect used to render\r\n */\r\n public AttachAfterBind(mesh: Mesh | undefined, effect: Effect) {\r\n if (this._newUniformInstances) {\r\n for (const el in this._newUniformInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"vec2\") {\r\n effect.setVector2(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"vec3\") {\r\n if (this._newUniformInstances[el] instanceof Color3) {\r\n effect.setColor3(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector3(ea[1], this._newUniformInstances[el]);\r\n }\r\n } else if (ea[0] == \"vec4\") {\r\n if (this._newUniformInstances[el] instanceof Color4) {\r\n effect.setDirectColor4(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n }\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"mat4\") {\r\n effect.setMatrix(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"float\") {\r\n effect.setFloat(ea[1], this._newUniformInstances[el]);\r\n }\r\n }\r\n }\r\n if (this._newSamplerInstances) {\r\n for (const el in this._newSamplerInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"sampler2D\" && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {\r\n effect.setTexture(ea[1], this._newSamplerInstances[el]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public ReviewUniform(name: string, arr: string[]): string[] {\r\n if (name == \"uniform\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") == -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n if (name == \"sampler\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") != -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n return arr;\r\n }\r\n\r\n /**\r\n * Builds the material\r\n * @param shaderName name of the shader\r\n * @param uniforms list of uniforms\r\n * @param uniformBuffers list of uniform buffers\r\n * @param samplers list of samplers\r\n * @param defines list of defines\r\n * @param attributes list of attributes\r\n * @param options options to compile the shader\r\n * @returns the shader name\r\n */\r\n public Builder(\r\n shaderName: string,\r\n uniforms: string[],\r\n uniformBuffers: string[],\r\n samplers: string[],\r\n defines: MaterialDefines | string[],\r\n attributes?: string[],\r\n options?: ICustomShaderNameResolveOptions\r\n ): string {\r\n if (options) {\r\n const currentProcessing = options.processFinalCode;\r\n options.processFinalCode = (type: string, code: string) => {\r\n if (type === \"vertex\") {\r\n return currentProcessing ? currentProcessing(type, code) : code;\r\n }\r\n const sci = new ShaderCodeInliner(code);\r\n sci.inlineToken = \"#define pbr_inline\";\r\n sci.processCode();\r\n return currentProcessing ? currentProcessing(type, sci.code) : sci.code;\r\n };\r\n }\r\n\r\n if (attributes && this._customAttributes && this._customAttributes.length > 0) {\r\n attributes.push(...this._customAttributes);\r\n }\r\n\r\n this.ReviewUniform(\"uniform\", uniforms);\r\n this.ReviewUniform(\"sampler\", samplers);\r\n\r\n const name = this._createdShaderName;\r\n\r\n if (Effect.ShadersStore[name + \"VertexShader\"] && Effect.ShadersStore[name + \"PixelShader\"]) {\r\n return name;\r\n }\r\n Effect.ShadersStore[name + \"VertexShader\"] = this._injectCustomCode(this.VertexShader, \"vertex\");\r\n Effect.ShadersStore[name + \"PixelShader\"] = this._injectCustomCode(this.FragmentShader, \"fragment\");\r\n\r\n return name;\r\n }\r\n\r\n protected _injectCustomCode(code: string, shaderType: string): string {\r\n const customCode = this._getCustomCode(shaderType);\r\n\r\n for (const point in customCode) {\r\n const injectedCode = customCode[point];\r\n\r\n if (injectedCode && injectedCode.length > 0) {\r\n const fullPointName = \"#define \" + point;\r\n code = code.replace(fullPointName, \"\\n\" + injectedCode + \"\\n\" + fullPointName);\r\n }\r\n }\r\n\r\n return code;\r\n }\r\n\r\n protected _getCustomCode(shaderType: string): { [pointName: string]: string } {\r\n if (shaderType === \"vertex\") {\r\n return {\r\n CUSTOM_VERTEX_BEGIN: this.CustomParts.Vertex_Begin,\r\n CUSTOM_VERTEX_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Vertex_Definitions || \"\"),\r\n CUSTOM_VERTEX_MAIN_BEGIN: this.CustomParts.Vertex_MainBegin,\r\n CUSTOM_VERTEX_UPDATE_POSITION: this.CustomParts.Vertex_Before_PositionUpdated,\r\n CUSTOM_VERTEX_UPDATE_NORMAL: this.CustomParts.Vertex_Before_NormalUpdated,\r\n CUSTOM_VERTEX_MAIN_END: this.CustomParts.Vertex_MainEnd,\r\n CUSTOM_VERTEX_UPDATE_WORLDPOS: this.CustomParts.Vertex_After_WorldPosComputed,\r\n };\r\n }\r\n return {\r\n CUSTOM_FRAGMENT_BEGIN: this.CustomParts.Fragment_Begin,\r\n CUSTOM_FRAGMENT_MAIN_BEGIN: this.CustomParts.Fragment_MainBegin,\r\n CUSTOM_FRAGMENT_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Fragment_Definitions || \"\"),\r\n CUSTOM_FRAGMENT_UPDATE_ALBEDO: this.CustomParts.Fragment_Custom_Albedo,\r\n CUSTOM_FRAGMENT_UPDATE_ALPHA: this.CustomParts.Fragment_Custom_Alpha,\r\n CUSTOM_FRAGMENT_BEFORE_LIGHTS: this.CustomParts.Fragment_Before_Lights,\r\n CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS: this.CustomParts.Fragment_Custom_MetallicRoughness,\r\n CUSTOM_FRAGMENT_UPDATE_MICROSURFACE: this.CustomParts.Fragment_Custom_MicroSurface,\r\n CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: this.CustomParts.Fragment_Before_FinalColorComposition,\r\n CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: this.CustomParts.Fragment_Before_FragColor,\r\n CUSTOM_FRAGMENT_MAIN_END: this.CustomParts.Fragment_MainEnd,\r\n CUSTOM_FRAGMENT_BEFORE_FOG: this.CustomParts.Fragment_Before_Fog,\r\n };\r\n }\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene, true);\r\n this.CustomParts = new ShaderAlbedoParts();\r\n this.customShaderNameResolve = this.Builder;\r\n\r\n this.FragmentShader = Effect.ShadersStore[\"pbrPixelShader\"];\r\n this.VertexShader = Effect.ShadersStore[\"pbrVertexShader\"];\r\n\r\n this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockAlbedoOpacity>/g, Effect.IncludesShadersStore[\"pbrBlockAlbedoOpacity\"]);\r\n this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockReflectivity>/g, Effect.IncludesShadersStore[\"pbrBlockReflectivity\"]);\r\n this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockFinalColorComposition>/g, Effect.IncludesShadersStore[\"pbrBlockFinalColorComposition\"]);\r\n\r\n PBRCustomMaterial.ShaderIndexer++;\r\n this._createdShaderName = \"custompbr_\" + PBRCustomMaterial.ShaderIndexer;\r\n }\r\n\r\n protected override _afterBind(mesh?: Mesh, effect: Nullable<Effect> = null, subMesh?: SubMesh): void {\r\n if (!effect) {\r\n return;\r\n }\r\n this.AttachAfterBind(mesh, effect);\r\n try {\r\n super._afterBind(mesh, effect, subMesh);\r\n } catch (e) {}\r\n }\r\n\r\n /**\r\n * Adds a new uniform to the shader\r\n * @param name the name of the uniform to add\r\n * @param kind the type of the uniform to add\r\n * @param param the value of the uniform to add\r\n * @returns the current material\r\n */\r\n public AddUniform(name: string, kind: string, param: any): PBRCustomMaterial {\r\n if (!this._customUniform) {\r\n this._customUniform = [];\r\n this._newUniforms = [];\r\n this._newSamplerInstances = {};\r\n this._newUniformInstances = {};\r\n }\r\n if (param) {\r\n if (kind.indexOf(\"sampler\") != -1) {\r\n (<any>this._newSamplerInstances)[kind + \"-\" + name] = param;\r\n } else {\r\n (<any>this._newUniformInstances)[kind + \"-\" + name] = param;\r\n }\r\n }\r\n this._customUniform.push(\"uniform \" + kind + \" \" + name + \";\");\r\n this._newUniforms.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a custom attribute\r\n * @param name the name of the attribute\r\n * @returns the current material\r\n */\r\n public AddAttribute(name: string): PBRCustomMaterial {\r\n if (!this._customAttributes) {\r\n this._customAttributes = [];\r\n }\r\n\r\n this._customAttributes.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Begin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Definitions(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainBegin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Albedo portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Albedo(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_Albedo = shaderPart.replace(\"result\", \"surfaceAlbedo\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Alpha portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Alpha(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace(\"result\", \"alpha\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Lights portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Lights(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_Lights = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_MetallicRoughness portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_MetallicRoughness(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_MicroSurface portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_MicroSurface(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_MicroSurface = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Fog portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Fog(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_Fog = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_FinalColorComposition portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_FinalColorComposition(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_FinalColorComposition = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_FragColor portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_FragColor(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_FragColor = shaderPart.replace(\"result\", \"color\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainEnd(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_MainEnd = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Begin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Definitions(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainBegin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_PositionUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_PositionUpdated(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace(\"result\", \"positionUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_NormalUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_NormalUpdated(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace(\"result\", \"normalUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_After_WorldPosComputed portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_After_WorldPosComputed(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainEnd(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_MainEnd = shaderPart;\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRCustomMaterial\", PBRCustomMaterial);\r\n","/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nimport * as MatLib from \"materials/custom/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst GlobalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof GlobalObject !== \"undefined\") {\r\n for (const key in MatLib) {\r\n (<any>GlobalObject).BABYLON[key] = (<any>MatLib)[key];\r\n }\r\n}\r\n\r\nexport * from \"materials/custom/index\";\r\n","import * as materials from \"@lts/materials/legacy/legacy-custom\";\r\nexport { materials };\r\nexport default materials;\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__597__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","extendStatics","b","setPrototypeOf","__proto__","Array","p","__extends","TypeError","String","__","constructor","create","SuppressedError","name","scene","CustomParts","ShaderSpecialParts","customShaderNameResolve","Builder","FragmentShader","Effect","ShadersStore","VertexShader","CustomMaterial","ShaderIndexer","_createdShaderName","AttachAfterBind","mesh","effect","_newUniformInstances","el","ea","toString","split","setVector2","Color3","setColor3","setVector3","Color4","setDirectColor4","setVector4","setMatrix","setFloat","_newSamplerInstances","isReady","setTexture","ReviewUniform","arr","_newUniforms","ind","length","_customUniform","indexOf","push","replace","shaderName","uniforms","uniformBuffers","samplers","defines","attributes","_customAttributes","_injectCustomCode","code","shaderType","customCode","_getCustomCode","point","injectedCode","fullPointName","CUSTOM_VERTEX_BEGIN","Vertex_Begin","CUSTOM_VERTEX_DEFINITIONS","join","Vertex_Definitions","CUSTOM_VERTEX_MAIN_BEGIN","Vertex_MainBegin","CUSTOM_VERTEX_UPDATE_POSITION","Vertex_Before_PositionUpdated","CUSTOM_VERTEX_UPDATE_NORMAL","Vertex_Before_NormalUpdated","CUSTOM_VERTEX_MAIN_END","Vertex_MainEnd","CUSTOM_VERTEX_UPDATE_WORLDPOS","Vertex_After_WorldPosComputed","CUSTOM_FRAGMENT_BEGIN","Fragment_Begin","CUSTOM_FRAGMENT_DEFINITIONS","Fragment_Definitions","CUSTOM_FRAGMENT_MAIN_BEGIN","Fragment_MainBegin","CUSTOM_FRAGMENT_UPDATE_DIFFUSE","Fragment_Custom_Diffuse","CUSTOM_FRAGMENT_UPDATE_ALPHA","Fragment_Custom_Alpha","CUSTOM_FRAGMENT_BEFORE_LIGHTS","Fragment_Before_Lights","CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR","Fragment_Before_FragColor","CUSTOM_FRAGMENT_MAIN_END","Fragment_MainEnd","CUSTOM_FRAGMENT_BEFORE_FOG","Fragment_Before_Fog","_afterBind","subMesh","AddUniform","kind","param","AddAttribute","shaderPart","StandardMaterial","RegisterClass","ShaderAlebdoParts","ShaderAlbedoParts","IncludesShadersStore","PBRCustomMaterial","options","processFinalCode","type","sci","ShaderCodeInliner","inlineToken","processCode","CUSTOM_FRAGMENT_UPDATE_ALBEDO","Fragment_Custom_Albedo","CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS","Fragment_Custom_MetallicRoughness","CUSTOM_FRAGMENT_UPDATE_MICROSURFACE","Fragment_Custom_MicroSurface","CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION","Fragment_Before_FinalColorComposition","PBRMaterial","GlobalObject","BABYLON"],"sourceRoot":""}
1
+ {"version":3,"file":"babylon.customMaterial.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,sBAAuB,CAAC,aAAcJ,GACnB,iBAAZC,QACdA,QAAQ,uBAAyBD,EAAQG,QAAQ,cAEjDJ,EAAgB,UAAIC,EAAQD,EAAc,QAC3C,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IAAIC,EAASQ,EAAyBE,GAAY,CAGjDX,QAAS,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E,8BAAgCyB,EAC1C3I,IACX,EAOO,YAAAgH,eAAP,SAAsB2B,GAElB,OADA3I,KAAK6C,YAAYmE,eAAiB2B,EAC3B3I,IACX,EAncc,EAAAsD,cAAgB,EAoclC,C,CAxcA,CAAuC,EAAA2G,cA0cvC,IAAApB,eAAc,4BAA6BI,GCnjB3C,IAAMiB,OAAiC,IAAX,EAAAlJ,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjB4J,EACP,IAAK,IAAMxJ,KAAO,EACRwJ,EAAcC,QAAQzJ,GAAa,EAAQA,GCRzD,U","sources":["webpack://MATERIALS/webpack/universalModuleDefinition","webpack://MATERIALS/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://MATERIALS/webpack/bootstrap","webpack://MATERIALS/webpack/runtime/define property getters","webpack://MATERIALS/webpack/runtime/global","webpack://MATERIALS/webpack/runtime/hasOwnProperty shorthand","webpack://MATERIALS/webpack/runtime/make namespace object","webpack://MATERIALS/../../../../node_modules/tslib/tslib.es6.mjs","webpack://MATERIALS/../../../dev/materials/src/custom/customMaterial.ts","webpack://MATERIALS/../../../dev/materials/src/custom/pbrCustomMaterial.ts","webpack://MATERIALS/../../../lts/materials/src/legacy/legacy-custom.ts","webpack://MATERIALS/./src/custom.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-materials\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-materials\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"MATERIALS\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__597__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__597__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport type { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport \"core/Shaders/default.vertex\";\r\nimport \"core/Shaders/default.fragment\";\r\n\r\n/**\r\n * Structure of a custom shader\r\n */\r\nexport class CustomShaderStructure {\r\n /**\r\n * Fragment store\r\n */\r\n public FragmentStore: string;\r\n /**\r\n * Vertex store\r\n */\r\n public VertexStore: string;\r\n\r\n constructor() {}\r\n}\r\n\r\n/**\r\n * Parts of a shader\r\n */\r\nexport class ShaderSpecialParts {\r\n constructor() {}\r\n\r\n /**\r\n * Beginning of the fragment shader\r\n */\r\n public Fragment_Begin: string;\r\n /**\r\n * Variable definitions of the fragment shader\r\n */\r\n public Fragment_Definitions: string;\r\n /**\r\n * Beginning of the fragment main function\r\n */\r\n public Fragment_MainBegin: string;\r\n /**\r\n * End of the fragment main function\r\n */\r\n public Fragment_MainEnd: string;\r\n\r\n /**\r\n * Diffuse color calculation\r\n */\r\n public Fragment_Custom_Diffuse: string;\r\n /**\r\n * Before lightning computations\r\n */\r\n public Fragment_Before_Lights: string;\r\n /**\r\n * Before fog computations\r\n */\r\n public Fragment_Before_Fog: string;\r\n /**\r\n * Alpha calculations\r\n */\r\n public Fragment_Custom_Alpha: string;\r\n /**\r\n * Before frag color is assigned\r\n */\r\n public Fragment_Before_FragColor: string;\r\n /**\r\n * Beginning of the vertex shader\r\n */\r\n public Vertex_Begin: string;\r\n /**\r\n * Variable definitions of the vertex shader\r\n */\r\n public Vertex_Definitions: string;\r\n /**\r\n * Start of the main function of the vertex shader\r\n */\r\n public Vertex_MainBegin: string;\r\n\r\n /**\r\n * Before the world position computation\r\n */\r\n public Vertex_Before_PositionUpdated: string;\r\n\r\n /**\r\n * Before the normal computation\r\n */\r\n public Vertex_Before_NormalUpdated: string;\r\n\r\n /**\r\n * After the world position has been computed\r\n */\r\n public Vertex_After_WorldPosComputed: string;\r\n\r\n /**\r\n * Main end of the vertex shader\r\n */\r\n public Vertex_MainEnd: string;\r\n}\r\n\r\n/**\r\n * Customized material\r\n */\r\nexport class CustomMaterial extends StandardMaterial {\r\n /**\r\n * Index for each created shader\r\n */\r\n public static ShaderIndexer = 1;\r\n /**\r\n * Custom shader structure\r\n */\r\n public CustomParts: ShaderSpecialParts;\r\n /**\r\n * Name of the shader\r\n */\r\n public _createdShaderName: string;\r\n /**\r\n * List of custom uniforms\r\n */\r\n public _customUniform: string[];\r\n /**\r\n * Names of the new uniforms\r\n */\r\n public _newUniforms: string[];\r\n /**\r\n * Instances of the new uniform objects\r\n */\r\n public _newUniformInstances: { [name: string]: any };\r\n /**\r\n * Instances of the new sampler objects\r\n */\r\n public _newSamplerInstances: { [name: string]: Texture };\r\n /**\r\n * List of the custom attributes\r\n */\r\n public _customAttributes: string[];\r\n\r\n /**\r\n * Fragment shader string\r\n */\r\n public FragmentShader: string;\r\n /**\r\n * Vertex shader string\r\n */\r\n public VertexShader: string;\r\n\r\n /**\r\n * Runs after the material is bound to a mesh\r\n * @param mesh mesh bound\r\n * @param effect bound effect used to render\r\n */\r\n public AttachAfterBind(mesh: Mesh | undefined, effect: Effect) {\r\n if (this._newUniformInstances) {\r\n for (const el in this._newUniformInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"vec2\") {\r\n effect.setVector2(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"vec3\") {\r\n if (this._newUniformInstances[el] instanceof Color3) {\r\n effect.setColor3(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector3(ea[1], this._newUniformInstances[el]);\r\n }\r\n } else if (ea[0] == \"vec4\") {\r\n if (this._newUniformInstances[el] instanceof Color4) {\r\n effect.setDirectColor4(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n }\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"mat4\") {\r\n effect.setMatrix(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"float\") {\r\n effect.setFloat(ea[1], this._newUniformInstances[el]);\r\n }\r\n }\r\n }\r\n if (this._newSamplerInstances) {\r\n for (const el in this._newSamplerInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"sampler2D\" && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {\r\n effect.setTexture(ea[1], this._newSamplerInstances[el]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public ReviewUniform(name: string, arr: string[]): string[] {\r\n if (name == \"uniform\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") == -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n if (name == \"sampler\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") != -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n return arr;\r\n }\r\n\r\n /**\r\n * Builds the material\r\n * @param shaderName name of the shader\r\n * @param uniforms list of uniforms\r\n * @param uniformBuffers list of uniform buffers\r\n * @param samplers list of samplers\r\n * @param defines list of defines\r\n * @param attributes list of attributes\r\n * @returns the shader name\r\n */\r\n public Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: MaterialDefines | string[], attributes?: string[]): string {\r\n if (attributes && this._customAttributes && this._customAttributes.length > 0) {\r\n attributes.push(...this._customAttributes);\r\n }\r\n\r\n this.ReviewUniform(\"uniform\", uniforms);\r\n this.ReviewUniform(\"sampler\", samplers);\r\n\r\n const name = this._createdShaderName;\r\n\r\n if (Effect.ShadersStore[name + \"VertexShader\"] && Effect.ShadersStore[name + \"PixelShader\"]) {\r\n return name;\r\n }\r\n Effect.ShadersStore[name + \"VertexShader\"] = this._injectCustomCode(this.VertexShader, \"vertex\");\r\n Effect.ShadersStore[name + \"PixelShader\"] = this._injectCustomCode(this.FragmentShader, \"fragment\");\r\n\r\n return name;\r\n }\r\n\r\n protected _injectCustomCode(code: string, shaderType: string): string {\r\n const customCode = this._getCustomCode(shaderType);\r\n\r\n for (const point in customCode) {\r\n const injectedCode = customCode[point];\r\n\r\n if (injectedCode && injectedCode.length > 0) {\r\n const fullPointName = \"#define \" + point;\r\n code = code.replace(fullPointName, \"\\n\" + injectedCode + \"\\n\" + fullPointName);\r\n }\r\n }\r\n\r\n return code;\r\n }\r\n\r\n protected _getCustomCode(shaderType: string): { [pointName: string]: string } {\r\n if (shaderType === \"vertex\") {\r\n return {\r\n CUSTOM_VERTEX_BEGIN: this.CustomParts.Vertex_Begin,\r\n CUSTOM_VERTEX_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Vertex_Definitions || \"\"),\r\n CUSTOM_VERTEX_MAIN_BEGIN: this.CustomParts.Vertex_MainBegin,\r\n CUSTOM_VERTEX_UPDATE_POSITION: this.CustomParts.Vertex_Before_PositionUpdated,\r\n CUSTOM_VERTEX_UPDATE_NORMAL: this.CustomParts.Vertex_Before_NormalUpdated,\r\n CUSTOM_VERTEX_MAIN_END: this.CustomParts.Vertex_MainEnd,\r\n CUSTOM_VERTEX_UPDATE_WORLDPOS: this.CustomParts.Vertex_After_WorldPosComputed,\r\n };\r\n }\r\n return {\r\n CUSTOM_FRAGMENT_BEGIN: this.CustomParts.Fragment_Begin,\r\n CUSTOM_FRAGMENT_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Fragment_Definitions || \"\"),\r\n CUSTOM_FRAGMENT_MAIN_BEGIN: this.CustomParts.Fragment_MainBegin,\r\n CUSTOM_FRAGMENT_UPDATE_DIFFUSE: this.CustomParts.Fragment_Custom_Diffuse,\r\n CUSTOM_FRAGMENT_UPDATE_ALPHA: this.CustomParts.Fragment_Custom_Alpha,\r\n CUSTOM_FRAGMENT_BEFORE_LIGHTS: this.CustomParts.Fragment_Before_Lights,\r\n CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: this.CustomParts.Fragment_Before_FragColor,\r\n CUSTOM_FRAGMENT_MAIN_END: this.CustomParts.Fragment_MainEnd,\r\n CUSTOM_FRAGMENT_BEFORE_FOG: this.CustomParts.Fragment_Before_Fog,\r\n };\r\n }\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene, true);\r\n this.CustomParts = new ShaderSpecialParts();\r\n this.customShaderNameResolve = this.Builder;\r\n\r\n this.FragmentShader = Effect.ShadersStore[\"defaultPixelShader\"];\r\n this.VertexShader = Effect.ShadersStore[\"defaultVertexShader\"];\r\n\r\n CustomMaterial.ShaderIndexer++;\r\n this._createdShaderName = \"custom_\" + CustomMaterial.ShaderIndexer;\r\n }\r\n\r\n protected override _afterBind(mesh?: Mesh, effect: Nullable<Effect> = null, subMesh?: SubMesh): void {\r\n if (!effect) {\r\n return;\r\n }\r\n this.AttachAfterBind(mesh, effect);\r\n try {\r\n super._afterBind(mesh, effect, subMesh);\r\n } catch (e) {}\r\n }\r\n\r\n /**\r\n * Adds a new uniform to the shader\r\n * @param name the name of the uniform to add\r\n * @param kind the type of the uniform to add\r\n * @param param the value of the uniform to add\r\n * @returns the current material\r\n */\r\n public AddUniform(name: string, kind: string, param: any): CustomMaterial {\r\n if (!this._customUniform) {\r\n this._customUniform = [];\r\n this._newUniforms = [];\r\n this._newSamplerInstances = {};\r\n this._newUniformInstances = {};\r\n }\r\n if (param) {\r\n if (kind.indexOf(\"sampler\") != -1) {\r\n (<any>this._newSamplerInstances)[kind + \"-\" + name] = param;\r\n } else {\r\n (<any>this._newUniformInstances)[kind + \"-\" + name] = param;\r\n }\r\n }\r\n this._customUniform.push(\"uniform \" + kind + \" \" + name + \";\");\r\n this._newUniforms.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a custom attribute\r\n * @param name the name of the attribute\r\n * @returns the current material\r\n */\r\n public AddAttribute(name: string): CustomMaterial {\r\n if (!this._customAttributes) {\r\n this._customAttributes = [];\r\n }\r\n\r\n this._customAttributes.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Begin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Definitions(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainBegin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainEnd(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_MainEnd = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Diffuse portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace(\"result\", \"diffuseColor\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Alpha portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Alpha(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace(\"result\", \"alpha\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Lights portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Lights(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Before_Lights = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Fog portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Fog(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Before_Fog = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_FragColor portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_FragColor(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Fragment_Before_FragColor = shaderPart.replace(\"result\", \"color\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Begin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Definitions(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainBegin(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_PositionUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace(\"result\", \"positionUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_NormalUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace(\"result\", \"normalUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_After_WorldPosComputed portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_After_WorldPosComputed(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainEnd(shaderPart: string): CustomMaterial {\r\n this.CustomParts.Vertex_MainEnd = shaderPart;\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CustomMaterial\", CustomMaterial);\r\n","/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport type { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { ShaderCodeInliner } from \"core/Engines/Processors/shaderCodeInliner\";\r\nimport type { ICustomShaderNameResolveOptions } from \"core/Materials/material\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\n\r\nimport \"core/Shaders/pbr.vertex\";\r\nimport \"core/Shaders/pbr.fragment\";\r\n\r\n/**\r\n * Albedo parts of the shader\r\n */\r\nexport class ShaderAlbedoParts {\r\n constructor() {}\r\n\r\n /**\r\n * Beginning of the fragment shader\r\n */\r\n public Fragment_Begin: string;\r\n /**\r\n * Fragment definitions\r\n */\r\n public Fragment_Definitions: string;\r\n /**\r\n * Beginning of the main function\r\n */\r\n public Fragment_MainBegin: string;\r\n /**\r\n * End of main function\r\n */\r\n public Fragment_MainEnd: string;\r\n\r\n /**\r\n * Albedo color\r\n */\r\n public Fragment_Custom_Albedo: string;\r\n /**\r\n * Lights\r\n */\r\n public Fragment_Before_Lights: string;\r\n /**\r\n * Metallic and roughness\r\n */\r\n public Fragment_Custom_MetallicRoughness: string;\r\n /**\r\n * Microsurface\r\n */\r\n public Fragment_Custom_MicroSurface: string;\r\n /**\r\n * Fog computations\r\n */\r\n public Fragment_Before_Fog: string;\r\n /**\r\n * Alpha\r\n */\r\n public Fragment_Custom_Alpha: string;\r\n /**\r\n * Color composition\r\n */\r\n public Fragment_Before_FinalColorComposition: string;\r\n /**\r\n * Fragment color\r\n */\r\n public Fragment_Before_FragColor: string;\r\n\r\n /**\r\n * Beginning of vertex shader\r\n */\r\n public Vertex_Begin: string;\r\n /**\r\n * Vertex definitions\r\n */\r\n public Vertex_Definitions: string;\r\n /**\r\n * Vertex main begin\r\n */\r\n public Vertex_MainBegin: string;\r\n\r\n /**\r\n * Vertex before position updated\r\n */\r\n public Vertex_Before_PositionUpdated: string;\r\n\r\n /**\r\n * Vertex before normal updated\r\n */\r\n public Vertex_Before_NormalUpdated: string;\r\n\r\n /**\r\n * Vertex after world pos computed\r\n */\r\n public Vertex_After_WorldPosComputed: string;\r\n\r\n /**\r\n * Vertex main end\r\n */\r\n public Vertex_MainEnd: string;\r\n}\r\n\r\n/**\r\n * @deprecated use ShaderAlbedoParts instead.\r\n */\r\nexport const ShaderAlebdoParts = ShaderAlbedoParts;\r\n\r\nexport class PBRCustomMaterial extends PBRMaterial {\r\n /**\r\n * Index for each created shader\r\n */\r\n public static ShaderIndexer = 1;\r\n /**\r\n * Custom shader structure\r\n */\r\n public CustomParts: ShaderAlbedoParts;\r\n /**\r\n * Name of the shader\r\n */\r\n _createdShaderName: string;\r\n /**\r\n * List of custom uniforms\r\n */\r\n _customUniform: string[];\r\n /**\r\n * Names of the new uniforms\r\n */\r\n _newUniforms: string[];\r\n /**\r\n * Instances of the new uniform objects\r\n */\r\n _newUniformInstances: { [name: string]: any };\r\n /**\r\n * Instances of the new sampler objects\r\n */\r\n _newSamplerInstances: { [name: string]: Texture };\r\n /**\r\n * List of the custom attributes\r\n */\r\n _customAttributes: string[];\r\n\r\n /**\r\n * Fragment shader string\r\n */\r\n public FragmentShader: string;\r\n /**\r\n * Vertex shader string\r\n */\r\n public VertexShader: string;\r\n\r\n /**\r\n * Runs after the material is bound to a mesh\r\n * @param mesh mesh bound\r\n * @param effect bound effect used to render\r\n */\r\n public AttachAfterBind(mesh: Mesh | undefined, effect: Effect) {\r\n if (this._newUniformInstances) {\r\n for (const el in this._newUniformInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"vec2\") {\r\n effect.setVector2(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"vec3\") {\r\n if (this._newUniformInstances[el] instanceof Color3) {\r\n effect.setColor3(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector3(ea[1], this._newUniformInstances[el]);\r\n }\r\n } else if (ea[0] == \"vec4\") {\r\n if (this._newUniformInstances[el] instanceof Color4) {\r\n effect.setDirectColor4(ea[1], this._newUniformInstances[el]);\r\n } else {\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n }\r\n effect.setVector4(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"mat4\") {\r\n effect.setMatrix(ea[1], this._newUniformInstances[el]);\r\n } else if (ea[0] == \"float\") {\r\n effect.setFloat(ea[1], this._newUniformInstances[el]);\r\n }\r\n }\r\n }\r\n if (this._newSamplerInstances) {\r\n for (const el in this._newSamplerInstances) {\r\n const ea = el.toString().split(\"-\");\r\n if (ea[0] == \"sampler2D\" && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {\r\n effect.setTexture(ea[1], this._newSamplerInstances[el]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public ReviewUniform(name: string, arr: string[]): string[] {\r\n if (name == \"uniform\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") == -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n if (name == \"sampler\" && this._newUniforms) {\r\n for (let ind = 0; ind < this._newUniforms.length; ind++) {\r\n if (this._customUniform[ind].indexOf(\"sampler\") != -1) {\r\n arr.push(this._newUniforms[ind].replace(/\\[\\d*\\]/g, \"\"));\r\n }\r\n }\r\n }\r\n return arr;\r\n }\r\n\r\n /**\r\n * Builds the material\r\n * @param shaderName name of the shader\r\n * @param uniforms list of uniforms\r\n * @param uniformBuffers list of uniform buffers\r\n * @param samplers list of samplers\r\n * @param defines list of defines\r\n * @param attributes list of attributes\r\n * @param options options to compile the shader\r\n * @returns the shader name\r\n */\r\n public Builder(\r\n shaderName: string,\r\n uniforms: string[],\r\n uniformBuffers: string[],\r\n samplers: string[],\r\n defines: MaterialDefines | string[],\r\n attributes?: string[],\r\n options?: ICustomShaderNameResolveOptions\r\n ): string {\r\n if (options) {\r\n const currentProcessing = options.processFinalCode;\r\n options.processFinalCode = (type: string, code: string) => {\r\n if (type === \"vertex\") {\r\n return currentProcessing ? currentProcessing(type, code) : code;\r\n }\r\n const sci = new ShaderCodeInliner(code);\r\n sci.inlineToken = \"#define pbr_inline\";\r\n sci.processCode();\r\n return currentProcessing ? currentProcessing(type, sci.code) : sci.code;\r\n };\r\n }\r\n\r\n if (attributes && this._customAttributes && this._customAttributes.length > 0) {\r\n attributes.push(...this._customAttributes);\r\n }\r\n\r\n this.ReviewUniform(\"uniform\", uniforms);\r\n this.ReviewUniform(\"sampler\", samplers);\r\n\r\n const name = this._createdShaderName;\r\n\r\n if (Effect.ShadersStore[name + \"VertexShader\"] && Effect.ShadersStore[name + \"PixelShader\"]) {\r\n return name;\r\n }\r\n Effect.ShadersStore[name + \"VertexShader\"] = this._injectCustomCode(this.VertexShader, \"vertex\");\r\n Effect.ShadersStore[name + \"PixelShader\"] = this._injectCustomCode(this.FragmentShader, \"fragment\");\r\n\r\n return name;\r\n }\r\n\r\n protected _injectCustomCode(code: string, shaderType: string): string {\r\n const customCode = this._getCustomCode(shaderType);\r\n\r\n for (const point in customCode) {\r\n const injectedCode = customCode[point];\r\n\r\n if (injectedCode && injectedCode.length > 0) {\r\n const fullPointName = \"#define \" + point;\r\n code = code.replace(fullPointName, \"\\n\" + injectedCode + \"\\n\" + fullPointName);\r\n }\r\n }\r\n\r\n return code;\r\n }\r\n\r\n protected _getCustomCode(shaderType: string): { [pointName: string]: string } {\r\n if (shaderType === \"vertex\") {\r\n return {\r\n CUSTOM_VERTEX_BEGIN: this.CustomParts.Vertex_Begin,\r\n CUSTOM_VERTEX_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Vertex_Definitions || \"\"),\r\n CUSTOM_VERTEX_MAIN_BEGIN: this.CustomParts.Vertex_MainBegin,\r\n CUSTOM_VERTEX_UPDATE_POSITION: this.CustomParts.Vertex_Before_PositionUpdated,\r\n CUSTOM_VERTEX_UPDATE_NORMAL: this.CustomParts.Vertex_Before_NormalUpdated,\r\n CUSTOM_VERTEX_MAIN_END: this.CustomParts.Vertex_MainEnd,\r\n CUSTOM_VERTEX_UPDATE_WORLDPOS: this.CustomParts.Vertex_After_WorldPosComputed,\r\n };\r\n }\r\n return {\r\n CUSTOM_FRAGMENT_BEGIN: this.CustomParts.Fragment_Begin,\r\n CUSTOM_FRAGMENT_MAIN_BEGIN: this.CustomParts.Fragment_MainBegin,\r\n CUSTOM_FRAGMENT_DEFINITIONS: (this._customUniform?.join(\"\\n\") || \"\") + (this.CustomParts.Fragment_Definitions || \"\"),\r\n CUSTOM_FRAGMENT_UPDATE_ALBEDO: this.CustomParts.Fragment_Custom_Albedo,\r\n CUSTOM_FRAGMENT_UPDATE_ALPHA: this.CustomParts.Fragment_Custom_Alpha,\r\n CUSTOM_FRAGMENT_BEFORE_LIGHTS: this.CustomParts.Fragment_Before_Lights,\r\n CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS: this.CustomParts.Fragment_Custom_MetallicRoughness,\r\n CUSTOM_FRAGMENT_UPDATE_MICROSURFACE: this.CustomParts.Fragment_Custom_MicroSurface,\r\n CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION: this.CustomParts.Fragment_Before_FinalColorComposition,\r\n CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR: this.CustomParts.Fragment_Before_FragColor,\r\n CUSTOM_FRAGMENT_MAIN_END: this.CustomParts.Fragment_MainEnd,\r\n CUSTOM_FRAGMENT_BEFORE_FOG: this.CustomParts.Fragment_Before_Fog,\r\n };\r\n }\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene, true);\r\n this.CustomParts = new ShaderAlbedoParts();\r\n this.customShaderNameResolve = this.Builder;\r\n\r\n this.FragmentShader = Effect.ShadersStore[\"pbrPixelShader\"];\r\n this.VertexShader = Effect.ShadersStore[\"pbrVertexShader\"];\r\n\r\n this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockAlbedoOpacity>/g, Effect.IncludesShadersStore[\"pbrBlockAlbedoOpacity\"]);\r\n this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockReflectivity>/g, Effect.IncludesShadersStore[\"pbrBlockReflectivity\"]);\r\n this.FragmentShader = this.FragmentShader.replace(/#include<pbrBlockFinalColorComposition>/g, Effect.IncludesShadersStore[\"pbrBlockFinalColorComposition\"]);\r\n\r\n PBRCustomMaterial.ShaderIndexer++;\r\n this._createdShaderName = \"custompbr_\" + PBRCustomMaterial.ShaderIndexer;\r\n }\r\n\r\n protected override _afterBind(mesh?: Mesh, effect: Nullable<Effect> = null, subMesh?: SubMesh): void {\r\n if (!effect) {\r\n return;\r\n }\r\n this.AttachAfterBind(mesh, effect);\r\n try {\r\n super._afterBind(mesh, effect, subMesh);\r\n } catch (e) {}\r\n }\r\n\r\n /**\r\n * Adds a new uniform to the shader\r\n * @param name the name of the uniform to add\r\n * @param kind the type of the uniform to add\r\n * @param param the value of the uniform to add\r\n * @returns the current material\r\n */\r\n public AddUniform(name: string, kind: string, param: any): PBRCustomMaterial {\r\n if (!this._customUniform) {\r\n this._customUniform = [];\r\n this._newUniforms = [];\r\n this._newSamplerInstances = {};\r\n this._newUniformInstances = {};\r\n }\r\n if (param) {\r\n if (kind.indexOf(\"sampler\") != -1) {\r\n (<any>this._newSamplerInstances)[kind + \"-\" + name] = param;\r\n } else {\r\n (<any>this._newUniformInstances)[kind + \"-\" + name] = param;\r\n }\r\n }\r\n this._customUniform.push(\"uniform \" + kind + \" \" + name + \";\");\r\n this._newUniforms.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a custom attribute\r\n * @param name the name of the attribute\r\n * @returns the current material\r\n */\r\n public AddAttribute(name: string): PBRCustomMaterial {\r\n if (!this._customAttributes) {\r\n this._customAttributes = [];\r\n }\r\n\r\n this._customAttributes.push(name);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Begin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Definitions(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainBegin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Albedo portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Albedo(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_Albedo = shaderPart.replace(\"result\", \"surfaceAlbedo\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_Alpha portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_Alpha(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace(\"result\", \"alpha\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Lights portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Lights(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_Lights = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_MetallicRoughness portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_MetallicRoughness(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Custom_MicroSurface portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Custom_MicroSurface(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Custom_MicroSurface = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_Fog portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_Fog(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_Fog = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_FinalColorComposition portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_FinalColorComposition(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_FinalColorComposition = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_Before_FragColor portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_Before_FragColor(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_Before_FragColor = shaderPart.replace(\"result\", \"color\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Fragment_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Fragment_MainEnd(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Fragment_MainEnd = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Begin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Begin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Begin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Definitions portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Definitions(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Definitions = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainBegin portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainBegin(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_MainBegin = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_PositionUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_PositionUpdated(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace(\"result\", \"positionUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_Before_NormalUpdated portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_Before_NormalUpdated(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace(\"result\", \"normalUpdated\");\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_After_WorldPosComputed portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_After_WorldPosComputed(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the code on Vertex_MainEnd portion\r\n * @param shaderPart the code string\r\n * @returns the current material\r\n */\r\n public Vertex_MainEnd(shaderPart: string): PBRCustomMaterial {\r\n this.CustomParts.Vertex_MainEnd = shaderPart;\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRCustomMaterial\", PBRCustomMaterial);\r\n","/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nimport * as MatLib from \"materials/custom/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst GlobalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof GlobalObject !== \"undefined\") {\r\n for (const key in MatLib) {\r\n (<any>GlobalObject).BABYLON[key] = (<any>MatLib)[key];\r\n }\r\n}\r\n\r\nexport * from \"materials/custom/index\";\r\n","import * as materials from \"@lts/materials/legacy/legacy-custom\";\r\nexport { materials };\r\nexport default materials;\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__597__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","extendStatics","b","setPrototypeOf","__proto__","Array","p","__extends","TypeError","String","__","constructor","create","SuppressedError","name","scene","CustomParts","ShaderSpecialParts","customShaderNameResolve","Builder","FragmentShader","Effect","ShadersStore","VertexShader","CustomMaterial","ShaderIndexer","_createdShaderName","AttachAfterBind","mesh","effect","_newUniformInstances","el","ea","toString","split","setVector2","Color3","setColor3","setVector3","Color4","setDirectColor4","setVector4","setMatrix","setFloat","_newSamplerInstances","isReady","setTexture","ReviewUniform","arr","_newUniforms","ind","length","_customUniform","indexOf","push","replace","shaderName","uniforms","uniformBuffers","samplers","defines","attributes","_customAttributes","_injectCustomCode","code","shaderType","customCode","_getCustomCode","point","injectedCode","fullPointName","CUSTOM_VERTEX_BEGIN","Vertex_Begin","CUSTOM_VERTEX_DEFINITIONS","join","Vertex_Definitions","CUSTOM_VERTEX_MAIN_BEGIN","Vertex_MainBegin","CUSTOM_VERTEX_UPDATE_POSITION","Vertex_Before_PositionUpdated","CUSTOM_VERTEX_UPDATE_NORMAL","Vertex_Before_NormalUpdated","CUSTOM_VERTEX_MAIN_END","Vertex_MainEnd","CUSTOM_VERTEX_UPDATE_WORLDPOS","Vertex_After_WorldPosComputed","CUSTOM_FRAGMENT_BEGIN","Fragment_Begin","CUSTOM_FRAGMENT_DEFINITIONS","Fragment_Definitions","CUSTOM_FRAGMENT_MAIN_BEGIN","Fragment_MainBegin","CUSTOM_FRAGMENT_UPDATE_DIFFUSE","Fragment_Custom_Diffuse","CUSTOM_FRAGMENT_UPDATE_ALPHA","Fragment_Custom_Alpha","CUSTOM_FRAGMENT_BEFORE_LIGHTS","Fragment_Before_Lights","CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR","Fragment_Before_FragColor","CUSTOM_FRAGMENT_MAIN_END","Fragment_MainEnd","CUSTOM_FRAGMENT_BEFORE_FOG","Fragment_Before_Fog","_afterBind","subMesh","AddUniform","kind","param","AddAttribute","shaderPart","StandardMaterial","RegisterClass","ShaderAlebdoParts","ShaderAlbedoParts","IncludesShadersStore","PBRCustomMaterial","options","processFinalCode","type","sci","ShaderCodeInliner","inlineToken","processCode","CUSTOM_FRAGMENT_UPDATE_ALBEDO","Fragment_Custom_Albedo","CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS","Fragment_Custom_MetallicRoughness","CUSTOM_FRAGMENT_UPDATE_MICROSURFACE","Fragment_Custom_MicroSurface","CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION","Fragment_Before_FinalColorComposition","PBRMaterial","GlobalObject","BABYLON"],"ignoreList":[],"sourceRoot":""}