babylonjs-materials 9.17.1 → 9.18.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.
Files changed (45) hide show
  1. package/babylon.cellMaterial.js +1 -1
  2. package/babylon.cellMaterial.js.map +1 -1
  3. package/babylon.cellMaterial.min.js +1 -1
  4. package/babylon.cellMaterial.min.js.map +1 -1
  5. package/babylon.fireMaterial.js +1 -1
  6. package/babylon.fireMaterial.js.map +1 -1
  7. package/babylon.fireMaterial.min.js +1 -1
  8. package/babylon.fireMaterial.min.js.map +1 -1
  9. package/babylon.furMaterial.js +1 -1
  10. package/babylon.furMaterial.js.map +1 -1
  11. package/babylon.furMaterial.min.js +1 -1
  12. package/babylon.furMaterial.min.js.map +1 -1
  13. package/babylon.gradientMaterial.js +1 -1
  14. package/babylon.gradientMaterial.js.map +1 -1
  15. package/babylon.gradientMaterial.min.js +1 -1
  16. package/babylon.gradientMaterial.min.js.map +1 -1
  17. package/babylon.lavaMaterial.js +1 -1
  18. package/babylon.lavaMaterial.js.map +1 -1
  19. package/babylon.lavaMaterial.min.js +1 -1
  20. package/babylon.lavaMaterial.min.js.map +1 -1
  21. package/babylon.mixMaterial.js +1 -1
  22. package/babylon.mixMaterial.js.map +1 -1
  23. package/babylon.mixMaterial.min.js +1 -1
  24. package/babylon.mixMaterial.min.js.map +1 -1
  25. package/babylon.normalMaterial.js +1 -1
  26. package/babylon.normalMaterial.js.map +1 -1
  27. package/babylon.normalMaterial.min.js +1 -1
  28. package/babylon.normalMaterial.min.js.map +1 -1
  29. package/babylon.simpleMaterial.js +1 -1
  30. package/babylon.simpleMaterial.js.map +1 -1
  31. package/babylon.simpleMaterial.min.js +1 -1
  32. package/babylon.simpleMaterial.min.js.map +1 -1
  33. package/babylon.terrainMaterial.js +1 -1
  34. package/babylon.terrainMaterial.js.map +1 -1
  35. package/babylon.terrainMaterial.min.js +1 -1
  36. package/babylon.terrainMaterial.min.js.map +1 -1
  37. package/babylon.triPlanarMaterial.js +1 -1
  38. package/babylon.triPlanarMaterial.js.map +1 -1
  39. package/babylon.triPlanarMaterial.min.js +1 -1
  40. package/babylon.triPlanarMaterial.min.js.map +1 -1
  41. package/babylonjs.materials.js +1 -1
  42. package/babylonjs.materials.js.map +1 -1
  43. package/babylonjs.materials.min.js +1 -1
  44. package/babylonjs.materials.min.js.map +1 -1
  45. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("babylonjs")):"function"==typeof define&&define.amd?define(["exports","babylonjs"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).BABYLON=e.BABYLON||{},e.BABYLON)}(this,function(e,n){"use strict";function t(e,n,t,i,r,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=i.kind,f="getter"===l?"get":"setter"===l?"set":"value",d=!n&&e?i.static?e:e.prototype:null,u=n||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),c=!1,m=t.length-1;m>=0;m--){var h={};for(var S in i)h[S]="access"===S?{}:i[S];for(var S in i.access)h.access[S]=i.access[S];h.addInitializer=function(e){if(c)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var v=(0,t[m])("accessor"===l?{get:u.get,set:u.set}:u[f],h);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=s(v.get))&&(u.get=o),(o=s(v.set))&&(u.set=o),(o=s(v.init))&&r.unshift(o)}else(o=s(v))&&("field"===l?r.unshift(o):u[f]=o)}d&&Object.defineProperty(d,i.name,u),c=!0}function i(e,n,t){for(var i=arguments.length>2,r=0;r<n.length;r++)t=i?n[r].call(e,t):n[r].call(e);return i?t:void 0}function r(e,n,t,i){if("a"===t&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!i:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?i:"a"===t?i.call(e):i?i.value:n.get(e)}function a(e,n,t,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,t):r?r.value=t:n.set(e,t),t}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;class s extends n.MaterialDefines{constructor(){super(),this.DIFFUSEX=!1,this.DIFFUSEY=!1,this.DIFFUSEZ=!1,this.BUMPX=!1,this.BUMPY=!1,this.BUMPZ=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.NORMAL=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.INSTANCES=!1,this.INSTANCESCOLOR=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.NONUNIFORMSCALING=!1,this.LOGARITHMICDEPTH=!1,this.AREALIGHTSUPPORTED=!0,this.AREALIGHTNOROUGHTNESS=!0,this.rebuild()}}let o=(()=>{var e,o,l,f,d,u,c,h,S;let v,g,x,T,L,_,C,N,F,b,D,I,y,A,O,U,M,w,z,V,R,W=n.PushMaterial,X=[],Y=[],Z=[],B=[],G=[],k=[],H=[],j=[],K=[],q=[],J=[],Q=[],$=[],ee=[],ne=[],te=[],ie=[],re=[],ae=[],se=[],oe=[],le=[],fe=[],de=[],ue=[],ce=[],me=[],he=[],Se=[],ve=[],pe=[],ge=[],xe=[],Te=[],Ee=[],Le=[],_e=[],Ce=[],Pe=[],Ne=[],Fe=[],be=[];return e=class extends W{get diffuseTextureX(){return r(this,o,"f")}set diffuseTextureX(e){a(this,o,e,"f")}get diffuseTextureY(){return r(this,l,"f")}set diffuseTextureY(e){a(this,l,e,"f")}get diffuseTextureZ(){return r(this,f,"f")}set diffuseTextureZ(e){a(this,f,e,"f")}get normalTextureX(){return r(this,d,"f")}set normalTextureX(e){a(this,d,e,"f")}get normalTextureY(){return r(this,u,"f")}set normalTextureY(e){a(this,u,e,"f")}get normalTextureZ(){return r(this,c,"f")}set normalTextureZ(e){a(this,c,e,"f")}get disableLighting(){return r(this,h,"f")}set disableLighting(e){a(this,h,e,"f")}get maxSimultaneousLights(){return r(this,S,"f")}set maxSimultaneousLights(e){a(this,S,e,"f")}constructor(e,t,r=!1){super(e,t,void 0,r),this.mixTexture=i(this,X,void 0),this._diffuseTextureX=(i(this,Y),i(this,Z,void 0)),o.set(this,(i(this,B),i(this,G,void 0))),this._diffuseTextureY=(i(this,k),i(this,H,void 0)),l.set(this,(i(this,j),i(this,K,void 0))),this._diffuseTextureZ=(i(this,q),i(this,J,void 0)),f.set(this,(i(this,Q),i(this,$,void 0))),this._normalTextureX=(i(this,ee),i(this,ne,void 0)),d.set(this,(i(this,te),i(this,ie,void 0))),this._normalTextureY=(i(this,re),i(this,ae,void 0)),u.set(this,(i(this,se),i(this,oe,void 0))),this._normalTextureZ=(i(this,le),i(this,fe,void 0)),c.set(this,(i(this,de),i(this,ue,void 0))),this.tileSize=(i(this,ce),i(this,me,1)),this.diffuseColor=(i(this,he),i(this,Se,new n.Color3(1,1,1))),this.specularColor=(i(this,ve),i(this,pe,new n.Color3(.2,.2,.2))),this.specularPower=(i(this,ge),i(this,xe,64)),this._disableLighting=(i(this,Te),i(this,Ee,!1)),h.set(this,(i(this,Le),i(this,_e,void 0))),this._maxSimultaneousLights=(i(this,Ce),i(this,Pe,4)),S.set(this,(i(this,Ne),i(this,Fe,void 0))),this._shadersLoaded=(i(this,be),!1)}needAlphaBlending(){return this.alpha<1}needAlphaTesting(){return!1}getAlphaTestTexture(){return null}isReadyForSubMesh(e,t,i){const r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new s);const a=t.materialDefines,o=this.getScene();if(this._isReadyForSubMesh(t))return!0;const l=o.getEngine();if(a._areTexturesDirty&&o.texturesEnabled){if(n.MaterialFlags.DiffuseTextureEnabled){const e=[this.diffuseTextureX,this.diffuseTextureY,this.diffuseTextureZ],n=["DIFFUSEX","DIFFUSEY","DIFFUSEZ"];for(let t=0;t<e.length;t++)if(e[t]){if(!e[t].isReady())return!1;a[n[t]]=!0}}if(n.MaterialFlags.BumpTextureEnabled){const e=[this.normalTextureX,this.normalTextureY,this.normalTextureZ],n=["BUMPX","BUMPY","BUMPZ"];for(let t=0;t<e.length;t++)if(e[t]){if(!e[t].isReady())return!1;a[n[t]]=!0}}}if(n.PrepareDefinesForMisc(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),a,void 0,void 0,void 0,this._isVertexOutputInvariant),a._needNormals=n.PrepareDefinesForLights(o,e,a,!1,this._maxSimultaneousLights,this._disableLighting),n.PrepareDefinesForFrameBoundValues(o,l,this,a,!!i),n.PrepareDefinesForAttributes(e,a,!0,!0),a.isDirty){a.markAsProcessed(),o.resetCachedMaterial();const i=new n.EffectFallbacks;a.FOG&&i.addFallback(1,"FOG"),n.HandleFallbacksForShadows(a,i,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&i.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=o.imageProcessingConfiguration.applyByPostProcess;const r=[n.VertexBuffer.PositionKind];a.NORMAL&&r.push(n.VertexBuffer.NormalKind),a.VERTEXCOLOR&&r.push(n.VertexBuffer.ColorKind),n.PrepareAttributesForBones(r,e,a,i),n.PrepareAttributesForInstances(r,a);const s="triplanar",f=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","mBones","tileSize"],u=["diffuseSamplerX","diffuseSamplerY","diffuseSamplerZ","normalSamplerX","normalSamplerY","normalSamplerZ","logarithmicDepthConstant","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],c=[];n.AddClipPlaneUniforms(d),n.PrepareUniformsAndSamplersList({uniformsNames:d,uniformBuffersNames:c,samplers:u,defines:a,maxSimultaneousLights:this.maxSimultaneousLights,shaderLanguage:this._shaderLanguage}),t.setEffect(o.getEngine().createEffect(s,{attributes:r,uniformsNames:d,uniformBuffersNames:c,samplers:u,defines:f,fallbacks:i,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights},shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:()=>{return e=this,n=void 0,i=function*(){1===this.shaderLanguage?yield Promise.all([Promise.resolve().then(function(){return m}),Promise.resolve().then(function(){return p})]):yield Promise.all([Promise.resolve().then(function(){return E}),Promise.resolve().then(function(){return P})]),this._shadersLoaded=!0},new((t=void 0)||(t=Promise))(function(r,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(s,o)}l((i=i.apply(e,n||[])).next())});var e,n,t,i}},l),a,this._materialContext)}if(a.AREALIGHTUSED)for(let n=0;n<e.lightSources.length;n++)if(!e.lightSources[n]._isReady())return!1;return!(!t.effect||!t.effect.isReady()||(a._renderId=o.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))}bindForSubMesh(e,t,i){const r=this.getScene(),a=i.materialDefines;if(!a)return;const s=i.effect;s&&(this._activeEffect=s,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),n.BindBonesParameters(t,this._activeEffect),this._activeEffect.setFloat("tileSize",this.tileSize),this._mustRebind(r,s,i)&&(this.diffuseTextureX&&this._activeEffect.setTexture("diffuseSamplerX",this.diffuseTextureX),this.diffuseTextureY&&this._activeEffect.setTexture("diffuseSamplerY",this.diffuseTextureY),this.diffuseTextureZ&&this._activeEffect.setTexture("diffuseSamplerZ",this.diffuseTextureZ),this.normalTextureX&&this._activeEffect.setTexture("normalSamplerX",this.normalTextureX),this.normalTextureY&&this._activeEffect.setTexture("normalSamplerY",this.normalTextureY),this.normalTextureZ&&this._activeEffect.setTexture("normalSamplerZ",this.normalTextureZ),n.BindClipPlane(s,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&n.BindLogDepth(a,s,r),r.bindEyePosition(s)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),a.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&n.BindLights(r,t,this._activeEffect,a,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),n.BindFogParameters(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}getAnimatables(){const e=[];return this.mixTexture&&this.mixTexture.animations&&this.mixTexture.animations.length>0&&e.push(this.mixTexture),e}getActiveTextures(){const e=super.getActiveTextures();return this._diffuseTextureX&&e.push(this._diffuseTextureX),this._diffuseTextureY&&e.push(this._diffuseTextureY),this._diffuseTextureZ&&e.push(this._diffuseTextureZ),this._normalTextureX&&e.push(this._normalTextureX),this._normalTextureY&&e.push(this._normalTextureY),this._normalTextureZ&&e.push(this._normalTextureZ),e}hasTexture(e){return!!super.hasTexture(e)||this._diffuseTextureX===e||this._diffuseTextureY===e||this._diffuseTextureZ===e||this._normalTextureX===e||this._normalTextureY===e||this._normalTextureZ===e}dispose(e){this.mixTexture&&this.mixTexture.dispose(),super.dispose(e)}clone(t){return n.SerializationHelper.Clone(()=>new e(t,this.getScene()),this)}serialize(){const e=super.serialize();return e.customType="BABYLON.TriPlanarMaterial",e}getClassName(){return"TriPlanarMaterial"}static Parse(t,i,r){return n.SerializationHelper.Parse(()=>new e(t.name,i),t,i,r)}},o=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,S=new WeakMap,(()=>{var i;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(i=W[Symbol.metadata])&&void 0!==i?i:null):void 0;v=[n.serializeAsTexture()],g=[n.serializeAsTexture("diffuseTextureX")],x=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],T=[n.serializeAsTexture("diffuseTexturY")],L=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],_=[n.serializeAsTexture("diffuseTextureZ")],C=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],N=[n.serializeAsTexture("normalTextureX")],F=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],b=[n.serializeAsTexture("normalTextureY")],D=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],I=[n.serializeAsTexture("normalTextureZ")],y=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],A=[n.serialize()],O=[n.serializeAsColor3()],U=[n.serializeAsColor3()],M=[n.serialize()],w=[n.serialize("disableLighting")],z=[n.expandToProperty("_markAllSubMeshesAsLightsDirty")],V=[n.serialize("maxSimultaneousLights")],R=[n.expandToProperty("_markAllSubMeshesAsLightsDirty")],t(e,null,x,{kind:"accessor",name:"diffuseTextureX",static:!1,private:!1,access:{has:e=>"diffuseTextureX"in e,get:e=>e.diffuseTextureX,set:(e,n)=>{e.diffuseTextureX=n}},metadata:r},G,k),t(e,null,L,{kind:"accessor",name:"diffuseTextureY",static:!1,private:!1,access:{has:e=>"diffuseTextureY"in e,get:e=>e.diffuseTextureY,set:(e,n)=>{e.diffuseTextureY=n}},metadata:r},K,q),t(e,null,C,{kind:"accessor",name:"diffuseTextureZ",static:!1,private:!1,access:{has:e=>"diffuseTextureZ"in e,get:e=>e.diffuseTextureZ,set:(e,n)=>{e.diffuseTextureZ=n}},metadata:r},$,ee),t(e,null,F,{kind:"accessor",name:"normalTextureX",static:!1,private:!1,access:{has:e=>"normalTextureX"in e,get:e=>e.normalTextureX,set:(e,n)=>{e.normalTextureX=n}},metadata:r},ie,re),t(e,null,D,{kind:"accessor",name:"normalTextureY",static:!1,private:!1,access:{has:e=>"normalTextureY"in e,get:e=>e.normalTextureY,set:(e,n)=>{e.normalTextureY=n}},metadata:r},oe,le),t(e,null,y,{kind:"accessor",name:"normalTextureZ",static:!1,private:!1,access:{has:e=>"normalTextureZ"in e,get:e=>e.normalTextureZ,set:(e,n)=>{e.normalTextureZ=n}},metadata:r},ue,ce),t(e,null,z,{kind:"accessor",name:"disableLighting",static:!1,private:!1,access:{has:e=>"disableLighting"in e,get:e=>e.disableLighting,set:(e,n)=>{e.disableLighting=n}},metadata:r},_e,Ce),t(e,null,R,{kind:"accessor",name:"maxSimultaneousLights",static:!1,private:!1,access:{has:e=>"maxSimultaneousLights"in e,get:e=>e.maxSimultaneousLights,set:(e,n)=>{e.maxSimultaneousLights=n}},metadata:r},Fe,be),t(null,null,v,{kind:"field",name:"mixTexture",static:!1,private:!1,access:{has:e=>"mixTexture"in e,get:e=>e.mixTexture,set:(e,n)=>{e.mixTexture=n}},metadata:r},X,Y),t(null,null,g,{kind:"field",name:"_diffuseTextureX",static:!1,private:!1,access:{has:e=>"_diffuseTextureX"in e,get:e=>e._diffuseTextureX,set:(e,n)=>{e._diffuseTextureX=n}},metadata:r},Z,B),t(null,null,T,{kind:"field",name:"_diffuseTextureY",static:!1,private:!1,access:{has:e=>"_diffuseTextureY"in e,get:e=>e._diffuseTextureY,set:(e,n)=>{e._diffuseTextureY=n}},metadata:r},H,j),t(null,null,_,{kind:"field",name:"_diffuseTextureZ",static:!1,private:!1,access:{has:e=>"_diffuseTextureZ"in e,get:e=>e._diffuseTextureZ,set:(e,n)=>{e._diffuseTextureZ=n}},metadata:r},J,Q),t(null,null,N,{kind:"field",name:"_normalTextureX",static:!1,private:!1,access:{has:e=>"_normalTextureX"in e,get:e=>e._normalTextureX,set:(e,n)=>{e._normalTextureX=n}},metadata:r},ne,te),t(null,null,b,{kind:"field",name:"_normalTextureY",static:!1,private:!1,access:{has:e=>"_normalTextureY"in e,get:e=>e._normalTextureY,set:(e,n)=>{e._normalTextureY=n}},metadata:r},ae,se),t(null,null,I,{kind:"field",name:"_normalTextureZ",static:!1,private:!1,access:{has:e=>"_normalTextureZ"in e,get:e=>e._normalTextureZ,set:(e,n)=>{e._normalTextureZ=n}},metadata:r},fe,de),t(null,null,A,{kind:"field",name:"tileSize",static:!1,private:!1,access:{has:e=>"tileSize"in e,get:e=>e.tileSize,set:(e,n)=>{e.tileSize=n}},metadata:r},me,he),t(null,null,O,{kind:"field",name:"diffuseColor",static:!1,private:!1,access:{has:e=>"diffuseColor"in e,get:e=>e.diffuseColor,set:(e,n)=>{e.diffuseColor=n}},metadata:r},Se,ve),t(null,null,U,{kind:"field",name:"specularColor",static:!1,private:!1,access:{has:e=>"specularColor"in e,get:e=>e.specularColor,set:(e,n)=>{e.specularColor=n}},metadata:r},pe,ge),t(null,null,M,{kind:"field",name:"specularPower",static:!1,private:!1,access:{has:e=>"specularPower"in e,get:e=>e.specularPower,set:(e,n)=>{e.specularPower=n}},metadata:r},xe,Te),t(null,null,w,{kind:"field",name:"_disableLighting",static:!1,private:!1,access:{has:e=>"_disableLighting"in e,get:e=>e._disableLighting,set:(e,n)=>{e._disableLighting=n}},metadata:r},Ee,Le),t(null,null,V,{kind:"field",name:"_maxSimultaneousLights",static:!1,private:!1,access:{has:e=>"_maxSimultaneousLights"in e,get:e=>e._maxSimultaneousLights,set:(e,n)=>{e._maxSimultaneousLights=n}},metadata:r},Pe,Ne),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();n.RegisterClass("BABYLON.TriPlanarMaterial",o);var l={__proto__:null,TriPlanarMaterial:o};const f="undefined"!=typeof global?global:"undefined"!=typeof window?window:void 0;if(void 0!==f)for(const e in l)f.BABYLON[e]=l[e];const d="triplanarVertexShader",u="attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;\n#endif\nuniform tileSize: f32;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSEX\nvertexOutputs.vTextureUVX=worldPos.zy/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEY\nvertexOutputs.vTextureUVY=worldPos.xz/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEZ\nvertexOutputs.vTextureUVZ=worldPos.xy/uniforms.tileSize;\n#endif\n#ifdef NORMAL\nvar xtan: vec3f= vec3f(0,0,1);var xbin: vec3f= vec3f(0,1,0);var ytan: vec3f= vec3f(1,0,0);var ybin: vec3f= vec3f(0,0,1);var ztan: vec3f= vec3f(1,0,0);var zbin: vec3f= vec3f(0,1,0);var normalizedNormal: vec3f=normalize(vertexInputs.normal);normalizedNormal=normalizedNormal*normalizedNormal;var worldBinormal: vec3f=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);var worldTangent: vec3f=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);var worldNormal: vec3f=normalize((normalWorld*normalize(vertexInputs.normal)).xyz);vertexOutputs.tangentSpace0=worldTangent;vertexOutputs.tangentSpace1=worldBinormal;vertexOutputs.tangentSpace2=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.ShaderStore.ShadersStoreWGSL[d]||(n.ShaderStore.ShadersStoreWGSL[d]=u);const c=[n.helperFunctionsWGSL,n.bonesDeclarationWGSL,n.bakedVertexAnimationDeclarationWGSL,n.instancesDeclarationWGSL,n.clipPlaneVertexDeclarationWGSL,n.logDepthDeclarationWGSL,n.fogVertexDeclarationWGSL,n.lightVxFragmentDeclarationWGSL,n.lightVxUboDeclarationWGSL,n.instancesVertexWGSL,n.bonesVertexWGSL,n.bakedVertexAnimationWGSL,n.clipPlaneVertexWGSL,n.logDepthVertexWGSL,n.fogVertexWGSL,n.shadowsVertexWGSL,n.vertexColorMixingWGSL];for(const e of c)n.ShaderStore.IncludesShadersStoreWGSL[e.name]||(n.ShaderStore.IncludesShadersStoreWGSL[e.name]=e.shader);var m={__proto__:null,triplanarVertexShaderWGSL:{name:d,shader:u}};const h="triplanarPixelShader",S="uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;var diffuseSamplerXSampler: sampler;var diffuseSamplerX: texture_2d<f32>;\n#ifdef BUMPX\nvar normalSamplerXSampler: sampler;var normalSamplerX: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;var diffuseSamplerYSampler: sampler;var diffuseSamplerY: texture_2d<f32>;\n#ifdef BUMPY\nvar normalSamplerYSampler: sampler;var normalSamplerY: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;var diffuseSamplerZSampler: sampler;var diffuseSamplerZ: texture_2d<f32>;\n#ifdef BUMPZ\nvar normalSamplerZSampler: sampler;var normalSamplerZ: texture_2d<f32>;\n#endif\n#endif\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(0.,0.,0.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=fragmentInputs.tangentSpace2;\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar baseNormal: vec4f= vec4f(0.0,0.0,0.0,1.0);normalW=normalW*normalW;\n#ifdef DIFFUSEX\nbaseColor=baseColor+textureSample(diffuseSamplerX,diffuseSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal=baseNormal+textureSample(normalSamplerX,normalSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor=baseColor+textureSample(diffuseSamplerY,diffuseSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal=baseNormal+textureSample(normalSamplerY,normalSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor=baseColor+textureSample(diffuseSamplerZ,diffuseSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal=baseNormal+textureSample(normalSamplerZ,normalSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nvar tangentSpace: mat3x3f=mat3x3f(fragmentInputs.tangentSpace0,fragmentInputs.tangentSpace1,fragmentInputs.tangentSpace2);normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.ShaderStore.ShadersStoreWGSL[h]||(n.ShaderStore.ShadersStoreWGSL[h]=S);const v=[n.helperFunctionsWGSL,n.lightUboDeclarationWGSL,n.logDepthDeclarationWGSL,n.lightsFragmentFunctionsWGSL,n.shadowsFragmentFunctionsWGSL,n.clipPlaneFragmentDeclarationWGSL,n.fogFragmentDeclarationWGSL,n.clipPlaneFragmentWGSL,n.depthPrePassWGSL,n.lightFragmentWGSL,n.logDepthFragmentWGSL,n.fogFragmentWGSL,n.imageProcessingCompatibilityWGSL];for(const e of v)n.ShaderStore.IncludesShadersStoreWGSL[e.name]||(n.ShaderStore.IncludesShadersStoreWGSL[e.name]=e.shader);var p={__proto__:null,triplanarPixelShaderWGSL:{name:h,shader:S}};const g="triplanarVertexShader",x="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\nvec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.ShaderStore.ShadersStore[g]||(n.ShaderStore.ShadersStore[g]=x);const T=[n.helperFunctions,n.bonesDeclaration,n.bakedVertexAnimationDeclaration,n.instancesDeclaration,n.clipPlaneVertexDeclaration,n.logDepthDeclaration,n.fogVertexDeclaration,n.lightFragmentDeclaration,n.lightUboDeclaration,n.instancesVertex,n.bonesVertex,n.bakedVertexAnimation,n.clipPlaneVertex,n.logDepthVertex,n.fogVertex,n.shadowsVertex,n.vertexColorMixing];for(const e of T)n.ShaderStore.IncludesShadersStore[e.name]||(n.ShaderStore.IncludesShadersStore[e.name]=e.shader);var E={__proto__:null,triplanarVertexShader:{name:g,shader:x}};const L="triplanarPixelShader",_="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=tangentSpace[2];\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW;\n#ifdef DIFFUSEX\nbaseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nnormalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.ShaderStore.ShadersStore[L]||(n.ShaderStore.ShadersStore[L]=_);const C=[n.helperFunctions,n.lightFragmentDeclaration,n.lightUboDeclaration,n.logDepthDeclaration,n.lightsFragmentFunctions,n.shadowsFragmentFunctions,n.clipPlaneFragmentDeclaration,n.fogFragmentDeclaration,n.clipPlaneFragment,n.depthPrePass,n.lightFragment,n.logDepthFragment,n.fogFragment,n.imageProcessingCompatibility];for(const e of C)n.ShaderStore.IncludesShadersStore[e.name]||(n.ShaderStore.IncludesShadersStore[e.name]=e.shader);var P={__proto__:null,triplanarPixelShader:{name:L,shader:_}};e.TriPlanarMaterial=o});
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("babylonjs")):"function"==typeof define&&define.amd?define(["exports","babylonjs"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).BABYLON=e.BABYLON||{},e.BABYLON)}(this,function(e,n){"use strict";function t(e,n,t,i,r,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=i.kind,f="getter"===l?"get":"setter"===l?"set":"value",d=!n&&e?i.static?e:e.prototype:null,u=n||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),c=!1,m=t.length-1;m>=0;m--){var h={};for(var S in i)h[S]="access"===S?{}:i[S];for(var S in i.access)h.access[S]=i.access[S];h.addInitializer=function(e){if(c)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var v=(0,t[m])("accessor"===l?{get:u.get,set:u.set}:u[f],h);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=s(v.get))&&(u.get=o),(o=s(v.set))&&(u.set=o),(o=s(v.init))&&r.unshift(o)}else(o=s(v))&&("field"===l?r.unshift(o):u[f]=o)}d&&Object.defineProperty(d,i.name,u),c=!0}function i(e,n,t){for(var i=arguments.length>2,r=0;r<n.length;r++)t=i?n[r].call(e,t):n[r].call(e);return i?t:void 0}function r(e,n,t,i){if("a"===t&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!i:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?i:"a"===t?i.call(e):i?i.value:n.get(e)}function a(e,n,t,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,t):r?r.value=t:n.set(e,t),t}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;class s extends n.MaterialDefines{constructor(){super(),this.DIFFUSEX=!1,this.DIFFUSEY=!1,this.DIFFUSEZ=!1,this.BUMPX=!1,this.BUMPY=!1,this.BUMPZ=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.NORMAL=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.INSTANCES=!1,this.INSTANCESCOLOR=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.NONUNIFORMSCALING=!1,this.LOGARITHMICDEPTH=!1,this.AREALIGHTSUPPORTED=!0,this.AREALIGHTNOROUGHTNESS=!0,this.rebuild()}}let o=(()=>{var e,o,l,f,d,u,c,h,S;let v,g,x,T,L,_,P,N,F,b,D,I,A,y,U,O,M,w,z,R,V,W=n.PushMaterial,X=[],Y=[],Z=[],B=[],G=[],k=[],H=[],j=[],K=[],q=[],J=[],Q=[],$=[],ee=[],ne=[],te=[],ie=[],re=[],ae=[],se=[],oe=[],le=[],fe=[],de=[],ue=[],ce=[],me=[],he=[],Se=[],ve=[],pe=[],ge=[],xe=[],Te=[],Ee=[],Le=[],_e=[],Pe=[],Ce=[],Ne=[],Fe=[],be=[];return e=class extends W{get diffuseTextureX(){return r(this,o,"f")}set diffuseTextureX(e){a(this,o,e,"f")}get diffuseTextureY(){return r(this,l,"f")}set diffuseTextureY(e){a(this,l,e,"f")}get diffuseTextureZ(){return r(this,f,"f")}set diffuseTextureZ(e){a(this,f,e,"f")}get normalTextureX(){return r(this,d,"f")}set normalTextureX(e){a(this,d,e,"f")}get normalTextureY(){return r(this,u,"f")}set normalTextureY(e){a(this,u,e,"f")}get normalTextureZ(){return r(this,c,"f")}set normalTextureZ(e){a(this,c,e,"f")}get disableLighting(){return r(this,h,"f")}set disableLighting(e){a(this,h,e,"f")}get maxSimultaneousLights(){return r(this,S,"f")}set maxSimultaneousLights(e){a(this,S,e,"f")}constructor(e,t,r=!1){super(e,t,void 0,r),this.mixTexture=i(this,X,void 0),this._diffuseTextureX=(i(this,Y),i(this,Z,void 0)),o.set(this,(i(this,B),i(this,G,void 0))),this._diffuseTextureY=(i(this,k),i(this,H,void 0)),l.set(this,(i(this,j),i(this,K,void 0))),this._diffuseTextureZ=(i(this,q),i(this,J,void 0)),f.set(this,(i(this,Q),i(this,$,void 0))),this._normalTextureX=(i(this,ee),i(this,ne,void 0)),d.set(this,(i(this,te),i(this,ie,void 0))),this._normalTextureY=(i(this,re),i(this,ae,void 0)),u.set(this,(i(this,se),i(this,oe,void 0))),this._normalTextureZ=(i(this,le),i(this,fe,void 0)),c.set(this,(i(this,de),i(this,ue,void 0))),this.tileSize=(i(this,ce),i(this,me,1)),this.diffuseColor=(i(this,he),i(this,Se,new n.Color3(1,1,1))),this.specularColor=(i(this,ve),i(this,pe,new n.Color3(.2,.2,.2))),this.specularPower=(i(this,ge),i(this,xe,64)),this._disableLighting=(i(this,Te),i(this,Ee,!1)),h.set(this,(i(this,Le),i(this,_e,void 0))),this._maxSimultaneousLights=(i(this,Pe),i(this,Ce,4)),S.set(this,(i(this,Ne),i(this,Fe,void 0))),this._shadersLoaded=(i(this,be),!1)}needAlphaBlending(){return this.alpha<1}needAlphaTesting(){return!1}getAlphaTestTexture(){return null}isReadyForSubMesh(e,t,i){const r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new s);const a=t.materialDefines,o=this.getScene();if(this._isReadyForSubMesh(t))return!0;const l=o.getEngine();if(a._areTexturesDirty&&o.texturesEnabled){if(n.MaterialFlags.DiffuseTextureEnabled){const e=[this.diffuseTextureX,this.diffuseTextureY,this.diffuseTextureZ],n=["DIFFUSEX","DIFFUSEY","DIFFUSEZ"];for(let t=0;t<e.length;t++)if(e[t]){if(!e[t].isReady())return!1;a[n[t]]=!0}}if(n.MaterialFlags.BumpTextureEnabled){const e=[this.normalTextureX,this.normalTextureY,this.normalTextureZ],n=["BUMPX","BUMPY","BUMPZ"];for(let t=0;t<e.length;t++)if(e[t]){if(!e[t].isReady())return!1;a[n[t]]=!0}}}if(n.PrepareDefinesForMisc(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),a,void 0,void 0,void 0,this._isVertexOutputInvariant),a._needNormals=n.PrepareDefinesForLights(o,e,a,!1,this._maxSimultaneousLights,this._disableLighting),n.PrepareDefinesForFrameBoundValues(o,l,this,a,!!i),n.PrepareDefinesForAttributes(e,a,!0,!0),a.isDirty){a.markAsProcessed(),o.resetCachedMaterial();const i=new n.EffectFallbacks;a.FOG&&i.addFallback(1,"FOG"),n.HandleFallbacksForShadows(a,i,this.maxSimultaneousLights),a.NUM_BONE_INFLUENCERS>0&&i.addCPUSkinningFallback(0,e),a.IMAGEPROCESSINGPOSTPROCESS=o.imageProcessingConfiguration.applyByPostProcess;const r=[n.VertexBuffer.PositionKind];a.NORMAL&&r.push(n.VertexBuffer.NormalKind),a.VERTEXCOLOR&&r.push(n.VertexBuffer.ColorKind),n.PrepareAttributesForBones(r,e,a,i),n.PrepareAttributesForInstances(r,a);const s="triplanar",f=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","mBones","tileSize"],u=["diffuseSamplerX","diffuseSamplerY","diffuseSamplerZ","normalSamplerX","normalSamplerY","normalSamplerZ","logarithmicDepthConstant","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],c=[];n.AddClipPlaneUniforms(d),n.PrepareUniformsAndSamplersList({uniformsNames:d,uniformBuffersNames:c,samplers:u,defines:a,maxSimultaneousLights:this.maxSimultaneousLights,shaderLanguage:this._shaderLanguage}),t.setEffect(o.getEngine().createEffect(s,{attributes:r,uniformsNames:d,uniformBuffersNames:c,samplers:u,defines:f,fallbacks:i,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights},shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:()=>{return e=this,n=void 0,i=function*(){1===this.shaderLanguage?yield Promise.all([Promise.resolve().then(function(){return m}),Promise.resolve().then(function(){return p})]):yield Promise.all([Promise.resolve().then(function(){return E}),Promise.resolve().then(function(){return C})]),this._shadersLoaded=!0},new((t=void 0)||(t=Promise))(function(r,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(s,o)}l((i=i.apply(e,n||[])).next())});var e,n,t,i}},l),a,this._materialContext)}if(a.AREALIGHTUSED)for(let n=0;n<e.lightSources.length;n++)if(!e.lightSources[n]._isReady())return!1;return!(!t.effect||!t.effect.isReady()||(a._renderId=o.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))}bindForSubMesh(e,t,i){const r=this.getScene(),a=i.materialDefines;if(!a)return;const s=i.effect;s&&(this._activeEffect=s,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),n.BindBonesParameters(t,this._activeEffect),this._activeEffect.setFloat("tileSize",this.tileSize),this._mustRebind(r,s,i)&&(this.diffuseTextureX&&this._activeEffect.setTexture("diffuseSamplerX",this.diffuseTextureX),this.diffuseTextureY&&this._activeEffect.setTexture("diffuseSamplerY",this.diffuseTextureY),this.diffuseTextureZ&&this._activeEffect.setTexture("diffuseSamplerZ",this.diffuseTextureZ),this.normalTextureX&&this._activeEffect.setTexture("normalSamplerX",this.normalTextureX),this.normalTextureY&&this._activeEffect.setTexture("normalSamplerY",this.normalTextureY),this.normalTextureZ&&this._activeEffect.setTexture("normalSamplerZ",this.normalTextureZ),n.BindClipPlane(s,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&n.BindLogDepth(a,s,r),r.bindEyePosition(s)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),a.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&n.BindLights(r,t,this._activeEffect,a,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),n.BindFogParameters(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}getAnimatables(){const e=[];return this.mixTexture&&this.mixTexture.animations&&this.mixTexture.animations.length>0&&e.push(this.mixTexture),e}getActiveTextures(){const e=super.getActiveTextures();return this._diffuseTextureX&&e.push(this._diffuseTextureX),this._diffuseTextureY&&e.push(this._diffuseTextureY),this._diffuseTextureZ&&e.push(this._diffuseTextureZ),this._normalTextureX&&e.push(this._normalTextureX),this._normalTextureY&&e.push(this._normalTextureY),this._normalTextureZ&&e.push(this._normalTextureZ),e}hasTexture(e){return!!super.hasTexture(e)||this._diffuseTextureX===e||this._diffuseTextureY===e||this._diffuseTextureZ===e||this._normalTextureX===e||this._normalTextureY===e||this._normalTextureZ===e}dispose(e){this.mixTexture&&this.mixTexture.dispose(),super.dispose(e)}clone(t){return n.SerializationHelper.Clone(()=>new e(t,this.getScene()),this)}serialize(){const e=super.serialize();return e.customType="BABYLON.TriPlanarMaterial",e}getClassName(){return"TriPlanarMaterial"}static Parse(t,i,r){return n.SerializationHelper.Parse(()=>new e(t.name,i),t,i,r)}},o=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,S=new WeakMap,(()=>{var i;const r="function"==typeof Symbol&&Symbol.metadata?Object.create(null!==(i=W[Symbol.metadata])&&void 0!==i?i:null):void 0;v=[n.serializeAsTexture()],g=[n.serializeAsTexture("diffuseTextureX")],x=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],T=[n.serializeAsTexture("diffuseTexturY")],L=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],_=[n.serializeAsTexture("diffuseTextureZ")],P=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],N=[n.serializeAsTexture("normalTextureX")],F=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],b=[n.serializeAsTexture("normalTextureY")],D=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],I=[n.serializeAsTexture("normalTextureZ")],A=[n.expandToProperty("_markAllSubMeshesAsTexturesDirty")],y=[n.serialize()],U=[n.serializeAsColor3()],O=[n.serializeAsColor3()],M=[n.serialize()],w=[n.serialize("disableLighting")],z=[n.expandToProperty("_markAllSubMeshesAsLightsDirty")],R=[n.serialize("maxSimultaneousLights")],V=[n.expandToProperty("_markAllSubMeshesAsLightsDirty")],t(e,null,x,{kind:"accessor",name:"diffuseTextureX",static:!1,private:!1,access:{has:e=>"diffuseTextureX"in e,get:e=>e.diffuseTextureX,set:(e,n)=>{e.diffuseTextureX=n}},metadata:r},G,k),t(e,null,L,{kind:"accessor",name:"diffuseTextureY",static:!1,private:!1,access:{has:e=>"diffuseTextureY"in e,get:e=>e.diffuseTextureY,set:(e,n)=>{e.diffuseTextureY=n}},metadata:r},K,q),t(e,null,P,{kind:"accessor",name:"diffuseTextureZ",static:!1,private:!1,access:{has:e=>"diffuseTextureZ"in e,get:e=>e.diffuseTextureZ,set:(e,n)=>{e.diffuseTextureZ=n}},metadata:r},$,ee),t(e,null,F,{kind:"accessor",name:"normalTextureX",static:!1,private:!1,access:{has:e=>"normalTextureX"in e,get:e=>e.normalTextureX,set:(e,n)=>{e.normalTextureX=n}},metadata:r},ie,re),t(e,null,D,{kind:"accessor",name:"normalTextureY",static:!1,private:!1,access:{has:e=>"normalTextureY"in e,get:e=>e.normalTextureY,set:(e,n)=>{e.normalTextureY=n}},metadata:r},oe,le),t(e,null,A,{kind:"accessor",name:"normalTextureZ",static:!1,private:!1,access:{has:e=>"normalTextureZ"in e,get:e=>e.normalTextureZ,set:(e,n)=>{e.normalTextureZ=n}},metadata:r},ue,ce),t(e,null,z,{kind:"accessor",name:"disableLighting",static:!1,private:!1,access:{has:e=>"disableLighting"in e,get:e=>e.disableLighting,set:(e,n)=>{e.disableLighting=n}},metadata:r},_e,Pe),t(e,null,V,{kind:"accessor",name:"maxSimultaneousLights",static:!1,private:!1,access:{has:e=>"maxSimultaneousLights"in e,get:e=>e.maxSimultaneousLights,set:(e,n)=>{e.maxSimultaneousLights=n}},metadata:r},Fe,be),t(null,null,v,{kind:"field",name:"mixTexture",static:!1,private:!1,access:{has:e=>"mixTexture"in e,get:e=>e.mixTexture,set:(e,n)=>{e.mixTexture=n}},metadata:r},X,Y),t(null,null,g,{kind:"field",name:"_diffuseTextureX",static:!1,private:!1,access:{has:e=>"_diffuseTextureX"in e,get:e=>e._diffuseTextureX,set:(e,n)=>{e._diffuseTextureX=n}},metadata:r},Z,B),t(null,null,T,{kind:"field",name:"_diffuseTextureY",static:!1,private:!1,access:{has:e=>"_diffuseTextureY"in e,get:e=>e._diffuseTextureY,set:(e,n)=>{e._diffuseTextureY=n}},metadata:r},H,j),t(null,null,_,{kind:"field",name:"_diffuseTextureZ",static:!1,private:!1,access:{has:e=>"_diffuseTextureZ"in e,get:e=>e._diffuseTextureZ,set:(e,n)=>{e._diffuseTextureZ=n}},metadata:r},J,Q),t(null,null,N,{kind:"field",name:"_normalTextureX",static:!1,private:!1,access:{has:e=>"_normalTextureX"in e,get:e=>e._normalTextureX,set:(e,n)=>{e._normalTextureX=n}},metadata:r},ne,te),t(null,null,b,{kind:"field",name:"_normalTextureY",static:!1,private:!1,access:{has:e=>"_normalTextureY"in e,get:e=>e._normalTextureY,set:(e,n)=>{e._normalTextureY=n}},metadata:r},ae,se),t(null,null,I,{kind:"field",name:"_normalTextureZ",static:!1,private:!1,access:{has:e=>"_normalTextureZ"in e,get:e=>e._normalTextureZ,set:(e,n)=>{e._normalTextureZ=n}},metadata:r},fe,de),t(null,null,y,{kind:"field",name:"tileSize",static:!1,private:!1,access:{has:e=>"tileSize"in e,get:e=>e.tileSize,set:(e,n)=>{e.tileSize=n}},metadata:r},me,he),t(null,null,U,{kind:"field",name:"diffuseColor",static:!1,private:!1,access:{has:e=>"diffuseColor"in e,get:e=>e.diffuseColor,set:(e,n)=>{e.diffuseColor=n}},metadata:r},Se,ve),t(null,null,O,{kind:"field",name:"specularColor",static:!1,private:!1,access:{has:e=>"specularColor"in e,get:e=>e.specularColor,set:(e,n)=>{e.specularColor=n}},metadata:r},pe,ge),t(null,null,M,{kind:"field",name:"specularPower",static:!1,private:!1,access:{has:e=>"specularPower"in e,get:e=>e.specularPower,set:(e,n)=>{e.specularPower=n}},metadata:r},xe,Te),t(null,null,w,{kind:"field",name:"_disableLighting",static:!1,private:!1,access:{has:e=>"_disableLighting"in e,get:e=>e._disableLighting,set:(e,n)=>{e._disableLighting=n}},metadata:r},Ee,Le),t(null,null,R,{kind:"field",name:"_maxSimultaneousLights",static:!1,private:!1,access:{has:e=>"_maxSimultaneousLights"in e,get:e=>e._maxSimultaneousLights,set:(e,n)=>{e._maxSimultaneousLights=n}},metadata:r},Ce,Ne),r&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r})})(),e})();n.RegisterClass("BABYLON.TriPlanarMaterial",o);var l={__proto__:null,TriPlanarMaterial:o};const f="undefined"!=typeof global?global:"undefined"!=typeof window?window:void 0;if(void 0!==f)for(const e in l)f.BABYLON[e]=l[e];const d="triplanarVertexShader",u="attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;\n#endif\nuniform tileSize: f32;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSEX\nvertexOutputs.vTextureUVX=worldPos.zy/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEY\nvertexOutputs.vTextureUVY=worldPos.xz/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEZ\nvertexOutputs.vTextureUVZ=worldPos.xy/uniforms.tileSize;\n#endif\n#ifdef NORMAL\nvar xtan: vec3f= vec3f(0,0,1);var xbin: vec3f= vec3f(0,1,0);var ytan: vec3f= vec3f(1,0,0);var ybin: vec3f= vec3f(0,0,1);var ztan: vec3f= vec3f(1,0,0);var zbin: vec3f= vec3f(0,1,0);var normalizedNormal: vec3f=normalize(vertexInputs.normal);normalizedNormal=normalizedNormal*normalizedNormal;var worldBinormal: vec3f=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);var worldTangent: vec3f=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);var worldNormal: vec3f=normalize((normalWorld*normalize(vertexInputs.normal)).xyz);vertexOutputs.tangentSpace0=worldTangent;vertexOutputs.tangentSpace1=worldBinormal;vertexOutputs.tangentSpace2=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.ShaderStore.ShadersStoreWGSL[d]||(n.ShaderStore.ShadersStoreWGSL[d]=u);const c=[n.helperFunctionsWGSL,n.bonesDeclarationWGSL,n.bakedVertexAnimationDeclarationWGSL,n.instancesDeclarationWGSL,n.clipPlaneVertexDeclarationWGSL,n.logDepthDeclarationWGSL,n.fogVertexDeclarationWGSL,n.lightVxFragmentDeclarationWGSL,n.lightVxUboDeclarationWGSL,n.instancesVertexWGSL,n.bonesVertexWGSL,n.bakedVertexAnimationWGSL,n.clipPlaneVertexWGSL,n.logDepthVertexWGSL,n.fogVertexWGSL,n.shadowsVertexWGSL,n.vertexColorMixingWGSL];for(const e of c)n.ShaderStore.IncludesShadersStoreWGSL[e.name]||(n.ShaderStore.IncludesShadersStoreWGSL[e.name]=e.shader);var m={__proto__:null,triplanarVertexShaderWGSL:{name:d,shader:u}};const h="triplanarPixelShader",S="uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;var diffuseSamplerXSampler: sampler;var diffuseSamplerX: texture_2d<f32>;\n#ifdef BUMPX\nvar normalSamplerXSampler: sampler;var normalSamplerX: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;var diffuseSamplerYSampler: sampler;var diffuseSamplerY: texture_2d<f32>;\n#ifdef BUMPY\nvar normalSamplerYSampler: sampler;var normalSamplerY: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;var diffuseSamplerZSampler: sampler;var diffuseSamplerZ: texture_2d<f32>;\n#ifdef BUMPZ\nvar normalSamplerZSampler: sampler;var normalSamplerZ: texture_2d<f32>;\n#endif\n#endif\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(0.,0.,0.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=fragmentInputs.tangentSpace2;\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar baseNormal: vec4f= vec4f(0.0,0.0,0.0,1.0);normalW=normalW*normalW;\n#ifdef DIFFUSEX\nbaseColor=baseColor+textureSample(diffuseSamplerX,diffuseSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal=baseNormal+textureSample(normalSamplerX,normalSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor=baseColor+textureSample(diffuseSamplerY,diffuseSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal=baseNormal+textureSample(normalSamplerY,normalSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor=baseColor+textureSample(diffuseSamplerZ,diffuseSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal=baseNormal+textureSample(normalSamplerZ,normalSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nvar tangentSpace: mat3x3f=mat3x3f(fragmentInputs.tangentSpace0,fragmentInputs.tangentSpace1,fragmentInputs.tangentSpace2);normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n";n.ShaderStore.ShadersStoreWGSL[h]||(n.ShaderStore.ShadersStoreWGSL[h]=S);const v=[n.helperFunctionsWGSL,n.lightUboDeclarationWGSL,n.logDepthDeclarationWGSL,n.lightsFragmentFunctionsWGSL,n.shadowsFragmentFunctionsWGSL,n.clipPlaneFragmentDeclarationWGSL,n.fogFragmentDeclarationWGSL,n.clipPlaneFragmentWGSL,n.depthPrePassWGSL,n.lightFragmentWGSL,n.logDepthFragmentWGSL,n.fogFragmentWGSL,n.imageProcessingCompatibilityWGSL];for(const e of v)n.ShaderStore.IncludesShadersStoreWGSL[e.name]||(n.ShaderStore.IncludesShadersStoreWGSL[e.name]=e.shader);var p={__proto__:null,triplanarPixelShaderWGSL:{name:h,shader:S}};const g="triplanarVertexShader",x="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void)\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\nvec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n";n.ShaderStore.ShadersStore[g]||(n.ShaderStore.ShadersStore[g]=x);const T=[n.helperFunctions,n.bonesDeclaration,n.bakedVertexAnimationDeclaration,n.instancesDeclaration,n.clipPlaneVertexDeclaration,n.logDepthDeclaration,n.fogVertexDeclaration,n.lightFragmentDeclaration,n.lightUboDeclaration,n.instancesVertex,n.bonesVertex,n.bakedVertexAnimation,n.clipPlaneVertex,n.logDepthVertex,n.fogVertex,n.shadowsVertex,n.vertexColorMixing];for(const e of T)n.ShaderStore.IncludesShadersStore[e.name]||(n.ShaderStore.IncludesShadersStore[e.name]=e.shader);var E={__proto__:null,triplanarVertexShader:{name:g,shader:x}};const L="triplanarPixelShader",_="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;uniform sampler2D diffuseSamplerX;\n#ifdef BUMPX\nuniform sampler2D normalSamplerX;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;uniform sampler2D diffuseSamplerY;\n#ifdef BUMPY\nuniform sampler2D normalSamplerY;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;uniform sampler2D diffuseSamplerZ;\n#ifdef BUMPZ\nuniform sampler2D normalSamplerZ;\n#endif\n#endif\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(0.,0.,0.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=tangentSpace[2];\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec4 baseNormal=vec4(0.0,0.0,0.0,1.0);normalW*=normalW;\n#ifdef DIFFUSEX\nbaseColor+=texture2D(diffuseSamplerX,vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal+=texture2D(normalSamplerX,vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor+=texture2D(diffuseSamplerY,vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal+=texture2D(normalSamplerY,vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor+=texture2D(diffuseSamplerZ,vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal+=texture2D(normalSamplerZ,vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nnormalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n";n.ShaderStore.ShadersStore[L]||(n.ShaderStore.ShadersStore[L]=_);const P=[n.helperFunctions,n.lightFragmentDeclaration,n.lightUboDeclaration,n.logDepthDeclaration,n.lightsFragmentFunctions,n.shadowsFragmentFunctions,n.clipPlaneFragmentDeclaration,n.fogFragmentDeclaration,n.clipPlaneFragment,n.depthPrePass,n.lightFragment,n.logDepthFragment,n.fogFragment,n.imageProcessingCompatibility];for(const e of P)n.ShaderStore.IncludesShadersStore[e.name]||(n.ShaderStore.IncludesShadersStore[e.name]=e.shader);var C={__proto__:null,triplanarPixelShader:{name:L,shader:_}};e.TriPlanarMaterial=o});
2
2
  //# sourceMappingURL=babylon.triPlanarMaterial.min.js.map