UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

1 lines 6.79 MB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("babylonjs",[],t):"object"==typeof exports?exports.babylonjs=t():e.BABYLON=t()}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(()=>(()=>{"use strict";var e={132:(e,t,r)=>{r.r(t),r.d(t,{FlowGraphGetPropertyBlock:()=>a});var n=r(78322),i=r(88099),o=r(34623),a=function(e){function t(t){var r=e.call(this,i.Vv,t)||this;return r.config=t,r.object=r.registerDataInput("object",i.Vv,t.object),r.propertyName=r.registerDataInput("propertyName",i.Vv,t.propertyName),r.customGetFunction=r.registerDataInput("customGetFunction",i.Vv),r}return(0,n.C6)(t,e),t.prototype._doOperation=function(e){var t,r=this.customGetFunction.getValue(e);if(r)t=r(this.object.getValue(e),this.propertyName.getValue(e),e);else{var n=this.object.getValue(e),i=this.propertyName.getValue(e);t=n&&i?this._getPropertyValue(n,i):void 0}return t},t.prototype._getPropertyValue=function(e,t){for(var r=e,n=0,i=t.split(".");n<i.length;n++)if(void 0===(r=r[i[n]]))return;return r},t.prototype.getClassName=function(){return"FlowGraphGetPropertyBlock"},t}(r(61930).r);(0,o.Y5)("FlowGraphGetPropertyBlock",a)},252:(e,t,r)=>{r.d(t,{n:()=>o});var n=r(7164),i=r(34623),o=function(){function e(){}return e.Instantiate=function(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];var t=(0,i.n9)(e);if(t)return t;n.V.Warn(e+" not found, you may have missed an import.");for(var r=e.split("."),o=window||this,a=0,s=r.length;a<s;a++)o=o[r[a]];return"function"!=typeof o?null:o},e.RegisteredExternalClasses={},e}()},338:(e,t,r)=>{var n=r(98519),i="samplerFragmentDeclaration";n.l.IncludesShadersStoreWGSL[i]||(n.l.IncludesShadersStoreWGSL[i]="#ifdef _DEFINENAME_\n#if _DEFINENAME_DIRECTUV==1\n#define v_VARYINGNAME_UV vMainUV1\n#elif _DEFINENAME_DIRECTUV==2\n#define v_VARYINGNAME_UV vMainUV2\n#elif _DEFINENAME_DIRECTUV==3\n#define v_VARYINGNAME_UV vMainUV3\n#elif _DEFINENAME_DIRECTUV==4\n#define v_VARYINGNAME_UV vMainUV4\n#elif _DEFINENAME_DIRECTUV==5\n#define v_VARYINGNAME_UV vMainUV5\n#elif _DEFINENAME_DIRECTUV==6\n#define v_VARYINGNAME_UV vMainUV6\n#else\nvarying v_VARYINGNAME_UV: vec2f;\n#endif\nvar _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;\n#endif\n")},583:(e,t,r)=>{r.r(t),r.d(t,{meshUVSpaceRendererFinaliserVertexShaderWGSL:()=>a});var n=r(98519),i="meshUVSpaceRendererFinaliserVertexShader",o="attribute position: vec3f;attribute uv: vec2f;uniform worldViewProjection: mat4x4f;varying vUV: vec2f;@vertex\nfn main(input : VertexInputs)->FragmentInputs {vertexOutputs.position=uniforms.worldViewProjection* vec4f(input.position,1.0);vertexOutputs.positionvUV=input.uv;}\n";n.l.ShadersStoreWGSL[i]||(n.l.ShadersStoreWGSL[i]=o);var a={name:i,shader:o}},608:(e,t,r)=>{r.d(t,{BG:()=>a,PR:()=>l,eG:()=>p,g7:()=>d,jf:()=>u,kF:()=>c,kX:()=>s,rT:()=>f,tl:()=>h});var n=r(5153),i=r(82673),o=r(66614);function a(e,t,r){e._onCanvasFocus=function(){e.onCanvasFocusObservable.notifyObservers(e)},e._onCanvasBlur=function(){e.onCanvasBlurObservable.notifyObservers(e)},e._onCanvasContextMenu=function(t){e.disableContextMenu&&t.preventDefault()},t.addEventListener("focus",e._onCanvasFocus),t.addEventListener("blur",e._onCanvasBlur),t.addEventListener("contextmenu",e._onCanvasContextMenu),e._onBlur=function(){e.disablePerformanceMonitorInBackground&&e.performanceMonitor.disable(),e._windowIsBackground=!0},e._onFocus=function(){e.disablePerformanceMonitorInBackground&&e.performanceMonitor.enable(),e._windowIsBackground=!1},e._onCanvasPointerOut=function(r){document.elementFromPoint(r.clientX,r.clientY)!==t&&e.onCanvasPointerOutObservable.notifyObservers(r)};var o=e.getHostWindow();o&&"function"==typeof o.addEventListener&&(o.addEventListener("blur",e._onBlur),o.addEventListener("focus",e._onFocus)),t.addEventListener("pointerout",e._onCanvasPointerOut),r.doNotHandleTouchAction||function(e){e&&e.setAttribute&&(e.setAttribute("touch-action","none"),e.style.touchAction="none",e.style.webkitTapHighlightColor="transparent")}(t),!i.$.audioEngine&&r.audioEngine&&i.$.AudioEngineFactory&&(i.$.audioEngine=i.$.AudioEngineFactory(e.getRenderingCanvas(),e.getAudioContext(),e.getAudioDestination())),(0,n.Nf)()&&(e._onFullscreenChange=function(){e.isFullscreen=!!document.fullscreenElement,e.isFullscreen&&e._pointerLockRequested&&t&&p(t)},document.addEventListener("fullscreenchange",e._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",e._onFullscreenChange,!1),e._onPointerLockChange=function(){e.isPointerLock=document.pointerLockElement===t},document.addEventListener("pointerlockchange",e._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",e._onPointerLockChange,!1)),e.enableOfflineSupport=void 0!==i.$.OfflineProviderFactory,e._deterministicLockstep=!!r.deterministicLockstep,e._lockstepMaxSteps=r.lockstepMaxSteps||0,e._timeStep=r.timeStep||1/60}function s(e,t){1===o.q.Instances.length&&i.$.audioEngine&&(i.$.audioEngine.dispose(),i.$.audioEngine=null);var r=e.getHostWindow();r&&"function"==typeof r.removeEventListener&&(r.removeEventListener("blur",e._onBlur),r.removeEventListener("focus",e._onFocus)),t&&(t.removeEventListener("focus",e._onCanvasFocus),t.removeEventListener("blur",e._onCanvasBlur),t.removeEventListener("pointerout",e._onCanvasPointerOut),t.removeEventListener("contextmenu",e._onCanvasContextMenu)),(0,n.Nf)()&&(document.removeEventListener("fullscreenchange",e._onFullscreenChange),document.removeEventListener("mozfullscreenchange",e._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",e._onFullscreenChange),document.removeEventListener("msfullscreenchange",e._onFullscreenChange),document.removeEventListener("pointerlockchange",e._onPointerLockChange),document.removeEventListener("mspointerlockchange",e._onPointerLockChange),document.removeEventListener("mozpointerlockchange",e._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",e._onPointerLockChange))}function l(e){var t=document.createElement("span");t.textContent="Hg",t.style.font=e;var r=document.createElement("div");r.style.display="inline-block",r.style.width="1px",r.style.height="0px",r.style.verticalAlign="bottom";var n=document.createElement("div");n.style.whiteSpace="nowrap",n.appendChild(t),n.appendChild(r),document.body.appendChild(n);var i=0,o=0;try{o=r.getBoundingClientRect().top-t.getBoundingClientRect().top,r.style.verticalAlign="baseline",i=r.getBoundingClientRect().top-t.getBoundingClientRect().top}finally{document.body.removeChild(n)}return{ascent:i,height:o,descent:o-i}}function c(e,t,r){return new Promise((function(n,i){var o=new Image;o.onload=function(){o.decode().then((function(){e.createImageBitmap(o,r).then((function(e){n(e)}))}))},o.onerror=function(){i("Error loading image ".concat(o.src))},o.src=t}))}function u(e,t,r,n){var i=e.createCanvas(r,n).getContext("2d");if(!i)throw new Error("Unable to get 2d context for resizeImageBitmap");return i.drawImage(t,0,0),i.getImageData(0,0,r,n).data}function h(e){var t=e.requestFullscreen||e.webkitRequestFullscreen;t&&t.call(e)}function d(){var e=document;document.exitFullscreen?document.exitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()}function p(e){if(e.requestPointerLock){var t=e.requestPointerLock();t instanceof Promise?t.then((function(){e.focus()})).catch((function(){})):e.focus()}}function f(){document.exitPointerLock&&document.exitPointerLock()}},779:(e,t,r)=>{r.r(t),r.d(t,{geometryVertexShader:()=>l});var n=r(98519),i=(r(36470),r(64400),r(24444),r(67369),r(38615),"geometryVertexDeclaration");n.l.IncludesShadersStore[i]||(n.l.IncludesShadersStore[i]="uniform mat4 viewProjection;uniform mat4 view;"),r(50851);var o="geometryUboDeclaration";n.l.IncludesShadersStore[o]||(n.l.IncludesShadersStore[o]="#include<sceneUboDeclaration>\n"),r(85637),r(58266),r(84589),r(35397),r(76898),r(49334),r(83057),r(35845);var a="geometryVertexShader",s="precision highp float;\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\n#include<__decl__geometryVertex>\n#include<clipPlaneVertexDeclaration>\nattribute vec3 position;attribute vec3 normal;\n#ifdef NEED_UV\nvarying vec2 vUV;\n#ifdef ALPHATEST\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef BUMP\nuniform mat4 bumpMatrix;varying vec2 vBumpUV;\n#endif\n#ifdef REFLECTIVITY\nuniform mat4 reflectivityMatrix;uniform mat4 albedoMatrix;varying vec2 vReflectivityUV;varying vec2 vAlbedoUV;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#ifdef BUMP\nvarying mat4 vWorldView;\n#endif\n#ifdef BUMP\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nuniform mat4 previousViewProjection;varying vec4 vCurrentPosition;varying vec4 vPreviousPosition;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{vec3 positionUpdated=position;vec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef UV2\nvec2 uv2Updated=uv2;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=vec4(finalWorld*vec4(positionUpdated,1.0));\n#ifdef BUMP\nvWorldView=view*finalWorld;mat3 normalWorld=mat3(finalWorld);vNormalW=normalize(normalWorld*normalUpdated);\n#else\n#ifdef NORMAL_WORLDSPACE\nvNormalV=normalize(vec3(finalWorld*vec4(normalUpdated,0.0)));\n#else\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));\n#endif\n#endif\nvViewPos=view*worldPos;\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvPositionW=worldPos.xyz/worldPos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#include<clipPlaneVertex>\n#ifdef NEED_UV\n#ifdef UV1\n#if defined(ALPHATEST) && defined(ALPHATEST_UV1)\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#else\nvUV=uvUpdated;\n#endif\n#ifdef BUMP_UV1\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY_UV1\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef ALBEDO_UV1\nvAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#endif\n#ifdef UV2\n#if defined(ALPHATEST) && defined(ALPHATEST_UV2)\nvUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));\n#else\nvUV=uv2Updated;\n#endif\n#ifdef BUMP_UV2\nvBumpUV=vec2(bumpMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY_UV2\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#ifdef ALBEDO_UV2\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2Updated,1.0,0.0));\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n";n.l.ShadersStore[a]||(n.l.ShadersStore[a]=s);var l={name:a,shader:s}},922:(e,t,r)=>{r.r(t),r.d(t,{taaPixelShader:()=>a});var n=r(98519),i="taaPixelShader",o="varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D historySampler;uniform float factor;void main() {vec4 c=texelFetch(textureSampler,ivec2(gl_FragCoord.xy),0);vec4 h=texelFetch(historySampler,ivec2(gl_FragCoord.xy),0);gl_FragColor=mix(h,c,factor);}\n";n.l.ShadersStore[i]||(n.l.ShadersStore[i]=o);var a={name:i,shader:o}},1235:(e,t,r)=>{r.d(t,{gT:()=>s,hy:()=>a,kf:()=>o});var n=r(7164),i=new Map;function o(e,t){a(e)&&n.V.Warn("Extension with the name '".concat(name,"' already exists")),i.set(e,t)}function a(e){return i.delete(e)}function s(e,t){"image/ktx"!==t&&"image/ktx2"!==t||(e=".ktx"),i.has(e)||(e.endsWith(".ies")&&o(".ies",(function(){return Promise.resolve().then(r.bind(r,19941)).then((function(e){return new e._IESTextureLoader}))})),e.endsWith(".dds")&&o(".dds",(function(){return Promise.resolve().then(r.bind(r,19135)).then((function(e){return new e._DDSTextureLoader}))})),e.endsWith(".basis")&&o(".basis",(function(){return Promise.resolve().then(r.bind(r,23586)).then((function(e){return new e._BasisTextureLoader}))})),e.endsWith(".env")&&o(".env",(function(){return Promise.resolve().then(r.bind(r,71545)).then((function(e){return new e._ENVTextureLoader}))})),e.endsWith(".hdr")&&o(".hdr",(function(){return Promise.resolve().then(r.bind(r,78750)).then((function(e){return new e._HDRTextureLoader}))})),(e.endsWith(".ktx")||e.endsWith(".ktx2"))&&(o(".ktx",(function(){return Promise.resolve().then(r.bind(r,81867)).then((function(e){return new e._KTXTextureLoader}))})),o(".ktx2",(function(){return Promise.resolve().then(r.bind(r,81867)).then((function(e){return new e._KTXTextureLoader}))}))),e.endsWith(".tga")&&o(".tga",(function(){return Promise.resolve().then(r.bind(r,5996)).then((function(e){return new e._TGATextureLoader}))})),e.endsWith(".exr")&&o(".exr",(function(){return Promise.resolve().then(r.bind(r,93747)).then((function(e){return new e._ExrTextureLoader}))})));var n=i.get(e);return n?Promise.resolve(n(t)):null}},1554:(e,t,r)=>{r.d(t,{K:()=>i});var n=r(81152),i=function(){function e(e,t,r,i){void 0===r&&(r=n.Y.BUFFER_CREATIONFLAG_READWRITE),this._engine=e,this._label=i,this._engine._storageBuffers.push(this),this._create(t,r)}return e.prototype._create=function(e,t){this._bufferSize=e,this._creationFlags=t,this._buffer=this._engine.createStorageBuffer(e,t,this._label)},e.prototype._rebuild=function(){this._create(this._bufferSize,this._creationFlags)},e.prototype.getBuffer=function(){return this._buffer},e.prototype.update=function(e,t,r){this._buffer&&this._engine.updateStorageBuffer(this._buffer,e,t,r)},e.prototype.read=function(e,t,r,n){return this._engine.readFromStorageBuffer(this._buffer,e,t,r,n)},e.prototype.dispose=function(){var e=this._engine._storageBuffers,t=e.indexOf(this);-1!==t&&(e[t]=e[e.length-1],e.pop()),this._engine._releaseBuffer(this._buffer),this._buffer=null},e}()},1746:(e,t,r)=>{r.r(t),r.d(t,{tonemapPixelShader:()=>a});var n=r(98519),i="tonemapPixelShader",o="varying vec2 vUV;uniform sampler2D textureSampler;uniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;const float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{return dot(c,vec3(0.22,0.707,0.071));}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) \n{vec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb); \nfloat lumTm=lum*_ExposureAdjustment;float scale=lumTm/(1.0+lumTm); \ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;const float ExposureBias=2.0;vec3 x=ExposureBias*colour;vec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;x=vec3(W,W,W);vec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);colour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;vec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);vec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);colour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour= vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);}";n.l.ShadersStore[i]||(n.l.ShadersStore[i]=o);var a={name:i,shader:o}},2362:(e,t,r)=>{r.d(t,{II:()=>h,Lm:()=>p,PD:()=>s,XG:()=>c,gs:()=>d,jm:()=>u,oi:()=>f,w:()=>l});var n=r(81152),i=r(7164);function o(e,t,r,i){switch(t){case n.Y.BYTE:var o=e.getInt8(r);return i&&(o=Math.max(o/127,-1)),o;case n.Y.UNSIGNED_BYTE:return o=e.getUint8(r),i&&(o/=255),o;case n.Y.SHORT:return o=e.getInt16(r,!0),i&&(o=Math.max(o/32767,-1)),o;case n.Y.UNSIGNED_SHORT:return o=e.getUint16(r,!0),i&&(o/=65535),o;case n.Y.INT:return e.getInt32(r,!0);case n.Y.UNSIGNED_INT:return e.getUint32(r,!0);case n.Y.FLOAT:return e.getFloat32(r,!0);default:throw new Error("Invalid component type ".concat(t))}}function a(e,t,r,i,o){switch(t){case n.Y.BYTE:i&&(o=Math.round(127*o)),e.setInt8(r,o);break;case n.Y.UNSIGNED_BYTE:i&&(o=Math.round(255*o)),e.setUint8(r,o);break;case n.Y.SHORT:i&&(o=Math.round(32767*o)),e.setInt16(r,o,!0);break;case n.Y.UNSIGNED_SHORT:i&&(o=Math.round(65535*o)),e.setUint16(r,o,!0);break;case n.Y.INT:e.setInt32(r,o,!0);break;case n.Y.UNSIGNED_INT:e.setUint32(r,o,!0);break;case n.Y.FLOAT:e.setFloat32(r,o,!0);break;default:throw new Error("Invalid component type ".concat(t))}}function s(e){switch(e){case n.Y.BYTE:case n.Y.UNSIGNED_BYTE:return 1;case n.Y.SHORT:case n.Y.UNSIGNED_SHORT:return 2;case n.Y.INT:case n.Y.UNSIGNED_INT:case n.Y.FLOAT:return 4;default:throw new Error("Invalid type '".concat(e,"'"))}}function l(e){switch(e){case n.Y.BYTE:return Int8Array;case n.Y.UNSIGNED_BYTE:return Uint8Array;case n.Y.SHORT:return Int16Array;case n.Y.UNSIGNED_SHORT:return Uint16Array;case n.Y.INT:return Int32Array;case n.Y.UNSIGNED_INT:return Uint32Array;case n.Y.FLOAT:return Float32Array;default:throw new Error("Invalid component type '".concat(e,"'"))}}function c(e,t,r,n,i,l,c,u){var h=new Array(n),d=new Array(n);if(e instanceof Array)for(var p=t/4,f=r/4,_=0;_<l;_+=n){for(var m=0;m<n;m++)h[m]=d[m]=e[p+m];for(u(d,_),m=0;m<n;m++)h[m]!==d[m]&&(e[p+m]=d[m]);p+=f}else{var g=ArrayBuffer.isView(e)?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(e),v=s(i);for(_=0;_<l;_+=n){m=0;for(var y=t;m<n;m++,y+=v)h[m]=d[m]=o(g,i,y,c);for(u(d,_),m=0,y=t;m<n;m++,y+=v)h[m]!==d[m]&&a(g,i,y,c,d[m]);t+=r}}}function u(e,t,r,o,a,l,u,h){var d=t*s(r),p=u*t;if(r!==n.Y.FLOAT||a!==d){var f=new Float32Array(p);return c(e,o,a,t,r,p,l,(function(e,r){for(var n=0;n<t;n++)f[r+n]=e[n]})),f}if(!(e instanceof Array||e instanceof Float32Array)||0!==o||e.length!==p){if(e instanceof Array){var _=o/4;return e.slice(_,_+p)}return e instanceof ArrayBuffer?new Float32Array(e,o,p):(3&(_=e.byteOffset+o)&&(i.V.Warn("Float array must be aligned to 4-bytes border"),h=!0),h?new Float32Array(e.buffer.slice(_,_+p*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(e.buffer,_,p))}return h?e.slice():e}function h(e,t,r,n,o,a,u,h){var d,p=s(r),f=l(r),_=u*t;if(Array.isArray(e)){if(3&n||3&o)throw new Error("byteOffset and byteStride must be a multiple of 4 for number[] data.");var m=n/4,g=o/4;if(m+(u-1)*g+t>e.length)throw new Error("Last accessed index is out of bounds.");if(g<t)throw new Error("Data stride cannot be smaller than the component size.");if(g!==t){var v=new f(_);return c(e,n,o,t,r,_,a,(function(e,r){for(var n=0;n<t;n++)v[r+n]=e[n]})),v}return new f(e.slice(m,m+_))}var y=n;if(e instanceof ArrayBuffer?d=e:(d=e.buffer,y+=e.byteOffset),y+(u-1)*o+t*p>d.byteLength)throw new Error("Last accessed byte is out of bounds.");var b=t*p;if(o<b)throw new Error("Byte stride cannot be smaller than the component's byte size.");if(o!==b){var S=new f(_);return c(d,y,o,t,r,_,a,(function(e,r){for(var n=0;n<t;n++)S[r+n]=e[n]})),S}return 1!==p&&y&p-1&&(i.V.Warn("Array must be aligned to border of element size. Data will be copied."),h=!0),h?new f(d.slice(y,y+_*p)):new f(d,y,_)}function d(e,t,r,o,a,l,u,h){var d=t*s(r),p=u*t;if(h.length!==p)throw new Error("Output length is not valid");if(r===n.Y.FLOAT&&a===d)if(e instanceof Array){var f=o/4;h.set(e,f)}else if(e instanceof ArrayBuffer){var _=new Float32Array(e,o,p);h.set(_)}else{if(3&(f=e.byteOffset+o))return i.V.Warn("Float array must be aligned to 4-bytes border"),void h.set(new Float32Array(e.buffer.slice(f,f+p*Float32Array.BYTES_PER_ELEMENT)));_=new Float32Array(e.buffer,f,p),h.set(_)}else c(e,o,a,t,r,p,l,(function(e,r){for(var n=0;n<t;n++)h[r+n]=e[n]}))}function p(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),Array.isArray(e)){for(var i=0;i<t;i++)if(e[r+i]-n>65535)return!0;return!1}return 4===e.BYTES_PER_ELEMENT}function f(e,t){var r=t*e.BYTES_PER_ELEMENT;return 3&r?(r=r+3&-4,new e(new ArrayBuffer(r),0,t)):new e(t)}},2613:(e,t,r)=>{r.r(t),r.d(t,{FlowGraphConstantBlock:()=>l});var n=r(78322),i=r(45749),o=r(88099),a=r(34623),s=r(38810),l=function(e){function t(t){var r=e.call(this,t)||this;return r.config=t,r.output=r.registerDataOutput("output",(0,o.k4)(t.value)),r}return(0,n.C6)(t,e),t.prototype._updateOutputs=function(e){this.output.setValue(this.config.value,e)},t.prototype.getClassName=function(){return"FlowGraphConstantBlock"},t.prototype.serialize=function(t,r){void 0===t&&(t={}),void 0===r&&(r=s.X5),e.prototype.serialize.call(this,t),r("value",this.config.value,t.config)},t}(i.e);(0,a.Y5)("FlowGraphConstantBlock",l)},2652:(e,t,r)=>{r.r(t),r.d(t,{layerPixelShaderWGSL:()=>a});var n=r(98519),i=(r(17393),"layerPixelShader"),o="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#if defined(CONVERT_TO_GAMMA)\nbaseColor=toGammaSpace(baseColor);\n#elif defined(CONVERT_TO_LINEAR)\nbaseColor=toLinearSpaceVec4(baseColor);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\nfragmentOutputs.color=baseColor*uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}";n.l.ShadersStoreWGSL[i]||(n.l.ShadersStoreWGSL[i]=o);var a={name:i,shader:o}},2804:(e,t,r)=>{var n=r(98519),i="subSurfaceScatteringFunctions";n.l.IncludesShadersStoreWGSL[i]||(n.l.IncludesShadersStoreWGSL[i]="fn testLightingForSSS(diffusionProfile: f32)->bool\n{return diffusionProfile<1.;}")},2835:(e,t,r)=>{r.r(t),r.d(t,{fluidRenderingParticleThicknessPixelShaderWGSL:()=>a});var n=r(98519),i="fluidRenderingParticleThicknessPixelShader",o="uniform particleAlpha: f32;varying uv: vec2f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var normalxy: vec2f=input.uv*2.0-1.0;var r2: f32=dot(normalxy,normalxy);if (r2>1.0) {discard;}\nvar thickness: f32=sqrt(1.0-r2);fragmentOutputs.color=vec4f(vec3f(uniforms.particleAlpha*thickness),1.0);}\n";n.l.ShadersStoreWGSL[i]||(n.l.ShadersStoreWGSL[i]=o);var a={name:i,shader:o}},3072:(e,t,r)=>{r.r(t),r.d(t,{postprocessVertexShaderWGSL:()=>a});var n=r(98519),i="postprocessVertexShader",o="attribute position: vec2<f32>;uniform scale: vec2<f32>;varying vUV: vec2<f32>;const madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs.position=vec4(vertexInputs.position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.l.ShadersStoreWGSL[i]||(n.l.ShadersStoreWGSL[i]=o);var a={name:i,shader:o}},3173:(e,t,r)=>{r.r(t),r.d(t,{FlowGraphMultiGateBlock:()=>l});var n=r(78322),i=r(34623),o=r(88677),a=r(88099),s=r(40099),l=function(e){function t(t){var r=e.call(this,t)||this;return r.config=t,r.outputSignals=[],r.reset=r._registerSignalInput("reset"),r.lastIndex=r.registerDataOutput("lastIndex",a.x2,new s.P(-1)),r.setNumberOfOutputSignals(null==t?void 0:t.outputSignalCount),r}return(0,n.C6)(t,e),t.prototype._getNextIndex=function(e){if(e.includes(!1)||this.config.isLoop&&e.fill(!1),this.config.isRandom){var t=e.map((function(e,t){return e?-1:t})).filter((function(e){return-1!==e}));return t.length?t[Math.floor(Math.random()*t.length)]:-1}return e.indexOf(!1)},t.prototype.setNumberOfOutputSignals=function(e){for(void 0===e&&(e=1);this.outputSignals.length>e;){var t=this.outputSignals.pop();t&&(t.disconnectFromAll(),this._unregisterSignalOutput(t.name))}for(;this.outputSignals.length<e;)this.outputSignals.push(this._registerSignalOutput("out_".concat(this.outputSignals.length)))},t.prototype._execute=function(e,t){if(e._hasExecutionVariable(this,"indexesUsed")||e._setExecutionVariable(this,"indexesUsed",this.outputSignals.map((function(){return!1}))),t===this.reset)return e._deleteExecutionVariable(this,"indexesUsed"),void this.lastIndex.setValue(new s.P(-1),e);var r=e._getExecutionVariable(this,"indexesUsed",[]),n=this._getNextIndex(r);n>-1&&(this.lastIndex.setValue(new s.P(n),e),r[n]=!0,e._setExecutionVariable(this,"indexesUsed",r),this.outputSignals[n]._activateSignal(e))},t.prototype.getClassName=function(){return"FlowGraphMultiGateBlock"},t.prototype.serialize=function(t){e.prototype.serialize.call(this,t),t.config.outputSignalCount=this.config.outputSignalCount,t.config.isRandom=this.config.isRandom,t.config.loop=this.config.isLoop,t.config.startIndex=this.config.startIndex},t}(o.u);(0,i.Y5)("FlowGraphMultiGateBlock",l)},3429:(e,t,r)=>{r.d(t,{$l:()=>a,GX:()=>o,vl:()=>i});var n=r(81152);function i(e){return e===n.Y.TEXTUREFORMAT_DEPTH24_STENCIL8||e===n.Y.TEXTUREFORMAT_DEPTH32_FLOAT||e===n.Y.TEXTUREFORMAT_DEPTH16||e===n.Y.TEXTUREFORMAT_DEPTH24||e===n.Y.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8||e===n.Y.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8||e===n.Y.TEXTUREFORMAT_STENCIL8}function o(e){switch(e){case n.Y.TEXTUREFORMAT_DEPTH24_STENCIL8:case n.Y.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8:case n.Y.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:case n.Y.TEXTUREFORMAT_DEPTH32_FLOAT:case n.Y.TEXTUREFORMAT_DEPTH24:return n.Y.TEXTURETYPE_FLOAT;case n.Y.TEXTUREFORMAT_DEPTH16:return n.Y.TEXTURETYPE_UNSIGNED_SHORT;case n.Y.TEXTUREFORMAT_STENCIL8:return n.Y.TEXTURETYPE_UNSIGNED_BYTE}return n.Y.TEXTURETYPE_UNSIGNED_BYTE}function a(e){return e===n.Y.TEXTUREFORMAT_DEPTH24_STENCIL8||e===n.Y.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8||e===n.Y.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8||e===n.Y.TEXTUREFORMAT_STENCIL8}},3638:(e,t,r)=>{r.r(t),r.d(t,{FlowGraphPointerOverEventBlock:()=>l});var n=r(78322),i=r(90279),o=r(88099),a=r(34623),s=r(95803),l=function(e){function t(t){var r=e.call(this,t)||this;return r.type="PointerOver",r.pointerId=r.registerDataOutput("pointerId",o.Es),r.targetMesh=r.registerDataInput("targetMesh",o.Vv,null==t?void 0:t.targetMesh),r.meshUnderPointer=r.registerDataOutput("meshUnderPointer",o.Vv),r}return(0,n.C6)(t,e),t.prototype._executeEvent=function(e,t){var r,n=this.targetMesh.getValue(e);this.meshUnderPointer.setValue(t.mesh,e);var i=t.out&&(0,s.rC)(t.out,n);return this.pointerId.setValue(t.pointerId,e),!(!i&&(t.mesh===n||(0,s.rC)(t.mesh,n))&&(this._execute(e),null===(r=this.config)||void 0===r?void 0:r.stopPropagation))},t.prototype._preparePendingTasks=function(e){},t.prototype._cancelPendingTasks=function(e){},t.prototype.getClassName=function(){return"FlowGraphPointerOverEventBlock"},t}(i.i);(0,a.Y5)("FlowGraphPointerOverEventBlock",l)},3641:(e,t,r)=>{r.r(t),r.d(t,{bonesVertexWGSL:()=>a});var n=r(98519),i="bonesVertex",o="#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\n#endif \n#else \ninfluence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif \n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n";n.l.IncludesShadersStoreWGSL[i]||(n.l.IncludesShadersStoreWGSL[i]=o);var a={name:i,shader:o}},3911:(e,t,r)=>{r.d(t,{K:()=>i});var n=r(81152),i=function(){function e(){this.reset()}return e.prototype.reset=function(){this.enabled=!1,this.mask=255,this.func=e.ALWAYS,this.funcRef=1,this.funcMask=255,this.opStencilFail=e.KEEP,this.opDepthFail=e.KEEP,this.opStencilDepthPass=e.REPLACE},Object.defineProperty(e.prototype,"stencilFunc",{get:function(){return this.func},set:function(e){this.func=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFuncRef",{get:function(){return this.funcRef},set:function(e){this.funcRef=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilFuncMask",{get:function(){return this.funcMask},set:function(e){this.funcMask=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpStencilFail",{get:function(){return this.opStencilFail},set:function(e){this.opStencilFail=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpDepthFail",{get:function(){return this.opDepthFail},set:function(e){this.opDepthFail=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilOpStencilDepthPass",{get:function(){return this.opStencilDepthPass},set:function(e){this.opStencilDepthPass=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilMask",{get:function(){return this.mask},set:function(e){this.mask=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilTest",{get:function(){return this.enabled},set:function(e){this.enabled=e},enumerable:!1,configurable:!0}),e.ALWAYS=n.Y.ALWAYS,e.KEEP=n.Y.KEEP,e.REPLACE=n.Y.REPLACE,e}()},4064:(e,t,r)=>{r.d(t,{P:()=>l});var n=r(78322),i=r(66377),o=r(7931),a=r(81152),s=r(11296),l=function(){function e(e,t,r){var a=this;this._unObserveRenderList=null,this._renderListHasChanged=function(e,t){var r=a._renderList?a._renderList.length:0;(0===t&&r>0||0===r)&&a._scene.meshes.forEach((function(e){e._markSubMeshesAsLightDirty()}))},this.particleSystemList=null,this.getCustomRenderList=null,this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this._renderInLinearSpace=!1,this.onBeforeRenderObservable=new i.cP,this.onAfterRenderObservable=new i.cP,this.onBeforeRenderingManagerRenderObservable=new i.cP,this.onAfterRenderingManagerRenderObservable=new i.cP,this.onFastPathRenderObservable=new i.cP,this._currentRefreshId=-1,this._refreshRate=1,this._currentApplyByPostProcessSetting=!1,this._currentSceneCamera=null,this.name=e,this._scene=t,this.renderList=[],this._renderPassIds=[],this.options=(0,n.Cl)({numPasses:1,doNotChangeAspectRatio:!0},r),this._createRenderPassId(),this.renderPassId=this._renderPassIds[0],this._renderingManager=new o.m(t),this._renderingManager._useSceneAutoClearSetup=!0}return Object.defineProperty(e.prototype,"renderList",{get:function(){return this._renderList},set:function(e){this._renderList!==e&&(this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=(0,s.lL)(e,this._renderListHasChanged)),this._renderList=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderInLinearSpace",{get:function(){return this._renderInLinearSpace},set:function(e){e!==this._renderInLinearSpace&&(this._renderInLinearSpace=e,this._scene.markAllMaterialsAsDirty(a.Y.MATERIAL_ImageProcessingDirtyFlag))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){if(this._name!==e&&(this._name=e,this._scene))for(var t=this._scene.getEngine(),r=0;r<this._renderPassIds.length;++r){var n=this._renderPassIds[r];t._renderPassNames[n]="".concat(this._name,"#").concat(r)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderPassIds",{get:function(){return this._renderPassIds},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRefreshId",{get:function(){return this._currentRefreshId},enumerable:!1,configurable:!0}),e.prototype.setMaterialForRendering=function(e,t){var r;r=Array.isArray(e)?e:[e];for(var n=0;n<r.length;++n)for(var i=0;i<this.options.numPasses;++i)r[n].setMaterialForRenderPass(this._renderPassIds[i],void 0!==t?Array.isArray(t)?t[i]:t:void 0)},e.prototype._releaseRenderPassId=function(){for(var e=this._scene.getEngine(),t=0;t<this.options.numPasses;++t)e.releaseRenderPassId(this._renderPassIds[t]);this._renderPassIds.length=0},e.prototype._createRenderPassId=function(){this._releaseRenderPassId();for(var e=this._scene.getEngine(),t=0;t<this.options.numPasses;++t)this._renderPassIds[t]=e.createRenderPassId("".concat(this.name,"#").concat(t))},e.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!1,configurable:!0}),e.prototype.shouldRender=function(){return-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)},e.prototype.isReadyForRendering=function(e,t){this.prepareRenderList(),this.initRender(e,t);var r=this._checkReadiness();return this.finishRender(),r},e.prototype.prepareRenderList=function(){var e=this._scene;if(this._waitingRenderList){if(!this.renderListPredicate){this.renderList=[];for(var t=0;t<this._waitingRenderList.length;t++){var r=this._waitingRenderList[t];(i=e.getMeshById(r))&&this.renderList.push(i)}}this._waitingRenderList=void 0}if(this.renderListPredicate){this.renderList?this.renderList.length=0:this.renderList=[];var n=this._scene.meshes;for(t=0;t<n.length;t++){var i=n[t];this.renderListPredicate(i)&&this.renderList.push(i)}}this._currentApplyByPostProcessSetting=this._scene.imageProcessingConfiguration.applyByPostProcess,this._scene.imageProcessingConfiguration._applyByPostProcess=!!this._renderInLinearSpace},e.prototype.initRender=function(e,t){var r,n=this._scene.getEngine(),i=null!==(r=this.activeCamera)&&void 0!==r?r:this._scene.activeCamera;this._currentSceneCamera=this._scene.activeCamera,i&&(i!==this._scene.activeCamera&&(this._scene.setTransformMatrix(i.getViewMatrix(),i.getProjectionMatrix(!0)),this._scene.activeCamera=i),n.setViewport(i.rigParent?i.rigParent.viewport:i.viewport,e,t)),this._defaultRenderListPrepared=!1},e.prototype.finishRender=function(){var e=this._scene;e.imageProcessingConfiguration._applyByPostProcess=this._currentApplyByPostProcessSetting,e.activeCamera=this._currentSceneCamera,this._currentSceneCamera&&(this.activeCamera&&this.activeCamera!==e.activeCamera&&e.setTransformMatrix(this._currentSceneCamera.getViewMatrix(),this._currentSceneCamera.getProjectionMatrix(!0)),e.getEngine().setViewport(this._currentSceneCamera.viewport)),e.resetCachedMaterial()},e.prototype.render=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var r=this._scene,n=r.getEngine(),i=n.currentRenderPassId;if(n.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e),n.snapshotRendering&&n.snapshotRenderingMode===a.Y.SNAPSHOTRENDERING_FAST)this.onFastPathRenderObservable.notifyObservers(e);else{var o=null,s=this.renderList?this.renderList:r.getActiveMeshes().data,l=this.renderList?this.renderList.length:r.getActiveMeshes().length;this.getCustomRenderList&&(o=this.getCustomRenderList(e,s,l)),o?this._prepareRenderingManager(o,o.length,this.forceLayerMaskCheck):(this._defaultRenderListPrepared||(this._prepareRenderingManager(s,l,!this.renderList||this.forceLayerMaskCheck),this._defaultRenderListPrepared=!0),o=s),this.onBeforeRenderingManagerRenderObservable.notifyObservers(e),this._renderingManager.render(this.customRenderFunction,o,this.renderParticles,this.renderSprites),this.onAfterRenderingManagerRenderObservable.notifyObservers(e)}t||this.onAfterRenderObservable.notifyObservers(e),n.currentRenderPassId=i},e.prototype._checkReadiness=function(){var e=this._scene,t=e.getEngine(),r=t.currentRenderPassId,n=!0;e.getViewMatrix()||e.updateTransformMatrix();for(var i=this.options.numPasses,o=0;o<i&&n;o++){var a=null,s=this.renderList?this.renderList:e.getActiveMeshes().data,l=this.renderList?this.renderList.length:e.getActiveMeshes().length;t.currentRenderPassId=this._renderPassIds[o],this.onBeforeRenderObservable.notifyObservers(o),this.getCustomRenderList&&(a=this.getCustomRenderList(o,s,l)),a||(a=s),this.options.doNotChangeAspectRatio||e.updateTransformMatrix(!0);for(var c=0;c<a.length&&n;++c){var u=a[c];if(u.isEnabled()&&!u.isBlocked&&u.isVisible&&u.subMeshes)if(this.customIsReadyFunction){if(!this.customIsReadyFunction(u,this.refreshRate,!0)){n=!1;continue}}else if(!u.isReady(!0)){n=!1;continue}}this.onAfterRenderObservable.notifyObservers(o),i>1&&(e.incrementRenderId(),e.resetCachedMaterial())}for(var h=0,d=this.particleSystemList||e.particleSystems;h<d.length;h++)d[h].isReady()||(n=!1);return t.currentRenderPassId=r,n},e.prototype._prepareRenderingManager=function(e,t,r){var n,i=this._scene,o=i.activeCamera,a=null!==(n=this.cameraForLOD)&&void 0!==n?n:o;this._renderingManager.reset();for(var s=i.getRenderId(),l=i.getFrameId(),c=0;c<t;c++){var u=e[c];if(u&&!u.isBlocked){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(u,this.refreshRate,!1)){this.resetRefreshCounter();continue}}else if(!u.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}var h=null;if(a){var d=u._internalAbstractMeshDataInfo._currentLOD.get(a);d&&d[1]===l?h=d[0]:(h=i.customLODSelector?i.customLODSelector(u,a):u.getLOD(a),d?(d[0]=h,d[1]=l):u._internalAbstractMeshDataInfo._currentLOD.set(a,[h,l]))}else h=u;if(!h)continue;h!==u&&0!==h.billboardMode&&h.computeWorldMatrix(),h._preActivateForIntermediateRendering(s);var p;if(p=!(!r||!o||u.layerMask&o.layerMask),u.isEnabled()&&u.isVisible&&u.subMeshes&&!p){if(h!==u&&h._activate(s,!0),u._activate(s,!0)&&u.subMeshes.length){u.isAnInstance?u._internalAbstractMeshDataInfo._actAsRegularMesh&&(h=u):h._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,h._internalAbstractMeshDataInfo._isActiveIntermediate=!0,i._prepareSkeleton(h);for(var f=0;f<h.subMeshes.length;f++){var _=h.subMeshes[f];this._renderingManager.dispatch(_,h)}}u._postActivate()}}}for(var m=this.particleSystemList||i.particleSystems,g=0;g<m.length;g++){var v=m[g],y=v.emitter;v.isStarted()&&y&&(!y.position||y.isEnabled())&&this._renderingManager.dispatchParticles(v)}},e.prototype.setRenderingOrder=function(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._renderingManager.setRenderingOrder(e,t,r,n)},e.prototype.setRenderingAutoClearDepthStencil=function(e,t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0),this._renderingManager.setRenderingAutoClearDepthStencil(e,t,r,n),this._renderingManager._useSceneAutoClearSetup=!1},e.prototype.clone=function(){var t=new e(this.name,this._scene,this.options);return this.renderList&&(t.renderList=this.renderList.slice(0)),t},e.prototype.dispose=function(){for(var e=this.renderList?this.renderList:this._scene.getActiveMeshes().data,t=this.renderList?this.renderList.length:this._scene.getActiveMeshes().length,r=0;r<t;r++){var n=e[r];void 0!==n.getMaterialForRenderPass(this.renderPassId)&&n.setMaterialForRenderPass(this.renderPassId,void 0)}this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderingManagerRenderObservable.clear(),this.onAfterRenderingManagerRenderObservable.clear(),this.onFastPathRenderObservable.clear(),this._releaseRenderPassId(),this.renderList=null},e.prototype._rebuild=function(){this.refreshRate===e.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=e.REFRESHRATE_RENDER_ONCE)},e.prototype.freeRenderingGroups=function(){this._renderingManager&&this._renderingManager.freeRenderingGroups()},e.REFRESHRATE_RENDER_ONCE=0,e.REFRESHRATE_RENDER_ONEVERYFRAME=1,e.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2,e}()},4141:(e,t,r)=>{r.r(t),r.d(t,{hdrIrradianceFilteringPixelShaderWGSL:()=>a});var n=r(98519),i=(r(17393),r(28469),r(61669),r(31321),"hdrIrradianceFilteringPixelShader"),o="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nvar inputTextureSampler: sampler;var inputTexture: texture_cube<f32>;\n#ifdef IBL_CDF_FILTERING\nvar icdfTextureSampler: sampler;var icdfTexture: texture_2d<f32>;\n#endif\nuniform vFilteringInfo: vec2f;uniform hdrScale: f32;varying direction: vec3f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var color: vec3f=irradiance(inputTexture,inputTextureSampler,input.direction,uniforms.vFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,icdfTexture,icdfTextureSampler\n#endif\n);fragmentOutputs.color= vec4f(color*uniforms.hdrScale,1.0);}";n.l.ShadersStoreWGSL[i]||(n.l.ShadersStoreWGSL[i]=o);var a={name:i,shader:o}},4661:(e,t,r)=>{r.r(t),r.d(t,{imageProcessingFunctionsWGSL:()=>a});var n=r(98519),i="imageProcessingFunctions",o="#if TONEMAPPING==3\nconst PBRNeutralStartCompression: f32=0.8-0.04;const PBRNeutralDesaturation: f32=0.15;fn PBRNeutralToneMapping( color: vec3f )->vec3f {var x: f32=min(color.r,min(color.g,color.b));var offset: f32=select(0.04,x-6.25*x*x,x<0.08);var result=color;result-=offset;var peak: f32=max(result.r,max(result.g,result.b));if (peak<PBRNeutralStartCompression) {return result;}\nvar d: f32=1.-PBRNeutralStartCompression;var newPeak: f32=1.-d*d/(peak+d-PBRNeutralStartCompression);result*=newPeak/peak;var g: f32=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(result,newPeak* vec3f(1,1,1),g);}\n#endif\n#if TONEMAPPING==2\nconst ACESInputMat: mat3x3f= mat3x3f(\nvec3f(0.59719,0.07600,0.02840),\nvec3f(0.35458,0.90834,0.13383),\nvec3f(0.04823,0.01566,0.83777)\n);const ACESOutputMat: mat3x3f= mat3x3f(\nvec3f( 1.60475,-0.10208,-0.00327),\nvec3f(-0.53108, 1.10813,-0.07276),\nvec3f(-0.07367,-0.00605, 1.07602)\n);fn RRTAndODTFit(v: vec3f)->vec3f\n{var a: vec3f=v*(v+0.0245786)-0.000090537;var b: vec3f=v*(0.983729*v+0.4329510)+0.238081;return a/b;}\nfn ACESFitted(color: vec3f)->vec3f\n{var output=ACESInputMat*color;output=RRTAndODTFit(output);output=ACESOutputMat*output;output=saturateVec3(output);return output;}\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS\nfn applyImageProcessing(result: vec4f)->vec4f {\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART\nvar rgb=result.rgb;;\n#ifdef EXPOSURE\nrgb*=uniforms.exposureLinear;\n#endif\n#ifdef VIGNETTE\nvar viewportXY: vec2f=fragmentInputs.position.xy*uniforms.vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;var vignetteXY1: vec3f= vec3f(viewportXY*uniforms.vignetteSettings1.xy+uniforms.vignetteSettings1.zw,1.0);var vignetteTerm: f32=dot(vignetteXY1,vignetteXY1);var vignette: f32=pow(vignetteTerm,uniforms.vignetteSettings2.w);var vignetteColor: vec3f=uniforms.vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvar vignetteColorMultiplier: vec3f=mix(vignetteColor, vec3f(1,1,1),vignette);rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nrgb=mix(vignetteColor,rgb,vignette);\n#endif\n#endif\n#if TONEMAPPING==3\nrgb=PBRNeutralToneMapping(rgb);\n#elif TONEMAPPING==2\nrgb=ACESFitted(rgb);\n#elif TONEMAPPING==1\nconst tonemappingCalibration: f32=1.590579;rgb=1.0-exp2(-tonemappingCalibration*rgb);\n#endif\nrgb=toGammaSpaceVec3(rgb);rgb=saturateVec3(rgb);\n#ifdef CONTRAST\nvar resultHighContrast: vec3f=rgb*rgb*(3.0-2.0*rgb);if (uniforms.contrast<1.0) {rgb=mix( vec3f(0.5,0.5,0.5),rgb,uniforms.contrast);} else {rgb=mix(rgb,resultHighContrast,uniforms.contrast-1.0);}\n#endif\n#ifdef COLORGRADING\nvar colorTransformInput: vec3f=rgb*uniforms.colorTransformSettings.xxx+uniforms.colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvar colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput).rgb;\n#else\nvar colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput,uniforms.colorTransformSettings.yz).rgb;\n#endif\nrgb=mix(rgb,colorTransformOutput,uniforms.colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\nvar luma: f32=getLuminance(rgb);var curveMix: vec2f=clamp( vec2f(luma*3.0-1.5,luma*-3.0+1.5), vec2f(0.0), vec2f(1.0));var colorCurve: vec4f=uniforms.vCameraColorCurveNeutral+curveMix.x*uniforms.vCameraColorCurvePositive-curveMix.y*uniforms.vCameraColorCurveNegative;rgb*=colorCurve.rgb;rgb=mix( vec3f(luma),rgb,colorCurve.a);\n#endif\n#ifdef DITHER\nvar rand: f32=getRand(fragmentInputs.position.xy*uniforms.vInverseScreenSize);var dither: f32=mix(-uniforms.ditherIntensity,uniforms.ditherIntensity,rand);rgb=saturateVec3(rgb+ vec3f(dither));\n#endif\n#define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND\nreturn vec4f(rgb,result.a);}";n.l.IncludesShadersStoreWGSL[i]||(n.l.IncludesShadersStoreWGSL[i]=o);var a={name:i,shader:o}},5153:(e,t,r)=>{function n(){return"undefined"!=typeof window}function i(){return"undefined"!=typeof navigator}function o(){return"undefined"!=typeof document}function a(e){for(var t="",r=e.firstChild;r;)3===r.nodeType&&(t+=r.textContent),r=r.nextSibling;return t}r.d(t,{Az:()=>s,BA:()=>n,Nf:()=>o,XD:()=>i,Zl:()=>a});var s={IsWindowObjectExist:n,IsNavigatorAvailable:i,IsDocumentAvailable:o,GetDOMTextContent:a}},5196:(e,t,r)=>{r.r(t),r.d(t,{FlowGraphSetDelayBlock:()=>c});var n=r(78322),i=r(21379),o=r(88099),a=r(93051),s=r(7164),l=r(34623),c=function(e){function t(t){var r=e.call(this,t)||this;return r.cancel=r._registerSignalInput("cancel"),r.duration=r.registerDataInput("duration",o.Es),r.lastDelayIndex=r.registerDataOutput("lastDelayIndex",o.Es,-1),r}return(0,n.C6)(t,e),t.prototype._preparePendingTasks=function(e){var r=this,n=this.duration.getValue(e);if(n<0||isNaN(n)||!isFinite(n))return this._reportError(e,"Invalid duration in SetDelay block");if(e._getGlobalContextVariable("activeDelays",0)>=t.MaxParallelDelayCount)return this._reportError(e,"Max parallel delays reached");var i=e._getGlobalContextVariable("lastDelayIndex",-1),o=e._getExecutionVariable(this,"pendingDelays",[]),s=e.configuration.scene,l=new a.Qz({timeout:1e3*n,contextObservable:s.onBeforeRenderObservable,onEnded:function(){return r._onEnded(l,e)}});l.start();var c=i+1;this.lastDelayIndex.setValue(c,e),e._setGlobalContextVariable("lastDelayIndex",c),o[c]=l,e._setExecutionVariable(this,"pendingDelays",o)},t.prototype._cancelPendingTasks=function(e){for(var t=0,r=e._getExecutionVariable(this,"pendingDelays",[]);t<r.length;t++){var n=r[t];null==n||n.dispose()}e._deleteExecutionVariable(this,"pendingDelays"),this.lastDelayIndex.setValue(-1,e)},t.prototype._execute=function(e,t){t!==this.cancel?(this._preparePendingTasks(e),this.out._activateSignal(e)):this._cancelPendingTasks(e)},t.prototype.getClassName=function(){return"FlowGraphSetDelayBlock"},t.prototype._onEnded=function(e,t){var r=t._getExecutionVariable(this,"pendingDelays",[]),n=r.indexOf(e);-1!==n?r.splice(n,1):s.V.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list"),t._removePendingBlock(this),this.done._activateSignal(t)},t.MaxParallelDelayCount=100,t}(i.M);(0,l.Y5)("FlowGraphSetDelayBlock",c)},5439:(e,t,r)=>{r.r(t),r.d(t,{blackAndWhitePixelShader:()=>a});var n=