babylonjs-procedural-textures 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babylon.brickProceduralTexture.js +113 -100
- package/babylon.brickProceduralTexture.js.map +1 -1
- package/babylon.brickProceduralTexture.min.js +1 -1
- package/babylon.brickProceduralTexture.min.js.map +1 -1
- package/babylon.cloudProceduralTexture.js +111 -100
- package/babylon.cloudProceduralTexture.js.map +1 -1
- package/babylon.cloudProceduralTexture.min.js +1 -1
- package/babylon.cloudProceduralTexture.min.js.map +1 -1
- package/babylon.fireProceduralTexture.js +130 -146
- package/babylon.fireProceduralTexture.js.map +1 -1
- package/babylon.fireProceduralTexture.min.js +1 -1
- package/babylon.fireProceduralTexture.min.js.map +1 -1
- package/babylon.grassProceduralTexture.js +87 -70
- package/babylon.grassProceduralTexture.js.map +1 -1
- package/babylon.grassProceduralTexture.min.js +1 -1
- package/babylon.grassProceduralTexture.min.js.map +1 -1
- package/babylon.marbleProceduralTexture.js +100 -100
- package/babylon.marbleProceduralTexture.js.map +1 -1
- package/babylon.marbleProceduralTexture.min.js +1 -1
- package/babylon.marbleProceduralTexture.min.js.map +1 -1
- package/babylon.normalMapProceduralTexture.js +79 -63
- package/babylon.normalMapProceduralTexture.js.map +1 -1
- package/babylon.normalMapProceduralTexture.min.js +1 -1
- package/babylon.normalMapProceduralTexture.min.js.map +1 -1
- package/babylon.perlinNoiseProceduralTexture.js +115 -61
- package/babylon.perlinNoiseProceduralTexture.js.map +1 -1
- package/babylon.perlinNoiseProceduralTexture.min.js +1 -1
- package/babylon.perlinNoiseProceduralTexture.min.js.map +1 -1
- package/babylon.roadProceduralTexture.js +77 -55
- package/babylon.roadProceduralTexture.js.map +1 -1
- package/babylon.roadProceduralTexture.min.js +1 -1
- package/babylon.roadProceduralTexture.min.js.map +1 -1
- package/babylon.starfieldProceduralTexture.js +197 -210
- package/babylon.starfieldProceduralTexture.js.map +1 -1
- package/babylon.starfieldProceduralTexture.min.js +1 -1
- package/babylon.starfieldProceduralTexture.min.js.map +1 -1
- package/babylon.woodProceduralTexture.js +87 -70
- package/babylon.woodProceduralTexture.js.map +1 -1
- package/babylon.woodProceduralTexture.min.js +1 -1
- package/babylon.woodProceduralTexture.min.js.map +1 -1
- package/babylonjs.proceduralTextures.d.ts +20 -20
- package/babylonjs.proceduralTextures.js +826 -905
- package/babylonjs.proceduralTextures.js.map +1 -1
- package/babylonjs.proceduralTextures.min.js +1 -1
- package/babylonjs.proceduralTextures.min.js.map +1 -1
- package/babylonjs.proceduralTextures.module.d.ts +64 -64
- package/config.json +1 -1
- package/package.json +2 -2
- package/src/brick.ts +3 -14
- package/src/cloud.ts +3 -14
- package/src/fire.ts +3 -14
- package/src/grass.ts +3 -14
- package/src/index.ts +1 -1
- package/src/marble.ts +3 -14
- package/src/normalMap.ts +3 -14
- package/src/perlinNoise.ts +3 -14
- package/src/road.ts +3 -14
- package/src/starfield.ts +3 -14
- package/src/wood.ts +3 -14
- package/tsconfig.build.json +2 -1
- package/tsconfig.json +2 -1
- package/webpack.config.js +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babylon.roadProceduralTexture.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,gCAAiC,CAAC,aAAcJ,GAC7B,iBAAZC,QACdA,QAAQ,iCAAmCD,EAAQG,QAAQ,cAE3DJ,EAAyB,mBAAIC,EAAQD,EAAc,QACpD,CATD,CASoB,oBAATO,KAAuBA,KAAyB,oBAAXC,OAAyBA,OAASC,MAAQC,G,kCCT1FP,EAAOD,QAAUQ,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaZ,QAGrB,IA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ACpH,IAAK,IAAIO,EAAIT,EAAWK,OAAS,EAAGI,GAAK,EAAGA,KAAShE,EAAIuD,EAAWS,MAAI9C,GAAKwC,EAAI,EAAI1D,EAAEkB,GAAKwC,EAAI,EAAI1D,EAAEwD,EAAQtD,EAAKgB,GAAKlB,EAAEwD,EAAQtD,KAASgB,GACzIwC,EAAI,GAAKxC,GAAKd,OAAOC,eAAemD,EAAQtD,EAAKgB,EAC1D,CErCI,GADC,IAAA+C,sB,8BAsCL,C,CAlDO,CAAoC,EAAAC,oBAoD3C,IAAAC,eAAc,gCAAiCf,GCtD/C,MAAMgB,OAAiC,IAAX,EAAA5D,EAAyB,EAAAA,EAA2B,oBAAXI,OAAyBA,YAASd,EACvG,QAA4B,IAAjBsE,EACP,IAAK,MAAMlE,KAAO,EACRkE,EAAcC,QAAQnE,GAAa,EAAmBA,E","sources":["webpack://PROCEDURALTEXTURES/webpack/universalModuleDefinition","webpack://PROCEDURALTEXTURES/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://PROCEDURALTEXTURES/webpack/bootstrap","webpack://PROCEDURALTEXTURES/webpack/runtime/define property getters","webpack://PROCEDURALTEXTURES/webpack/runtime/global","webpack://PROCEDURALTEXTURES/webpack/runtime/hasOwnProperty shorthand","webpack://PROCEDURALTEXTURES/webpack/runtime/make namespace object","webpack://PROCEDURALTEXTURES/../../../../node_modules/tslib/tslib.es6.mjs","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/road/roadProceduralTexture.fragment.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/generated/road/roadProceduralTexture.ts","webpack://PROCEDURALTEXTURES/./src/road.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-procedural-textures\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-procedural-textures\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"PROCEDURALTEXTURES\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__520__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__520__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n 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); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"roadProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vUV; \nuniform vec3 roadColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));vec3 color=roadColor*ratioy;gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const roadProceduralTexturePixelShader = { name, shader };\n","import { serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\nimport \"./roadProceduralTexture.fragment\";\r\n\r\nexport class RoadProceduralTexture extends ProceduralTexture {\r\n private _roadColor = new Color3(0.53, 0.53, 0.53);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"roadProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"roadColor\", this._roadColor);\r\n }\r\n\r\n @serializeAsColor3()\r\n public get roadColor(): Color3 {\r\n return this._roadColor;\r\n }\r\n\r\n public set roadColor(value: Color3) {\r\n this._roadColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this road procedural texture\r\n * @returns a serialized road procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.RoadProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Road Procedural Texture from parsed road procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing road procedural texture information\r\n * @returns a parsed Road Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RoadProceduralTexture\", RoadProceduralTexture);\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"procedural-textures/road/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n for (const key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"procedural-textures/road/index\";\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__520__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","extendStatics","b","setPrototypeOf","__proto__","Array","p","create","ShaderStore","ShadersStore","name","size","scene","fallbackTexture","generateMipMaps","_roadColor","Color3","updateShaderUniforms","TypeError","String","__","constructor","setColor3","serialize","serializationObject","SerializationHelper","Serialize","customType","Parse","parsedTexture","rootUrl","RoadProceduralTexture","_size","_generateMipMaps","decorators","target","desc","c","arguments","length","getOwnPropertyDescriptor","Reflect","decorate","i","serializeAsColor3","ProceduralTexture","RegisterClass","globalObject","BABYLON"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"babylon.roadProceduralTexture.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,cACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,gCAAiC,CAAC,aAAcJ,GAC7B,iBAAZC,QACdA,QAAQ,iCAAmCD,EAAQG,QAAQ,cAE3DJ,EAAyB,mBAAIC,EAAQD,EAA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AAa,EAAmBA,GCPpE,S","sources":["webpack://PROCEDURALTEXTURES/webpack/universalModuleDefinition","webpack://PROCEDURALTEXTURES/external umd {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}","webpack://PROCEDURALTEXTURES/webpack/bootstrap","webpack://PROCEDURALTEXTURES/webpack/runtime/define property getters","webpack://PROCEDURALTEXTURES/webpack/runtime/global","webpack://PROCEDURALTEXTURES/webpack/runtime/hasOwnProperty shorthand","webpack://PROCEDURALTEXTURES/webpack/runtime/make namespace object","webpack://PROCEDURALTEXTURES/../../../../node_modules/tslib/tslib.es6.mjs","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/road/roadProceduralTexture.fragment.ts","webpack://PROCEDURALTEXTURES/../../../dev/proceduralTextures/src/road/roadProceduralTexture.ts","webpack://PROCEDURALTEXTURES/../../../lts/proceduralTextures/src/legacy/legacy-road.ts","webpack://PROCEDURALTEXTURES/./src/road.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-procedural-textures\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-procedural-textures\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"PROCEDURALTEXTURES\"] = factory(root[\"BABYLON\"]);\n})((typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : this), (__WEBPACK_EXTERNAL_MODULE__520__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__520__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n 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); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n","// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"roadProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vUV; \nuniform vec3 roadColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nfloat ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));vec3 color=roadColor*ratioy;gl_FragColor=vec4(color,1.0);\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const roadProceduralTexturePixelShader = { name, shader };\n","import { serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\nimport \"./roadProceduralTexture.fragment\";\r\n\r\nexport class RoadProceduralTexture extends ProceduralTexture {\r\n private _roadColor = new Color3(0.53, 0.53, 0.53);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"roadProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setColor3(\"roadColor\", this._roadColor);\r\n }\r\n\r\n @serializeAsColor3()\r\n public get roadColor(): Color3 {\r\n return this._roadColor;\r\n }\r\n\r\n public set roadColor(value: Color3) {\r\n this._roadColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this road procedural texture\r\n * @returns a serialized road procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.RoadProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Road Procedural Texture from parsed road procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing road procedural texture information\r\n * @returns a parsed Road Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): RoadProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new RoadProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RoadProceduralTexture\", RoadProceduralTexture);\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"procedural-textures/road/index\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n for (const key in proceduralTexture) {\r\n (<any>globalObject).BABYLON[key] = (<any>proceduralTexture)[key];\r\n }\r\n}\r\n\r\nexport * from \"procedural-textures/road/index\";\r\n","/* eslint-disable import/no-internal-modules */\r\nimport * as proceduralTexture from \"@lts/procedural-textures/legacy/legacy-road\";\r\nexport { proceduralTexture };\r\nexport default proceduralTexture;\r\n"],"names":["root","factory","exports","module","require","define","amd","self","global","this","__WEBPACK_EXTERNAL_MODULE__520__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","create","ShaderStore","ShadersStore","RoadProceduralTexture","ProceduralTexture","constructor","name","size","scene","fallbackTexture","generateMipMaps","super","_roadColor","Color3","updateShaderUniforms","setColor3","roadColor","serialize","serializationObject","SerializationHelper","Serialize","customType","static","parsedTexture","rootUrl","Parse","_size","_generateMipMaps","decorators","target","desc","c","arguments","length","getOwnPropertyDescriptor","Reflect","decorate","i","serializeAsColor3","RegisterClass","globalObject","BABYLON"],"sourceRoot":""}
|
|
@@ -12,9 +12,9 @@ return /******/ (() => { // webpackBootstrap
|
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/ "../../../
|
|
15
|
+
/***/ "../../../dev/proceduralTextures/dist/starfield/index.js":
|
|
16
16
|
/*!***************************************************************!*\
|
|
17
|
-
!*** ../../../
|
|
17
|
+
!*** ../../../dev/proceduralTextures/dist/starfield/index.js ***!
|
|
18
18
|
\***************************************************************/
|
|
19
19
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20
20
|
|
|
@@ -22,15 +22,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22
22
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
23
|
/* harmony export */ StarfieldProceduralTexture: () => (/* reexport safe */ _starfieldProceduralTexture__WEBPACK_IMPORTED_MODULE_0__.StarfieldProceduralTexture)
|
|
24
24
|
/* harmony export */ });
|
|
25
|
-
/* harmony import */ var _starfieldProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./starfieldProceduralTexture */ "../../../
|
|
25
|
+
/* harmony import */ var _starfieldProceduralTexture__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./starfieldProceduralTexture */ "../../../dev/proceduralTextures/dist/starfield/starfieldProceduralTexture.js");
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
/***/ }),
|
|
30
30
|
|
|
31
|
-
/***/ "../../../
|
|
31
|
+
/***/ "../../../dev/proceduralTextures/dist/starfield/starfieldProceduralTexture.fragment.js":
|
|
32
32
|
/*!*********************************************************************************************!*\
|
|
33
|
-
!*** ../../../
|
|
33
|
+
!*** ../../../dev/proceduralTextures/dist/starfield/starfieldProceduralTexture.fragment.js ***!
|
|
34
34
|
\*********************************************************************************************/
|
|
35
35
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
36
|
|
|
@@ -42,19 +42,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42
42
|
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
|
|
43
43
|
// Do not edit.
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
const name = "starfieldProceduralTexturePixelShader";
|
|
46
|
+
const shader = `precision highp float;
|
|
47
|
+
#define volsteps 20
|
|
48
|
+
#define iterations 15
|
|
49
|
+
varying vec2 vPosition;varying vec2 vUV;uniform float time;uniform float alpha;uniform float beta;uniform float zoom;uniform float formuparam;uniform float stepsize;uniform float tile;uniform float brightness;uniform float darkmatter;uniform float distfading;uniform float saturation;void main()
|
|
50
|
+
{vec3 dir=vec3(vUV*zoom,1.);float localTime=time*0.0001;mat2 rot1=mat2(cos(alpha),sin(alpha),-sin(alpha),cos(alpha));mat2 rot2=mat2(cos(beta),sin(beta),-sin(beta),cos(beta));dir.xz*=rot1;dir.xy*=rot2;vec3 from_=vec3(1.,.5,0.5);from_+=vec3(-2.,localTime*2.,localTime);from_.xz*=rot1;from_.xy*=rot2;float s=0.1,fade=1.;vec3 v=vec3(0.);for (int r=0; r<volsteps; r++) {vec3 p=from_+s*dir*.5;p=abs(vec3(tile)-mod(p,vec3(tile*2.)));
|
|
51
|
+
float pa,a=pa=0.;for (int i=0; i<iterations; i++) {p=abs(p)/dot(p,p)-formuparam;
|
|
52
|
+
a+=abs(length(p)-pa);
|
|
53
|
+
pa=length(p);}
|
|
54
|
+
float dm=max(0.,darkmatter-a*a*.001);
|
|
55
|
+
a*=a*a;
|
|
56
|
+
if (r>6) fade*=1.-dm;
|
|
57
|
+
v+=fade;v+=vec3(s,s*s,s*s*s*s)*a*brightness*fade;
|
|
58
|
+
fade*=distfading;
|
|
59
|
+
s+=stepsize;}
|
|
60
|
+
v=mix(vec3(length(v)),v,saturation);
|
|
61
|
+
gl_FragColor=vec4(v*.01,1.);}`;
|
|
47
62
|
// Sideeffect
|
|
48
63
|
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
|
|
49
64
|
/** @internal */
|
|
50
|
-
|
|
65
|
+
const starfieldProceduralTexturePixelShader = { name, shader };
|
|
51
66
|
|
|
52
67
|
|
|
53
68
|
/***/ }),
|
|
54
69
|
|
|
55
|
-
/***/ "../../../
|
|
70
|
+
/***/ "../../../dev/proceduralTextures/dist/starfield/starfieldProceduralTexture.js":
|
|
56
71
|
/*!************************************************************************************!*\
|
|
57
|
-
!*** ../../../
|
|
72
|
+
!*** ../../../dev/proceduralTextures/dist/starfield/starfieldProceduralTexture.js ***!
|
|
58
73
|
\************************************************************************************/
|
|
59
74
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
60
75
|
|
|
@@ -65,32 +80,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65
80
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.mjs");
|
|
66
81
|
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/decorators");
|
|
67
82
|
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__);
|
|
68
|
-
/* harmony import */ var _starfieldProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./starfieldProceduralTexture.fragment */ "../../../
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
_this._saturation = 0.85;
|
|
90
|
-
_this.updateShaderUniforms();
|
|
91
|
-
return _this;
|
|
83
|
+
/* harmony import */ var _starfieldProceduralTexture_fragment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./starfieldProceduralTexture.fragment */ "../../../dev/proceduralTextures/dist/starfield/starfieldProceduralTexture.fragment.js");
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class StarfieldProceduralTexture extends core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.ProceduralTexture {
|
|
90
|
+
constructor(name, size, scene = null, fallbackTexture, generateMipMaps) {
|
|
91
|
+
super(name, size, "starfieldProceduralTexture", scene, fallbackTexture, generateMipMaps);
|
|
92
|
+
this._time = 1;
|
|
93
|
+
this._alpha = 0.5;
|
|
94
|
+
this._beta = 0.8;
|
|
95
|
+
this._zoom = 0.8;
|
|
96
|
+
this._formuparam = 0.53;
|
|
97
|
+
this._stepsize = 0.1;
|
|
98
|
+
this._tile = 0.85;
|
|
99
|
+
this._brightness = 0.0015;
|
|
100
|
+
this._darkmatter = 0.4;
|
|
101
|
+
this._distfading = 0.73;
|
|
102
|
+
this._saturation = 0.85;
|
|
103
|
+
this.updateShaderUniforms();
|
|
92
104
|
}
|
|
93
|
-
|
|
105
|
+
updateShaderUniforms() {
|
|
94
106
|
this.setFloat("time", this._time);
|
|
95
107
|
this.setFloat("alpha", this._alpha);
|
|
96
108
|
this.setFloat("beta", this._beta);
|
|
@@ -102,137 +114,93 @@ var StarfieldProceduralTexture = /** @class */ (function (_super) {
|
|
|
102
114
|
this.setFloat("darkmatter", this._darkmatter);
|
|
103
115
|
this.setFloat("distfading", this._distfading);
|
|
104
116
|
this.setFloat("saturation", this._saturation);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "brightness", {
|
|
184
|
-
get: function () {
|
|
185
|
-
return this._brightness;
|
|
186
|
-
},
|
|
187
|
-
set: function (value) {
|
|
188
|
-
this._brightness = value;
|
|
189
|
-
this.updateShaderUniforms();
|
|
190
|
-
},
|
|
191
|
-
enumerable: false,
|
|
192
|
-
configurable: true
|
|
193
|
-
});
|
|
194
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "darkmatter", {
|
|
195
|
-
get: function () {
|
|
196
|
-
return this._darkmatter;
|
|
197
|
-
},
|
|
198
|
-
set: function (value) {
|
|
199
|
-
this._darkmatter = value;
|
|
200
|
-
this.updateShaderUniforms();
|
|
201
|
-
},
|
|
202
|
-
enumerable: false,
|
|
203
|
-
configurable: true
|
|
204
|
-
});
|
|
205
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "distfading", {
|
|
206
|
-
get: function () {
|
|
207
|
-
return this._distfading;
|
|
208
|
-
},
|
|
209
|
-
set: function (value) {
|
|
210
|
-
this._distfading = value;
|
|
211
|
-
this.updateShaderUniforms();
|
|
212
|
-
},
|
|
213
|
-
enumerable: false,
|
|
214
|
-
configurable: true
|
|
215
|
-
});
|
|
216
|
-
Object.defineProperty(StarfieldProceduralTexture.prototype, "saturation", {
|
|
217
|
-
get: function () {
|
|
218
|
-
return this._saturation;
|
|
219
|
-
},
|
|
220
|
-
set: function (value) {
|
|
221
|
-
this._saturation = value;
|
|
222
|
-
this.updateShaderUniforms();
|
|
223
|
-
},
|
|
224
|
-
enumerable: false,
|
|
225
|
-
configurable: true
|
|
226
|
-
});
|
|
117
|
+
}
|
|
118
|
+
get time() {
|
|
119
|
+
return this._time;
|
|
120
|
+
}
|
|
121
|
+
set time(value) {
|
|
122
|
+
this._time = value;
|
|
123
|
+
this.updateShaderUniforms();
|
|
124
|
+
}
|
|
125
|
+
get alpha() {
|
|
126
|
+
return this._alpha;
|
|
127
|
+
}
|
|
128
|
+
set alpha(value) {
|
|
129
|
+
this._alpha = value;
|
|
130
|
+
this.updateShaderUniforms();
|
|
131
|
+
}
|
|
132
|
+
get beta() {
|
|
133
|
+
return this._beta;
|
|
134
|
+
}
|
|
135
|
+
set beta(value) {
|
|
136
|
+
this._beta = value;
|
|
137
|
+
this.updateShaderUniforms();
|
|
138
|
+
}
|
|
139
|
+
get formuparam() {
|
|
140
|
+
return this._formuparam;
|
|
141
|
+
}
|
|
142
|
+
set formuparam(value) {
|
|
143
|
+
this._formuparam = value;
|
|
144
|
+
this.updateShaderUniforms();
|
|
145
|
+
}
|
|
146
|
+
get stepsize() {
|
|
147
|
+
return this._stepsize;
|
|
148
|
+
}
|
|
149
|
+
set stepsize(value) {
|
|
150
|
+
this._stepsize = value;
|
|
151
|
+
this.updateShaderUniforms();
|
|
152
|
+
}
|
|
153
|
+
get zoom() {
|
|
154
|
+
return this._zoom;
|
|
155
|
+
}
|
|
156
|
+
set zoom(value) {
|
|
157
|
+
this._zoom = value;
|
|
158
|
+
this.updateShaderUniforms();
|
|
159
|
+
}
|
|
160
|
+
get tile() {
|
|
161
|
+
return this._tile;
|
|
162
|
+
}
|
|
163
|
+
set tile(value) {
|
|
164
|
+
this._tile = value;
|
|
165
|
+
this.updateShaderUniforms();
|
|
166
|
+
}
|
|
167
|
+
get brightness() {
|
|
168
|
+
return this._brightness;
|
|
169
|
+
}
|
|
170
|
+
set brightness(value) {
|
|
171
|
+
this._brightness = value;
|
|
172
|
+
this.updateShaderUniforms();
|
|
173
|
+
}
|
|
174
|
+
get darkmatter() {
|
|
175
|
+
return this._darkmatter;
|
|
176
|
+
}
|
|
177
|
+
set darkmatter(value) {
|
|
178
|
+
this._darkmatter = value;
|
|
179
|
+
this.updateShaderUniforms();
|
|
180
|
+
}
|
|
181
|
+
get distfading() {
|
|
182
|
+
return this._distfading;
|
|
183
|
+
}
|
|
184
|
+
set distfading(value) {
|
|
185
|
+
this._distfading = value;
|
|
186
|
+
this.updateShaderUniforms();
|
|
187
|
+
}
|
|
188
|
+
get saturation() {
|
|
189
|
+
return this._saturation;
|
|
190
|
+
}
|
|
191
|
+
set saturation(value) {
|
|
192
|
+
this._saturation = value;
|
|
193
|
+
this.updateShaderUniforms();
|
|
194
|
+
}
|
|
227
195
|
/**
|
|
228
196
|
* Serializes this starfield procedural texture
|
|
229
197
|
* @returns a serialized starfield procedural texture object
|
|
230
198
|
*/
|
|
231
|
-
|
|
232
|
-
|
|
199
|
+
serialize() {
|
|
200
|
+
const serializationObject = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.SerializationHelper.Serialize(this, super.serialize());
|
|
233
201
|
serializationObject.customType = "BABYLON.StarfieldProceduralTexture";
|
|
234
202
|
return serializationObject;
|
|
235
|
-
}
|
|
203
|
+
}
|
|
236
204
|
/**
|
|
237
205
|
* Creates a Starfield Procedural Texture from parsed startfield procedural texture data
|
|
238
206
|
* @param parsedTexture defines parsed texture data
|
|
@@ -240,48 +208,75 @@ var StarfieldProceduralTexture = /** @class */ (function (_super) {
|
|
|
240
208
|
* @param rootUrl defines the root URL containing startfield procedural texture information
|
|
241
209
|
* @returns a parsed Starfield Procedural Texture
|
|
242
210
|
*/
|
|
243
|
-
|
|
244
|
-
|
|
211
|
+
static Parse(parsedTexture, scene, rootUrl) {
|
|
212
|
+
const texture = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.SerializationHelper.Parse(() => new StarfieldProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
|
|
245
213
|
return texture;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.ProceduralTexture));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
217
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
218
|
+
], StarfieldProceduralTexture.prototype, "time", null);
|
|
219
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
220
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
221
|
+
], StarfieldProceduralTexture.prototype, "alpha", null);
|
|
222
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
223
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
224
|
+
], StarfieldProceduralTexture.prototype, "beta", null);
|
|
225
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
226
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
227
|
+
], StarfieldProceduralTexture.prototype, "formuparam", null);
|
|
228
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
229
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
230
|
+
], StarfieldProceduralTexture.prototype, "stepsize", null);
|
|
231
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
232
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
233
|
+
], StarfieldProceduralTexture.prototype, "zoom", null);
|
|
234
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
235
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
236
|
+
], StarfieldProceduralTexture.prototype, "tile", null);
|
|
237
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
238
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
239
|
+
], StarfieldProceduralTexture.prototype, "brightness", null);
|
|
240
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
241
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
242
|
+
], StarfieldProceduralTexture.prototype, "darkmatter", null);
|
|
243
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
244
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
245
|
+
], StarfieldProceduralTexture.prototype, "distfading", null);
|
|
246
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
|
|
247
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.serialize)()
|
|
248
|
+
], StarfieldProceduralTexture.prototype, "saturation", null);
|
|
282
249
|
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_0__.RegisterClass)("BABYLON.StarfieldProceduralTexture", StarfieldProceduralTexture);
|
|
283
250
|
|
|
284
251
|
|
|
252
|
+
/***/ }),
|
|
253
|
+
|
|
254
|
+
/***/ "../../../lts/proceduralTextures/dist/legacy/legacy-starfield.js":
|
|
255
|
+
/*!***********************************************************************!*\
|
|
256
|
+
!*** ../../../lts/proceduralTextures/dist/legacy/legacy-starfield.js ***!
|
|
257
|
+
\***********************************************************************/
|
|
258
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
259
|
+
|
|
260
|
+
__webpack_require__.r(__webpack_exports__);
|
|
261
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
262
|
+
/* harmony export */ StarfieldProceduralTexture: () => (/* reexport safe */ procedural_textures_starfield_index__WEBPACK_IMPORTED_MODULE_0__.StarfieldProceduralTexture)
|
|
263
|
+
/* harmony export */ });
|
|
264
|
+
/* harmony import */ var procedural_textures_starfield_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! procedural-textures/starfield/index */ "../../../dev/proceduralTextures/dist/starfield/index.js");
|
|
265
|
+
/* eslint-disable import/no-internal-modules */
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* This is the entry point for the UMD module.
|
|
269
|
+
* The entry point for a future ESM package should be index.ts
|
|
270
|
+
*/
|
|
271
|
+
var globalObject = typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : undefined;
|
|
272
|
+
if (typeof globalObject !== "undefined") {
|
|
273
|
+
for (var key in procedural_textures_starfield_index__WEBPACK_IMPORTED_MODULE_0__) {
|
|
274
|
+
globalObject.BABYLON[key] = procedural_textures_starfield_index__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
285
280
|
/***/ }),
|
|
286
281
|
|
|
287
282
|
/***/ "core/Misc/decorators":
|
|
@@ -746,22 +741,14 @@ var __webpack_exports__ = {};
|
|
|
746
741
|
\**************************/
|
|
747
742
|
__webpack_require__.r(__webpack_exports__);
|
|
748
743
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
749
|
-
/* harmony export */
|
|
744
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
745
|
+
/* harmony export */ proceduralTexture: () => (/* reexport module object */ _lts_procedural_textures_legacy_legacy_starfield__WEBPACK_IMPORTED_MODULE_0__)
|
|
750
746
|
/* harmony export */ });
|
|
751
|
-
/* harmony import */ var
|
|
747
|
+
/* harmony import */ var _lts_procedural_textures_legacy_legacy_starfield__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lts/procedural-textures/legacy/legacy-starfield */ "../../../lts/proceduralTextures/dist/legacy/legacy-starfield.js");
|
|
752
748
|
/* eslint-disable import/no-internal-modules */
|
|
753
749
|
|
|
754
|
-
/**
|
|
755
|
-
* This is the entry point for the UMD module.
|
|
756
|
-
* The entry point for a future ESM package should be index.ts
|
|
757
|
-
*/
|
|
758
|
-
const globalObject = typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : undefined;
|
|
759
|
-
if (typeof globalObject !== "undefined") {
|
|
760
|
-
for (const key in procedural_textures_starfield_index__WEBPACK_IMPORTED_MODULE_0__) {
|
|
761
|
-
globalObject.BABYLON[key] = procedural_textures_starfield_index__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
750
|
|
|
751
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_lts_procedural_textures_legacy_legacy_starfield__WEBPACK_IMPORTED_MODULE_0__);
|
|
765
752
|
|
|
766
753
|
})();
|
|
767
754
|
|