babylon.customMaterial.js 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("babylonjs"));
  4. else if(typeof define === 'function' && define.amd)
  5. define("babylonjs-materials", ["babylonjs"], factory);
  6. else if(typeof exports === 'object')
  7. exports["babylonjs-materials"] = factory(require("babylonjs"));
  8. else
  9. root["MATERIALS"] = factory(root["BABYLON"]);
  10. })((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./legacy/legacy-custom.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "../../node_modules/tslib/tslib.es6.js":
  99. /*!*****************************************************************************!*\
  100. !*** C:/Users/trbaron/workspace/Babylon.js/node_modules/tslib/tslib.es6.js ***!
  101. \*****************************************************************************/
  102. /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
  103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104. "use strict";
  105. __webpack_require__.r(__webpack_exports__);
  106. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
  107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
  108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
  109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
  110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
  111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
  112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
  113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
  114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
  115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
  116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
  117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
  118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
  119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
  120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
  121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
  122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
  123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
  124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
  125. /*! *****************************************************************************
  126. Copyright (c) Microsoft Corporation. All rights reserved.
  127. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  128. this file except in compliance with the License. You may obtain a copy of the
  129. License at http://www.apache.org/licenses/LICENSE-2.0
  130. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  131. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  132. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  133. MERCHANTABLITY OR NON-INFRINGEMENT.
  134. See the Apache Version 2.0 License for specific language governing permissions
  135. and limitations under the License.
  136. ***************************************************************************** */
  137. /* global Reflect, Promise */
  138. var extendStatics = function(d, b) {
  139. extendStatics = Object.setPrototypeOf ||
  140. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  141. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  142. return extendStatics(d, b);
  143. };
  144. function __extends(d, b) {
  145. extendStatics(d, b);
  146. function __() { this.constructor = d; }
  147. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  148. }
  149. var __assign = function() {
  150. __assign = Object.assign || function __assign(t) {
  151. for (var s, i = 1, n = arguments.length; i < n; i++) {
  152. s = arguments[i];
  153. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  154. }
  155. return t;
  156. }
  157. return __assign.apply(this, arguments);
  158. }
  159. function __rest(s, e) {
  160. var t = {};
  161. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  162. t[p] = s[p];
  163. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  164. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  165. t[p[i]] = s[p[i]];
  166. return t;
  167. }
  168. function __decorate(decorators, target, key, desc) {
  169. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  170. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  171. 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;
  172. return c > 3 && r && Object.defineProperty(target, key, r), r;
  173. }
  174. function __param(paramIndex, decorator) {
  175. return function (target, key) { decorator(target, key, paramIndex); }
  176. }
  177. function __metadata(metadataKey, metadataValue) {
  178. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  179. }
  180. function __awaiter(thisArg, _arguments, P, generator) {
  181. return new (P || (P = Promise))(function (resolve, reject) {
  182. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  183. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  184. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  185. step((generator = generator.apply(thisArg, _arguments || [])).next());
  186. });
  187. }
  188. function __generator(thisArg, body) {
  189. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  190. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  191. function verb(n) { return function (v) { return step([n, v]); }; }
  192. function step(op) {
  193. if (f) throw new TypeError("Generator is already executing.");
  194. while (_) try {
  195. 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;
  196. if (y = 0, t) op = [op[0] & 2, t.value];
  197. switch (op[0]) {
  198. case 0: case 1: t = op; break;
  199. case 4: _.label++; return { value: op[1], done: false };
  200. case 5: _.label++; y = op[1]; op = [0]; continue;
  201. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  202. default:
  203. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  204. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  205. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  206. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  207. if (t[2]) _.ops.pop();
  208. _.trys.pop(); continue;
  209. }
  210. op = body.call(thisArg, _);
  211. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  212. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  213. }
  214. }
  215. function __exportStar(m, exports) {
  216. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  217. }
  218. function __values(o) {
  219. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  220. if (m) return m.call(o);
  221. return {
  222. next: function () {
  223. if (o && i >= o.length) o = void 0;
  224. return { value: o && o[i++], done: !o };
  225. }
  226. };
  227. }
  228. function __read(o, n) {
  229. var m = typeof Symbol === "function" && o[Symbol.iterator];
  230. if (!m) return o;
  231. var i = m.call(o), r, ar = [], e;
  232. try {
  233. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  234. }
  235. catch (error) { e = { error: error }; }
  236. finally {
  237. try {
  238. if (r && !r.done && (m = i["return"])) m.call(i);
  239. }
  240. finally { if (e) throw e.error; }
  241. }
  242. return ar;
  243. }
  244. function __spread() {
  245. for (var ar = [], i = 0; i < arguments.length; i++)
  246. ar = ar.concat(__read(arguments[i]));
  247. return ar;
  248. }
  249. function __await(v) {
  250. return this instanceof __await ? (this.v = v, this) : new __await(v);
  251. }
  252. function __asyncGenerator(thisArg, _arguments, generator) {
  253. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  254. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  255. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  256. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  257. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  258. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  259. function fulfill(value) { resume("next", value); }
  260. function reject(value) { resume("throw", value); }
  261. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  262. }
  263. function __asyncDelegator(o) {
  264. var i, p;
  265. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  266. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  267. }
  268. function __asyncValues(o) {
  269. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  270. var m = o[Symbol.asyncIterator], i;
  271. 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);
  272. 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); }); }; }
  273. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  274. }
  275. function __makeTemplateObject(cooked, raw) {
  276. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  277. return cooked;
  278. };
  279. function __importStar(mod) {
  280. if (mod && mod.__esModule) return mod;
  281. var result = {};
  282. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  283. result.default = mod;
  284. return result;
  285. }
  286. function __importDefault(mod) {
  287. return (mod && mod.__esModule) ? mod : { default: mod };
  288. }
  289. /***/ }),
  290. /***/ "../../node_modules/webpack/buildin/global.js":
  291. /*!***********************************!*\
  292. !*** (webpack)/buildin/global.js ***!
  293. \***********************************/
  294. /*! no static exports found */
  295. /***/ (function(module, exports) {
  296. var g;
  297. // This works in non-strict mode
  298. g = (function() {
  299. return this;
  300. })();
  301. try {
  302. // This works if eval is allowed (see CSP)
  303. g = g || new Function("return this")();
  304. } catch (e) {
  305. // This works if the window reference is available
  306. if (typeof window === "object") g = window;
  307. }
  308. // g can still be undefined, but nothing to do about it...
  309. // We return undefined, instead of nothing here, so it's
  310. // easier to handle this case. if(!global) { ...}
  311. module.exports = g;
  312. /***/ }),
  313. /***/ "./custom/customMaterial.ts":
  314. /*!**********************************!*\
  315. !*** ./custom/customMaterial.ts ***!
  316. \**********************************/
  317. /*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial */
  318. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  319. "use strict";
  320. __webpack_require__.r(__webpack_exports__);
  321. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return CustomShaderStructure; });
  322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return ShaderSpecialParts; });
  323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return CustomMaterial; });
  324. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  325. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  326. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__);
  327. var CustomShaderStructure = /** @class */ (function () {
  328. function CustomShaderStructure() {
  329. }
  330. return CustomShaderStructure;
  331. }());
  332. var ShaderSpecialParts = /** @class */ (function () {
  333. function ShaderSpecialParts() {
  334. }
  335. return ShaderSpecialParts;
  336. }());
  337. var CustomMaterial = /** @class */ (function (_super) {
  338. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CustomMaterial, _super);
  339. function CustomMaterial(name, scene) {
  340. var _this = _super.call(this, name, scene) || this;
  341. _this.CustomParts = new ShaderSpecialParts();
  342. _this.customShaderNameResolve = _this.Builder;
  343. _this.FragmentShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["defaultPixelShader"];
  344. _this.VertexShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["defaultVertexShader"];
  345. return _this;
  346. }
  347. CustomMaterial.prototype.AttachAfterBind = function (mesh, effect) {
  348. for (var el in this._newUniformInstances) {
  349. var ea = el.toString().split('-');
  350. if (ea[0] == 'vec2') {
  351. effect.setVector2(ea[1], this._newUniformInstances[el]);
  352. }
  353. else if (ea[0] == 'vec3') {
  354. effect.setVector3(ea[1], this._newUniformInstances[el]);
  355. }
  356. else if (ea[0] == 'vec4') {
  357. effect.setVector4(ea[1], this._newUniformInstances[el]);
  358. }
  359. else if (ea[0] == 'mat4') {
  360. effect.setMatrix(ea[1], this._newUniformInstances[el]);
  361. }
  362. else if (ea[0] == 'float') {
  363. effect.setFloat(ea[1], this._newUniformInstances[el]);
  364. }
  365. }
  366. for (var el in this._newSamplerInstances) {
  367. var ea = el.toString().split('-');
  368. if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {
  369. effect.setTexture(ea[1], this._newSamplerInstances[el]);
  370. }
  371. }
  372. };
  373. CustomMaterial.prototype.ReviewUniform = function (name, arr) {
  374. if (name == "uniform") {
  375. for (var ind in this._newUniforms) {
  376. if (this._customUniform[ind].indexOf('sampler') == -1) {
  377. arr.push(this._newUniforms[ind]);
  378. }
  379. }
  380. }
  381. if (name == "sampler") {
  382. for (var ind in this._newUniforms) {
  383. if (this._customUniform[ind].indexOf('sampler') != -1) {
  384. arr.push(this._newUniforms[ind]);
  385. }
  386. }
  387. }
  388. return arr;
  389. };
  390. CustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines) {
  391. var _this = this;
  392. if (this._isCreatedShader) {
  393. return this._createdShaderName;
  394. }
  395. this._isCreatedShader = false;
  396. CustomMaterial.ShaderIndexer++;
  397. var name = "custom_" + CustomMaterial.ShaderIndexer;
  398. this.ReviewUniform("uniform", uniforms);
  399. this.ReviewUniform("sampler", samplers);
  400. var fn_afterBind = this._afterBind.bind(this);
  401. this._afterBind = function (m, e) {
  402. if (!e) {
  403. return;
  404. }
  405. _this.AttachAfterBind(m, e);
  406. try {
  407. fn_afterBind(m, e);
  408. }
  409. catch (e) { }
  410. };
  411. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = this.VertexShader
  412. .replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : ""))
  413. .replace('#define CUSTOM_VERTEX_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : ""))
  414. .replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : ""))
  415. .replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : ""))
  416. .replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : ""))
  417. .replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""));
  418. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = this.FragmentShader
  419. .replace('#define CUSTOM_FRAGMENT_BEGIN', (this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : ""))
  420. .replace('#define CUSTOM_FRAGMENT_MAIN_BEGIN', (this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : ""))
  421. .replace('#define CUSTOM_FRAGMENT_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : ""))
  422. .replace('#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE', (this.CustomParts.Fragment_Custom_Diffuse ? this.CustomParts.Fragment_Custom_Diffuse : ""))
  423. .replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : ""))
  424. .replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : ""))
  425. .replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', (this.CustomParts.Fragment_Before_Fog ? this.CustomParts.Fragment_Before_Fog : ""))
  426. .replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : ""));
  427. this._isCreatedShader = true;
  428. this._createdShaderName = name;
  429. return name;
  430. };
  431. CustomMaterial.prototype.AddUniform = function (name, kind, param) {
  432. if (!this._customUniform) {
  433. this._customUniform = new Array();
  434. this._newUniforms = new Array();
  435. this._newSamplerInstances = new Array();
  436. this._newUniformInstances = new Array();
  437. }
  438. if (param) {
  439. if (kind.indexOf("sampler") == -1) {
  440. this._newUniformInstances[kind + "-" + name] = param;
  441. }
  442. else {
  443. this._newUniformInstances[kind + "-" + name] = param;
  444. }
  445. }
  446. this._customUniform.push("uniform " + kind + " " + name + ";");
  447. this._newUniforms.push(name);
  448. return this;
  449. };
  450. CustomMaterial.prototype.Fragment_Begin = function (shaderPart) {
  451. this.CustomParts.Fragment_Begin = shaderPart;
  452. return this;
  453. };
  454. CustomMaterial.prototype.Fragment_Definitions = function (shaderPart) {
  455. this.CustomParts.Fragment_Definitions = shaderPart;
  456. return this;
  457. };
  458. CustomMaterial.prototype.Fragment_MainBegin = function (shaderPart) {
  459. this.CustomParts.Fragment_MainBegin = shaderPart;
  460. return this;
  461. };
  462. CustomMaterial.prototype.Fragment_Custom_Diffuse = function (shaderPart) {
  463. this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace("result", "diffuseColor");
  464. return this;
  465. };
  466. CustomMaterial.prototype.Fragment_Custom_Alpha = function (shaderPart) {
  467. this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha");
  468. return this;
  469. };
  470. CustomMaterial.prototype.Fragment_Before_Lights = function (shaderPart) {
  471. this.CustomParts.Fragment_Before_Lights = shaderPart;
  472. return this;
  473. };
  474. CustomMaterial.prototype.Fragment_Before_Fog = function (shaderPart) {
  475. this.CustomParts.Fragment_Before_Fog = shaderPart;
  476. return this;
  477. };
  478. CustomMaterial.prototype.Fragment_Before_FragColor = function (shaderPart) {
  479. this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color");
  480. return this;
  481. };
  482. CustomMaterial.prototype.Vertex_Begin = function (shaderPart) {
  483. this.CustomParts.Vertex_Begin = shaderPart;
  484. return this;
  485. };
  486. CustomMaterial.prototype.Vertex_Definitions = function (shaderPart) {
  487. this.CustomParts.Vertex_Definitions = shaderPart;
  488. return this;
  489. };
  490. CustomMaterial.prototype.Vertex_MainBegin = function (shaderPart) {
  491. this.CustomParts.Vertex_MainBegin = shaderPart;
  492. return this;
  493. };
  494. CustomMaterial.prototype.Vertex_Before_PositionUpdated = function (shaderPart) {
  495. this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated");
  496. return this;
  497. };
  498. CustomMaterial.prototype.Vertex_Before_NormalUpdated = function (shaderPart) {
  499. this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated");
  500. return this;
  501. };
  502. CustomMaterial.prototype.Vertex_MainEnd = function (shaderPart) {
  503. this.CustomParts.Vertex_MainEnd = shaderPart;
  504. return this;
  505. };
  506. CustomMaterial.ShaderIndexer = 1;
  507. return CustomMaterial;
  508. }(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]));
  509. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.CustomMaterial"] = CustomMaterial;
  510. /***/ }),
  511. /***/ "./custom/index.ts":
  512. /*!*************************!*\
  513. !*** ./custom/index.ts ***!
  514. \*************************/
  515. /*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial */
  516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  517. "use strict";
  518. __webpack_require__.r(__webpack_exports__);
  519. /* harmony import */ var _customMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./customMaterial */ "./custom/customMaterial.ts");
  520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["CustomShaderStructure"]; });
  521. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["ShaderSpecialParts"]; });
  522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _customMaterial__WEBPACK_IMPORTED_MODULE_0__["CustomMaterial"]; });
  523. /* harmony import */ var _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pbrCustomMaterial */ "./custom/pbrCustomMaterial.ts");
  524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__["ShaderAlebdoParts"]; });
  525. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _pbrCustomMaterial__WEBPACK_IMPORTED_MODULE_1__["PBRCustomMaterial"]; });
  526. /***/ }),
  527. /***/ "./custom/pbrCustomMaterial.ts":
  528. /*!*************************************!*\
  529. !*** ./custom/pbrCustomMaterial.ts ***!
  530. \*************************************/
  531. /*! exports provided: ShaderAlebdoParts, PBRCustomMaterial */
  532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  533. "use strict";
  534. __webpack_require__.r(__webpack_exports__);
  535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return ShaderAlebdoParts; });
  536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return PBRCustomMaterial; });
  537. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  538. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  539. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__);
  540. var ShaderAlebdoParts = /** @class */ (function () {
  541. function ShaderAlebdoParts() {
  542. }
  543. return ShaderAlebdoParts;
  544. }());
  545. var PBRCustomMaterial = /** @class */ (function (_super) {
  546. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](PBRCustomMaterial, _super);
  547. function PBRCustomMaterial(name, scene) {
  548. var _this = _super.call(this, name, scene) || this;
  549. _this.CustomParts = new ShaderAlebdoParts();
  550. _this.customShaderNameResolve = _this.Builder;
  551. _this.FragmentShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["pbrPixelShader"];
  552. _this.VertexShader = babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore["pbrVertexShader"];
  553. return _this;
  554. }
  555. PBRCustomMaterial.prototype.AttachAfterBind = function (mesh, effect) {
  556. for (var el in this._newUniformInstances) {
  557. var ea = el.toString().split('-');
  558. if (ea[0] == 'vec2') {
  559. effect.setVector2(ea[1], this._newUniformInstances[el]);
  560. }
  561. else if (ea[0] == 'vec3') {
  562. effect.setVector3(ea[1], this._newUniformInstances[el]);
  563. }
  564. else if (ea[0] == 'vec4') {
  565. effect.setVector4(ea[1], this._newUniformInstances[el]);
  566. }
  567. else if (ea[0] == 'mat4') {
  568. effect.setMatrix(ea[1], this._newUniformInstances[el]);
  569. }
  570. else if (ea[0] == 'float') {
  571. effect.setFloat(ea[1], this._newUniformInstances[el]);
  572. }
  573. }
  574. for (var el in this._newSamplerInstances) {
  575. var ea = el.toString().split('-');
  576. if (ea[0] == 'sampler2D' && this._newSamplerInstances[el].isReady && this._newSamplerInstances[el].isReady()) {
  577. effect.setTexture(ea[1], this._newSamplerInstances[el]);
  578. }
  579. }
  580. };
  581. PBRCustomMaterial.prototype.ReviewUniform = function (name, arr) {
  582. if (name == "uniform") {
  583. for (var ind in this._newUniforms) {
  584. if (this._customUniform[ind].indexOf('sampler') == -1) {
  585. arr.push(this._newUniforms[ind]);
  586. }
  587. }
  588. }
  589. if (name == "sampler") {
  590. for (var ind in this._newUniforms) {
  591. if (this._customUniform[ind].indexOf('sampler') != -1) {
  592. arr.push(this._newUniforms[ind]);
  593. }
  594. }
  595. }
  596. return arr;
  597. };
  598. PBRCustomMaterial.prototype.Builder = function (shaderName, uniforms, uniformBuffers, samplers, defines) {
  599. var _this = this;
  600. if (this._isCreatedShader) {
  601. return this._createdShaderName;
  602. }
  603. this._isCreatedShader = false;
  604. PBRCustomMaterial.ShaderIndexer++;
  605. var name = "custom_" + PBRCustomMaterial.ShaderIndexer;
  606. this.ReviewUniform("uniform", uniforms);
  607. this.ReviewUniform("sampler", samplers);
  608. var fn_afterBind = this._afterBind.bind(this);
  609. this._afterBind = function (m, e) {
  610. if (!e) {
  611. return;
  612. }
  613. _this.AttachAfterBind(m, e);
  614. try {
  615. fn_afterBind(m, e);
  616. }
  617. catch (e) { }
  618. };
  619. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "VertexShader"] = this.VertexShader
  620. .replace('#define CUSTOM_VERTEX_BEGIN', (this.CustomParts.Vertex_Begin ? this.CustomParts.Vertex_Begin : ""))
  621. .replace('#define CUSTOM_VERTEX_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Vertex_Definitions ? this.CustomParts.Vertex_Definitions : ""))
  622. .replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : ""))
  623. .replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : ""))
  624. .replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : ""))
  625. .replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""));
  626. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["Effect"].ShadersStore[name + "PixelShader"] = this.FragmentShader
  627. .replace('#define CUSTOM_FRAGMENT_BEGIN', (this.CustomParts.Fragment_Begin ? this.CustomParts.Fragment_Begin : ""))
  628. .replace('#define CUSTOM_FRAGMENT_MAIN_BEGIN', (this.CustomParts.Fragment_MainBegin ? this.CustomParts.Fragment_MainBegin : ""))
  629. .replace('#define CUSTOM_FRAGMENT_DEFINITIONS', (this._customUniform ? this._customUniform.join("\n") : "") + (this.CustomParts.Fragment_Definitions ? this.CustomParts.Fragment_Definitions : ""))
  630. .replace('#define CUSTOM_FRAGMENT_UPDATE_ALBEDO', (this.CustomParts.Fragment_Custom_Albedo ? this.CustomParts.Fragment_Custom_Albedo : ""))
  631. .replace('#define CUSTOM_FRAGMENT_UPDATE_ALPHA', (this.CustomParts.Fragment_Custom_Alpha ? this.CustomParts.Fragment_Custom_Alpha : ""))
  632. .replace('#define CUSTOM_FRAGMENT_BEFORE_LIGHTS', (this.CustomParts.Fragment_Before_Lights ? this.CustomParts.Fragment_Before_Lights : ""))
  633. .replace('#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS', (this.CustomParts.Fragment_Custom_MetallicRoughness ? this.CustomParts.Fragment_Custom_MetallicRoughness : ""))
  634. .replace('#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE', (this.CustomParts.Fragment_Custom_MicroSurface ? this.CustomParts.Fragment_Custom_MicroSurface : ""))
  635. .replace('#define CUSTOM_FRAGMENT_BEFORE_FOG', (this.CustomParts.Fragment_Before_Fog ? this.CustomParts.Fragment_Before_Fog : ""))
  636. .replace('#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR', (this.CustomParts.Fragment_Before_FragColor ? this.CustomParts.Fragment_Before_FragColor : ""));
  637. this._isCreatedShader = true;
  638. this._createdShaderName = name;
  639. return name;
  640. };
  641. PBRCustomMaterial.prototype.AddUniform = function (name, kind, param) {
  642. if (!this._customUniform) {
  643. this._customUniform = new Array();
  644. this._newUniforms = new Array();
  645. this._newSamplerInstances = new Array();
  646. this._newUniformInstances = new Array();
  647. }
  648. if (param) {
  649. if (kind.indexOf("sampler") == -1) {
  650. this._newUniformInstances[kind + "-" + name] = param;
  651. }
  652. else {
  653. this._newUniformInstances[kind + "-" + name] = param;
  654. }
  655. }
  656. this._customUniform.push("uniform " + kind + " " + name + ";");
  657. this._newUniforms.push(name);
  658. return this;
  659. };
  660. PBRCustomMaterial.prototype.Fragment_Begin = function (shaderPart) {
  661. this.CustomParts.Fragment_Begin = shaderPart;
  662. return this;
  663. };
  664. PBRCustomMaterial.prototype.Fragment_Definitions = function (shaderPart) {
  665. this.CustomParts.Fragment_Definitions = shaderPart;
  666. return this;
  667. };
  668. PBRCustomMaterial.prototype.Fragment_MainBegin = function (shaderPart) {
  669. this.CustomParts.Fragment_MainBegin = shaderPart;
  670. return this;
  671. };
  672. PBRCustomMaterial.prototype.Fragment_Custom_Albedo = function (shaderPart) {
  673. this.CustomParts.Fragment_Custom_Albedo = shaderPart.replace("result", "surfaceAlbedo");
  674. return this;
  675. };
  676. PBRCustomMaterial.prototype.Fragment_Custom_Alpha = function (shaderPart) {
  677. this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha");
  678. return this;
  679. };
  680. PBRCustomMaterial.prototype.Fragment_Before_Lights = function (shaderPart) {
  681. this.CustomParts.Fragment_Before_Lights = shaderPart;
  682. return this;
  683. };
  684. PBRCustomMaterial.prototype.Fragment_Custom_MetallicRoughness = function (shaderPart) {
  685. this.CustomParts.Fragment_Custom_MetallicRoughness = shaderPart;
  686. return this;
  687. };
  688. PBRCustomMaterial.prototype.Fragment_Custom_MicroSurface = function (shaderPart) {
  689. this.CustomParts.Fragment_Custom_MicroSurface = shaderPart;
  690. return this;
  691. };
  692. PBRCustomMaterial.prototype.Fragment_Before_Fog = function (shaderPart) {
  693. this.CustomParts.Fragment_Before_Fog = shaderPart;
  694. return this;
  695. };
  696. PBRCustomMaterial.prototype.Fragment_Before_FragColor = function (shaderPart) {
  697. this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color");
  698. return this;
  699. };
  700. PBRCustomMaterial.prototype.Vertex_Begin = function (shaderPart) {
  701. this.CustomParts.Vertex_Begin = shaderPart;
  702. return this;
  703. };
  704. PBRCustomMaterial.prototype.Vertex_Definitions = function (shaderPart) {
  705. this.CustomParts.Vertex_Definitions = shaderPart;
  706. return this;
  707. };
  708. PBRCustomMaterial.prototype.Vertex_MainBegin = function (shaderPart) {
  709. this.CustomParts.Vertex_MainBegin = shaderPart;
  710. return this;
  711. };
  712. PBRCustomMaterial.prototype.Vertex_Before_PositionUpdated = function (shaderPart) {
  713. this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated");
  714. return this;
  715. };
  716. PBRCustomMaterial.prototype.Vertex_Before_NormalUpdated = function (shaderPart) {
  717. this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated");
  718. return this;
  719. };
  720. PBRCustomMaterial.prototype.Vertex_MainEnd = function (shaderPart) {
  721. this.CustomParts.Vertex_MainEnd = shaderPart;
  722. return this;
  723. };
  724. PBRCustomMaterial.ShaderIndexer = 1;
  725. return PBRCustomMaterial;
  726. }(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["PBRMaterial"]));
  727. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.PBRCustomMaterial"] = PBRCustomMaterial;
  728. /***/ }),
  729. /***/ "./legacy/legacy-custom.ts":
  730. /*!*********************************!*\
  731. !*** ./legacy/legacy-custom.ts ***!
  732. \*********************************/
  733. /*! exports provided: CustomShaderStructure, ShaderSpecialParts, CustomMaterial, ShaderAlebdoParts, PBRCustomMaterial */
  734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  735. "use strict";
  736. __webpack_require__.r(__webpack_exports__);
  737. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _custom_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../custom/index */ "./custom/index.ts");
  738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomShaderStructure", function() { return _custom_index__WEBPACK_IMPORTED_MODULE_0__["CustomShaderStructure"]; });
  739. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderSpecialParts", function() { return _custom_index__WEBPACK_IMPORTED_MODULE_0__["ShaderSpecialParts"]; });
  740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomMaterial", function() { return _custom_index__WEBPACK_IMPORTED_MODULE_0__["CustomMaterial"]; });
  741. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ShaderAlebdoParts", function() { return _custom_index__WEBPACK_IMPORTED_MODULE_0__["ShaderAlebdoParts"]; });
  742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PBRCustomMaterial", function() { return _custom_index__WEBPACK_IMPORTED_MODULE_0__["PBRCustomMaterial"]; });
  743. /**
  744. * This is the entry point for the UMD module.
  745. * The entry point for a future ESM package should be index.ts
  746. */
  747. var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
  748. if (typeof globalObject !== "undefined") {
  749. for (var key in _custom_index__WEBPACK_IMPORTED_MODULE_0__) {
  750. globalObject.BABYLON[key] = _custom_index__WEBPACK_IMPORTED_MODULE_0__[key];
  751. }
  752. }
  753. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  754. /***/ }),
  755. /***/ "babylonjs/Misc/decorators":
  756. /*!****************************************************************************************************!*\
  757. !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
  758. \****************************************************************************************************/
  759. /*! no static exports found */
  760. /***/ (function(module, exports) {
  761. module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
  762. /***/ })
  763. /******/ });
  764. });
  765. //# sourceMappingURL=babylon.customMaterial.js.map