babylonjs-materials 9.4.1 → 9.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babylon.cellMaterial.min.js +2 -2
- package/babylon.cellMaterial.min.js.map +1 -1
- package/babylon.customMaterial.min.js +2 -2
- package/babylon.customMaterial.min.js.map +1 -1
- package/babylon.fireMaterial.min.js +2 -2
- package/babylon.fireMaterial.min.js.map +1 -1
- package/babylon.furMaterial.min.js +2 -2
- package/babylon.furMaterial.min.js.map +1 -1
- package/babylon.gradientMaterial.min.js +2 -2
- package/babylon.gradientMaterial.min.js.map +1 -1
- package/babylon.gridMaterial.min.js +2 -2
- package/babylon.gridMaterial.min.js.map +1 -1
- package/babylon.lavaMaterial.min.js +2 -2
- package/babylon.lavaMaterial.min.js.map +1 -1
- package/babylon.mixMaterial.min.js +2 -2
- package/babylon.mixMaterial.min.js.map +1 -1
- package/babylon.normalMaterial.min.js +2 -2
- package/babylon.normalMaterial.min.js.map +1 -1
- package/babylon.shadowOnlyMaterial.min.js +2 -2
- package/babylon.shadowOnlyMaterial.min.js.map +1 -1
- package/babylon.simpleMaterial.min.js +2 -2
- package/babylon.simpleMaterial.min.js.map +1 -1
- package/babylon.skyMaterial.min.js +2 -2
- package/babylon.skyMaterial.min.js.map +1 -1
- package/babylon.terrainMaterial.min.js +2 -2
- package/babylon.terrainMaterial.min.js.map +1 -1
- package/babylon.triPlanarMaterial.min.js +2 -2
- package/babylon.triPlanarMaterial.min.js.map +1 -1
- package/babylon.waterMaterial.min.js +2 -2
- package/babylon.waterMaterial.min.js.map +1 -1
- package/babylonjs.materials.d.ts +293 -14
- package/babylonjs.materials.js +2 -2
- package/babylonjs.materials.js.map +1 -0
- package/babylonjs.materials.min.js +2 -2
- package/babylonjs.materials.min.js.map +1 -1
- package/babylonjs.materials.module.d.ts +983 -56
- package/package.json +6 -10
- package/rollup.config.umd.mjs +37 -0
- package/src/cell.ts +2 -3
- package/src/custom.ts +2 -3
- package/src/fire.ts +2 -3
- package/src/fur.ts +2 -3
- package/src/gradient.ts +2 -3
- package/src/grid.ts +2 -3
- package/src/index.ts +2 -3
- package/src/lava.ts +2 -3
- package/src/mix.ts +2 -3
- package/src/normal.ts +2 -3
- package/src/shadowOnly.ts +2 -3
- package/src/simple.ts +2 -3
- package/src/sky.ts +2 -3
- package/src/terrain.ts +2 -3
- package/src/triPlanar.ts +2 -3
- package/src/water.ts +2 -3
- package/babylon.cellMaterial.js +0 -2
- package/babylon.customMaterial.js +0 -2
- package/babylon.fireMaterial.js +0 -2
- package/babylon.furMaterial.js +0 -2
- package/babylon.gradientMaterial.js +0 -2
- package/babylon.gridMaterial.js +0 -2
- package/babylon.lavaMaterial.js +0 -2
- package/babylon.mixMaterial.js +0 -2
- package/babylon.normalMaterial.js +0 -2
- package/babylon.shadowOnlyMaterial.js +0 -2
- package/babylon.simpleMaterial.js +0 -2
- package/babylon.skyMaterial.js +0 -2
- package/babylon.terrainMaterial.js +0 -2
- package/babylon.triPlanarMaterial.js +0 -2
- package/babylon.waterMaterial.js +0 -2
- package/webpack.config.js +0 -35
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-materials",["babylonjs"],i):"object"==typeof exports?exports["babylonjs-materials"]=i(require("babylonjs")):e.MATERIALS=i(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,e=>(()=>{"use strict";var i={597(i){i.exports=e}},t={};function n(e){var r=t[e];if(void 0!==r)return r.exports;var o=t[e]={exports:{}};return i[e](o,o.exports,n),o.exports}n.d=(e,i)=>{for(var t in i)n.o(i,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.d(r,{default:()=>S});var o={};n.r(o),n.d(o,{SimpleMaterial:()=>h});var s={};n.r(s),n.d(s,{SimpleMaterial:()=>h});var a=function(e,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])},a(e,i)};function f(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function t(){this.constructor=e}a(e,i),e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t)}function l(e,i,t,n){var r,o=arguments.length,s=o<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,i,t,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(i,t,s):r(i,t))||s);return o>3&&s&&Object.defineProperty(i,t,s),s}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var u=n(597),d="simplePixelShader";u.ShaderStore.ShadersStore[d]||(u.ShaderStore.ShadersStore[d]="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;varying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform sampler2D diffuseSampler;uniform vec2 vDiffuseInfos;\n#endif\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\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(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif \n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;vec4 color=vec4(finalDiffuse,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}");var c="simpleVertexShader";u.ShaderStore.ShadersStore[c]||(u.ShaderStore.ShadersStore[c]="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vDiffuseUV;uniform mat4 diffuseMatrix;uniform vec2 vDiffuseInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\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#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 NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vDiffuseInfos.x==0.)\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}\nelse\n{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}\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");var p=function(e){function i(){var i=e.call(this)||this;return i.DIFFUSE=!1,i.CLIPPLANE=!1,i.CLIPPLANE2=!1,i.CLIPPLANE3=!1,i.CLIPPLANE4=!1,i.CLIPPLANE5=!1,i.CLIPPLANE6=!1,i.ALPHATEST=!1,i.DEPTHPREPASS=!1,i.POINTSIZE=!1,i.FOG=!1,i.NORMAL=!1,i.UV1=!1,i.UV2=!1,i.VERTEXCOLOR=!1,i.VERTEXALPHA=!1,i.NUM_BONE_INFLUENCERS=0,i.BonesPerMesh=0,i.INSTANCES=!1,i.INSTANCESCOLOR=!1,i.IMAGEPROCESSINGPOSTPROCESS=!1,i.SKIPFINALCOLORCLAMP=!1,i.LOGARITHMICDEPTH=!1,i.AREALIGHTSUPPORTED=!0,i.AREALIGHTNOROUGHTNESS=!0,i.rebuild(),i}return f(i,e),i}(u.MaterialDefines),h=function(e){function i(i,t){var n=e.call(this,i,t)||this;return n.diffuseColor=new u.Color3(1,1,1),n._disableLighting=!1,n._maxSimultaneousLights=4,n}return f(i,e),i.prototype.needAlphaBlending=function(){return this.alpha<1},i.prototype.needAlphaTesting=function(){return!1},i.prototype.getAlphaTestTexture=function(){return null},i.prototype.isReadyForSubMesh=function(e,i,t){var n=i._drawWrapper;if(this.isFrozen&&n.effect&&n._wasPreviouslyReady&&n._wasPreviouslyUsingInstances===t)return!0;i.materialDefines||(i.materialDefines=new p);var r=i.materialDefines,o=this.getScene();if(this._isReadyForSubMesh(i))return!0;var s=o.getEngine();if(r._areTexturesDirty&&(r._needUVs=!1,o.texturesEnabled&&this._diffuseTexture&&u.MaterialFlags.DiffuseTextureEnabled)){if(!this._diffuseTexture.isReady())return!1;r._needUVs=!0,r.DIFFUSE=!0}if((0,u.PrepareDefinesForMisc)(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),r,void 0,void 0,void 0,this._isVertexOutputInvariant),r._needNormals=(0,u.PrepareDefinesForLights)(o,e,r,!1,this._maxSimultaneousLights,this._disableLighting),(0,u.PrepareDefinesForFrameBoundValues)(o,s,this,r,!!t),(0,u.PrepareDefinesForAttributes)(e,r,!0,!0),r.isDirty){r.markAsProcessed(),o.resetCachedMaterial();var a=new u.EffectFallbacks;r.FOG&&a.addFallback(1,"FOG"),(0,u.HandleFallbacksForShadows)(r,a,this.maxSimultaneousLights),r.NUM_BONE_INFLUENCERS>0&&a.addCPUSkinningFallback(0,e),r.IMAGEPROCESSINGPOSTPROCESS=o.imageProcessingConfiguration.applyByPostProcess;var f=[u.VertexBuffer.PositionKind];r.NORMAL&&f.push(u.VertexBuffer.NormalKind),r.UV1&&f.push(u.VertexBuffer.UVKind),r.UV2&&f.push(u.VertexBuffer.UV2Kind),r.VERTEXCOLOR&&f.push(u.VertexBuffer.ColorKind),(0,u.PrepareAttributesForBones)(f,e,r,a),(0,u.PrepareAttributesForInstances)(f,r);var l=r.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","mBones","diffuseMatrix","logarithmicDepthConstant"],c=["diffuseSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],h=[];(0,u.AddClipPlaneUniforms)(d),(0,u.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:h,samplers:c,defines:r,maxSimultaneousLights:this.maxSimultaneousLights}),i.setEffect(o.getEngine().createEffect("simple",{attributes:f,uniformsNames:d,uniformBuffersNames:h,samplers:c,defines:l,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights-1}},s),r,this._materialContext)}if(r.AREALIGHTUSED)for(var v=0;v<e.lightSources.length;v++)if(!e.lightSources[v]._isReady())return!1;return!(!i.effect||!i.effect.isReady()||(r._renderId=o.getRenderId(),n._wasPreviouslyReady=!0,n._wasPreviouslyUsingInstances=!!t,0))},i.prototype.bindForSubMesh=function(e,i,t){var n=this.getScene(),r=t.materialDefines;if(r){var o=t.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",n.getTransformMatrix()),(0,u.BindBonesParameters)(i,this._activeEffect),this._mustRebind(n,o,t)&&(this._diffuseTexture&&u.MaterialFlags.DiffuseTextureEnabled&&(this._activeEffect.setTexture("diffuseSampler",this._diffuseTexture),this._activeEffect.setFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),this._activeEffect.setMatrix("diffuseMatrix",this._diffuseTexture.getTextureMatrix())),(0,u.BindClipPlane)(o,this,n),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,u.BindLogDepth)(r,o,n),n.bindEyePosition(o)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*i.visibility),n.lightsEnabled&&!this.disableLighting&&(0,u.BindLights)(n,i,this._activeEffect,r,this.maxSimultaneousLights),n.fogEnabled&&i.applyFog&&n.fogMode!==u.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",n.getViewMatrix()),(0,u.BindFogParameters)(n,i,this._activeEffect),this._afterBind(i,this._activeEffect,t))}},i.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),e},i.prototype.getActiveTextures=function(){var i=e.prototype.getActiveTextures.call(this);return this._diffuseTexture&&i.push(this._diffuseTexture),i},i.prototype.hasTexture=function(i){return!!e.prototype.hasTexture.call(this,i)||this.diffuseTexture===i},i.prototype.dispose=function(i){this._diffuseTexture&&this._diffuseTexture.dispose(),e.prototype.dispose.call(this,i)},i.prototype.clone=function(e){var t=this;return u.SerializationHelper.Clone(function(){return new i(e,t.getScene())},this)},i.prototype.serialize=function(){var i=e.prototype.serialize.call(this);return i.customType="BABYLON.SimpleMaterial",i},i.prototype.getClassName=function(){return"SimpleMaterial"},i.Parse=function(e,t,n){return u.SerializationHelper.Parse(function(){return new i(e.name,t)},e,t,n)},l([(0,u.serializeAsTexture)("diffuseTexture")],i.prototype,"_diffuseTexture",void 0),l([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"diffuseTexture",void 0),l([(0,u.serializeAsColor3)("diffuse")],i.prototype,"diffuseColor",void 0),l([(0,u.serialize)("disableLighting")],i.prototype,"_disableLighting",void 0),l([(0,u.expandToProperty)("_markAllSubMeshesAsLightsDirty")],i.prototype,"disableLighting",void 0),l([(0,u.serialize)("maxSimultaneousLights")],i.prototype,"_maxSimultaneousLights",void 0),l([(0,u.expandToProperty)("_markAllSubMeshesAsLightsDirty")],i.prototype,"maxSimultaneousLights",void 0),i}(u.PushMaterial);(0,u.RegisterClass)("BABYLON.SimpleMaterial",h);var v=void 0!==n.g?n.g:"undefined"!=typeof window?window:void 0;if(void 0!==v)for(var g in o)v.BABYLON[g]=o[g];const S=s;return r.default})());
|
|
2
|
-
//# sourceMappingURL=babylon.simpleMaterial.min.js.map
|
package/babylon.skyMaterial.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-materials",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-materials"]=t(require("babylonjs")):e.MATERIALS=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,e=>(()=>{"use strict";var t={597(t){t.exports=e}},i={};function o(e){var n=i[e];if(void 0!==n)return n.exports;var r=i[e]={exports:{}};return t[e](r,r.exports,o),r.exports}o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.d(n,{default:()=>y});var r={};o.r(r),o.d(r,{SkyMaterial:()=>h});var a={};o.r(a),o.d(a,{SkyMaterial:()=>h});var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},s(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function l(e,t,i,o){var n,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var f=o(597),u="skyPixelShader";f.ShaderStore.ShadersStore[u]||(f.ShaderStore.ShadersStore[u]="precision highp float;varying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform vec3 cameraPosition;uniform vec3 cameraOffset;uniform vec3 up;uniform float luminance;uniform float turbidity;uniform float rayleigh;uniform float mieCoefficient;uniform float mieDirectionalG;uniform vec3 sunPosition;\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst float e=2.71828182845904523536028747135266249775724709369995957;const float pi=3.141592653589793238462643383279502884197169;const float n=1.0003;const float N=2.545E25;const float pn=0.035;const vec3 lambda=vec3(680E-9,550E-9,450E-9);const vec3 K=vec3(0.686,0.678,0.666);const float v=4.0;const float rayleighZenithLength=8.4E3;const float mieZenithLength=1.25E3;const float EE=1000.0;const float sunAngularDiameterCos=0.999956676946448443553574619906976478926848692873900859324;const float cutoffAngle=pi/1.95;const float steepness=1.5;vec3 totalRayleigh(vec3 lambda)\n{return (8.0*pow(pi,3.0)*pow(pow(n,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*N*pow(lambda,vec3(4.0))*(6.0-7.0*pn));}\nvec3 simplifiedRayleigh()\n{return 0.0005/vec3(94,40,18);}\nfloat rayleighPhase(float cosTheta)\n{ \nreturn (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nvec3 totalMie(vec3 lambda,vec3 K,float T)\n{float c=(0.2*T )*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambda,vec3(v-2.0))*K;}\nfloat hgPhase(float cosTheta,float g)\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfloat sunIntensity(float zenithAngleCos)\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nfloat A=0.15;float B=0.50;float C=0.10;float D=0.20;float EEE=0.02;float F=0.30;float W=1000.0;vec3 Uncharted2Tonemap(vec3 x)\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat sunfade=1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);float rayleighCoefficient=rayleigh-(1.0*(1.0-sunfade));vec3 sunDirection=normalize(sunPosition);float sunE=sunIntensity(dot(sunDirection,up));vec3 betaR=simplifiedRayleigh()*rayleighCoefficient;vec3 betaM=totalMie(lambda,K,turbidity)*mieCoefficient;float zenithAngle=acos(max(0.0,dot(up,normalize(vPositionW-cameraPosition+cameraOffset))));float sR=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));float sM=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));vec3 Fex=exp(-(betaR*sR+betaM*sM));float cosTheta=dot(normalize(vPositionW-cameraPosition),sunDirection);float rPhase=rayleighPhase(cosTheta*0.5+0.5);vec3 betaRTheta=betaR*rPhase;float mPhase=hgPhase(cosTheta,mieDirectionalG);vec3 betaMTheta=betaM*mPhase;vec3 Lin=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex),vec3(1.5));Lin*=mix(vec3(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up,sunDirection),5.0),0.0,1.0));vec3 direction=normalize(vPositionW-cameraPosition);float theta=acos(direction.y);float phi=atan(direction.z,direction.x);vec2 uv=vec2(phi,theta)/vec2(2.0*pi,pi)+vec2(0.5,0.0);vec3 L0=vec3(0.1)*Fex;float sundisk=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0+=(sunE*19000.0*Fex)*sundisk;vec3 whiteScale=1.0/Uncharted2Tonemap(vec3(W));vec3 texColor=(Lin+L0);texColor*=0.04 ;texColor+=vec3(0.0,0.001,0.0025)*0.3;float g_fMaxLuminance=1.0;float fLumScaled=0.1/luminance; \nfloat fLumCompressed=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled); \nfloat ExposureBias=fLumCompressed;vec3 curr=Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);vec3 retColor=curr*whiteScale;/**\n*--------------------------------------------------------------------------------------------------\n* Sky Color\n*--------------------------------------------------------------------------------------------------\n*/\nfloat alpha=1.0;\n#ifdef VERTEXCOLOR\nretColor.rgb*=vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#if DITHER\nretColor.rgb+=dither(gl_FragCoord.xy,0.5);\n#endif\nvec4 color=clamp(vec4(retColor.rgb,alpha),0.0,1.0);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n");var p="skyVertexShader";f.ShaderStore.ShadersStore[p]||(f.ShaderStore.ShadersStore[p]="precision highp float;attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\nuniform mat4 world;uniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\ngl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos);\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n");var d=function(e){function t(){var t=e.call(this)||this;return t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.DITHER=!1,t.LOGARITHMICDEPTH=!1,t.rebuild(),t}return c(t,e),t}(f.MaterialDefines),h=function(e){function t(t,i){var o=e.call(this,t,i)||this;return o.luminance=1,o.turbidity=10,o.rayleigh=2,o.mieCoefficient=.005,o.mieDirectionalG=.8,o.distance=500,o.inclination=.49,o.azimuth=.25,o.sunPosition=new f.Vector3(0,100,0),o.useSunPosition=!1,o.cameraOffset=f.Vector3.Zero(),o.up=f.Vector3.Up(),o.dithering=!1,o._cameraPosition=f.Vector3.Zero(),o._skyOrientation=new f.Quaternion,o}return c(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t){var i=t._drawWrapper;if(this.isFrozen&&i.effect&&i._wasPreviouslyReady)return!0;t.materialDefines||(t.materialDefines=new d);var o=t.materialDefines,n=this.getScene();if(this._isReadyForSubMesh(t))return!0;if((0,f.PrepareDefinesForMisc)(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,!1,o,void 0,void 0,void 0,this._isVertexOutputInvariant),(0,f.PrepareDefinesForAttributes)(e,o,!0,!1),o.IMAGEPROCESSINGPOSTPROCESS!==n.imageProcessingConfiguration.applyByPostProcess&&o.markAsMiscDirty(),o.DITHER!==this.dithering&&o.markAsMiscDirty(),o.isDirty){o.markAsProcessed(),n.resetCachedMaterial();var r=new f.EffectFallbacks;o.FOG&&r.addFallback(1,"FOG"),o.IMAGEPROCESSINGPOSTPROCESS=n.imageProcessingConfiguration.applyByPostProcess,o.DITHER=this.dithering;var a=[f.VertexBuffer.PositionKind];o.VERTEXCOLOR&&a.push(f.VertexBuffer.ColorKind);var s=["world","viewProjection","view","vFogInfos","vFogColor","logarithmicDepthConstant","pointSize","luminance","turbidity","rayleigh","mieCoefficient","mieDirectionalG","sunPosition","cameraPosition","cameraOffset","up"];(0,f.AddClipPlaneUniforms)(s);var c=o.toString();t.setEffect(n.getEngine().createEffect("sky",a,s,[],c,r,this.onCompiled,this.onError),o,this._materialContext)}return!(!t.effect||!t.effect.isReady()||(o._renderId=n.getRenderId(),i._wasPreviouslyReady=!0,0))},t.prototype.bindForSubMesh=function(e,t,i){var o=this.getScene(),n=i.materialDefines;if(n){var r=i.effect;if(r){this._activeEffect=r,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",o.getTransformMatrix()),this._mustRebind(o,r,i)&&((0,f.BindClipPlane)(r,this,o),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,f.BindLogDepth)(n,r,o)),o.fogEnabled&&t.applyFog&&o.fogMode!==f.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",o.getViewMatrix()),(0,f.BindFogParameters)(o,t,this._activeEffect);var a=o.activeCamera;if(a){var s=a.getWorldMatrix();this._cameraPosition.x=s.m[12],this._cameraPosition.y=s.m[13],this._cameraPosition.z=s.m[14],this._activeEffect.setVector3("cameraPosition",f.TmpVectors.Vector3[0].copyFrom(this._cameraPosition).subtractInPlace(o.floatingOriginOffset))}if(this._activeEffect.setVector3("cameraOffset",this.cameraOffset),this._activeEffect.setVector3("up",this.up),this.luminance>0&&this._activeEffect.setFloat("luminance",this.luminance),this._activeEffect.setFloat("turbidity",this.turbidity),this._activeEffect.setFloat("rayleigh",this.rayleigh),this._activeEffect.setFloat("mieCoefficient",this.mieCoefficient),this._activeEffect.setFloat("mieDirectionalG",this.mieDirectionalG),!this.useSunPosition){var c=Math.PI*(this.inclination-.5),l=2*Math.PI*(this.azimuth-.5);this.sunPosition.x=this.distance*Math.cos(l)*Math.cos(c),this.sunPosition.y=this.distance*Math.sin(-c),this.sunPosition.z=this.distance*Math.sin(l)*Math.cos(c),f.Quaternion.FromUnitVectorsToRef(f.Vector3.UpReadOnly,this.up,this._skyOrientation),this.sunPosition.rotateByQuaternionToRef(this._skyOrientation,this.sunPosition)}this._activeEffect.setVector3("sunPosition",this.sunPosition),this._afterBind(t,this._activeEffect,i)}}},t.prototype.getAnimatables=function(){return[]},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return f.SerializationHelper.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.SkyMaterial",t},t.prototype.getClassName=function(){return"SkyMaterial"},t.Parse=function(e,i,o){return f.SerializationHelper.Parse(function(){return new t(e.name,i)},e,i,o)},l([(0,f.serialize)()],t.prototype,"luminance",void 0),l([(0,f.serialize)()],t.prototype,"turbidity",void 0),l([(0,f.serialize)()],t.prototype,"rayleigh",void 0),l([(0,f.serialize)()],t.prototype,"mieCoefficient",void 0),l([(0,f.serialize)()],t.prototype,"mieDirectionalG",void 0),l([(0,f.serialize)()],t.prototype,"distance",void 0),l([(0,f.serialize)()],t.prototype,"inclination",void 0),l([(0,f.serialize)()],t.prototype,"azimuth",void 0),l([(0,f.serializeAsVector3)()],t.prototype,"sunPosition",void 0),l([(0,f.serialize)()],t.prototype,"useSunPosition",void 0),l([(0,f.serializeAsVector3)()],t.prototype,"cameraOffset",void 0),l([(0,f.serializeAsVector3)()],t.prototype,"up",void 0),l([(0,f.serialize)()],t.prototype,"dithering",void 0),t}(f.PushMaterial);(0,f.RegisterClass)("BABYLON.SkyMaterial",h);var v=void 0!==o.g?o.g:"undefined"!=typeof window?window:void 0;if(void 0!==v)for(var m in r)v.BABYLON[m]=r[m];const y=a;return n.default})());
|
|
2
|
-
//# sourceMappingURL=babylon.skyMaterial.min.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-materials",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-materials"]=t(require("babylonjs")):e.MATERIALS=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,e=>(()=>{"use strict";var t={597(t){t.exports=e}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.d(n,{default:()=>h});var o={};r.r(o),r.d(o,{TerrainMaterial:()=>m});var s={};r.r(s),r.d(s,{TerrainMaterial:()=>m});var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},a(e,t)};function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function f(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var l=r(597),d="terrainPixelShader";l.ShaderStore.ShadersStore[d]||(l.ShaderStore.ShadersStore[d]="precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);}\n#endif\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(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(textureSampler,vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\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\nvec3 specularBase=vec3(0.,0.,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*baseColor.rgb,0.0,1.0);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");var p="terrainVertexShader";l.ShaderStore.ShadersStore[p]||(l.ShaderStore.ShadersStore[p]="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\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#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 NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\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");var c=function(e){function t(){var t=e.call(this)||this;return t.DIFFUSE=!1,t.BUMP=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.ALPHATEST=!1,t.DEPTHPREPASS=!1,t.POINTSIZE=!1,t.FOG=!1,t.SPECULARTERM=!1,t.NORMAL=!1,t.UV1=!1,t.UV2=!1,t.VERTEXCOLOR=!1,t.VERTEXALPHA=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.INSTANCES=!1,t.INSTANCESCOLOR=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.SKIPFINALCOLORCLAMP=!1,t.LOGARITHMICDEPTH=!1,t.AREALIGHTSUPPORTED=!0,t.AREALIGHTNOROUGHTNESS=!0,t.rebuild(),t}return u(t,e),t}(l.MaterialDefines),m=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.diffuseColor=new l.Color3(1,1,1),r.specularColor=new l.Color3(0,0,0),r.specularPower=64,r._disableLighting=!1,r._maxSimultaneousLights=4,r}return u(t,e),t.prototype.needAlphaBlending=function(){return this.alpha<1},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(e,t,i){var r=t._drawWrapper;if(this.isFrozen&&r.effect&&r._wasPreviouslyReady&&r._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(t.materialDefines=new c);var n=t.materialDefines,o=this.getScene();if(this._isReadyForSubMesh(t))return!0;var s=o.getEngine();if(o.texturesEnabled){if(!this.mixTexture||!this.mixTexture.isReady())return!1;if(n._needUVs=!0,l.MaterialFlags.DiffuseTextureEnabled){if(!this.diffuseTexture1||!this.diffuseTexture1.isReady())return!1;if(!this.diffuseTexture2||!this.diffuseTexture2.isReady())return!1;if(!this.diffuseTexture3||!this.diffuseTexture3.isReady())return!1;n.DIFFUSE=!0}if(this.bumpTexture1&&this.bumpTexture2&&this.bumpTexture3&&l.MaterialFlags.BumpTextureEnabled){if(!this.bumpTexture1.isReady())return!1;if(!this.bumpTexture2.isReady())return!1;if(!this.bumpTexture3.isReady())return!1;n._needNormals=!0,n.BUMP=!0}}if((0,l.PrepareDefinesForMisc)(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),n,void 0,void 0,void 0,this._isVertexOutputInvariant),n._needNormals=(0,l.PrepareDefinesForLights)(o,e,n,!1,this._maxSimultaneousLights,this._disableLighting),(0,l.PrepareDefinesForFrameBoundValues)(o,s,this,n,!!i),(0,l.PrepareDefinesForAttributes)(e,n,!0,!0),n.isDirty){n.markAsProcessed(),o.resetCachedMaterial();var a=new l.EffectFallbacks;n.FOG&&a.addFallback(1,"FOG"),(0,l.HandleFallbacksForShadows)(n,a,this.maxSimultaneousLights),n.NUM_BONE_INFLUENCERS>0&&a.addCPUSkinningFallback(0,e),n.IMAGEPROCESSINGPOSTPROCESS=o.imageProcessingConfiguration.applyByPostProcess;var u=[l.VertexBuffer.PositionKind];n.NORMAL&&u.push(l.VertexBuffer.NormalKind),n.UV1&&u.push(l.VertexBuffer.UVKind),n.UV2&&u.push(l.VertexBuffer.UV2Kind),n.VERTEXCOLOR&&u.push(l.VertexBuffer.ColorKind),(0,l.PrepareAttributesForBones)(u,e,n,a),(0,l.PrepareAttributesForInstances)(u,n);var f=n.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vTextureInfos","mBones","textureMatrix","diffuse1Infos","diffuse2Infos","diffuse3Infos"],p=["textureSampler","diffuse1Sampler","diffuse2Sampler","diffuse3Sampler","bump1Sampler","bump2Sampler","bump3Sampler","logarithmicDepthConstant","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],m=[];(0,l.AddClipPlaneUniforms)(d),(0,l.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:m,samplers:p,defines:n,maxSimultaneousLights:this.maxSimultaneousLights}),t.setEffect(o.getEngine().createEffect("terrain",{attributes:u,uniformsNames:d,uniformBuffersNames:m,samplers:p,defines:f,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},s),n,this._materialContext)}if(n.AREALIGHTUSED)for(var v=0;v<e.lightSources.length;v++)if(!e.lightSources[v]._isReady())return!1;return!(!t.effect||!t.effect.isReady()||(n._renderId=o.getRenderId(),r._wasPreviouslyReady=!0,r._wasPreviouslyUsingInstances=!!i,0))},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),n=i.materialDefines;if(n){var o=i.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("view",r.getViewMatrix()),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),(0,l.BindBonesParameters)(t,this._activeEffect),this._mustRebind(r,o,i)&&(this.mixTexture&&(this._activeEffect.setTexture("textureSampler",this._mixTexture),this._activeEffect.setFloat2("vTextureInfos",this._mixTexture.coordinatesIndex,this._mixTexture.level),this._activeEffect.setMatrix("textureMatrix",this._mixTexture.getTextureMatrix()),l.MaterialFlags.DiffuseTextureEnabled&&(this._diffuseTexture1&&(this._activeEffect.setTexture("diffuse1Sampler",this._diffuseTexture1),this._activeEffect.setFloat2("diffuse1Infos",this._diffuseTexture1.uScale,this._diffuseTexture1.vScale)),this._diffuseTexture2&&(this._activeEffect.setTexture("diffuse2Sampler",this._diffuseTexture2),this._activeEffect.setFloat2("diffuse2Infos",this._diffuseTexture2.uScale,this._diffuseTexture2.vScale)),this._diffuseTexture3&&(this._activeEffect.setTexture("diffuse3Sampler",this._diffuseTexture3),this._activeEffect.setFloat2("diffuse3Infos",this._diffuseTexture3.uScale,this._diffuseTexture3.vScale))),l.MaterialFlags.BumpTextureEnabled&&r.getEngine().getCaps().standardDerivatives&&(this._bumpTexture1&&this._activeEffect.setTexture("bump1Sampler",this._bumpTexture1),this._bumpTexture2&&this._activeEffect.setTexture("bump2Sampler",this._bumpTexture2),this._bumpTexture3&&this._activeEffect.setTexture("bump3Sampler",this._bumpTexture3))),(0,l.BindClipPlane)(o,this,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,l.BindLogDepth)(n,o,r),r.bindEyePosition(o)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*t.visibility),n.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),r.lightsEnabled&&!this.disableLighting&&(0,l.BindLights)(r,t,this._activeEffect,n,this.maxSimultaneousLights),r.fogEnabled&&t.applyFog&&r.fogMode!==l.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),(0,l.BindFogParameters)(r,t,this._activeEffect),this._afterBind(t,this._activeEffect,i))}},t.prototype.getAnimatables=function(){var e=[];return this.mixTexture&&this.mixTexture.animations&&this.mixTexture.animations.length>0&&e.push(this.mixTexture),e},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._mixTexture&&t.push(this._mixTexture),this._diffuseTexture1&&t.push(this._diffuseTexture1),this._diffuseTexture2&&t.push(this._diffuseTexture2),this._diffuseTexture3&&t.push(this._diffuseTexture3),this._bumpTexture1&&t.push(this._bumpTexture1),this._bumpTexture2&&t.push(this._bumpTexture2),this._bumpTexture3&&t.push(this._bumpTexture3),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||this._mixTexture===t||this._diffuseTexture1===t||this._diffuseTexture2===t||this._diffuseTexture3===t||this._bumpTexture1===t||this._bumpTexture2===t||this._bumpTexture3===t},t.prototype.dispose=function(t){this.mixTexture&&this.mixTexture.dispose(),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var i=this;return l.SerializationHelper.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.customType="BABYLON.TerrainMaterial",t},t.prototype.getClassName=function(){return"TerrainMaterial"},t.Parse=function(e,i,r){return l.SerializationHelper.Parse(function(){return new t(e.name,i)},e,i,r)},f([(0,l.serializeAsTexture)("mixTexture")],t.prototype,"_mixTexture",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"mixTexture",void 0),f([(0,l.serializeAsTexture)("diffuseTexture1")],t.prototype,"_diffuseTexture1",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture1",void 0),f([(0,l.serializeAsTexture)("diffuseTexture2")],t.prototype,"_diffuseTexture2",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture2",void 0),f([(0,l.serializeAsTexture)("diffuseTexture3")],t.prototype,"_diffuseTexture3",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture3",void 0),f([(0,l.serializeAsTexture)("bumpTexture1")],t.prototype,"_bumpTexture1",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture1",void 0),f([(0,l.serializeAsTexture)("bumpTexture2")],t.prototype,"_bumpTexture2",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture2",void 0),f([(0,l.serializeAsTexture)("bumpTexture3")],t.prototype,"_bumpTexture3",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture3",void 0),f([(0,l.serializeAsColor3)()],t.prototype,"diffuseColor",void 0),f([(0,l.serializeAsColor3)()],t.prototype,"specularColor",void 0),f([(0,l.serialize)()],t.prototype,"specularPower",void 0),f([(0,l.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),f([(0,l.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),f([(0,l.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),t}(l.PushMaterial);(0,l.RegisterClass)("BABYLON.TerrainMaterial",m);var v=void 0!==r.g?r.g:"undefined"!=typeof window?window:void 0;if(void 0!==v)for(var x in o)v.BABYLON[x]=o[x];const h=s;return n.default})());
|
|
2
|
-
//# sourceMappingURL=babylon.terrainMaterial.min.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-materials",["babylonjs"],i):"object"==typeof exports?exports["babylonjs-materials"]=i(require("babylonjs")):e.MATERIALS=i(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,e=>(()=>{"use strict";var i={597(i){i.exports=e}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return i[e](o,o.exports,t),o.exports}t.d=(e,i)=>{for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.d(n,{default:()=>T});var o={};t.r(o),t.d(o,{TriPlanarMaterial:()=>m});var a={};t.r(a),t.d(a,{TriPlanarMaterial:()=>m});var s=function(e,i){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},s(e,i)};function l(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}s(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}function f(e,i,r,t){var n,o=arguments.length,a=o<3?i:null===t?t=Object.getOwnPropertyDescriptor(i,r):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,i,r,t);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(i,r,a):n(i,r))||a);return o>3&&a&&Object.defineProperty(i,r,a),a}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var u=t(597),d="triplanarPixelShader";u.ShaderStore.ShadersStore[d]||(u.ShaderStore.ShadersStore[d]="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");var c="triplanarVertexShader";u.ShaderStore.ShadersStore[c]||(u.ShaderStore.ShadersStore[c]="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");var p=function(e){function i(){var i=e.call(this)||this;return i.DIFFUSEX=!1,i.DIFFUSEY=!1,i.DIFFUSEZ=!1,i.BUMPX=!1,i.BUMPY=!1,i.BUMPZ=!1,i.CLIPPLANE=!1,i.CLIPPLANE2=!1,i.CLIPPLANE3=!1,i.CLIPPLANE4=!1,i.CLIPPLANE5=!1,i.CLIPPLANE6=!1,i.ALPHATEST=!1,i.DEPTHPREPASS=!1,i.POINTSIZE=!1,i.FOG=!1,i.SPECULARTERM=!1,i.NORMAL=!1,i.VERTEXCOLOR=!1,i.VERTEXALPHA=!1,i.NUM_BONE_INFLUENCERS=0,i.BonesPerMesh=0,i.INSTANCES=!1,i.INSTANCESCOLOR=!1,i.IMAGEPROCESSINGPOSTPROCESS=!1,i.SKIPFINALCOLORCLAMP=!1,i.NONUNIFORMSCALING=!1,i.LOGARITHMICDEPTH=!1,i.AREALIGHTSUPPORTED=!0,i.AREALIGHTNOROUGHTNESS=!0,i.rebuild(),i}return l(i,e),i}(u.MaterialDefines),m=function(e){function i(i,r){var t=e.call(this,i,r)||this;return t.tileSize=1,t.diffuseColor=new u.Color3(1,1,1),t.specularColor=new u.Color3(.2,.2,.2),t.specularPower=64,t._disableLighting=!1,t._maxSimultaneousLights=4,t}return l(i,e),i.prototype.needAlphaBlending=function(){return this.alpha<1},i.prototype.needAlphaTesting=function(){return!1},i.prototype.getAlphaTestTexture=function(){return null},i.prototype.isReadyForSubMesh=function(e,i,r){var t=i._drawWrapper;if(this.isFrozen&&t.effect&&t._wasPreviouslyReady&&t._wasPreviouslyUsingInstances===r)return!0;i.materialDefines||(i.materialDefines=new p);var n=i.materialDefines,o=this.getScene();if(this._isReadyForSubMesh(i))return!0;var a=o.getEngine();if(n._areTexturesDirty&&o.texturesEnabled){if(u.MaterialFlags.DiffuseTextureEnabled)for(var s=[this.diffuseTextureX,this.diffuseTextureY,this.diffuseTextureZ],l=["DIFFUSEX","DIFFUSEY","DIFFUSEZ"],f=0;f<s.length;f++)if(s[f]){if(!s[f].isReady())return!1;n[l[f]]=!0}if(u.MaterialFlags.BumpTextureEnabled)for(s=[this.normalTextureX,this.normalTextureY,this.normalTextureZ],l=["BUMPX","BUMPY","BUMPZ"],f=0;f<s.length;f++)if(s[f]){if(!s[f].isReady())return!1;n[l[f]]=!0}}if((0,u.PrepareDefinesForMisc)(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),n,void 0,void 0,void 0,this._isVertexOutputInvariant),n._needNormals=(0,u.PrepareDefinesForLights)(o,e,n,!1,this._maxSimultaneousLights,this._disableLighting),(0,u.PrepareDefinesForFrameBoundValues)(o,a,this,n,!!r),(0,u.PrepareDefinesForAttributes)(e,n,!0,!0),n.isDirty){n.markAsProcessed(),o.resetCachedMaterial();var d=new u.EffectFallbacks;n.FOG&&d.addFallback(1,"FOG"),(0,u.HandleFallbacksForShadows)(n,d,this.maxSimultaneousLights),n.NUM_BONE_INFLUENCERS>0&&d.addCPUSkinningFallback(0,e),n.IMAGEPROCESSINGPOSTPROCESS=o.imageProcessingConfiguration.applyByPostProcess;var c=[u.VertexBuffer.PositionKind];n.NORMAL&&c.push(u.VertexBuffer.NormalKind),n.VERTEXCOLOR&&c.push(u.VertexBuffer.ColorKind),(0,u.PrepareAttributesForBones)(c,e,n,d),(0,u.PrepareAttributesForInstances)(c,n);var m=n.toString(),h=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","mBones","tileSize"],v=["diffuseSamplerX","diffuseSamplerY","diffuseSamplerZ","normalSamplerX","normalSamplerY","normalSamplerZ","logarithmicDepthConstant","areaLightsLTC1Sampler","areaLightsLTC2Sampler"],T=[];(0,u.AddClipPlaneUniforms)(h),(0,u.PrepareUniformsAndSamplersList)({uniformsNames:h,uniformBuffersNames:T,samplers:v,defines:n,maxSimultaneousLights:this.maxSimultaneousLights}),i.setEffect(o.getEngine().createEffect("triplanar",{attributes:c,uniformsNames:h,uniformBuffersNames:T,samplers:v,defines:m,fallbacks:d,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this.maxSimultaneousLights}},a),n,this._materialContext)}if(n.AREALIGHTUSED)for(var S=0;S<e.lightSources.length;S++)if(!e.lightSources[S]._isReady())return!1;return!(!i.effect||!i.effect.isReady()||(n._renderId=o.getRenderId(),t._wasPreviouslyReady=!0,t._wasPreviouslyUsingInstances=!!r,0))},i.prototype.bindForSubMesh=function(e,i,r){var t=this.getScene(),n=r.materialDefines;if(n){var o=r.effect;o&&(this._activeEffect=o,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",t.getTransformMatrix()),(0,u.BindBonesParameters)(i,this._activeEffect),this._activeEffect.setFloat("tileSize",this.tileSize),this._mustRebind(t,o,r)&&(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),(0,u.BindClipPlane)(o,this,t),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,u.BindLogDepth)(n,o,t),t.bindEyePosition(o)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*i.visibility),n.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),t.lightsEnabled&&!this.disableLighting&&(0,u.BindLights)(t,i,this._activeEffect,n,this.maxSimultaneousLights),t.fogEnabled&&i.applyFog&&t.fogMode!==u.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",t.getViewMatrix()),(0,u.BindFogParameters)(t,i,this._activeEffect),this._afterBind(i,this._activeEffect,r))}},i.prototype.getAnimatables=function(){var e=[];return this.mixTexture&&this.mixTexture.animations&&this.mixTexture.animations.length>0&&e.push(this.mixTexture),e},i.prototype.getActiveTextures=function(){var i=e.prototype.getActiveTextures.call(this);return this._diffuseTextureX&&i.push(this._diffuseTextureX),this._diffuseTextureY&&i.push(this._diffuseTextureY),this._diffuseTextureZ&&i.push(this._diffuseTextureZ),this._normalTextureX&&i.push(this._normalTextureX),this._normalTextureY&&i.push(this._normalTextureY),this._normalTextureZ&&i.push(this._normalTextureZ),i},i.prototype.hasTexture=function(i){return!!e.prototype.hasTexture.call(this,i)||this._diffuseTextureX===i||this._diffuseTextureY===i||this._diffuseTextureZ===i||this._normalTextureX===i||this._normalTextureY===i||this._normalTextureZ===i},i.prototype.dispose=function(i){this.mixTexture&&this.mixTexture.dispose(),e.prototype.dispose.call(this,i)},i.prototype.clone=function(e){var r=this;return u.SerializationHelper.Clone(function(){return new i(e,r.getScene())},this)},i.prototype.serialize=function(){var i=e.prototype.serialize.call(this);return i.customType="BABYLON.TriPlanarMaterial",i},i.prototype.getClassName=function(){return"TriPlanarMaterial"},i.Parse=function(e,r,t){return u.SerializationHelper.Parse(function(){return new i(e.name,r)},e,r,t)},f([(0,u.serializeAsTexture)()],i.prototype,"mixTexture",void 0),f([(0,u.serializeAsTexture)("diffuseTextureX")],i.prototype,"_diffuseTextureX",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"diffuseTextureX",void 0),f([(0,u.serializeAsTexture)("diffuseTexturY")],i.prototype,"_diffuseTextureY",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"diffuseTextureY",void 0),f([(0,u.serializeAsTexture)("diffuseTextureZ")],i.prototype,"_diffuseTextureZ",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"diffuseTextureZ",void 0),f([(0,u.serializeAsTexture)("normalTextureX")],i.prototype,"_normalTextureX",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"normalTextureX",void 0),f([(0,u.serializeAsTexture)("normalTextureY")],i.prototype,"_normalTextureY",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"normalTextureY",void 0),f([(0,u.serializeAsTexture)("normalTextureZ")],i.prototype,"_normalTextureZ",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],i.prototype,"normalTextureZ",void 0),f([(0,u.serialize)()],i.prototype,"tileSize",void 0),f([(0,u.serializeAsColor3)()],i.prototype,"diffuseColor",void 0),f([(0,u.serializeAsColor3)()],i.prototype,"specularColor",void 0),f([(0,u.serialize)()],i.prototype,"specularPower",void 0),f([(0,u.serialize)("disableLighting")],i.prototype,"_disableLighting",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsLightsDirty")],i.prototype,"disableLighting",void 0),f([(0,u.serialize)("maxSimultaneousLights")],i.prototype,"_maxSimultaneousLights",void 0),f([(0,u.expandToProperty)("_markAllSubMeshesAsLightsDirty")],i.prototype,"maxSimultaneousLights",void 0),i}(u.PushMaterial);(0,u.RegisterClass)("BABYLON.TriPlanarMaterial",m);var h=void 0!==t.g?t.g:"undefined"!=typeof window?window:void 0;if(void 0!==h)for(var v in o)h.BABYLON[v]=o[v];const T=a;return n.default})());
|
|
2
|
-
//# sourceMappingURL=babylon.triPlanarMaterial.min.js.map
|
package/babylon.waterMaterial.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-materials",["babylonjs"],r):"object"==typeof exports?exports["babylonjs-materials"]=r(require("babylonjs")):e.MATERIALS=r(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,e=>(()=>{"use strict";var r={597(r){r.exports=e}},i={};function t(e){var o=i[e];if(void 0!==o)return o.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,t),n.exports}t.d=(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};t.d(o,{default:()=>h});var n={};t.r(n),t.d(n,{WaterMaterial:()=>v});var a={};t.r(a),t.d(a,{WaterMaterial:()=>v});var s=function(e,r){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},s(e,r)};function l(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=e}s(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}function f(e,r,i,t){var o,n=arguments.length,a=n<3?r:null===t?t=Object.getOwnPropertyDescriptor(r,i):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,r,i,t);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(r,i,a):o(r,i))||a);return n>3&&a&&Object.defineProperty(r,i,a),a}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var c=t(597),d="waterPixelShader";c.ShaderStore.ShadersStore[d]||(c.ShaderStore.ShadersStore[d]="#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform sampler2D normalSampler;uniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\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(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;float alpha=vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));\n#else\nbaseColor=texture2D(normalSampler,vNormalUV);\n#endif\nvec3 bumpColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nbaseColor.rgb*=vNormalInfos.y;\n#else\nvec3 bumpColor=vec3(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec2 perturbation=bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\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]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\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\n#else \n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation;vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\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]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\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\n#endif\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n");var u="waterVertexShader";c.ShaderStore.ShadersStore[u]||(c.ShaderStore.ShadersStore[u]="precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;uniform vec2 vNormalInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\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);vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef BUMP\nif (vNormalInfos.x==0.)\n{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));\n#endif\n}\nelse\n{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvec3 p=worldPos.xyz;\n#else\nvec3 p=position;\n#endif\nfloat newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY);\n#ifdef USE_WORLD_COORDINATES\ngl_Position=viewProjection*vec4(p,1.0);\n#else\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#endif\n#ifdef REFLECTION\nvRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n");var p=function(e){function r(){var r=e.call(this)||this;return r.BUMP=!1,r.REFLECTION=!1,r.CLIPPLANE=!1,r.CLIPPLANE2=!1,r.CLIPPLANE3=!1,r.CLIPPLANE4=!1,r.CLIPPLANE5=!1,r.CLIPPLANE6=!1,r.ALPHATEST=!1,r.DEPTHPREPASS=!1,r.POINTSIZE=!1,r.FOG=!1,r.NORMAL=!1,r.UV1=!1,r.UV2=!1,r.VERTEXCOLOR=!1,r.VERTEXALPHA=!1,r.NUM_BONE_INFLUENCERS=0,r.BonesPerMesh=0,r.INSTANCES=!1,r.INSTANCESCOLOR=!1,r.SPECULARTERM=!1,r.LOGARITHMICDEPTH=!1,r.USE_REVERSE_DEPTHBUFFER=!1,r.FRESNELSEPARATE=!1,r.BUMPSUPERIMPOSE=!1,r.BUMPAFFECTSREFLECTION=!1,r.USE_WORLD_COORDINATES=!1,r.IMAGEPROCESSING=!1,r.VIGNETTE=!1,r.VIGNETTEBLENDMODEMULTIPLY=!1,r.VIGNETTEBLENDMODEOPAQUE=!1,r.TONEMAPPING=0,r.CONTRAST=!1,r.EXPOSURE=!1,r.COLORCURVES=!1,r.COLORGRADING=!1,r.COLORGRADING3D=!1,r.SAMPLER3DGREENDEPTH=!1,r.SAMPLER3DBGRMAP=!1,r.DITHER=!1,r.IMAGEPROCESSINGPOSTPROCESS=!1,r.SKIPFINALCOLORCLAMP=!1,r.rebuild(),r}return l(r,e),r}(c.MaterialDefines),v=function(e){function r(r,i,t){void 0===t&&(t=new c.Vector2(512,512));var o=e.call(this,r,i)||this;return o.renderTargetSize=t,o.diffuseColor=new c.Color3(1,1,1),o.specularColor=new c.Color3(0,0,0),o.specularPower=64,o._disableLighting=!1,o._maxSimultaneousLights=4,o.windForce=6,o.windDirection=new c.Vector2(0,1),o.waveHeight=.4,o.bumpHeight=.4,o._bumpSuperimpose=!1,o._fresnelSeparate=!1,o._bumpAffectsReflection=!1,o.waterColor=new c.Color3(.1,.1,.6),o.colorBlendFactor=.2,o.waterColor2=new c.Color3(.1,.1,.6),o.colorBlendFactor2=.2,o.waveLength=.1,o.waveSpeed=1,o.waveCount=20,o.disableClipPlane=!1,o._useWorldCoordinatesForWaveDeformation=!1,o._renderTargets=new c.SmartArray(16),o._mesh=null,o._reflectionTransform=c.Matrix.Zero(),o._offsetMirror=c.Matrix.Zero(),o._tempPlane=new c.Plane(0,0,0,0),o._lastTime=0,o._lastDeltaTime=0,o._createRenderTargets(o.getScene(),t),o.getRenderTargetTextures=function(){return o._renderTargets.reset(),o._renderTargets.push(o._reflectionRTT),o._renderTargets.push(o._refractionRTT),o._renderTargets},o._imageProcessingConfiguration=o.getScene().imageProcessingConfiguration,o._imageProcessingConfiguration&&(o._imageProcessingObserver=o._imageProcessingConfiguration.onUpdateParameters.add(function(){o._markAllSubMeshesAsImageProcessingDirty()})),o}return l(r,e),Object.defineProperty(r.prototype,"hasRenderTargetTextures",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"refractionTexture",{get:function(){return this._refractionRTT},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"reflectionTexture",{get:function(){return this._reflectionRTT},enumerable:!1,configurable:!0}),r.prototype.addToRenderList=function(e){this._refractionRTT&&this._refractionRTT.renderList&&this._refractionRTT.renderList.push(e),this._reflectionRTT&&this._reflectionRTT.renderList&&this._reflectionRTT.renderList.push(e)},r.prototype.removeFromRenderList=function(e){var r;this._refractionRTT&&this._refractionRTT.renderList&&-1!==(r=this._refractionRTT.renderList.indexOf(e))&&this._refractionRTT.renderList.splice(r,1),this._reflectionRTT&&this._reflectionRTT.renderList&&-1!==(r=this._reflectionRTT.renderList.indexOf(e))&&this._reflectionRTT.renderList.splice(r,1)},r.prototype.enableRenderTargets=function(e){var r=e?1:0;this._refractionRTT&&(this._refractionRTT.refreshRate=r),this._reflectionRTT&&(this._reflectionRTT.refreshRate=r)},r.prototype.getRenderList=function(){return this._refractionRTT?this._refractionRTT.renderList:[]},Object.defineProperty(r.prototype,"renderTargetsEnabled",{get:function(){return!(this._refractionRTT&&0===this._refractionRTT.refreshRate)},enumerable:!1,configurable:!0}),r.prototype.needAlphaBlending=function(){return this.alpha<1},r.prototype.needAlphaTesting=function(){return!1},r.prototype.getAlphaTestTexture=function(){return null},r.prototype.isReadyForSubMesh=function(e,r,i){var t=r._drawWrapper;if(this.isFrozen&&t.effect&&t._wasPreviouslyReady&&t._wasPreviouslyUsingInstances===i)return!0;r.materialDefines||(r.materialDefines=new p);var o=r.materialDefines,n=this.getScene();if(this._isReadyForSubMesh(r))return!0;var a=n.getEngine();if(o._areTexturesDirty&&(o._needUVs=!1,n.texturesEnabled)){if(this.bumpTexture&&c.MaterialFlags.BumpTextureEnabled){if(!this.bumpTexture.isReady())return!1;o._needUVs=!0,o.BUMP=!0}c.MaterialFlags.ReflectionTextureEnabled&&(o.REFLECTION=!0)}if((0,c.PrepareDefinesForFrameBoundValues)(n,a,this,o,!!i),(0,c.PrepareDefinesForMisc)(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),o,void 0,void 0,void 0,this._isVertexOutputInvariant),o._areMiscDirty&&(o.FRESNELSEPARATE=this._fresnelSeparate,o.BUMPSUPERIMPOSE=this._bumpSuperimpose,o.BUMPAFFECTSREFLECTION=this._bumpAffectsReflection,o.USE_WORLD_COORDINATES=this._useWorldCoordinatesForWaveDeformation),o._needNormals=(0,c.PrepareDefinesForLights)(n,e,o,!0,this._maxSimultaneousLights,this._disableLighting),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o),o.IS_REFLECTION_LINEAR=null!=this.reflectionTexture&&!this.reflectionTexture.gammaSpace,o.IS_REFRACTION_LINEAR=null!=this.refractionTexture&&!this.refractionTexture.gammaSpace}if((0,c.PrepareDefinesForAttributes)(e,o,!0,!0),this._mesh=e,this._waitingRenderList){for(var s=0;s<this._waitingRenderList.length;s++)this.addToRenderList(n.getNodeById(this._waitingRenderList[s]));this._waitingRenderList=null}if(o.isDirty){o.markAsProcessed(),n.resetCachedMaterial();var l=new c.EffectFallbacks;o.FOG&&l.addFallback(1,"FOG"),o.LOGARITHMICDEPTH&&l.addFallback(0,"LOGARITHMICDEPTH"),(0,c.HandleFallbacksForShadows)(o,l,this.maxSimultaneousLights),o.NUM_BONE_INFLUENCERS>0&&l.addCPUSkinningFallback(0,e);var f=[c.VertexBuffer.PositionKind];o.NORMAL&&f.push(c.VertexBuffer.NormalKind),o.UV1&&f.push(c.VertexBuffer.UVKind),o.UV2&&f.push(c.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&f.push(c.VertexBuffer.ColorKind),(0,c.PrepareAttributesForBones)(f,e,o,l),(0,c.PrepareAttributesForInstances)(f,o);var d=o.toString(),u=["world","view","viewProjection","vEyePosition","vLightsType","vDiffuseColor","vSpecularColor","vFogInfos","vFogColor","pointSize","vNormalInfos","mBones","normalMatrix","logarithmicDepthConstant","reflectionViewProjection","windDirection","waveLength","time","windForce","cameraPosition","bumpHeight","waveHeight","waterColor","waterColor2","colorBlendFactor","colorBlendFactor2","waveSpeed","waveCount"],v=["normalSampler","refractionSampler","reflectionSampler"],m=[];c.ImageProcessingConfiguration&&(c.ImageProcessingConfiguration.PrepareUniforms(u,o),c.ImageProcessingConfiguration.PrepareSamplers(v,o)),(0,c.AddClipPlaneUniforms)(u),(0,c.PrepareUniformsAndSamplersList)({uniformsNames:u,uniformBuffersNames:m,samplers:v,defines:o,maxSimultaneousLights:this.maxSimultaneousLights}),r.setEffect(n.getEngine().createEffect("water",{attributes:f,uniformsNames:u,uniformBuffersNames:m,samplers:v,defines:d,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},a),o,this._materialContext)}return!(!r.effect||!r.effect.isReady()||(o._renderId=n.getRenderId(),t._wasPreviouslyReady=!0,t._wasPreviouslyUsingInstances=!!i,0))},r.prototype.bindForSubMesh=function(e,r,i){var t=this.getScene(),o=i.materialDefines;if(o){var n=i.effect;if(n&&this._mesh){this._activeEffect=n,this.bindOnlyWorldMatrix(e),this._activeEffect.setMatrix("viewProjection",t.getTransformMatrix()),(0,c.BindBonesParameters)(r,this._activeEffect),this._mustRebind(t,n,i)&&(this.bumpTexture&&c.MaterialFlags.BumpTextureEnabled&&(this._activeEffect.setTexture("normalSampler",this.bumpTexture),this._activeEffect.setFloat2("vNormalInfos",this.bumpTexture.coordinatesIndex,this.bumpTexture.level),this._activeEffect.setMatrix("normalMatrix",this.bumpTexture.getTextureMatrix())),(0,c.BindClipPlane)(n,this,t),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._useLogarithmicDepth&&(0,c.BindLogDepth)(o,n,t),t.bindEyePosition(n)),this._activeEffect.setColor4("vDiffuseColor",this.diffuseColor,this.alpha*r.visibility),o.SPECULARTERM&&this._activeEffect.setColor4("vSpecularColor",this.specularColor,this.specularPower),t.lightsEnabled&&!this.disableLighting&&(0,c.BindLights)(t,r,this._activeEffect,o,this.maxSimultaneousLights),t.fogEnabled&&r.applyFog&&t.fogMode!==c.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",t.getViewMatrix()),(0,c.BindFogParameters)(t,r,this._activeEffect),(0,c.BindLogDepth)(o,this._activeEffect,t),c.MaterialFlags.ReflectionTextureEnabled&&(this._activeEffect.setTexture("refractionSampler",this._refractionRTT),this._activeEffect.setTexture("reflectionSampler",this._reflectionRTT));var a=c.TmpVectors.Matrix[3].copyFrom(this._reflectionTransform);if(t.floatingOriginMode){var s=(0,c.OffsetViewToRef)(t.floatingOriginOffset,t.getViewMatrix(),c.TmpVectors.Matrix[1]);(0,c.MultiplyMatricesToRef)(this._offsetMirror,s,a)}a.multiplyToRef(t.getProjectionMatrix(),a);var l=t.getEngine().getDeltaTime();l!==this._lastDeltaTime&&(this._lastDeltaTime=l,this._lastTime+=this._lastDeltaTime),this._activeEffect.setMatrix("reflectionViewProjection",a),this._activeEffect.setVector2("windDirection",this.windDirection),this._activeEffect.setFloat("waveLength",this.waveLength),this._activeEffect.setFloat("time",this._lastTime/1e5),this._activeEffect.setFloat("windForce",this.windForce),this._activeEffect.setFloat("waveHeight",this.waveHeight),this._activeEffect.setFloat("bumpHeight",this.bumpHeight),this._activeEffect.setColor4("waterColor",this.waterColor,1),this._activeEffect.setFloat("colorBlendFactor",this.colorBlendFactor),this._activeEffect.setColor4("waterColor2",this.waterColor2,1),this._activeEffect.setFloat("colorBlendFactor2",this.colorBlendFactor2),this._activeEffect.setFloat("waveSpeed",this.waveSpeed),this._activeEffect.setFloat("waveCount",this.waveCount),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect),this._afterBind(r,this._activeEffect,i)}}},r.prototype._createRenderTargets=function(e,r){var i=this;this._refractionRTT=new c.RenderTargetTexture(name+"_refraction",{width:r.x,height:r.y},e,!1,!0),this._refractionRTT.wrapU=c.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.wrapV=c.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._refractionRTT.ignoreCameraViewport=!0;var t,o=!1;this._refractionRTT.onBeforeRenderObservable.add(function(){o=e.getBoundingBoxRenderer().enabled,e.getBoundingBoxRenderer().enabled=!1}),this._refractionRTT.onAfterRenderObservable.add(function(){e.getBoundingBoxRenderer().enabled=o}),this._reflectionRTT=new c.RenderTargetTexture(name+"_reflection",{width:r.x,height:r.y},e,!1,!0),this._reflectionRTT.wrapU=c.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.wrapV=c.Constants.TEXTURE_MIRROR_ADDRESSMODE,this._reflectionRTT.ignoreCameraViewport=!0;var n,a=null,s=c.Matrix.Zero();this._refractionRTT.onBeforeRender=function(){if(i._mesh&&(t=i._mesh.isVisible,i._mesh.isVisible=!1),!i.disableClipPlane){a=e.clipPlane;var r=i._mesh?i._mesh.absolutePosition.y:0;e.clipPlane=c.Plane.FromPositionAndNormal(new c.Vector3(0,r+.05,0),new c.Vector3(0,1,0))}},this._refractionRTT.onAfterRender=function(){i._mesh&&(i._mesh.isVisible=t),i.disableClipPlane||(e.clipPlane=a)},this._reflectionRTT.onBeforeRender=function(){if(i._mesh&&(t=i._mesh.isVisible,i._mesh.isVisible=!1),!i.disableClipPlane){a=e.clipPlane;var r=i._mesh?i._mesh.absolutePosition.y:0;e.clipPlane=c.Plane.FromPositionAndNormal(new c.Vector3(0,r-.05,0),new c.Vector3(0,-1,0)),c.Matrix.ReflectionToRef(e.clipPlane,s),i._offsetMirror.copyFrom(s),e.floatingOriginMode&&((0,c.OffsetClipPlaneToRef)(e.floatingOriginOffset,e.clipPlane,i._tempPlane),c.Matrix.ReflectionToRef(i._tempPlane,i._offsetMirror))}n=e.getViewMatrix(),s.multiplyToRef(n,i._reflectionTransform),e.setTransformMatrix(i._reflectionTransform,e.getProjectionMatrix());var o=c.Vector3.TransformCoordinates(e.activeCamera.position,s);e._mirroredCameraPosition=o,e._forcedViewPosition=o},this._reflectionRTT.onAfterRender=function(){i._mesh&&(i._mesh.isVisible=t),e.clipPlane=a,e.setTransformMatrix(n,e.getProjectionMatrix()),e._mirroredCameraPosition=null,e._forcedViewPosition=null}},r.prototype.getAnimatables=function(){var e=[];return this.bumpTexture&&this.bumpTexture.animations&&this.bumpTexture.animations.length>0&&e.push(this.bumpTexture),this._reflectionRTT&&this._reflectionRTT.animations&&this._reflectionRTT.animations.length>0&&e.push(this._reflectionRTT),this._refractionRTT&&this._refractionRTT.animations&&this._refractionRTT.animations.length>0&&e.push(this._refractionRTT),e},r.prototype.getActiveTextures=function(){var r=e.prototype.getActiveTextures.call(this);return this._bumpTexture&&r.push(this._bumpTexture),r},r.prototype.hasTexture=function(r){return!!e.prototype.hasTexture.call(this,r)||this._bumpTexture===r},r.prototype.dispose=function(r){this.bumpTexture&&this.bumpTexture.dispose();var i=this.getScene().customRenderTargets.indexOf(this._refractionRTT);-1!=i&&this.getScene().customRenderTargets.splice(i,1),-1!=(i=this.getScene().customRenderTargets.indexOf(this._reflectionRTT))&&this.getScene().customRenderTargets.splice(i,1),this._reflectionRTT&&this._reflectionRTT.dispose(),this._refractionRTT&&this._refractionRTT.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,r)},r.prototype.clone=function(e){var i=this;return c.SerializationHelper.Clone(function(){return new r(e,i.getScene())},this)},r.prototype.serialize=function(){var r=e.prototype.serialize.call(this);if(r.customType="BABYLON.WaterMaterial",r.renderList=[],this._refractionRTT&&this._refractionRTT.renderList)for(var i=0;i<this._refractionRTT.renderList.length;i++)r.renderList.push(this._refractionRTT.renderList[i].id);return r},r.prototype.getClassName=function(){return"WaterMaterial"},r.Parse=function(e,i,t){var o=c.SerializationHelper.Parse(function(){return new r(e.name,i)},e,i,t);return o._waitingRenderList=e.renderList,o},r.CreateDefaultMesh=function(e,r){return(0,c.CreateGround)(e,{width:512,height:512,subdivisions:32,updatable:!1},r)},f([(0,c.serializeAsTexture)("bumpTexture")],r.prototype,"_bumpTexture",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],r.prototype,"bumpTexture",void 0),f([(0,c.serializeAsColor3)()],r.prototype,"diffuseColor",void 0),f([(0,c.serializeAsColor3)()],r.prototype,"specularColor",void 0),f([(0,c.serialize)()],r.prototype,"specularPower",void 0),f([(0,c.serialize)("disableLighting")],r.prototype,"_disableLighting",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsLightsDirty")],r.prototype,"disableLighting",void 0),f([(0,c.serialize)("maxSimultaneousLights")],r.prototype,"_maxSimultaneousLights",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsLightsDirty")],r.prototype,"maxSimultaneousLights",void 0),f([(0,c.serialize)()],r.prototype,"windForce",void 0),f([(0,c.serializeAsVector2)()],r.prototype,"windDirection",void 0),f([(0,c.serialize)()],r.prototype,"waveHeight",void 0),f([(0,c.serialize)()],r.prototype,"bumpHeight",void 0),f([(0,c.serialize)("bumpSuperimpose")],r.prototype,"_bumpSuperimpose",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsMiscDirty")],r.prototype,"bumpSuperimpose",void 0),f([(0,c.serialize)("fresnelSeparate")],r.prototype,"_fresnelSeparate",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsMiscDirty")],r.prototype,"fresnelSeparate",void 0),f([(0,c.serialize)("bumpAffectsReflection")],r.prototype,"_bumpAffectsReflection",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsMiscDirty")],r.prototype,"bumpAffectsReflection",void 0),f([(0,c.serializeAsColor3)()],r.prototype,"waterColor",void 0),f([(0,c.serialize)()],r.prototype,"colorBlendFactor",void 0),f([(0,c.serializeAsColor3)()],r.prototype,"waterColor2",void 0),f([(0,c.serialize)()],r.prototype,"colorBlendFactor2",void 0),f([(0,c.serialize)()],r.prototype,"waveLength",void 0),f([(0,c.serialize)()],r.prototype,"waveSpeed",void 0),f([(0,c.serialize)()],r.prototype,"waveCount",void 0),f([(0,c.serialize)()],r.prototype,"disableClipPlane",void 0),f([(0,c.serialize)("useWorldCoordinatesForWaveDeformation")],r.prototype,"_useWorldCoordinatesForWaveDeformation",void 0),f([(0,c.expandToProperty)("_markAllSubMeshesAsMiscDirty")],r.prototype,"useWorldCoordinatesForWaveDeformation",void 0),r}(c.PushMaterial);(0,c.RegisterClass)("BABYLON.WaterMaterial",v);var m=void 0!==t.g?t.g:"undefined"!=typeof window?window:void 0;if(void 0!==m)for(var T in n)m.BABYLON[T]=n[T];const h=a;return o.default})());
|
|
2
|
-
//# sourceMappingURL=babylon.waterMaterial.min.js.map
|
package/webpack.config.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const commonConfigGenerator = require("@dev/build-tools").webpackTools.commonUMDWebpackConfiguration;
|
|
2
|
-
const path = require("path");
|
|
3
|
-
module.exports = (env) => {
|
|
4
|
-
const commonConfig = commonConfigGenerator({
|
|
5
|
-
mode: env.production ? "production" : "development",
|
|
6
|
-
devPackageName: "materials",
|
|
7
|
-
outputPath: path.resolve(__dirname),
|
|
8
|
-
entryPoints: {
|
|
9
|
-
materials: "./src/index.ts",
|
|
10
|
-
cell: "./src/cell.ts",
|
|
11
|
-
custom: "./src/custom.ts",
|
|
12
|
-
fire: "./src/fire.ts",
|
|
13
|
-
fur: "./src/fur.ts",
|
|
14
|
-
gradient: "./src/gradient.ts",
|
|
15
|
-
grid: "./src/grid.ts",
|
|
16
|
-
lava: "./src/lava.ts",
|
|
17
|
-
mix: "./src/mix.ts",
|
|
18
|
-
normal: "./src/normal.ts",
|
|
19
|
-
shadowOnly: "./src/shadowOnly.ts",
|
|
20
|
-
simple: "./src/simple.ts",
|
|
21
|
-
sky: "./src/sky.ts",
|
|
22
|
-
terrain: "./src/terrain.ts",
|
|
23
|
-
triPlanar: "./src/triPlanar.ts",
|
|
24
|
-
water: "./src/water.ts",
|
|
25
|
-
},
|
|
26
|
-
alias: {
|
|
27
|
-
materials: path.resolve(__dirname, "../../../dev/materials/src"),
|
|
28
|
-
},
|
|
29
|
-
overrideFilename: (pathData) => {
|
|
30
|
-
return pathData.chunk.name === "materials" ? `babylonjs.[name]${env.production ? ".min" : ""}.js` : `babylon.[name]Material${env.production ? ".min" : ""}.js`;
|
|
31
|
-
},
|
|
32
|
-
minToMax: true,
|
|
33
|
-
});
|
|
34
|
-
return commonConfig;
|
|
35
|
-
};
|