babylonjs.proceduralTextures.js 113 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060
  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-procedural-textures", ["babylonjs"], factory);
  6. else if(typeof exports === 'object')
  7. exports["babylonjs-procedural-textures"] = factory(require("babylonjs"));
  8. else
  9. root["PROCEDURALTEXTURES"] = 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.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "../../node_modules/tslib/tslib.es6.js":
  99. /*!***********************************************************!*\
  100. <<<<<<< HEAD
  101. !*** D:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
  102. =======
  103. !*** C:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
  104. >>>>>>> c561ead7a93fc6094d0854d66d037d358954fe3b
  105. \***********************************************************/
  106. /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
  107. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
  111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
  112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
  113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
  114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
  115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
  116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
  117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
  118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
  119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
  120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
  121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
  122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
  123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
  124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
  125. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
  126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
  127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
  128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
  129. /*! *****************************************************************************
  130. Copyright (c) Microsoft Corporation. All rights reserved.
  131. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  132. this file except in compliance with the License. You may obtain a copy of the
  133. License at http://www.apache.org/licenses/LICENSE-2.0
  134. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  135. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  136. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  137. MERCHANTABLITY OR NON-INFRINGEMENT.
  138. See the Apache Version 2.0 License for specific language governing permissions
  139. and limitations under the License.
  140. ***************************************************************************** */
  141. /* global Reflect, Promise */
  142. var extendStatics = function(d, b) {
  143. extendStatics = Object.setPrototypeOf ||
  144. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  145. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  146. return extendStatics(d, b);
  147. };
  148. function __extends(d, b) {
  149. extendStatics(d, b);
  150. function __() { this.constructor = d; }
  151. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  152. }
  153. var __assign = function() {
  154. __assign = Object.assign || function __assign(t) {
  155. for (var s, i = 1, n = arguments.length; i < n; i++) {
  156. s = arguments[i];
  157. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  158. }
  159. return t;
  160. }
  161. return __assign.apply(this, arguments);
  162. }
  163. function __rest(s, e) {
  164. var t = {};
  165. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  166. t[p] = s[p];
  167. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  168. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  169. t[p[i]] = s[p[i]];
  170. return t;
  171. }
  172. function __decorate(decorators, target, key, desc) {
  173. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  174. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  175. 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;
  176. return c > 3 && r && Object.defineProperty(target, key, r), r;
  177. }
  178. function __param(paramIndex, decorator) {
  179. return function (target, key) { decorator(target, key, paramIndex); }
  180. }
  181. function __metadata(metadataKey, metadataValue) {
  182. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  183. }
  184. function __awaiter(thisArg, _arguments, P, generator) {
  185. return new (P || (P = Promise))(function (resolve, reject) {
  186. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  187. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  188. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  189. step((generator = generator.apply(thisArg, _arguments || [])).next());
  190. });
  191. }
  192. function __generator(thisArg, body) {
  193. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  194. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  195. function verb(n) { return function (v) { return step([n, v]); }; }
  196. function step(op) {
  197. if (f) throw new TypeError("Generator is already executing.");
  198. while (_) try {
  199. 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;
  200. if (y = 0, t) op = [op[0] & 2, t.value];
  201. switch (op[0]) {
  202. case 0: case 1: t = op; break;
  203. case 4: _.label++; return { value: op[1], done: false };
  204. case 5: _.label++; y = op[1]; op = [0]; continue;
  205. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  206. default:
  207. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  208. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  209. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  210. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  211. if (t[2]) _.ops.pop();
  212. _.trys.pop(); continue;
  213. }
  214. op = body.call(thisArg, _);
  215. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  216. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  217. }
  218. }
  219. function __exportStar(m, exports) {
  220. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  221. }
  222. function __values(o) {
  223. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  224. if (m) return m.call(o);
  225. return {
  226. next: function () {
  227. if (o && i >= o.length) o = void 0;
  228. return { value: o && o[i++], done: !o };
  229. }
  230. };
  231. }
  232. function __read(o, n) {
  233. var m = typeof Symbol === "function" && o[Symbol.iterator];
  234. if (!m) return o;
  235. var i = m.call(o), r, ar = [], e;
  236. try {
  237. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  238. }
  239. catch (error) { e = { error: error }; }
  240. finally {
  241. try {
  242. if (r && !r.done && (m = i["return"])) m.call(i);
  243. }
  244. finally { if (e) throw e.error; }
  245. }
  246. return ar;
  247. }
  248. function __spread() {
  249. for (var ar = [], i = 0; i < arguments.length; i++)
  250. ar = ar.concat(__read(arguments[i]));
  251. return ar;
  252. }
  253. function __await(v) {
  254. return this instanceof __await ? (this.v = v, this) : new __await(v);
  255. }
  256. function __asyncGenerator(thisArg, _arguments, generator) {
  257. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  258. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  259. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  260. 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); }); }; }
  261. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  262. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  263. function fulfill(value) { resume("next", value); }
  264. function reject(value) { resume("throw", value); }
  265. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  266. }
  267. function __asyncDelegator(o) {
  268. var i, p;
  269. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  270. 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; }
  271. }
  272. function __asyncValues(o) {
  273. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  274. var m = o[Symbol.asyncIterator], i;
  275. 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);
  276. 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); }); }; }
  277. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  278. }
  279. function __makeTemplateObject(cooked, raw) {
  280. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  281. return cooked;
  282. };
  283. function __importStar(mod) {
  284. if (mod && mod.__esModule) return mod;
  285. var result = {};
  286. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  287. result.default = mod;
  288. return result;
  289. }
  290. function __importDefault(mod) {
  291. return (mod && mod.__esModule) ? mod : { default: mod };
  292. }
  293. /***/ }),
  294. /***/ "../../node_modules/webpack/buildin/global.js":
  295. /*!***********************************!*\
  296. !*** (webpack)/buildin/global.js ***!
  297. \***********************************/
  298. /*! no static exports found */
  299. /***/ (function(module, exports) {
  300. var g;
  301. // This works in non-strict mode
  302. g = (function() {
  303. return this;
  304. })();
  305. try {
  306. // This works if eval is allowed (see CSP)
  307. g = g || new Function("return this")();
  308. } catch (e) {
  309. // This works if the window reference is available
  310. if (typeof window === "object") g = window;
  311. }
  312. // g can still be undefined, but nothing to do about it...
  313. // We return undefined, instead of nothing here, so it's
  314. // easier to handle this case. if(!global) { ...}
  315. module.exports = g;
  316. /***/ }),
  317. /***/ "./brick/brickProceduralTexture.fragment.ts":
  318. /*!**************************************************!*\
  319. !*** ./brick/brickProceduralTexture.fragment.ts ***!
  320. \**************************************************/
  321. /*! exports provided: brickProceduralTexturePixelShader */
  322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  323. "use strict";
  324. __webpack_require__.r(__webpack_exports__);
  325. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brickProceduralTexturePixelShader", function() { return brickProceduralTexturePixelShader; });
  326. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  327. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  328. var name = 'brickProceduralTexturePixelShader';
  329. var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfBricksHeight;\nuniform float numberOfBricksWidth;\nuniform vec3 brickColor;\nuniform vec3 jointColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\nvoid main(void)\n{\nfloat brickW=1.0/numberOfBricksWidth;\nfloat brickH=1.0/numberOfBricksHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.05;\nvec3 color=brickColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0) == 0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat brickColorSwitch=mod(floor(yi)+floor(xi),3.0);\nif (brickColorSwitch == 0.0)\ncolor=mix(color,vec3(0.33,0.33,0.33),0.3);\nelse if (brickColorSwitch == 2.0)\ncolor=mix(color,vec3(0.11,0.11,0.11),0.3);\n}\ngl_FragColor=vec4(color,1.0);\n}";
  330. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  331. /** @hidden */
  332. var brickProceduralTexturePixelShader = { name: name, shader: shader };
  333. /***/ }),
  334. /***/ "./brick/brickProceduralTexture.ts":
  335. /*!*****************************************!*\
  336. !*** ./brick/brickProceduralTexture.ts ***!
  337. \*****************************************/
  338. /*! exports provided: BrickProceduralTexture */
  339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  340. "use strict";
  341. __webpack_require__.r(__webpack_exports__);
  342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrickProceduralTexture", function() { return BrickProceduralTexture; });
  343. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  344. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  345. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  346. /* harmony import */ var _brickProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./brickProceduralTexture.fragment */ "./brick/brickProceduralTexture.fragment.ts");
  347. var BrickProceduralTexture = /** @class */ (function (_super) {
  348. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BrickProceduralTexture, _super);
  349. function BrickProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  350. var _this = _super.call(this, name, size, "brickProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  351. _this._numberOfBricksHeight = 15;
  352. _this._numberOfBricksWidth = 5;
  353. _this._jointColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.72, 0.72, 0.72);
  354. _this._brickColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.77, 0.47, 0.40);
  355. _this.updateShaderUniforms();
  356. return _this;
  357. }
  358. BrickProceduralTexture.prototype.updateShaderUniforms = function () {
  359. this.setFloat("numberOfBricksHeight", this._numberOfBricksHeight);
  360. this.setFloat("numberOfBricksWidth", this._numberOfBricksWidth);
  361. this.setColor3("brickColor", this._brickColor);
  362. this.setColor3("jointColor", this._jointColor);
  363. };
  364. Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksHeight", {
  365. get: function () {
  366. return this._numberOfBricksHeight;
  367. },
  368. set: function (value) {
  369. this._numberOfBricksHeight = value;
  370. this.updateShaderUniforms();
  371. },
  372. enumerable: true,
  373. configurable: true
  374. });
  375. Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksWidth", {
  376. get: function () {
  377. return this._numberOfBricksWidth;
  378. },
  379. set: function (value) {
  380. this._numberOfBricksWidth = value;
  381. this.updateShaderUniforms();
  382. },
  383. enumerable: true,
  384. configurable: true
  385. });
  386. Object.defineProperty(BrickProceduralTexture.prototype, "jointColor", {
  387. get: function () {
  388. return this._jointColor;
  389. },
  390. set: function (value) {
  391. this._jointColor = value;
  392. this.updateShaderUniforms();
  393. },
  394. enumerable: true,
  395. configurable: true
  396. });
  397. Object.defineProperty(BrickProceduralTexture.prototype, "brickColor", {
  398. get: function () {
  399. return this._brickColor;
  400. },
  401. set: function (value) {
  402. this._brickColor = value;
  403. this.updateShaderUniforms();
  404. },
  405. enumerable: true,
  406. configurable: true
  407. });
  408. /**
  409. * Serializes this brick procedural texture
  410. * @returns a serialized brick procedural texture object
  411. */
  412. BrickProceduralTexture.prototype.serialize = function () {
  413. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  414. serializationObject.customType = "BABYLON.BrickProceduralTexture";
  415. return serializationObject;
  416. };
  417. /**
  418. * Creates a Brick Procedural Texture from parsed brick procedural texture data
  419. * @param parsedTexture defines parsed texture data
  420. * @param scene defines the current scene
  421. * @param rootUrl defines the root URL containing brick procedural texture information
  422. * @returns a parsed Brick Procedural Texture
  423. */
  424. BrickProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  425. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new BrickProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  426. return texture;
  427. };
  428. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  429. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  430. ], BrickProceduralTexture.prototype, "numberOfBricksHeight", null);
  431. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  432. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  433. ], BrickProceduralTexture.prototype, "numberOfBricksWidth", null);
  434. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  435. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
  436. ], BrickProceduralTexture.prototype, "jointColor", null);
  437. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  438. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
  439. ], BrickProceduralTexture.prototype, "brickColor", null);
  440. return BrickProceduralTexture;
  441. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  442. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.BrickProceduralTexture"] = BrickProceduralTexture;
  443. /***/ }),
  444. /***/ "./brick/index.ts":
  445. /*!************************!*\
  446. !*** ./brick/index.ts ***!
  447. \************************/
  448. /*! exports provided: BrickProceduralTexture */
  449. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  450. "use strict";
  451. __webpack_require__.r(__webpack_exports__);
  452. /* harmony import */ var _brickProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./brickProceduralTexture */ "./brick/brickProceduralTexture.ts");
  453. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrickProceduralTexture", function() { return _brickProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["BrickProceduralTexture"]; });
  454. /***/ }),
  455. /***/ "./cloud/cloudProceduralTexture.fragment.ts":
  456. /*!**************************************************!*\
  457. !*** ./cloud/cloudProceduralTexture.fragment.ts ***!
  458. \**************************************************/
  459. /*! exports provided: cloudProceduralTexturePixelShader */
  460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  461. "use strict";
  462. __webpack_require__.r(__webpack_exports__);
  463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloudProceduralTexturePixelShader", function() { return cloudProceduralTexturePixelShader; });
  464. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  465. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  466. var name = 'cloudProceduralTexturePixelShader';
  467. var shader = "precision highp float;\nvarying vec2 vUV;\nuniform vec4 skyColor;\nuniform vec4 cloudColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nvoid main() {\nvec2 p=vUV*12.0;\nvec4 c=mix(skyColor,cloudColor,fbm(p));\ngl_FragColor=c;\n}\n";
  468. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  469. /** @hidden */
  470. var cloudProceduralTexturePixelShader = { name: name, shader: shader };
  471. /***/ }),
  472. /***/ "./cloud/cloudProceduralTexture.ts":
  473. /*!*****************************************!*\
  474. !*** ./cloud/cloudProceduralTexture.ts ***!
  475. \*****************************************/
  476. /*! exports provided: CloudProceduralTexture */
  477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  478. "use strict";
  479. __webpack_require__.r(__webpack_exports__);
  480. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CloudProceduralTexture", function() { return CloudProceduralTexture; });
  481. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  482. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  483. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  484. /* harmony import */ var _cloudProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloudProceduralTexture.fragment */ "./cloud/cloudProceduralTexture.fragment.ts");
  485. var CloudProceduralTexture = /** @class */ (function (_super) {
  486. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CloudProceduralTexture, _super);
  487. function CloudProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  488. var _this = _super.call(this, name, size, "cloudProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  489. _this._skyColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color4"](0.15, 0.68, 1.0, 1.0);
  490. _this._cloudColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color4"](1, 1, 1, 1.0);
  491. _this.updateShaderUniforms();
  492. return _this;
  493. }
  494. CloudProceduralTexture.prototype.updateShaderUniforms = function () {
  495. this.setColor4("skyColor", this._skyColor);
  496. this.setColor4("cloudColor", this._cloudColor);
  497. };
  498. Object.defineProperty(CloudProceduralTexture.prototype, "skyColor", {
  499. get: function () {
  500. return this._skyColor;
  501. },
  502. set: function (value) {
  503. this._skyColor = value;
  504. this.updateShaderUniforms();
  505. },
  506. enumerable: true,
  507. configurable: true
  508. });
  509. Object.defineProperty(CloudProceduralTexture.prototype, "cloudColor", {
  510. get: function () {
  511. return this._cloudColor;
  512. },
  513. set: function (value) {
  514. this._cloudColor = value;
  515. this.updateShaderUniforms();
  516. },
  517. enumerable: true,
  518. configurable: true
  519. });
  520. /**
  521. * Serializes this cloud procedural texture
  522. * @returns a serialized cloud procedural texture object
  523. */
  524. CloudProceduralTexture.prototype.serialize = function () {
  525. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  526. serializationObject.customType = "BABYLON.CloudProceduralTexture";
  527. return serializationObject;
  528. };
  529. /**
  530. * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
  531. * @param parsedTexture defines parsed texture data
  532. * @param scene defines the current scene
  533. * @param rootUrl defines the root URL containing cloud procedural texture information
  534. * @returns a parsed Cloud Procedural Texture
  535. */
  536. CloudProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  537. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new CloudProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  538. return texture;
  539. };
  540. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  541. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor4"])()
  542. ], CloudProceduralTexture.prototype, "skyColor", null);
  543. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  544. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor4"])()
  545. ], CloudProceduralTexture.prototype, "cloudColor", null);
  546. return CloudProceduralTexture;
  547. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  548. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.CloudProceduralTexture"] = CloudProceduralTexture;
  549. /***/ }),
  550. /***/ "./cloud/index.ts":
  551. /*!************************!*\
  552. !*** ./cloud/index.ts ***!
  553. \************************/
  554. /*! exports provided: CloudProceduralTexture */
  555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  556. "use strict";
  557. __webpack_require__.r(__webpack_exports__);
  558. /* harmony import */ var _cloudProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cloudProceduralTexture */ "./cloud/cloudProceduralTexture.ts");
  559. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CloudProceduralTexture", function() { return _cloudProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["CloudProceduralTexture"]; });
  560. /***/ }),
  561. /***/ "./fire/fireProceduralTexture.fragment.ts":
  562. /*!************************************************!*\
  563. !*** ./fire/fireProceduralTexture.fragment.ts ***!
  564. \************************************************/
  565. /*! exports provided: fireProceduralTexturePixelShader */
  566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  567. "use strict";
  568. __webpack_require__.r(__webpack_exports__);
  569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fireProceduralTexturePixelShader", function() { return fireProceduralTexturePixelShader; });
  570. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  571. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  572. var name = 'fireProceduralTexturePixelShader';
  573. var shader = "precision highp float;\nuniform float time;\nuniform vec3 c1;\nuniform vec3 c2;\nuniform vec3 c3;\nuniform vec3 c4;\nuniform vec3 c5;\nuniform vec3 c6;\nuniform vec2 speed;\nuniform float shift;\nuniform float alphaThreshold;\nvarying vec2 vUV;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nvoid main() {\nvec2 p=vUV*8.0;\nfloat q=fbm(p-time*0.1);\nvec2 r=vec2(fbm(p+q+time*speed.x-p.x-p.y),fbm(p+q-time*speed.y));\nvec3 c=mix(c1,c2,fbm(p+r))+mix(c3,c4,r.x)-mix(c5,c6,r.y);\nvec3 color=c*cos(shift*vUV.y);\nfloat luminance=dot(color.rgb,vec3(0.3,0.59,0.11));\ngl_FragColor=vec4(color,luminance*alphaThreshold+(1.0-alphaThreshold));\n}";
  574. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  575. /** @hidden */
  576. var fireProceduralTexturePixelShader = { name: name, shader: shader };
  577. /***/ }),
  578. /***/ "./fire/fireProceduralTexture.ts":
  579. /*!***************************************!*\
  580. !*** ./fire/fireProceduralTexture.ts ***!
  581. \***************************************/
  582. /*! exports provided: FireProceduralTexture */
  583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  584. "use strict";
  585. __webpack_require__.r(__webpack_exports__);
  586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FireProceduralTexture", function() { return FireProceduralTexture; });
  587. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  588. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  589. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  590. /* harmony import */ var _fireProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fireProceduralTexture.fragment */ "./fire/fireProceduralTexture.fragment.ts");
  591. var FireProceduralTexture = /** @class */ (function (_super) {
  592. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FireProceduralTexture, _super);
  593. function FireProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  594. var _this = _super.call(this, name, size, "fireProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  595. _this._time = 0.0;
  596. _this._speed = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector2"](0.5, 0.3);
  597. _this._autoGenerateTime = true;
  598. _this._alphaThreshold = 0.5;
  599. _this._fireColors = FireProceduralTexture.RedFireColors;
  600. _this.updateShaderUniforms();
  601. return _this;
  602. }
  603. FireProceduralTexture.prototype.updateShaderUniforms = function () {
  604. this.setFloat("time", this._time);
  605. this.setVector2("speed", this._speed);
  606. this.setColor3("c1", this._fireColors[0]);
  607. this.setColor3("c2", this._fireColors[1]);
  608. this.setColor3("c3", this._fireColors[2]);
  609. this.setColor3("c4", this._fireColors[3]);
  610. this.setColor3("c5", this._fireColors[4]);
  611. this.setColor3("c6", this._fireColors[5]);
  612. this.setFloat("alphaThreshold", this._alphaThreshold);
  613. };
  614. FireProceduralTexture.prototype.render = function (useCameraPostProcess) {
  615. var scene = this.getScene();
  616. if (this._autoGenerateTime && scene) {
  617. this._time += scene.getAnimationRatio() * 0.03;
  618. this.updateShaderUniforms();
  619. }
  620. _super.prototype.render.call(this, useCameraPostProcess);
  621. };
  622. Object.defineProperty(FireProceduralTexture, "PurpleFireColors", {
  623. get: function () {
  624. return [
  625. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 0.0, 1.0),
  626. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.9, 0.0, 1.0),
  627. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.2, 0.0, 1.0),
  628. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1.0, 0.9, 1.0),
  629. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.1, 1.0),
  630. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.9, 0.9, 1.0)
  631. ];
  632. },
  633. enumerable: true,
  634. configurable: true
  635. });
  636. Object.defineProperty(FireProceduralTexture, "GreenFireColors", {
  637. get: function () {
  638. return [
  639. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 1.0, 0.0),
  640. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 1.0, 0.0),
  641. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.3, 0.4, 0.0),
  642. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 1.0, 0.0),
  643. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.2, 0.0, 0.0),
  644. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 1.0, 0.0)
  645. ];
  646. },
  647. enumerable: true,
  648. configurable: true
  649. });
  650. Object.defineProperty(FireProceduralTexture, "RedFireColors", {
  651. get: function () {
  652. return [
  653. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.5, 0.0, 0.1),
  654. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.9, 0.0, 0.0),
  655. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.2, 0.0, 0.0),
  656. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1.0, 0.9, 0.0),
  657. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.1, 0.1),
  658. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.9, 0.9, 0.9)
  659. ];
  660. },
  661. enumerable: true,
  662. configurable: true
  663. });
  664. Object.defineProperty(FireProceduralTexture, "BlueFireColors", {
  665. get: function () {
  666. return [
  667. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.0, 0.5),
  668. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.0, 0.0, 0.5),
  669. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.0, 0.2),
  670. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.0, 0.0, 1.0),
  671. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.1, 0.2, 0.3),
  672. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.0, 0.2, 0.9)
  673. ];
  674. },
  675. enumerable: true,
  676. configurable: true
  677. });
  678. Object.defineProperty(FireProceduralTexture.prototype, "autoGenerateTime", {
  679. get: function () {
  680. return this._autoGenerateTime;
  681. },
  682. set: function (value) {
  683. this._autoGenerateTime = value;
  684. },
  685. enumerable: true,
  686. configurable: true
  687. });
  688. Object.defineProperty(FireProceduralTexture.prototype, "fireColors", {
  689. get: function () {
  690. return this._fireColors;
  691. },
  692. set: function (value) {
  693. this._fireColors = value;
  694. this.updateShaderUniforms();
  695. },
  696. enumerable: true,
  697. configurable: true
  698. });
  699. Object.defineProperty(FireProceduralTexture.prototype, "time", {
  700. get: function () {
  701. return this._time;
  702. },
  703. set: function (value) {
  704. this._time = value;
  705. this.updateShaderUniforms();
  706. },
  707. enumerable: true,
  708. configurable: true
  709. });
  710. Object.defineProperty(FireProceduralTexture.prototype, "speed", {
  711. get: function () {
  712. return this._speed;
  713. },
  714. set: function (value) {
  715. this._speed = value;
  716. this.updateShaderUniforms();
  717. },
  718. enumerable: true,
  719. configurable: true
  720. });
  721. Object.defineProperty(FireProceduralTexture.prototype, "alphaThreshold", {
  722. get: function () {
  723. return this._alphaThreshold;
  724. },
  725. set: function (value) {
  726. this._alphaThreshold = value;
  727. this.updateShaderUniforms();
  728. },
  729. enumerable: true,
  730. configurable: true
  731. });
  732. /**
  733. * Serializes this fire procedural texture
  734. * @returns a serialized fire procedural texture object
  735. */
  736. FireProceduralTexture.prototype.serialize = function () {
  737. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  738. serializationObject.customType = "BABYLON.FireProceduralTexture";
  739. serializationObject.fireColors = [];
  740. for (var i = 0; i < this._fireColors.length; i++) {
  741. serializationObject.fireColors.push(this._fireColors[i].asArray());
  742. }
  743. return serializationObject;
  744. };
  745. /**
  746. * Creates a Fire Procedural Texture from parsed fire procedural texture data
  747. * @param parsedTexture defines parsed texture data
  748. * @param scene defines the current scene
  749. * @param rootUrl defines the root URL containing fire procedural texture information
  750. * @returns a parsed Fire Procedural Texture
  751. */
  752. FireProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  753. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new FireProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  754. var colors = [];
  755. for (var i = 0; i < parsedTexture.fireColors.length; i++) {
  756. colors.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(parsedTexture.fireColors[i]));
  757. }
  758. texture.fireColors = colors;
  759. return texture;
  760. };
  761. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  762. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  763. ], FireProceduralTexture.prototype, "autoGenerateTime", null);
  764. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  765. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  766. ], FireProceduralTexture.prototype, "time", null);
  767. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  768. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsVector2"])()
  769. ], FireProceduralTexture.prototype, "speed", null);
  770. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  771. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  772. ], FireProceduralTexture.prototype, "alphaThreshold", null);
  773. return FireProceduralTexture;
  774. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  775. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.FireProceduralTexture"] = FireProceduralTexture;
  776. /***/ }),
  777. /***/ "./fire/index.ts":
  778. /*!***********************!*\
  779. !*** ./fire/index.ts ***!
  780. \***********************/
  781. /*! exports provided: FireProceduralTexture */
  782. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  783. "use strict";
  784. __webpack_require__.r(__webpack_exports__);
  785. /* harmony import */ var _fireProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fireProceduralTexture */ "./fire/fireProceduralTexture.ts");
  786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireProceduralTexture", function() { return _fireProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["FireProceduralTexture"]; });
  787. /***/ }),
  788. /***/ "./grass/grassProceduralTexture.fragment.ts":
  789. /*!**************************************************!*\
  790. !*** ./grass/grassProceduralTexture.fragment.ts ***!
  791. \**************************************************/
  792. /*! exports provided: grassProceduralTexturePixelShader */
  793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  794. "use strict";
  795. __webpack_require__.r(__webpack_exports__);
  796. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grassProceduralTexturePixelShader", function() { return grassProceduralTexturePixelShader; });
  797. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  798. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  799. var name = 'grassProceduralTexturePixelShader';
  800. var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform vec3 herb1Color;\nuniform vec3 herb2Color;\nuniform vec3 herb3Color;\nuniform vec3 groundColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nvoid main(void) {\nvec3 color=mix(groundColor,herb1Color,rand(gl_FragCoord.xy*4.0));\ncolor=mix(color,herb2Color,rand(gl_FragCoord.xy*8.0));\ncolor=mix(color,herb3Color,rand(gl_FragCoord.xy));\ncolor=mix(color,herb1Color,fbm(gl_FragCoord.xy*16.0));\ngl_FragColor=vec4(color,1.0);\n}";
  801. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  802. /** @hidden */
  803. var grassProceduralTexturePixelShader = { name: name, shader: shader };
  804. /***/ }),
  805. /***/ "./grass/grassProceduralTexture.ts":
  806. /*!*****************************************!*\
  807. !*** ./grass/grassProceduralTexture.ts ***!
  808. \*****************************************/
  809. /*! exports provided: GrassProceduralTexture */
  810. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  811. "use strict";
  812. __webpack_require__.r(__webpack_exports__);
  813. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GrassProceduralTexture", function() { return GrassProceduralTexture; });
  814. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  815. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  816. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  817. /* harmony import */ var _grassProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grassProceduralTexture.fragment */ "./grass/grassProceduralTexture.fragment.ts");
  818. var GrassProceduralTexture = /** @class */ (function (_super) {
  819. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GrassProceduralTexture, _super);
  820. function GrassProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  821. var _this = _super.call(this, name, size, "grassProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  822. _this._groundColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1, 1, 1);
  823. _this._grassColors = [
  824. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.29, 0.38, 0.02),
  825. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.36, 0.49, 0.09),
  826. new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.51, 0.6, 0.28)
  827. ];
  828. _this.updateShaderUniforms();
  829. return _this;
  830. }
  831. GrassProceduralTexture.prototype.updateShaderUniforms = function () {
  832. this.setColor3("herb1Color", this._grassColors[0]);
  833. this.setColor3("herb2Color", this._grassColors[1]);
  834. this.setColor3("herb3Color", this._grassColors[2]);
  835. this.setColor3("groundColor", this._groundColor);
  836. };
  837. Object.defineProperty(GrassProceduralTexture.prototype, "grassColors", {
  838. get: function () {
  839. return this._grassColors;
  840. },
  841. set: function (value) {
  842. this._grassColors = value;
  843. this.updateShaderUniforms();
  844. },
  845. enumerable: true,
  846. configurable: true
  847. });
  848. Object.defineProperty(GrassProceduralTexture.prototype, "groundColor", {
  849. get: function () {
  850. return this._groundColor;
  851. },
  852. set: function (value) {
  853. this._groundColor = value;
  854. this.updateShaderUniforms();
  855. },
  856. enumerable: true,
  857. configurable: true
  858. });
  859. /**
  860. * Serializes this grass procedural texture
  861. * @returns a serialized grass procedural texture object
  862. */
  863. GrassProceduralTexture.prototype.serialize = function () {
  864. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  865. serializationObject.customType = "BABYLON.GrassProceduralTexture";
  866. serializationObject.grassColors = [];
  867. for (var i = 0; i < this._grassColors.length; i++) {
  868. serializationObject.grassColors.push(this._grassColors[i].asArray());
  869. }
  870. return serializationObject;
  871. };
  872. /**
  873. * Creates a Grass Procedural Texture from parsed grass procedural texture data
  874. * @param parsedTexture defines parsed texture data
  875. * @param scene defines the current scene
  876. * @param rootUrl defines the root URL containing grass procedural texture information
  877. * @returns a parsed Grass Procedural Texture
  878. */
  879. GrassProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  880. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new GrassProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  881. var colors = [];
  882. for (var i = 0; i < parsedTexture.grassColors.length; i++) {
  883. colors.push(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"].FromArray(parsedTexture.grassColors[i]));
  884. }
  885. texture.grassColors = colors;
  886. return texture;
  887. };
  888. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  889. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
  890. ], GrassProceduralTexture.prototype, "groundColor", null);
  891. return GrassProceduralTexture;
  892. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  893. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.GrassProceduralTexture"] = GrassProceduralTexture;
  894. /***/ }),
  895. /***/ "./grass/index.ts":
  896. /*!************************!*\
  897. !*** ./grass/index.ts ***!
  898. \************************/
  899. /*! exports provided: GrassProceduralTexture */
  900. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  901. "use strict";
  902. __webpack_require__.r(__webpack_exports__);
  903. /* harmony import */ var _grassProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grassProceduralTexture */ "./grass/grassProceduralTexture.ts");
  904. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GrassProceduralTexture", function() { return _grassProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["GrassProceduralTexture"]; });
  905. /***/ }),
  906. /***/ "./index.ts":
  907. /*!******************!*\
  908. !*** ./index.ts ***!
  909. \******************/
  910. /*! exports provided: BrickProceduralTexture, CloudProceduralTexture, FireProceduralTexture, GrassProceduralTexture, MarbleProceduralTexture, NormalMapProceduralTexture, PerlinNoiseProceduralTexture, RoadProceduralTexture, StarfieldProceduralTexture, WoodProceduralTexture */
  911. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  912. "use strict";
  913. __webpack_require__.r(__webpack_exports__);
  914. /* harmony import */ var _brick__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./brick */ "./brick/index.ts");
  915. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrickProceduralTexture", function() { return _brick__WEBPACK_IMPORTED_MODULE_0__["BrickProceduralTexture"]; });
  916. /* harmony import */ var _cloud__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cloud */ "./cloud/index.ts");
  917. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CloudProceduralTexture", function() { return _cloud__WEBPACK_IMPORTED_MODULE_1__["CloudProceduralTexture"]; });
  918. /* harmony import */ var _fire__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fire */ "./fire/index.ts");
  919. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireProceduralTexture", function() { return _fire__WEBPACK_IMPORTED_MODULE_2__["FireProceduralTexture"]; });
  920. /* harmony import */ var _grass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./grass */ "./grass/index.ts");
  921. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GrassProceduralTexture", function() { return _grass__WEBPACK_IMPORTED_MODULE_3__["GrassProceduralTexture"]; });
  922. /* harmony import */ var _marble__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./marble */ "./marble/index.ts");
  923. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarbleProceduralTexture", function() { return _marble__WEBPACK_IMPORTED_MODULE_4__["MarbleProceduralTexture"]; });
  924. /* harmony import */ var _normalMap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./normalMap */ "./normalMap/index.ts");
  925. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMapProceduralTexture", function() { return _normalMap__WEBPACK_IMPORTED_MODULE_5__["NormalMapProceduralTexture"]; });
  926. /* harmony import */ var _perlinNoise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./perlinNoise */ "./perlinNoise/index.ts");
  927. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PerlinNoiseProceduralTexture", function() { return _perlinNoise__WEBPACK_IMPORTED_MODULE_6__["PerlinNoiseProceduralTexture"]; });
  928. /* harmony import */ var _road__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./road */ "./road/index.ts");
  929. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RoadProceduralTexture", function() { return _road__WEBPACK_IMPORTED_MODULE_7__["RoadProceduralTexture"]; });
  930. /* harmony import */ var _starfield__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./starfield */ "./starfield/index.ts");
  931. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StarfieldProceduralTexture", function() { return _starfield__WEBPACK_IMPORTED_MODULE_8__["StarfieldProceduralTexture"]; });
  932. /* harmony import */ var _wood__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./wood */ "./wood/index.ts");
  933. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WoodProceduralTexture", function() { return _wood__WEBPACK_IMPORTED_MODULE_9__["WoodProceduralTexture"]; });
  934. /***/ }),
  935. /***/ "./legacy/legacy.ts":
  936. /*!**************************!*\
  937. !*** ./legacy/legacy.ts ***!
  938. \**************************/
  939. /*! exports provided: BrickProceduralTexture, CloudProceduralTexture, FireProceduralTexture, GrassProceduralTexture, MarbleProceduralTexture, NormalMapProceduralTexture, PerlinNoiseProceduralTexture, RoadProceduralTexture, StarfieldProceduralTexture, WoodProceduralTexture */
  940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  941. "use strict";
  942. __webpack_require__.r(__webpack_exports__);
  943. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "./index.ts");
  944. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BrickProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["BrickProceduralTexture"]; });
  945. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CloudProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CloudProceduralTexture"]; });
  946. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FireProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FireProceduralTexture"]; });
  947. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GrassProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["GrassProceduralTexture"]; });
  948. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarbleProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["MarbleProceduralTexture"]; });
  949. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMapProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["NormalMapProceduralTexture"]; });
  950. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PerlinNoiseProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["PerlinNoiseProceduralTexture"]; });
  951. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RoadProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RoadProceduralTexture"]; });
  952. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StarfieldProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["StarfieldProceduralTexture"]; });
  953. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WoodProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["WoodProceduralTexture"]; });
  954. /**
  955. * Legacy support, defining window.BABYLON.GridMaterial... (global variable).
  956. *
  957. * This is the entry point for the UMD module.
  958. * The entry point for a future ESM package should be index.ts
  959. */
  960. var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
  961. if (typeof globalObject !== "undefined") {
  962. globalObject.BABYLON = globalObject.BABYLON || {};
  963. for (var mat in _index__WEBPACK_IMPORTED_MODULE_0__) {
  964. globalObject.BABYLON[mat] = _index__WEBPACK_IMPORTED_MODULE_0__[mat];
  965. }
  966. }
  967. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  968. /***/ }),
  969. /***/ "./marble/index.ts":
  970. /*!*************************!*\
  971. !*** ./marble/index.ts ***!
  972. \*************************/
  973. /*! exports provided: MarbleProceduralTexture */
  974. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  975. "use strict";
  976. __webpack_require__.r(__webpack_exports__);
  977. /* harmony import */ var _marbleProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./marbleProceduralTexture */ "./marble/marbleProceduralTexture.ts");
  978. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarbleProceduralTexture", function() { return _marbleProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["MarbleProceduralTexture"]; });
  979. /***/ }),
  980. /***/ "./marble/marbleProceduralTexture.fragment.ts":
  981. /*!****************************************************!*\
  982. !*** ./marble/marbleProceduralTexture.fragment.ts ***!
  983. \****************************************************/
  984. /*! exports provided: marbleProceduralTexturePixelShader */
  985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  986. "use strict";
  987. __webpack_require__.r(__webpack_exports__);
  988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "marbleProceduralTexturePixelShader", function() { return marbleProceduralTexturePixelShader; });
  989. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  990. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  991. var name = 'marbleProceduralTexturePixelShader';
  992. var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfTilesHeight;\nuniform float numberOfTilesWidth;\nuniform float amplitude;\nuniform vec3 marbleColor;\nuniform vec3 jointColor;\nconst vec3 tileSize=vec3(1.1,1.0,1.1);\nconst vec3 tilePct=vec3(0.98,1.0,0.98);\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat turbulence(vec2 P)\n{\nfloat val=0.0;\nfloat freq=1.0;\nfor (int i=0; i<4; i++)\n{\nval+=abs(noise(P*freq)/freq);\nfreq*=2.07;\n}\nreturn val;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\nvec3 marble_color(float x)\n{\nvec3 col;\nx=0.5*(x+1.);\nx=sqrt(x);\nx=sqrt(x);\nx=sqrt(x);\ncol=vec3(.2+.75*x);\ncol.b*=0.95;\nreturn col;\n}\nvoid main()\n{\nfloat brickW=1.0/numberOfTilesWidth;\nfloat brickH=1.0/numberOfTilesHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.01;\nvec3 color=marbleColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0) == 0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat t=6.28*brickvUV.x/(tileSize.x+noise(vec2(vUV)*6.0));\nt+=amplitude*turbulence(brickvUV.xy);\nt=sin(t);\ncolor=marble_color(t);\n}\ngl_FragColor=vec4(color,0.0);\n}";
  993. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  994. /** @hidden */
  995. var marbleProceduralTexturePixelShader = { name: name, shader: shader };
  996. /***/ }),
  997. /***/ "./marble/marbleProceduralTexture.ts":
  998. /*!*******************************************!*\
  999. !*** ./marble/marbleProceduralTexture.ts ***!
  1000. \*******************************************/
  1001. /*! exports provided: MarbleProceduralTexture */
  1002. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1003. "use strict";
  1004. __webpack_require__.r(__webpack_exports__);
  1005. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarbleProceduralTexture", function() { return MarbleProceduralTexture; });
  1006. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  1007. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  1008. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  1009. /* harmony import */ var _marbleProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./marbleProceduralTexture.fragment */ "./marble/marbleProceduralTexture.fragment.ts");
  1010. var MarbleProceduralTexture = /** @class */ (function (_super) {
  1011. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MarbleProceduralTexture, _super);
  1012. function MarbleProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  1013. var _this = _super.call(this, name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  1014. _this._numberOfTilesHeight = 3;
  1015. _this._numberOfTilesWidth = 3;
  1016. _this._amplitude = 9.0;
  1017. _this._jointColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.72, 0.72, 0.72);
  1018. _this.updateShaderUniforms();
  1019. return _this;
  1020. }
  1021. MarbleProceduralTexture.prototype.updateShaderUniforms = function () {
  1022. this.setFloat("numberOfTilesHeight", this._numberOfTilesHeight);
  1023. this.setFloat("numberOfTilesWidth", this._numberOfTilesWidth);
  1024. this.setFloat("amplitude", this._amplitude);
  1025. this.setColor3("jointColor", this._jointColor);
  1026. };
  1027. Object.defineProperty(MarbleProceduralTexture.prototype, "numberOfTilesHeight", {
  1028. get: function () {
  1029. return this._numberOfTilesHeight;
  1030. },
  1031. set: function (value) {
  1032. this._numberOfTilesHeight = value;
  1033. this.updateShaderUniforms();
  1034. },
  1035. enumerable: true,
  1036. configurable: true
  1037. });
  1038. Object.defineProperty(MarbleProceduralTexture.prototype, "amplitude", {
  1039. get: function () {
  1040. return this._amplitude;
  1041. },
  1042. set: function (value) {
  1043. this._amplitude = value;
  1044. this.updateShaderUniforms();
  1045. },
  1046. enumerable: true,
  1047. configurable: true
  1048. });
  1049. Object.defineProperty(MarbleProceduralTexture.prototype, "numberOfTilesWidth", {
  1050. get: function () {
  1051. return this._numberOfTilesWidth;
  1052. },
  1053. set: function (value) {
  1054. this._numberOfTilesWidth = value;
  1055. this.updateShaderUniforms();
  1056. },
  1057. enumerable: true,
  1058. configurable: true
  1059. });
  1060. Object.defineProperty(MarbleProceduralTexture.prototype, "jointColor", {
  1061. get: function () {
  1062. return this._jointColor;
  1063. },
  1064. set: function (value) {
  1065. this._jointColor = value;
  1066. this.updateShaderUniforms();
  1067. },
  1068. enumerable: true,
  1069. configurable: true
  1070. });
  1071. /**
  1072. * Serializes this marble procedural texture
  1073. * @returns a serialized marble procedural texture object
  1074. */
  1075. MarbleProceduralTexture.prototype.serialize = function () {
  1076. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  1077. serializationObject.customType = "BABYLON.MarbleProceduralTexture";
  1078. return serializationObject;
  1079. };
  1080. /**
  1081. * Creates a Marble Procedural Texture from parsed marble procedural texture data
  1082. * @param parsedTexture defines parsed texture data
  1083. * @param scene defines the current scene
  1084. * @param rootUrl defines the root URL containing marble procedural texture information
  1085. * @returns a parsed Marble Procedural Texture
  1086. */
  1087. MarbleProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  1088. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new MarbleProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  1089. return texture;
  1090. };
  1091. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1092. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1093. ], MarbleProceduralTexture.prototype, "numberOfTilesHeight", null);
  1094. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1095. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1096. ], MarbleProceduralTexture.prototype, "amplitude", null);
  1097. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1098. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1099. ], MarbleProceduralTexture.prototype, "numberOfTilesWidth", null);
  1100. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1101. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1102. ], MarbleProceduralTexture.prototype, "jointColor", null);
  1103. return MarbleProceduralTexture;
  1104. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  1105. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.MarbleProceduralTexture"] = MarbleProceduralTexture;
  1106. /***/ }),
  1107. /***/ "./normalMap/index.ts":
  1108. /*!****************************!*\
  1109. !*** ./normalMap/index.ts ***!
  1110. \****************************/
  1111. /*! exports provided: NormalMapProceduralTexture */
  1112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1113. "use strict";
  1114. __webpack_require__.r(__webpack_exports__);
  1115. /* harmony import */ var _normalMapProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalMapProceduralTexture */ "./normalMap/normalMapProceduralTexture.ts");
  1116. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NormalMapProceduralTexture", function() { return _normalMapProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["NormalMapProceduralTexture"]; });
  1117. /***/ }),
  1118. /***/ "./normalMap/normalMapProceduralTexture.fragment.ts":
  1119. /*!**********************************************************!*\
  1120. !*** ./normalMap/normalMapProceduralTexture.fragment.ts ***!
  1121. \**********************************************************/
  1122. /*! exports provided: normalMapProceduralTexturePixelShader */
  1123. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1124. "use strict";
  1125. __webpack_require__.r(__webpack_exports__);
  1126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalMapProceduralTexturePixelShader", function() { return normalMapProceduralTexturePixelShader; });
  1127. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  1128. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  1129. var name = 'normalMapProceduralTexturePixelShader';
  1130. var shader = "precision highp float;\n\nuniform sampler2D baseSampler;\nuniform float size;\n\nvarying vec2 vUV;\n\nconst vec3 LUMA_COEFFICIENT=vec3(0.2126,0.7152,0.0722);\nfloat lumaAtCoord(vec2 coord)\n{\nvec3 pixel=texture2D(baseSampler,coord).rgb;\nfloat luma=dot(pixel,LUMA_COEFFICIENT);\nreturn luma;\n}\nvoid main()\n{\nfloat lumaU0=lumaAtCoord(vUV+vec2(-1.0,0.0)/size);\nfloat lumaU1=lumaAtCoord(vUV+vec2( 1.0,0.0)/size);\nfloat lumaV0=lumaAtCoord(vUV+vec2( 0.0,-1.0)/size);\nfloat lumaV1=lumaAtCoord(vUV+vec2( 0.0,1.0)/size);\nvec2 slope=(vec2(lumaU0-lumaU1,lumaV0-lumaV1)+1.0)*0.5;\ngl_FragColor=vec4(slope,1.0,1.0);\n}\n";
  1131. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  1132. /** @hidden */
  1133. var normalMapProceduralTexturePixelShader = { name: name, shader: shader };
  1134. /***/ }),
  1135. /***/ "./normalMap/normalMapProceduralTexture.ts":
  1136. /*!*************************************************!*\
  1137. !*** ./normalMap/normalMapProceduralTexture.ts ***!
  1138. \*************************************************/
  1139. /*! exports provided: NormalMapProceduralTexture */
  1140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1141. "use strict";
  1142. __webpack_require__.r(__webpack_exports__);
  1143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NormalMapProceduralTexture", function() { return NormalMapProceduralTexture; });
  1144. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  1145. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  1146. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  1147. /* harmony import */ var _normalMapProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalMapProceduralTexture.fragment */ "./normalMap/normalMapProceduralTexture.fragment.ts");
  1148. var NormalMapProceduralTexture = /** @class */ (function (_super) {
  1149. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](NormalMapProceduralTexture, _super);
  1150. function NormalMapProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  1151. var _this = _super.call(this, name, size, "normalMapProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  1152. _this.updateShaderUniforms();
  1153. return _this;
  1154. }
  1155. NormalMapProceduralTexture.prototype.updateShaderUniforms = function () {
  1156. this.setTexture("baseSampler", this._baseTexture);
  1157. this.setFloat("size", this.getRenderSize());
  1158. };
  1159. NormalMapProceduralTexture.prototype.render = function (useCameraPostProcess) {
  1160. _super.prototype.render.call(this, useCameraPostProcess);
  1161. };
  1162. NormalMapProceduralTexture.prototype.resize = function (size, generateMipMaps) {
  1163. _super.prototype.resize.call(this, size, generateMipMaps);
  1164. // We need to update the "size" uniform
  1165. this.updateShaderUniforms();
  1166. };
  1167. Object.defineProperty(NormalMapProceduralTexture.prototype, "baseTexture", {
  1168. get: function () {
  1169. return this._baseTexture;
  1170. },
  1171. set: function (texture) {
  1172. this._baseTexture = texture;
  1173. this.updateShaderUniforms();
  1174. },
  1175. enumerable: true,
  1176. configurable: true
  1177. });
  1178. /**
  1179. * Serializes this normal map procedural texture
  1180. * @returns a serialized normal map procedural texture object
  1181. */
  1182. NormalMapProceduralTexture.prototype.serialize = function () {
  1183. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  1184. serializationObject.customType = "BABYLON.NormalMapProceduralTexture";
  1185. return serializationObject;
  1186. };
  1187. /**
  1188. * Creates a Normal Map Procedural Texture from parsed normal map procedural texture data
  1189. * @param parsedTexture defines parsed texture data
  1190. * @param scene defines the current scene
  1191. * @param rootUrl defines the root URL containing normal map procedural texture information
  1192. * @returns a parsed Normal Map Procedural Texture
  1193. */
  1194. NormalMapProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  1195. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new NormalMapProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  1196. return texture;
  1197. };
  1198. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1199. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsTexture"])()
  1200. ], NormalMapProceduralTexture.prototype, "baseTexture", null);
  1201. return NormalMapProceduralTexture;
  1202. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  1203. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.NormalMapProceduralTexture"] = NormalMapProceduralTexture;
  1204. /***/ }),
  1205. /***/ "./perlinNoise/index.ts":
  1206. /*!******************************!*\
  1207. !*** ./perlinNoise/index.ts ***!
  1208. \******************************/
  1209. /*! exports provided: PerlinNoiseProceduralTexture */
  1210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1211. "use strict";
  1212. __webpack_require__.r(__webpack_exports__);
  1213. /* harmony import */ var _perlinNoiseProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./perlinNoiseProceduralTexture */ "./perlinNoise/perlinNoiseProceduralTexture.ts");
  1214. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PerlinNoiseProceduralTexture", function() { return _perlinNoiseProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["PerlinNoiseProceduralTexture"]; });
  1215. /***/ }),
  1216. /***/ "./perlinNoise/perlinNoiseProceduralTexture.fragment.ts":
  1217. /*!**************************************************************!*\
  1218. !*** ./perlinNoise/perlinNoiseProceduralTexture.fragment.ts ***!
  1219. \**************************************************************/
  1220. /*! exports provided: perlinNoiseProceduralTexturePixelShader */
  1221. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1222. "use strict";
  1223. __webpack_require__.r(__webpack_exports__);
  1224. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "perlinNoiseProceduralTexturePixelShader", function() { return perlinNoiseProceduralTexturePixelShader; });
  1225. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  1226. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  1227. var name = 'perlinNoiseProceduralTexturePixelShader';
  1228. var shader = "\nprecision highp float;\n\nuniform float size;\nuniform float time;\nuniform float translationSpeed;\n\nvarying vec2 vUV;\n\nfloat r(float n)\n{\nreturn fract(cos(n*89.42)*343.42);\n}\nvec2 r(vec2 n)\n{\nreturn vec2(r(n.x*23.62-300.0+n.y*34.35),r(n.x*45.13+256.0+n.y*38.89));\n}\nfloat worley(vec2 n,float s)\n{\nfloat dis=1.0;\nfor(int x=-1; x<=1; x++)\n{\nfor(int y=-1; y<=1; y++)\n{\nvec2 p=floor(n/s)+vec2(x,y);\nfloat d=length(r(p)+vec2(x,y)-fract(n/s));\nif (dis>d)\ndis=d;\n}\n}\nreturn 1.0-dis;\n}\nvec3 hash33(vec3 p3)\n{\np3=fract(p3*vec3(0.1031,0.11369,0.13787));\np3+=dot(p3,p3.yxz+19.19);\nreturn -1.0+2.0*fract(vec3((p3.x+p3.y)*p3.z,(p3.x+p3.z)*p3.y,(p3.y+p3.z)*p3.x));\n}\nfloat perlinNoise(vec3 p)\n{\nvec3 pi=floor(p);\nvec3 pf=p-pi;\nvec3 w=pf*pf*(3.0-2.0*pf);\nreturn mix(\nmix(\nmix(\ndot(pf-vec3(0,0,0),hash33(pi+vec3(0,0,0))),\ndot(pf-vec3(1,0,0),hash33(pi+vec3(1,0,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,0,1),hash33(pi+vec3(0,0,1))),\ndot(pf-vec3(1,0,1),hash33(pi+vec3(1,0,1))),\nw.x\n),\nw.z\n),\nmix(\nmix(\ndot(pf-vec3(0,1,0),hash33(pi+vec3(0,1,0))),\ndot(pf-vec3(1,1,0),hash33(pi+vec3(1,1,0))),\nw.x\n),\nmix(\ndot(pf-vec3(0,1,1),hash33(pi+vec3(0,1,1))),\ndot(pf-vec3(1,1,1),hash33(pi+vec3(1,1,1))),\nw.x\n),\nw.z\n),\nw.y\n);\n}\n\nvoid main(void)\n{\nvec2 uv=gl_FragCoord.xy+translationSpeed;\nfloat dis=(\n1.0+perlinNoise(vec3(uv/vec2(size,size),time*0.05)*8.0))\n*(1.0+(worley(uv,32.0)+ 0.5*worley(2.0*uv,32.0)+0.25*worley(4.0*uv,32.0))\n);\ngl_FragColor=vec4(vec3(dis/4.0),1.0);\n}\n";
  1229. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  1230. /** @hidden */
  1231. var perlinNoiseProceduralTexturePixelShader = { name: name, shader: shader };
  1232. /***/ }),
  1233. /***/ "./perlinNoise/perlinNoiseProceduralTexture.ts":
  1234. /*!*****************************************************!*\
  1235. !*** ./perlinNoise/perlinNoiseProceduralTexture.ts ***!
  1236. \*****************************************************/
  1237. /*! exports provided: PerlinNoiseProceduralTexture */
  1238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1239. "use strict";
  1240. __webpack_require__.r(__webpack_exports__);
  1241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PerlinNoiseProceduralTexture", function() { return PerlinNoiseProceduralTexture; });
  1242. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  1243. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  1244. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  1245. /* harmony import */ var _perlinNoiseProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./perlinNoiseProceduralTexture.fragment */ "./perlinNoise/perlinNoiseProceduralTexture.fragment.ts");
  1246. var PerlinNoiseProceduralTexture = /** @class */ (function (_super) {
  1247. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](PerlinNoiseProceduralTexture, _super);
  1248. function PerlinNoiseProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  1249. var _this = _super.call(this, name, size, "perlinNoiseProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  1250. _this.time = 0.0;
  1251. _this.timeScale = 1.0;
  1252. _this.translationSpeed = 1.0;
  1253. _this._currentTranslation = 0;
  1254. _this.updateShaderUniforms();
  1255. return _this;
  1256. }
  1257. PerlinNoiseProceduralTexture.prototype.updateShaderUniforms = function () {
  1258. this.setFloat("size", this.getRenderSize());
  1259. var scene = this.getScene();
  1260. if (!scene) {
  1261. return;
  1262. }
  1263. var deltaTime = scene.getEngine().getDeltaTime();
  1264. this.time += deltaTime;
  1265. this.setFloat("time", this.time * this.timeScale / 1000);
  1266. this._currentTranslation += deltaTime * this.translationSpeed / 1000.0;
  1267. this.setFloat("translationSpeed", this._currentTranslation);
  1268. };
  1269. PerlinNoiseProceduralTexture.prototype.render = function (useCameraPostProcess) {
  1270. this.updateShaderUniforms();
  1271. _super.prototype.render.call(this, useCameraPostProcess);
  1272. };
  1273. PerlinNoiseProceduralTexture.prototype.resize = function (size, generateMipMaps) {
  1274. _super.prototype.resize.call(this, size, generateMipMaps);
  1275. };
  1276. /**
  1277. * Serializes this perlin noise procedural texture
  1278. * @returns a serialized perlin noise procedural texture object
  1279. */
  1280. PerlinNoiseProceduralTexture.prototype.serialize = function () {
  1281. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  1282. serializationObject.customType = "BABYLON.PerlinNoiseProceduralTexture";
  1283. return serializationObject;
  1284. };
  1285. /**
  1286. * Creates a Perlin Noise Procedural Texture from parsed perlin noise procedural texture data
  1287. * @param parsedTexture defines parsed texture data
  1288. * @param scene defines the current scene
  1289. * @param rootUrl defines the root URL containing perlin noise procedural texture information
  1290. * @returns a parsed Perlin Noise Procedural Texture
  1291. */
  1292. PerlinNoiseProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  1293. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new PerlinNoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  1294. return texture;
  1295. };
  1296. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1297. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1298. ], PerlinNoiseProceduralTexture.prototype, "time", void 0);
  1299. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1300. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1301. ], PerlinNoiseProceduralTexture.prototype, "timeScale", void 0);
  1302. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1303. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1304. ], PerlinNoiseProceduralTexture.prototype, "translationSpeed", void 0);
  1305. return PerlinNoiseProceduralTexture;
  1306. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  1307. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.PerlinNoiseProceduralTexture"] = PerlinNoiseProceduralTexture;
  1308. /***/ }),
  1309. /***/ "./road/index.ts":
  1310. /*!***********************!*\
  1311. !*** ./road/index.ts ***!
  1312. \***********************/
  1313. /*! exports provided: RoadProceduralTexture */
  1314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1315. "use strict";
  1316. __webpack_require__.r(__webpack_exports__);
  1317. /* harmony import */ var _roadProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./roadProceduralTexture */ "./road/roadProceduralTexture.ts");
  1318. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RoadProceduralTexture", function() { return _roadProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["RoadProceduralTexture"]; });
  1319. /***/ }),
  1320. /***/ "./road/roadProceduralTexture.fragment.ts":
  1321. /*!************************************************!*\
  1322. !*** ./road/roadProceduralTexture.fragment.ts ***!
  1323. \************************************************/
  1324. /*! exports provided: roadProceduralTexturePixelShader */
  1325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1326. "use strict";
  1327. __webpack_require__.r(__webpack_exports__);
  1328. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "roadProceduralTexturePixelShader", function() { return roadProceduralTexturePixelShader; });
  1329. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  1330. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  1331. var name = 'roadProceduralTexturePixelShader';
  1332. var shader = "precision highp float;\nvarying vec2 vUV;\nuniform vec3 roadColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nvoid main(void) {\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));\nvec3 color=roadColor*ratioy;\ngl_FragColor=vec4(color,1.0);\n}";
  1333. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  1334. /** @hidden */
  1335. var roadProceduralTexturePixelShader = { name: name, shader: shader };
  1336. /***/ }),
  1337. /***/ "./road/roadProceduralTexture.ts":
  1338. /*!***************************************!*\
  1339. !*** ./road/roadProceduralTexture.ts ***!
  1340. \***************************************/
  1341. /*! exports provided: RoadProceduralTexture */
  1342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1343. "use strict";
  1344. __webpack_require__.r(__webpack_exports__);
  1345. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RoadProceduralTexture", function() { return RoadProceduralTexture; });
  1346. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  1347. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  1348. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  1349. /* harmony import */ var _roadProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./roadProceduralTexture.fragment */ "./road/roadProceduralTexture.fragment.ts");
  1350. var RoadProceduralTexture = /** @class */ (function (_super) {
  1351. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RoadProceduralTexture, _super);
  1352. function RoadProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  1353. var _this = _super.call(this, name, size, "roadProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  1354. _this._roadColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.53, 0.53, 0.53);
  1355. _this.updateShaderUniforms();
  1356. return _this;
  1357. }
  1358. RoadProceduralTexture.prototype.updateShaderUniforms = function () {
  1359. this.setColor3("roadColor", this._roadColor);
  1360. };
  1361. Object.defineProperty(RoadProceduralTexture.prototype, "roadColor", {
  1362. get: function () {
  1363. return this._roadColor;
  1364. },
  1365. set: function (value) {
  1366. this._roadColor = value;
  1367. this.updateShaderUniforms();
  1368. },
  1369. enumerable: true,
  1370. configurable: true
  1371. });
  1372. /**
  1373. * Serializes this road procedural texture
  1374. * @returns a serialized road procedural texture object
  1375. */
  1376. RoadProceduralTexture.prototype.serialize = function () {
  1377. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  1378. serializationObject.customType = "BABYLON.RoadProceduralTexture";
  1379. return serializationObject;
  1380. };
  1381. /**
  1382. * Creates a Road Procedural Texture from parsed road procedural texture data
  1383. * @param parsedTexture defines parsed texture data
  1384. * @param scene defines the current scene
  1385. * @param rootUrl defines the root URL containing road procedural texture information
  1386. * @returns a parsed Road Procedural Texture
  1387. */
  1388. RoadProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  1389. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  1390. return texture;
  1391. };
  1392. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1393. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
  1394. ], RoadProceduralTexture.prototype, "roadColor", null);
  1395. return RoadProceduralTexture;
  1396. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  1397. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.RoadProceduralTexture"] = RoadProceduralTexture;
  1398. /***/ }),
  1399. /***/ "./starfield/index.ts":
  1400. /*!****************************!*\
  1401. !*** ./starfield/index.ts ***!
  1402. \****************************/
  1403. /*! exports provided: StarfieldProceduralTexture */
  1404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1405. "use strict";
  1406. __webpack_require__.r(__webpack_exports__);
  1407. /* harmony import */ var _starfieldProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./starfieldProceduralTexture */ "./starfield/starfieldProceduralTexture.ts");
  1408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StarfieldProceduralTexture", function() { return _starfieldProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["StarfieldProceduralTexture"]; });
  1409. /***/ }),
  1410. /***/ "./starfield/starfieldProceduralTexture.fragment.ts":
  1411. /*!**********************************************************!*\
  1412. !*** ./starfield/starfieldProceduralTexture.fragment.ts ***!
  1413. \**********************************************************/
  1414. /*! exports provided: starfieldProceduralTexturePixelShader */
  1415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1416. "use strict";
  1417. __webpack_require__.r(__webpack_exports__);
  1418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "starfieldProceduralTexturePixelShader", function() { return starfieldProceduralTexturePixelShader; });
  1419. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  1420. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  1421. var name = 'starfieldProceduralTexturePixelShader';
  1422. var shader = "precision highp float;\n\n#define volsteps 20\n#define iterations 15\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float time;\nuniform float alpha;\nuniform float beta;\nuniform float zoom;\nuniform float formuparam;\nuniform float stepsize;\nuniform float tile;\nuniform float brightness;\nuniform float darkmatter;\nuniform float distfading;\nuniform float saturation;\nvoid main()\n{\nvec3 dir=vec3(vUV*zoom,1.);\nfloat localTime=time*0.0001;\n\nmat2 rot1=mat2(cos(alpha),sin(alpha),-sin(alpha),cos(alpha));\nmat2 rot2=mat2(cos(beta),sin(beta),-sin(beta),cos(beta));\ndir.xz*=rot1;\ndir.xy*=rot2;\nvec3 from=vec3(1.,.5,0.5);\nfrom+=vec3(-2.,localTime*2.,localTime);\nfrom.xz*=rot1;\nfrom.xy*=rot2;\n\nfloat s=0.1,fade=1.;\nvec3 v=vec3(0.);\nfor (int r=0; r<volsteps; r++) {\nvec3 p=from+s*dir*.5;\np=abs(vec3(tile)-mod(p,vec3(tile*2.)));\nfloat pa,a=pa=0.;\nfor (int i=0; i<iterations; i++) {\np=abs(p)/dot(p,p)-formuparam;\na+=abs(length(p)-pa);\npa=length(p);\n}\nfloat dm=max(0.,darkmatter-a*a*.001);\na*=a*a;\nif (r>6) fade*=1.-dm;\n\nv+=fade;\nv+=vec3(s,s*s,s*s*s*s)*a*brightness*fade;\nfade*=distfading;\ns+=stepsize;\n}\nv=mix(vec3(length(v)),v,saturation);\ngl_FragColor=vec4(v*.01,1.);\n}";
  1423. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  1424. /** @hidden */
  1425. var starfieldProceduralTexturePixelShader = { name: name, shader: shader };
  1426. /***/ }),
  1427. /***/ "./starfield/starfieldProceduralTexture.ts":
  1428. /*!*************************************************!*\
  1429. !*** ./starfield/starfieldProceduralTexture.ts ***!
  1430. \*************************************************/
  1431. /*! exports provided: StarfieldProceduralTexture */
  1432. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1433. "use strict";
  1434. __webpack_require__.r(__webpack_exports__);
  1435. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StarfieldProceduralTexture", function() { return StarfieldProceduralTexture; });
  1436. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  1437. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  1438. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  1439. /* harmony import */ var _starfieldProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./starfieldProceduralTexture.fragment */ "./starfield/starfieldProceduralTexture.fragment.ts");
  1440. var StarfieldProceduralTexture = /** @class */ (function (_super) {
  1441. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](StarfieldProceduralTexture, _super);
  1442. function StarfieldProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  1443. var _this = _super.call(this, name, size, "starfieldProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  1444. _this._time = 1;
  1445. _this._alpha = 0.5;
  1446. _this._beta = 0.8;
  1447. _this._zoom = 0.8;
  1448. _this._formuparam = 0.53;
  1449. _this._stepsize = 0.1;
  1450. _this._tile = 0.850;
  1451. _this._brightness = 0.0015;
  1452. _this._darkmatter = 0.400;
  1453. _this._distfading = 0.730;
  1454. _this._saturation = 0.850;
  1455. _this.updateShaderUniforms();
  1456. return _this;
  1457. }
  1458. StarfieldProceduralTexture.prototype.updateShaderUniforms = function () {
  1459. this.setFloat("time", this._time);
  1460. this.setFloat("alpha", this._alpha);
  1461. this.setFloat("beta", this._beta);
  1462. this.setFloat("zoom", this._zoom);
  1463. this.setFloat("formuparam", this._formuparam);
  1464. this.setFloat("stepsize", this._stepsize);
  1465. this.setFloat("tile", this._tile);
  1466. this.setFloat("brightness", this._brightness);
  1467. this.setFloat("darkmatter", this._darkmatter);
  1468. this.setFloat("distfading", this._distfading);
  1469. this.setFloat("saturation", this._saturation);
  1470. };
  1471. Object.defineProperty(StarfieldProceduralTexture.prototype, "time", {
  1472. get: function () {
  1473. return this._time;
  1474. },
  1475. set: function (value) {
  1476. this._time = value;
  1477. this.updateShaderUniforms();
  1478. },
  1479. enumerable: true,
  1480. configurable: true
  1481. });
  1482. Object.defineProperty(StarfieldProceduralTexture.prototype, "alpha", {
  1483. get: function () {
  1484. return this._alpha;
  1485. },
  1486. set: function (value) {
  1487. this._alpha = value;
  1488. this.updateShaderUniforms();
  1489. },
  1490. enumerable: true,
  1491. configurable: true
  1492. });
  1493. Object.defineProperty(StarfieldProceduralTexture.prototype, "beta", {
  1494. get: function () {
  1495. return this._beta;
  1496. },
  1497. set: function (value) {
  1498. this._beta = value;
  1499. this.updateShaderUniforms();
  1500. },
  1501. enumerable: true,
  1502. configurable: true
  1503. });
  1504. Object.defineProperty(StarfieldProceduralTexture.prototype, "formuparam", {
  1505. get: function () {
  1506. return this._formuparam;
  1507. },
  1508. set: function (value) {
  1509. this._formuparam = value;
  1510. this.updateShaderUniforms();
  1511. },
  1512. enumerable: true,
  1513. configurable: true
  1514. });
  1515. Object.defineProperty(StarfieldProceduralTexture.prototype, "stepsize", {
  1516. get: function () {
  1517. return this._stepsize;
  1518. },
  1519. set: function (value) {
  1520. this._stepsize = value;
  1521. this.updateShaderUniforms();
  1522. },
  1523. enumerable: true,
  1524. configurable: true
  1525. });
  1526. Object.defineProperty(StarfieldProceduralTexture.prototype, "zoom", {
  1527. get: function () {
  1528. return this._zoom;
  1529. },
  1530. set: function (value) {
  1531. this._zoom = value;
  1532. this.updateShaderUniforms();
  1533. },
  1534. enumerable: true,
  1535. configurable: true
  1536. });
  1537. Object.defineProperty(StarfieldProceduralTexture.prototype, "tile", {
  1538. get: function () {
  1539. return this._tile;
  1540. },
  1541. set: function (value) {
  1542. this._tile = value;
  1543. this.updateShaderUniforms();
  1544. },
  1545. enumerable: true,
  1546. configurable: true
  1547. });
  1548. Object.defineProperty(StarfieldProceduralTexture.prototype, "brightness", {
  1549. get: function () {
  1550. return this._brightness;
  1551. },
  1552. set: function (value) {
  1553. this._brightness = value;
  1554. this.updateShaderUniforms();
  1555. },
  1556. enumerable: true,
  1557. configurable: true
  1558. });
  1559. Object.defineProperty(StarfieldProceduralTexture.prototype, "darkmatter", {
  1560. get: function () {
  1561. return this._darkmatter;
  1562. },
  1563. set: function (value) {
  1564. this._darkmatter = value;
  1565. this.updateShaderUniforms();
  1566. },
  1567. enumerable: true,
  1568. configurable: true
  1569. });
  1570. Object.defineProperty(StarfieldProceduralTexture.prototype, "distfading", {
  1571. get: function () {
  1572. return this._distfading;
  1573. },
  1574. set: function (value) {
  1575. this._distfading = value;
  1576. this.updateShaderUniforms();
  1577. },
  1578. enumerable: true,
  1579. configurable: true
  1580. });
  1581. Object.defineProperty(StarfieldProceduralTexture.prototype, "saturation", {
  1582. get: function () {
  1583. return this._saturation;
  1584. },
  1585. set: function (value) {
  1586. this._saturation = value;
  1587. this.updateShaderUniforms();
  1588. },
  1589. enumerable: true,
  1590. configurable: true
  1591. });
  1592. /**
  1593. * Serializes this starfield procedural texture
  1594. * @returns a serialized starfield procedural texture object
  1595. */
  1596. StarfieldProceduralTexture.prototype.serialize = function () {
  1597. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  1598. serializationObject.customType = "BABYLON.StarfieldProceduralTexture";
  1599. return serializationObject;
  1600. };
  1601. /**
  1602. * Creates a Starfield Procedural Texture from parsed startfield procedural texture data
  1603. * @param parsedTexture defines parsed texture data
  1604. * @param scene defines the current scene
  1605. * @param rootUrl defines the root URL containing startfield procedural texture information
  1606. * @returns a parsed Starfield Procedural Texture
  1607. */
  1608. StarfieldProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  1609. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new StarfieldProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  1610. return texture;
  1611. };
  1612. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1613. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1614. ], StarfieldProceduralTexture.prototype, "time", null);
  1615. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1616. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1617. ], StarfieldProceduralTexture.prototype, "alpha", null);
  1618. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1619. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1620. ], StarfieldProceduralTexture.prototype, "beta", null);
  1621. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1622. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1623. ], StarfieldProceduralTexture.prototype, "formuparam", null);
  1624. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1625. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1626. ], StarfieldProceduralTexture.prototype, "stepsize", null);
  1627. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1628. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1629. ], StarfieldProceduralTexture.prototype, "zoom", null);
  1630. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1631. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1632. ], StarfieldProceduralTexture.prototype, "tile", null);
  1633. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1634. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1635. ], StarfieldProceduralTexture.prototype, "brightness", null);
  1636. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1637. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1638. ], StarfieldProceduralTexture.prototype, "darkmatter", null);
  1639. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1640. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1641. ], StarfieldProceduralTexture.prototype, "distfading", null);
  1642. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1643. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1644. ], StarfieldProceduralTexture.prototype, "saturation", null);
  1645. return StarfieldProceduralTexture;
  1646. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  1647. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.StarfieldProceduralTexture"] = StarfieldProceduralTexture;
  1648. /***/ }),
  1649. /***/ "./wood/index.ts":
  1650. /*!***********************!*\
  1651. !*** ./wood/index.ts ***!
  1652. \***********************/
  1653. /*! exports provided: WoodProceduralTexture */
  1654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1655. "use strict";
  1656. __webpack_require__.r(__webpack_exports__);
  1657. /* harmony import */ var _woodProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./woodProceduralTexture */ "./wood/woodProceduralTexture.ts");
  1658. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WoodProceduralTexture", function() { return _woodProceduralTexture__WEBPACK_IMPORTED_MODULE_0__["WoodProceduralTexture"]; });
  1659. /***/ }),
  1660. /***/ "./wood/woodProceduralTexture.fragment.ts":
  1661. /*!************************************************!*\
  1662. !*** ./wood/woodProceduralTexture.fragment.ts ***!
  1663. \************************************************/
  1664. /*! exports provided: woodProceduralTexturePixelShader */
  1665. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1666. "use strict";
  1667. __webpack_require__.r(__webpack_exports__);
  1668. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "woodProceduralTexturePixelShader", function() { return woodProceduralTexturePixelShader; });
  1669. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/decorators");
  1670. /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
  1671. var name = 'woodProceduralTexturePixelShader';
  1672. var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float ampScale;\nuniform vec3 woodColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nvoid main(void) {\nfloat ratioy=mod(vUV.x*ampScale,2.0+fbm(vUV*0.8));\nvec3 wood=woodColor*ratioy;\ngl_FragColor=vec4(wood,1.0);\n}";
  1673. babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__["Effect"].ShadersStore[name] = shader;
  1674. /** @hidden */
  1675. var woodProceduralTexturePixelShader = { name: name, shader: shader };
  1676. /***/ }),
  1677. /***/ "./wood/woodProceduralTexture.ts":
  1678. /*!***************************************!*\
  1679. !*** ./wood/woodProceduralTexture.ts ***!
  1680. \***************************************/
  1681. /*! exports provided: WoodProceduralTexture */
  1682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1683. "use strict";
  1684. __webpack_require__.r(__webpack_exports__);
  1685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WoodProceduralTexture", function() { return WoodProceduralTexture; });
  1686. /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
  1687. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/decorators");
  1688. /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
  1689. /* harmony import */ var _woodProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./woodProceduralTexture.fragment */ "./wood/woodProceduralTexture.fragment.ts");
  1690. var WoodProceduralTexture = /** @class */ (function (_super) {
  1691. tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WoodProceduralTexture, _super);
  1692. function WoodProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
  1693. var _this = _super.call(this, name, size, "woodProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
  1694. _this._ampScale = 100.0;
  1695. _this._woodColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.32, 0.17, 0.09);
  1696. _this.updateShaderUniforms();
  1697. return _this;
  1698. }
  1699. WoodProceduralTexture.prototype.updateShaderUniforms = function () {
  1700. this.setFloat("ampScale", this._ampScale);
  1701. this.setColor3("woodColor", this._woodColor);
  1702. };
  1703. Object.defineProperty(WoodProceduralTexture.prototype, "ampScale", {
  1704. get: function () {
  1705. return this._ampScale;
  1706. },
  1707. set: function (value) {
  1708. this._ampScale = value;
  1709. this.updateShaderUniforms();
  1710. },
  1711. enumerable: true,
  1712. configurable: true
  1713. });
  1714. Object.defineProperty(WoodProceduralTexture.prototype, "woodColor", {
  1715. get: function () {
  1716. return this._woodColor;
  1717. },
  1718. set: function (value) {
  1719. this._woodColor = value;
  1720. this.updateShaderUniforms();
  1721. },
  1722. enumerable: true,
  1723. configurable: true
  1724. });
  1725. /**
  1726. * Serializes this wood procedural texture
  1727. * @returns a serialized wood procedural texture object
  1728. */
  1729. WoodProceduralTexture.prototype.serialize = function () {
  1730. var serializationObject = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Serialize(this, _super.prototype.serialize.call(this));
  1731. serializationObject.customType = "BABYLON.WoodProceduralTexture";
  1732. return serializationObject;
  1733. };
  1734. /**
  1735. * Creates a Wood Procedural Texture from parsed wood procedural texture data
  1736. * @param parsedTexture defines parsed texture data
  1737. * @param scene defines the current scene
  1738. * @param rootUrl defines the root URL containing wood procedural texture information
  1739. * @returns a parsed Wood Procedural Texture
  1740. */
  1741. WoodProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
  1742. var texture = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Parse(function () { return new WoodProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
  1743. return texture;
  1744. };
  1745. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1746. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
  1747. ], WoodProceduralTexture.prototype, "ampScale", null);
  1748. tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"]([
  1749. Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
  1750. ], WoodProceduralTexture.prototype, "woodColor", null);
  1751. return WoodProceduralTexture;
  1752. }(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["ProceduralTexture"]));
  1753. babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["_TypeStore"].RegisteredTypes["BABYLON.WoodProceduralTexture"] = WoodProceduralTexture;
  1754. /***/ }),
  1755. /***/ "babylonjs/Misc/decorators":
  1756. /*!****************************************************************************************************!*\
  1757. !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
  1758. \****************************************************************************************************/
  1759. /*! no static exports found */
  1760. /***/ (function(module, exports) {
  1761. module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_decorators__;
  1762. /***/ })
  1763. /******/ });
  1764. });
  1765. //# sourceMappingURL=babylonjs.proceduralTextures.js.map