@babylonjs/materials 7.34.4 → 7.35.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/cell/cellMaterial.js.map +1 -1
  2. package/custom/customMaterial.js.map +1 -1
  3. package/custom/pbrCustomMaterial.js.map +1 -1
  4. package/fire/fireMaterial.js.map +1 -1
  5. package/fur/furMaterial.js.map +1 -1
  6. package/gradient/gradientMaterial.js.map +1 -1
  7. package/grid/grid.fragment.d.ts +2 -0
  8. package/grid/grid.fragment.js +4 -0
  9. package/grid/grid.fragment.js.map +1 -1
  10. package/grid/grid.vertex.d.ts +2 -0
  11. package/grid/grid.vertex.js +4 -0
  12. package/grid/grid.vertex.js.map +1 -1
  13. package/grid/gridMaterial.js +15 -6
  14. package/grid/gridMaterial.js.map +1 -1
  15. package/lava/lavaMaterial.js.map +1 -1
  16. package/legacy/legacy-cell.js.map +1 -1
  17. package/legacy/legacy-custom.js.map +1 -1
  18. package/legacy/legacy-fire.js.map +1 -1
  19. package/legacy/legacy-fur.js.map +1 -1
  20. package/legacy/legacy-gradient.js.map +1 -1
  21. package/legacy/legacy-grid.js.map +1 -1
  22. package/legacy/legacy-lava.js.map +1 -1
  23. package/legacy/legacy-mix.js.map +1 -1
  24. package/legacy/legacy-normal.js.map +1 -1
  25. package/legacy/legacy-shadowOnly.js.map +1 -1
  26. package/legacy/legacy-simple.js.map +1 -1
  27. package/legacy/legacy-sky.js.map +1 -1
  28. package/legacy/legacy-terrain.js.map +1 -1
  29. package/legacy/legacy-triPlanar.js.map +1 -1
  30. package/legacy/legacy-water.js.map +1 -1
  31. package/legacy/legacy.js.map +1 -1
  32. package/mix/mixMaterial.js.map +1 -1
  33. package/normal/normalMaterial.js.map +1 -1
  34. package/package.json +2 -2
  35. package/shadowOnly/shadowOnlyMaterial.js.map +1 -1
  36. package/simple/simpleMaterial.js.map +1 -1
  37. package/sky/skyMaterial.js.map +1 -1
  38. package/terrain/terrainMaterial.js.map +1 -1
  39. package/triPlanar/triPlanarMaterial.js.map +1 -1
  40. package/water/waterMaterial.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"terrainMaterial.js","sourceRoot":"","sources":["../../../../dev/materials/src/terrain/terrainMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2CAA6B;AAC1G,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AAEzE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAK/C,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,mDAAqC;AAC7D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAInD,OAAO,EAAE,KAAK,EAAE,iCAAmB;AACnC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,6DAA+C;AAC7F,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,GACjC,8DAAgD;AAEjD,MAAM,sBAAuB,SAAQ,eAAe;IA2BhD;QACI,KAAK,EAAE,CAAC;QA3BL,YAAO,GAAG,KAAK,CAAC;QAChB,SAAI,GAAG,KAAK,CAAC;QACb,cAAS,GAAG,KAAK,CAAC;QAClB,eAAU,GAAG,KAAK,CAAC;QACnB,eAAU,GAAG,KAAK,CAAC;QACnB,eAAU,GAAG,KAAK,CAAC;QACnB,eAAU,GAAG,KAAK,CAAC;QACnB,eAAU,GAAG,KAAK,CAAC;QACnB,cAAS,GAAG,KAAK,CAAC;QAClB,iBAAY,GAAG,K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,eAAe,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { MaterialFlags } from \"core/Materials/materialFlags\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\nimport \"./terrain.fragment\";\r\nimport \"./terrain.vertex\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { addClipPlaneUniforms, bindClipPlane } from \"core/Materials/clipPlaneMaterialHelper\";\r\nimport {\r\n BindBonesParameters,\r\n BindFogParameters,\r\n BindLights,\r\n BindLogDepth,\r\n HandleFallbacksForShadows,\r\n PrepareAttributesForBones,\r\n PrepareAttributesForInstances,\r\n PrepareDefinesForAttributes,\r\n PrepareDefinesForFrameBoundValues,\r\n PrepareDefinesForLights,\r\n PrepareDefinesForMisc,\r\n PrepareUniformsAndSamplersList,\r\n} from \"core/Materials/materialHelper.functions\";\r\n\r\nclass TerrainMaterialDefines extends MaterialDefines {\r\n public DIFFUSE = false;\r\n public BUMP = false;\r\n public CLIPPLANE = false;\r\n public CLIPPLANE2 = false;\r\n public CLIPPLANE3 = false;\r\n public CLIPPLANE4 = false;\r\n public CLIPPLANE5 = false;\r\n public CLIPPLANE6 = false;\r\n public ALPHATEST = false;\r\n public DEPTHPREPASS = false;\r\n public POINTSIZE = false;\r\n public FOG = false;\r\n public SPECULARTERM = false;\r\n public NORMAL = false;\r\n public UV1 = false;\r\n public UV2 = false;\r\n public VERTEXCOLOR = false;\r\n public VERTEXALPHA = false;\r\n public NUM_BONE_INFLUENCERS = 0;\r\n public BonesPerMesh = 0;\r\n public INSTANCES = false;\r\n public INSTANCESCOLOR = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n public LOGARITHMICDEPTH = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class TerrainMaterial extends PushMaterial {\r\n @serializeAsTexture(\"mixTexture\")\r\n private _mixTexture: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public mixTexture: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTexture1\")\r\n private _diffuseTexture1: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTexture1: Texture;\r\n\r\n @serializeAsTexture(\"diffuseTexture2\")\r\n private _diffuseTexture2: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTexture2: Texture;\r\n\r\n @serializeAsTexture(\"diffuseTexture3\")\r\n private _diffuseTexture3: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTexture3: Texture;\r\n\r\n @serializeAsTexture(\"bumpTexture1\")\r\n private _bumpTexture1: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture1: Texture;\r\n\r\n @serializeAsTexture(\"bumpTexture2\")\r\n private _bumpTexture2: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture2: Texture;\r\n\r\n @serializeAsTexture(\"bumpTexture3\")\r\n private _bumpTexture3: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture3: Texture;\r\n\r\n @serializeAsColor3()\r\n public diffuseColor = new Color3(1, 1, 1);\r\n\r\n @serializeAsColor3()\r\n public specularColor = new Color3(0, 0, 0);\r\n\r\n @serialize()\r\n public specularPower = 64;\r\n\r\n @serialize(\"disableLighting\")\r\n private _disableLighting = false;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting: boolean;\r\n\r\n @serialize(\"maxSimultaneousLights\")\r\n private _maxSimultaneousLights = 4;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights: number;\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n }\r\n\r\n public override needAlphaBlending(): boolean {\r\n return this.alpha < 1.0;\r\n }\r\n\r\n public override needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public override getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public override isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new TerrainMaterialDefines();\r\n }\r\n\r\n const defines = <TerrainMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Textures\r\n if (scene.texturesEnabled) {\r\n if (!this.mixTexture || !this.mixTexture.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._needUVs = true;\r\n\r\n if (MaterialFlags.DiffuseTextureEnabled) {\r\n if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) {\r\n return false;\r\n }\r\n if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) {\r\n return false;\r\n }\r\n if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) {\r\n return false;\r\n }\r\n\r\n defines.DIFFUSE = true;\r\n }\r\n\r\n if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && MaterialFlags.BumpTextureEnabled) {\r\n if (!this.bumpTexture1.isReady()) {\r\n return false;\r\n }\r\n if (!this.bumpTexture2.isReady()) {\r\n return false;\r\n }\r\n if (!this.bumpTexture3.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._needNormals = true;\r\n defines.BUMP = true;\r\n }\r\n }\r\n\r\n // Misc.\r\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);\r\n\r\n // Lights\r\n defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);\r\n\r\n // Values that need to be evaluated on every frame\r\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances ? true : false);\r\n\r\n // Attribs\r\n PrepareDefinesForAttributes(mesh, defines, true, true);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);\r\n\r\n if (defines.NUM_BONE_INFLUENCERS > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n PrepareAttributesForBones(attribs, mesh, defines, fallbacks);\r\n PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"terrain\";\r\n const join = defines.toString();\r\n const uniforms = [\r\n \"world\",\r\n \"view\",\r\n \"viewProjection\",\r\n \"vEyePosition\",\r\n \"vLightsType\",\r\n \"vDiffuseColor\",\r\n \"vSpecularColor\",\r\n \"vFogInfos\",\r\n \"vFogColor\",\r\n \"pointSize\",\r\n \"vTextureInfos\",\r\n \"mBones\",\r\n \"textureMatrix\",\r\n \"diffuse1Infos\",\r\n \"diffuse2Infos\",\r\n \"diffuse3Infos\",\r\n ];\r\n const samplers = [\r\n \"textureSampler\",\r\n \"diffuse1Sampler\",\r\n \"diffuse2Sampler\",\r\n \"diffuse3Sampler\",\r\n \"bump1Sampler\",\r\n \"bump2Sampler\",\r\n \"bump3Sampler\",\r\n \"logarithmicDepthConstant\",\r\n ];\r\n\r\n const uniformBuffers: string[] = [];\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: this.maxSimultaneousLights,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n drawWrapper._wasPreviouslyUsingInstances = !!useInstances;\r\n\r\n return true;\r\n }\r\n\r\n public override bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <TerrainMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n\r\n // Bones\r\n BindBonesParameters(mesh, this._activeEffect);\r\n\r\n if (this._mustRebind(scene, effect, subMesh)) {\r\n // Textures\r\n if (this.mixTexture) {\r\n this._activeEffect.setTexture(\"textureSampler\", this._mixTexture);\r\n this._activeEffect.setFloat2(\"vTextureInfos\", this._mixTexture.coordinatesIndex, this._mixTexture.level);\r\n this._activeEffect.setMatrix(\"textureMatrix\", this._mixTexture.getTextureMatrix());\r\n\r\n if (MaterialFlags.DiffuseTextureEnabled) {\r\n if (this._diffuseTexture1) {\r\n this._activeEffect.setTexture(\"diffuse1Sampler\", this._diffuseTexture1);\r\n this._activeEffect.setFloat2(\"diffuse1Infos\", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale);\r\n }\r\n if (this._diffuseTexture2) {\r\n this._activeEffect.setTexture(\"diffuse2Sampler\", this._diffuseTexture2);\r\n this._activeEffect.setFloat2(\"diffuse2Infos\", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale);\r\n }\r\n if (this._diffuseTexture3) {\r\n this._activeEffect.setTexture(\"diffuse3Sampler\", this._diffuseTexture3);\r\n this._activeEffect.setFloat2(\"diffuse3Infos\", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale);\r\n }\r\n }\r\n\r\n if (MaterialFlags.BumpTextureEnabled && scene.getEngine().getCaps().standardDerivatives) {\r\n if (this._bumpTexture1) {\r\n this._activeEffect.setTexture(\"bump1Sampler\", this._bumpTexture1);\r\n }\r\n if (this._bumpTexture2) {\r\n this._activeEffect.setTexture(\"bump2Sampler\", this._bumpTexture2);\r\n }\r\n if (this._bumpTexture3) {\r\n this._activeEffect.setTexture(\"bump3Sampler\", this._bumpTexture3);\r\n }\r\n }\r\n }\r\n // Clip plane\r\n bindClipPlane(effect, this, scene);\r\n\r\n // Point size\r\n if (this.pointsCloud) {\r\n this._activeEffect.setFloat(\"pointSize\", this.pointSize);\r\n }\r\n\r\n // Log. depth\r\n if (this._useLogarithmicDepth) {\r\n BindLogDepth(defines, effect, scene);\r\n }\r\n\r\n scene.bindEyePosition(effect);\r\n }\r\n\r\n this._activeEffect.setColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha * mesh.visibility);\r\n\r\n if (defines.SPECULARTERM) {\r\n this._activeEffect.setColor4(\"vSpecularColor\", this.specularColor, this.specularPower);\r\n }\r\n\r\n if (scene.lightsEnabled && !this.disableLighting) {\r\n BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);\r\n }\r\n\r\n // View\r\n if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n }\r\n\r\n // Fog\r\n BindFogParameters(scene, mesh, this._activeEffect);\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n public override getAnimatables(): IAnimatable[] {\r\n const results = [];\r\n\r\n if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {\r\n results.push(this.mixTexture);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n public override getActiveTextures(): BaseTexture[] {\r\n const activeTextures = super.getActiveTextures();\r\n\r\n if (this._mixTexture) {\r\n activeTextures.push(this._mixTexture);\r\n }\r\n\r\n if (this._diffuseTexture1) {\r\n activeTextures.push(this._diffuseTexture1);\r\n }\r\n\r\n if (this._diffuseTexture2) {\r\n activeTextures.push(this._diffuseTexture2);\r\n }\r\n\r\n if (this._diffuseTexture3) {\r\n activeTextures.push(this._diffuseTexture3);\r\n }\r\n\r\n if (this._bumpTexture1) {\r\n activeTextures.push(this._bumpTexture1);\r\n }\r\n\r\n if (this._bumpTexture2) {\r\n activeTextures.push(this._bumpTexture2);\r\n }\r\n\r\n if (this._bumpTexture3) {\r\n activeTextures.push(this._bumpTexture3);\r\n }\r\n\r\n return activeTextures;\r\n }\r\n\r\n public override hasTexture(texture: BaseTexture): boolean {\r\n if (super.hasTexture(texture)) {\r\n return true;\r\n }\r\n\r\n if (this._mixTexture === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTexture1 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTexture2 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTexture3 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture1 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture2 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture3 === texture) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public override dispose(forceDisposeEffect?: boolean): void {\r\n if (this.mixTexture) {\r\n this.mixTexture.dispose();\r\n }\r\n\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public override clone(name: string): TerrainMaterial {\r\n return SerializationHelper.Clone(() => new TerrainMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.TerrainMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"TerrainMaterial\";\r\n }\r\n\r\n // Statics\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial {\r\n return SerializationHelper.Parse(() => new TerrainMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TerrainMaterial\", TerrainMaterial);\r\n"]}
1
+ {"version":3,"file":"terrainMaterial.js","sourceRoot":"","sources":["../../../../dev/materials/src/terrain/terrainMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2CAA6B;AAC1G,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AAEzE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAK/C,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,mDAAqC;AAC7D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAInD,OAAO,EAAE,KAAK,EAAE,iCAAmB;AACnC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,6DAA+C;AAC7F,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,GACjC,8DAAgD;AAEjD,MAAM,sBAAuB,SAAQ,eAAe;IA2BhD;QACI,KAAK,EAAE,CAAC;QA3BL,YAAO,GAAG,KAAK,CAAC;QAChB,SAAI,GAAG,KAAK,CAAC;QACb,cAAS,GAAG,KAAK,CAAC;QA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AGvB;IADP,kBAAkB,CAAC,iBAAiB,CAAC;yDACJ;AAE3B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;wDACrB;AAGxB;IADP,kBAAkB,CAAC,iBAAiB,CAAC;yDACJ;AAE3B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;wDACrB;AAGxB;IADP,kBAAkB,CAAC,iBAAiB,CAAC;yDACJ;AAE3B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;wDACrB;AAGxB;IADP,kBAAkB,CAAC,cAAc,CAAC;sDACJ;AAExB;IADN,gBAAgB,CAAC,kCAAkC,CAAC;qDACxB;AAGrB;IADP,kBAAkB,CAAC,cAAc,CAAC;sDACJ;AAExB;IADN,gBAAgB,CAAC,kCAAkC,CAAC;qDACxB;AAGrB;IADP,kBAAkB,CAAC,cAAc,CAAC;sDACJ;AAExB;IADN,gBAAgB,CAAC,kCAAkC,CAAC;qDACxB;AAGtB;IADN,iBAAiB,EAAE;qDACsB;AAGnC;IADN,iBAAiB,EAAE;sDACuB;AAGpC;IADN,SAAS,EAAE;sDACc;AAGlB;IADP,SAAS,CAAC,iBAAiB,CAAC;yDACI;AAE1B;IADN,gBAAgB,CAAC,gCAAgC,CAAC;wDACnB;AAGxB;IADP,SAAS,CAAC,uBAAuB,CAAC;+DACA;AAE5B;IADN,gBAAgB,CAAC,gCAAgC,CAAC;8DACd;AAwZzC,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { MaterialFlags } from \"core/Materials/materialFlags\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\nimport \"./terrain.fragment\";\r\nimport \"./terrain.vertex\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { addClipPlaneUniforms, bindClipPlane } from \"core/Materials/clipPlaneMaterialHelper\";\r\nimport {\r\n BindBonesParameters,\r\n BindFogParameters,\r\n BindLights,\r\n BindLogDepth,\r\n HandleFallbacksForShadows,\r\n PrepareAttributesForBones,\r\n PrepareAttributesForInstances,\r\n PrepareDefinesForAttributes,\r\n PrepareDefinesForFrameBoundValues,\r\n PrepareDefinesForLights,\r\n PrepareDefinesForMisc,\r\n PrepareUniformsAndSamplersList,\r\n} from \"core/Materials/materialHelper.functions\";\r\n\r\nclass TerrainMaterialDefines extends MaterialDefines {\r\n public DIFFUSE = false;\r\n public BUMP = false;\r\n public CLIPPLANE = false;\r\n public CLIPPLANE2 = false;\r\n public CLIPPLANE3 = false;\r\n public CLIPPLANE4 = false;\r\n public CLIPPLANE5 = false;\r\n public CLIPPLANE6 = false;\r\n public ALPHATEST = false;\r\n public DEPTHPREPASS = false;\r\n public POINTSIZE = false;\r\n public FOG = false;\r\n public SPECULARTERM = false;\r\n public NORMAL = false;\r\n public UV1 = false;\r\n public UV2 = false;\r\n public VERTEXCOLOR = false;\r\n public VERTEXALPHA = false;\r\n public NUM_BONE_INFLUENCERS = 0;\r\n public BonesPerMesh = 0;\r\n public INSTANCES = false;\r\n public INSTANCESCOLOR = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n public LOGARITHMICDEPTH = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class TerrainMaterial extends PushMaterial {\r\n @serializeAsTexture(\"mixTexture\")\r\n private _mixTexture: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public mixTexture: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTexture1\")\r\n private _diffuseTexture1: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTexture1: Texture;\r\n\r\n @serializeAsTexture(\"diffuseTexture2\")\r\n private _diffuseTexture2: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTexture2: Texture;\r\n\r\n @serializeAsTexture(\"diffuseTexture3\")\r\n private _diffuseTexture3: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTexture3: Texture;\r\n\r\n @serializeAsTexture(\"bumpTexture1\")\r\n private _bumpTexture1: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture1: Texture;\r\n\r\n @serializeAsTexture(\"bumpTexture2\")\r\n private _bumpTexture2: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture2: Texture;\r\n\r\n @serializeAsTexture(\"bumpTexture3\")\r\n private _bumpTexture3: Texture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture3: Texture;\r\n\r\n @serializeAsColor3()\r\n public diffuseColor = new Color3(1, 1, 1);\r\n\r\n @serializeAsColor3()\r\n public specularColor = new Color3(0, 0, 0);\r\n\r\n @serialize()\r\n public specularPower = 64;\r\n\r\n @serialize(\"disableLighting\")\r\n private _disableLighting = false;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting: boolean;\r\n\r\n @serialize(\"maxSimultaneousLights\")\r\n private _maxSimultaneousLights = 4;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights: number;\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n }\r\n\r\n public override needAlphaBlending(): boolean {\r\n return this.alpha < 1.0;\r\n }\r\n\r\n public override needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public override getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public override isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new TerrainMaterialDefines();\r\n }\r\n\r\n const defines = <TerrainMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Textures\r\n if (scene.texturesEnabled) {\r\n if (!this.mixTexture || !this.mixTexture.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._needUVs = true;\r\n\r\n if (MaterialFlags.DiffuseTextureEnabled) {\r\n if (!this.diffuseTexture1 || !this.diffuseTexture1.isReady()) {\r\n return false;\r\n }\r\n if (!this.diffuseTexture2 || !this.diffuseTexture2.isReady()) {\r\n return false;\r\n }\r\n if (!this.diffuseTexture3 || !this.diffuseTexture3.isReady()) {\r\n return false;\r\n }\r\n\r\n defines.DIFFUSE = true;\r\n }\r\n\r\n if (this.bumpTexture1 && this.bumpTexture2 && this.bumpTexture3 && MaterialFlags.BumpTextureEnabled) {\r\n if (!this.bumpTexture1.isReady()) {\r\n return false;\r\n }\r\n if (!this.bumpTexture2.isReady()) {\r\n return false;\r\n }\r\n if (!this.bumpTexture3.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._needNormals = true;\r\n defines.BUMP = true;\r\n }\r\n }\r\n\r\n // Misc.\r\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);\r\n\r\n // Lights\r\n defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);\r\n\r\n // Values that need to be evaluated on every frame\r\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances ? true : false);\r\n\r\n // Attribs\r\n PrepareDefinesForAttributes(mesh, defines, true, true);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);\r\n\r\n if (defines.NUM_BONE_INFLUENCERS > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n PrepareAttributesForBones(attribs, mesh, defines, fallbacks);\r\n PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"terrain\";\r\n const join = defines.toString();\r\n const uniforms = [\r\n \"world\",\r\n \"view\",\r\n \"viewProjection\",\r\n \"vEyePosition\",\r\n \"vLightsType\",\r\n \"vDiffuseColor\",\r\n \"vSpecularColor\",\r\n \"vFogInfos\",\r\n \"vFogColor\",\r\n \"pointSize\",\r\n \"vTextureInfos\",\r\n \"mBones\",\r\n \"textureMatrix\",\r\n \"diffuse1Infos\",\r\n \"diffuse2Infos\",\r\n \"diffuse3Infos\",\r\n ];\r\n const samplers = [\r\n \"textureSampler\",\r\n \"diffuse1Sampler\",\r\n \"diffuse2Sampler\",\r\n \"diffuse3Sampler\",\r\n \"bump1Sampler\",\r\n \"bump2Sampler\",\r\n \"bump3Sampler\",\r\n \"logarithmicDepthConstant\",\r\n ];\r\n\r\n const uniformBuffers: string[] = [];\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: this.maxSimultaneousLights,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n drawWrapper._wasPreviouslyUsingInstances = !!useInstances;\r\n\r\n return true;\r\n }\r\n\r\n public override bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <TerrainMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n\r\n // Bones\r\n BindBonesParameters(mesh, this._activeEffect);\r\n\r\n if (this._mustRebind(scene, effect, subMesh)) {\r\n // Textures\r\n if (this.mixTexture) {\r\n this._activeEffect.setTexture(\"textureSampler\", this._mixTexture);\r\n this._activeEffect.setFloat2(\"vTextureInfos\", this._mixTexture.coordinatesIndex, this._mixTexture.level);\r\n this._activeEffect.setMatrix(\"textureMatrix\", this._mixTexture.getTextureMatrix());\r\n\r\n if (MaterialFlags.DiffuseTextureEnabled) {\r\n if (this._diffuseTexture1) {\r\n this._activeEffect.setTexture(\"diffuse1Sampler\", this._diffuseTexture1);\r\n this._activeEffect.setFloat2(\"diffuse1Infos\", this._diffuseTexture1.uScale, this._diffuseTexture1.vScale);\r\n }\r\n if (this._diffuseTexture2) {\r\n this._activeEffect.setTexture(\"diffuse2Sampler\", this._diffuseTexture2);\r\n this._activeEffect.setFloat2(\"diffuse2Infos\", this._diffuseTexture2.uScale, this._diffuseTexture2.vScale);\r\n }\r\n if (this._diffuseTexture3) {\r\n this._activeEffect.setTexture(\"diffuse3Sampler\", this._diffuseTexture3);\r\n this._activeEffect.setFloat2(\"diffuse3Infos\", this._diffuseTexture3.uScale, this._diffuseTexture3.vScale);\r\n }\r\n }\r\n\r\n if (MaterialFlags.BumpTextureEnabled && scene.getEngine().getCaps().standardDerivatives) {\r\n if (this._bumpTexture1) {\r\n this._activeEffect.setTexture(\"bump1Sampler\", this._bumpTexture1);\r\n }\r\n if (this._bumpTexture2) {\r\n this._activeEffect.setTexture(\"bump2Sampler\", this._bumpTexture2);\r\n }\r\n if (this._bumpTexture3) {\r\n this._activeEffect.setTexture(\"bump3Sampler\", this._bumpTexture3);\r\n }\r\n }\r\n }\r\n // Clip plane\r\n bindClipPlane(effect, this, scene);\r\n\r\n // Point size\r\n if (this.pointsCloud) {\r\n this._activeEffect.setFloat(\"pointSize\", this.pointSize);\r\n }\r\n\r\n // Log. depth\r\n if (this._useLogarithmicDepth) {\r\n BindLogDepth(defines, effect, scene);\r\n }\r\n\r\n scene.bindEyePosition(effect);\r\n }\r\n\r\n this._activeEffect.setColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha * mesh.visibility);\r\n\r\n if (defines.SPECULARTERM) {\r\n this._activeEffect.setColor4(\"vSpecularColor\", this.specularColor, this.specularPower);\r\n }\r\n\r\n if (scene.lightsEnabled && !this.disableLighting) {\r\n BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);\r\n }\r\n\r\n // View\r\n if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n }\r\n\r\n // Fog\r\n BindFogParameters(scene, mesh, this._activeEffect);\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n public override getAnimatables(): IAnimatable[] {\r\n const results = [];\r\n\r\n if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {\r\n results.push(this.mixTexture);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n public override getActiveTextures(): BaseTexture[] {\r\n const activeTextures = super.getActiveTextures();\r\n\r\n if (this._mixTexture) {\r\n activeTextures.push(this._mixTexture);\r\n }\r\n\r\n if (this._diffuseTexture1) {\r\n activeTextures.push(this._diffuseTexture1);\r\n }\r\n\r\n if (this._diffuseTexture2) {\r\n activeTextures.push(this._diffuseTexture2);\r\n }\r\n\r\n if (this._diffuseTexture3) {\r\n activeTextures.push(this._diffuseTexture3);\r\n }\r\n\r\n if (this._bumpTexture1) {\r\n activeTextures.push(this._bumpTexture1);\r\n }\r\n\r\n if (this._bumpTexture2) {\r\n activeTextures.push(this._bumpTexture2);\r\n }\r\n\r\n if (this._bumpTexture3) {\r\n activeTextures.push(this._bumpTexture3);\r\n }\r\n\r\n return activeTextures;\r\n }\r\n\r\n public override hasTexture(texture: BaseTexture): boolean {\r\n if (super.hasTexture(texture)) {\r\n return true;\r\n }\r\n\r\n if (this._mixTexture === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTexture1 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTexture2 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTexture3 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture1 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture2 === texture) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture3 === texture) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public override dispose(forceDisposeEffect?: boolean): void {\r\n if (this.mixTexture) {\r\n this.mixTexture.dispose();\r\n }\r\n\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public override clone(name: string): TerrainMaterial {\r\n return SerializationHelper.Clone(() => new TerrainMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.TerrainMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"TerrainMaterial\";\r\n }\r\n\r\n // Statics\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial {\r\n return SerializationHelper.Parse(() => new TerrainMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TerrainMaterial\", TerrainMaterial);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"triPlanarMaterial.js","sourceRoot":"","sources":["../../../../dev/materials/src/triPlanar/triPlanarMaterial.ts"],"names":[],"mappings":";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,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;CACJ;AA3ZU;IADN,kBAAkB,EAAE;qDACU;AAGvB;IADP,kBAAkB,CAAC,iBAAiB,CAAC;2DACA;AAE/B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;0DACjB;AAG5B;IADP,kBAAkB,CAAC,gBAAgB,CAAC;2DACC;AAE/B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;0DACjB;AAG5B;IADP,kBAAkB,CAAC,iBAAiB,CAAC;2DACA;AAE/B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;0DACjB;AAG5B;IADP,kBAAkB,CAAC,gBAAgB,CAAC;0DACA;AAE9B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;yDAClB;AAG3B;IADP,kBAAkB,CAAC,gBAAgB,CAAC;0DACA;AAE9B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;yDAClB;AAG3B;IADP,kBAAkB,CAAC,gBAAgB,CAAC;0DACA;AAE9B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;yDAClB;AAG5B;IADN,SAAS,EAAE;mDACgB;AAGrB;IADN,iBAAiB,EAAE;uDACsB;AAGnC;IADN,iBAAiB,EAAE;wDAC6B;AAG1C;IADN,SAAS,EAAE;wDACc;AAGlB;IADP,SAAS,CAAC,iBAAiB,CAAC;2DACI;AAE1B;IADN,gBAAgB,CAAC,gCAAgC,CAAC;0DACnB;AAGxB;IADP,SAAS,CAAC,uBAAuB,CAAC;iEACA;AAE5B;IADN,gBAAgB,CAAC,gCAAgC,CAAC;gEACd;AAyWzC,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\n\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { MaterialFlags } from \"core/Materials/materialFlags\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\nimport \"./triplanar.fragment\";\r\nimport \"./triplanar.vertex\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { addClipPlaneUniforms, bindClipPlane } from \"core/Materials/clipPlaneMaterialHelper\";\r\nimport {\r\n BindBonesParameters,\r\n BindFogParameters,\r\n BindLights,\r\n BindLogDepth,\r\n HandleFallbacksForShadows,\r\n PrepareAttributesForBones,\r\n PrepareAttributesForInstances,\r\n PrepareDefinesForAttributes,\r\n PrepareDefinesForFrameBoundValues,\r\n PrepareDefinesForLights,\r\n PrepareDefinesForMisc,\r\n PrepareUniformsAndSamplersList,\r\n} from \"core/Materials/materialHelper.functions\";\r\n\r\nclass TriPlanarMaterialDefines extends MaterialDefines {\r\n public DIFFUSEX = false;\r\n public DIFFUSEY = false;\r\n public DIFFUSEZ = false;\r\n\r\n public BUMPX = false;\r\n public BUMPY = false;\r\n public BUMPZ = false;\r\n\r\n public CLIPPLANE = false;\r\n public CLIPPLANE2 = false;\r\n public CLIPPLANE3 = false;\r\n public CLIPPLANE4 = false;\r\n public CLIPPLANE5 = false;\r\n public CLIPPLANE6 = false;\r\n public ALPHATEST = false;\r\n public DEPTHPREPASS = false;\r\n public POINTSIZE = false;\r\n public FOG = false;\r\n public SPECULARTERM = false;\r\n public NORMAL = false;\r\n public VERTEXCOLOR = false;\r\n public VERTEXALPHA = false;\r\n public NUM_BONE_INFLUENCERS = 0;\r\n public BonesPerMesh = 0;\r\n public INSTANCES = false;\r\n public INSTANCESCOLOR = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n public NONUNIFORMSCALING = false;\r\n public LOGARITHMICDEPTH = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class TriPlanarMaterial extends PushMaterial {\r\n @serializeAsTexture()\r\n public mixTexture: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTextureX\")\r\n private _diffuseTextureX: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTextureX: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTexturY\")\r\n private _diffuseTextureY: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTextureY: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTextureZ\")\r\n private _diffuseTextureZ: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTextureZ: BaseTexture;\r\n\r\n @serializeAsTexture(\"normalTextureX\")\r\n private _normalTextureX: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public normalTextureX: BaseTexture;\r\n\r\n @serializeAsTexture(\"normalTextureY\")\r\n private _normalTextureY: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public normalTextureY: BaseTexture;\r\n\r\n @serializeAsTexture(\"normalTextureZ\")\r\n private _normalTextureZ: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public normalTextureZ: BaseTexture;\r\n\r\n @serialize()\r\n public tileSize: number = 1;\r\n\r\n @serializeAsColor3()\r\n public diffuseColor = new Color3(1, 1, 1);\r\n\r\n @serializeAsColor3()\r\n public specularColor = new Color3(0.2, 0.2, 0.2);\r\n\r\n @serialize()\r\n public specularPower = 64;\r\n\r\n @serialize(\"disableLighting\")\r\n private _disableLighting = false;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting: boolean;\r\n\r\n @serialize(\"maxSimultaneousLights\")\r\n private _maxSimultaneousLights = 4;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights: number;\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n }\r\n\r\n public override needAlphaBlending(): boolean {\r\n return this.alpha < 1.0;\r\n }\r\n\r\n public override needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public override getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public override isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new TriPlanarMaterialDefines();\r\n }\r\n\r\n const defines = <TriPlanarMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Textures\r\n if (defines._areTexturesDirty) {\r\n if (scene.texturesEnabled) {\r\n if (MaterialFlags.DiffuseTextureEnabled) {\r\n const textures = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ];\r\n const textureDefines = [\"DIFFUSEX\", \"DIFFUSEY\", \"DIFFUSEZ\"];\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n if (textures[i]) {\r\n if (!textures[i].isReady()) {\r\n return false;\r\n } else {\r\n (<any>defines)[textureDefines[i]] = true;\r\n }\r\n }\r\n }\r\n }\r\n if (MaterialFlags.BumpTextureEnabled) {\r\n const textures = [this.normalTextureX, this.normalTextureY, this.normalTextureZ];\r\n const textureDefines = [\"BUMPX\", \"BUMPY\", \"BUMPZ\"];\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n if (textures[i]) {\r\n if (!textures[i].isReady()) {\r\n return false;\r\n } else {\r\n (<any>defines)[textureDefines[i]] = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Misc.\r\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);\r\n\r\n // Lights\r\n defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);\r\n\r\n // Values that need to be evaluated on every frame\r\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances ? true : false);\r\n\r\n // Attribs\r\n PrepareDefinesForAttributes(mesh, defines, true, true);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);\r\n\r\n if (defines.NUM_BONE_INFLUENCERS > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n PrepareAttributesForBones(attribs, mesh, defines, fallbacks);\r\n PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"triplanar\";\r\n const join = defines.toString();\r\n const uniforms = [\r\n \"world\",\r\n \"view\",\r\n \"viewProjection\",\r\n \"vEyePosition\",\r\n \"vLightsType\",\r\n \"vDiffuseColor\",\r\n \"vSpecularColor\",\r\n \"vFogInfos\",\r\n \"vFogColor\",\r\n \"pointSize\",\r\n \"mBones\",\r\n \"tileSize\",\r\n ];\r\n const samplers = [\"diffuseSamplerX\", \"diffuseSamplerY\", \"diffuseSamplerZ\", \"normalSamplerX\", \"normalSamplerY\", \"normalSamplerZ\", \"logarithmicDepthConstant\"];\r\n\r\n const uniformBuffers: string[] = [];\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: this.maxSimultaneousLights,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n drawWrapper._wasPreviouslyUsingInstances = !!useInstances;\r\n\r\n return true;\r\n }\r\n\r\n public override bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <TriPlanarMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n\r\n // Bones\r\n BindBonesParameters(mesh, this._activeEffect);\r\n\r\n this._activeEffect.setFloat(\"tileSize\", this.tileSize);\r\n\r\n if (this._mustRebind(scene, effect, subMesh)) {\r\n // Textures\r\n if (this.diffuseTextureX) {\r\n this._activeEffect.setTexture(\"diffuseSamplerX\", this.diffuseTextureX);\r\n }\r\n if (this.diffuseTextureY) {\r\n this._activeEffect.setTexture(\"diffuseSamplerY\", this.diffuseTextureY);\r\n }\r\n if (this.diffuseTextureZ) {\r\n this._activeEffect.setTexture(\"diffuseSamplerZ\", this.diffuseTextureZ);\r\n }\r\n if (this.normalTextureX) {\r\n this._activeEffect.setTexture(\"normalSamplerX\", this.normalTextureX);\r\n }\r\n if (this.normalTextureY) {\r\n this._activeEffect.setTexture(\"normalSamplerY\", this.normalTextureY);\r\n }\r\n if (this.normalTextureZ) {\r\n this._activeEffect.setTexture(\"normalSamplerZ\", this.normalTextureZ);\r\n }\r\n // Clip plane\r\n bindClipPlane(effect, this, scene);\r\n\r\n // Point size\r\n if (this.pointsCloud) {\r\n this._activeEffect.setFloat(\"pointSize\", this.pointSize);\r\n }\r\n\r\n // Log. depth\r\n if (this._useLogarithmicDepth) {\r\n BindLogDepth(defines, effect, scene);\r\n }\r\n\r\n scene.bindEyePosition(effect);\r\n }\r\n\r\n this._activeEffect.setColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha * mesh.visibility);\r\n\r\n if (defines.SPECULARTERM) {\r\n this._activeEffect.setColor4(\"vSpecularColor\", this.specularColor, this.specularPower);\r\n }\r\n\r\n if (scene.lightsEnabled && !this.disableLighting) {\r\n BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);\r\n }\r\n\r\n // View\r\n if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n }\r\n\r\n // Fog\r\n BindFogParameters(scene, mesh, this._activeEffect);\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n public override getAnimatables(): IAnimatable[] {\r\n const results = [];\r\n\r\n if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {\r\n results.push(this.mixTexture);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n public override getActiveTextures(): BaseTexture[] {\r\n const activeTextures = super.getActiveTextures();\r\n\r\n if (this._diffuseTextureX) {\r\n activeTextures.push(this._diffuseTextureX);\r\n }\r\n\r\n if (this._diffuseTextureY) {\r\n activeTextures.push(this._diffuseTextureY);\r\n }\r\n\r\n if (this._diffuseTextureZ) {\r\n activeTextures.push(this._diffuseTextureZ);\r\n }\r\n\r\n if (this._normalTextureX) {\r\n activeTextures.push(this._normalTextureX);\r\n }\r\n\r\n if (this._normalTextureY) {\r\n activeTextures.push(this._normalTextureY);\r\n }\r\n\r\n if (this._normalTextureZ) {\r\n activeTextures.push(this._normalTextureZ);\r\n }\r\n\r\n return activeTextures;\r\n }\r\n\r\n public override hasTexture(texture: BaseTexture): boolean {\r\n if (super.hasTexture(texture)) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTextureX === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTextureY === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTextureZ === texture) {\r\n return true;\r\n }\r\n\r\n if (this._normalTextureX === texture) {\r\n return true;\r\n }\r\n\r\n if (this._normalTextureY === texture) {\r\n return true;\r\n }\r\n\r\n if (this._normalTextureZ === texture) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public override dispose(forceDisposeEffect?: boolean): void {\r\n if (this.mixTexture) {\r\n this.mixTexture.dispose();\r\n }\r\n\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public override clone(name: string): TriPlanarMaterial {\r\n return SerializationHelper.Clone(() => new TriPlanarMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.TriPlanarMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"TriPlanarMaterial\";\r\n }\r\n\r\n // Statics\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial {\r\n return SerializationHelper.Parse(() => new TriPlanarMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TriPlanarMaterial\", TriPlanarMaterial);\r\n"]}
1
+ {"version":3,"file":"triPlanarMaterial.js","sourceRoot":"","sources":["../../../../dev/materials/src/triPlanar/triPlanarMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2CAA6B;AAC1G,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AAEzE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAK/C,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,mDAAqC;AAC7D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAInD,OAAO,EAAE,KAAK,EAAE,iCAAmB;AACnC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,6DAA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eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\n\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { MaterialFlags } from \"core/Materials/materialFlags\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\nimport \"./triplanar.fragment\";\r\nimport \"./triplanar.vertex\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { addClipPlaneUniforms, bindClipPlane } from \"core/Materials/clipPlaneMaterialHelper\";\r\nimport {\r\n BindBonesParameters,\r\n BindFogParameters,\r\n BindLights,\r\n BindLogDepth,\r\n HandleFallbacksForShadows,\r\n PrepareAttributesForBones,\r\n PrepareAttributesForInstances,\r\n PrepareDefinesForAttributes,\r\n PrepareDefinesForFrameBoundValues,\r\n PrepareDefinesForLights,\r\n PrepareDefinesForMisc,\r\n PrepareUniformsAndSamplersList,\r\n} from \"core/Materials/materialHelper.functions\";\r\n\r\nclass TriPlanarMaterialDefines extends MaterialDefines {\r\n public DIFFUSEX = false;\r\n public DIFFUSEY = false;\r\n public DIFFUSEZ = false;\r\n\r\n public BUMPX = false;\r\n public BUMPY = false;\r\n public BUMPZ = false;\r\n\r\n public CLIPPLANE = false;\r\n public CLIPPLANE2 = false;\r\n public CLIPPLANE3 = false;\r\n public CLIPPLANE4 = false;\r\n public CLIPPLANE5 = false;\r\n public CLIPPLANE6 = false;\r\n public ALPHATEST = false;\r\n public DEPTHPREPASS = false;\r\n public POINTSIZE = false;\r\n public FOG = false;\r\n public SPECULARTERM = false;\r\n public NORMAL = false;\r\n public VERTEXCOLOR = false;\r\n public VERTEXALPHA = false;\r\n public NUM_BONE_INFLUENCERS = 0;\r\n public BonesPerMesh = 0;\r\n public INSTANCES = false;\r\n public INSTANCESCOLOR = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n public NONUNIFORMSCALING = false;\r\n public LOGARITHMICDEPTH = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class TriPlanarMaterial extends PushMaterial {\r\n @serializeAsTexture()\r\n public mixTexture: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTextureX\")\r\n private _diffuseTextureX: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTextureX: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTexturY\")\r\n private _diffuseTextureY: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTextureY: BaseTexture;\r\n\r\n @serializeAsTexture(\"diffuseTextureZ\")\r\n private _diffuseTextureZ: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public diffuseTextureZ: BaseTexture;\r\n\r\n @serializeAsTexture(\"normalTextureX\")\r\n private _normalTextureX: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public normalTextureX: BaseTexture;\r\n\r\n @serializeAsTexture(\"normalTextureY\")\r\n private _normalTextureY: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public normalTextureY: BaseTexture;\r\n\r\n @serializeAsTexture(\"normalTextureZ\")\r\n private _normalTextureZ: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public normalTextureZ: BaseTexture;\r\n\r\n @serialize()\r\n public tileSize: number = 1;\r\n\r\n @serializeAsColor3()\r\n public diffuseColor = new Color3(1, 1, 1);\r\n\r\n @serializeAsColor3()\r\n public specularColor = new Color3(0.2, 0.2, 0.2);\r\n\r\n @serialize()\r\n public specularPower = 64;\r\n\r\n @serialize(\"disableLighting\")\r\n private _disableLighting = false;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting: boolean;\r\n\r\n @serialize(\"maxSimultaneousLights\")\r\n private _maxSimultaneousLights = 4;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights: number;\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n }\r\n\r\n public override needAlphaBlending(): boolean {\r\n return this.alpha < 1.0;\r\n }\r\n\r\n public override needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public override getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n // Methods\r\n public override isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new TriPlanarMaterialDefines();\r\n }\r\n\r\n const defines = <TriPlanarMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Textures\r\n if (defines._areTexturesDirty) {\r\n if (scene.texturesEnabled) {\r\n if (MaterialFlags.DiffuseTextureEnabled) {\r\n const textures = [this.diffuseTextureX, this.diffuseTextureY, this.diffuseTextureZ];\r\n const textureDefines = [\"DIFFUSEX\", \"DIFFUSEY\", \"DIFFUSEZ\"];\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n if (textures[i]) {\r\n if (!textures[i].isReady()) {\r\n return false;\r\n } else {\r\n (<any>defines)[textureDefines[i]] = true;\r\n }\r\n }\r\n }\r\n }\r\n if (MaterialFlags.BumpTextureEnabled) {\r\n const textures = [this.normalTextureX, this.normalTextureY, this.normalTextureZ];\r\n const textureDefines = [\"BUMPX\", \"BUMPY\", \"BUMPZ\"];\r\n\r\n for (let i = 0; i < textures.length; i++) {\r\n if (textures[i]) {\r\n if (!textures[i].isReady()) {\r\n return false;\r\n } else {\r\n (<any>defines)[textureDefines[i]] = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Misc.\r\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);\r\n\r\n // Lights\r\n defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);\r\n\r\n // Values that need to be evaluated on every frame\r\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances ? true : false);\r\n\r\n // Attribs\r\n PrepareDefinesForAttributes(mesh, defines, true, true);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);\r\n\r\n if (defines.NUM_BONE_INFLUENCERS > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n PrepareAttributesForBones(attribs, mesh, defines, fallbacks);\r\n PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"triplanar\";\r\n const join = defines.toString();\r\n const uniforms = [\r\n \"world\",\r\n \"view\",\r\n \"viewProjection\",\r\n \"vEyePosition\",\r\n \"vLightsType\",\r\n \"vDiffuseColor\",\r\n \"vSpecularColor\",\r\n \"vFogInfos\",\r\n \"vFogColor\",\r\n \"pointSize\",\r\n \"mBones\",\r\n \"tileSize\",\r\n ];\r\n const samplers = [\"diffuseSamplerX\", \"diffuseSamplerY\", \"diffuseSamplerZ\", \"normalSamplerX\", \"normalSamplerY\", \"normalSamplerZ\", \"logarithmicDepthConstant\"];\r\n\r\n const uniformBuffers: string[] = [];\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: this.maxSimultaneousLights,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n drawWrapper._wasPreviouslyUsingInstances = !!useInstances;\r\n\r\n return true;\r\n }\r\n\r\n public override bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <TriPlanarMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n\r\n // Bones\r\n BindBonesParameters(mesh, this._activeEffect);\r\n\r\n this._activeEffect.setFloat(\"tileSize\", this.tileSize);\r\n\r\n if (this._mustRebind(scene, effect, subMesh)) {\r\n // Textures\r\n if (this.diffuseTextureX) {\r\n this._activeEffect.setTexture(\"diffuseSamplerX\", this.diffuseTextureX);\r\n }\r\n if (this.diffuseTextureY) {\r\n this._activeEffect.setTexture(\"diffuseSamplerY\", this.diffuseTextureY);\r\n }\r\n if (this.diffuseTextureZ) {\r\n this._activeEffect.setTexture(\"diffuseSamplerZ\", this.diffuseTextureZ);\r\n }\r\n if (this.normalTextureX) {\r\n this._activeEffect.setTexture(\"normalSamplerX\", this.normalTextureX);\r\n }\r\n if (this.normalTextureY) {\r\n this._activeEffect.setTexture(\"normalSamplerY\", this.normalTextureY);\r\n }\r\n if (this.normalTextureZ) {\r\n this._activeEffect.setTexture(\"normalSamplerZ\", this.normalTextureZ);\r\n }\r\n // Clip plane\r\n bindClipPlane(effect, this, scene);\r\n\r\n // Point size\r\n if (this.pointsCloud) {\r\n this._activeEffect.setFloat(\"pointSize\", this.pointSize);\r\n }\r\n\r\n // Log. depth\r\n if (this._useLogarithmicDepth) {\r\n BindLogDepth(defines, effect, scene);\r\n }\r\n\r\n scene.bindEyePosition(effect);\r\n }\r\n\r\n this._activeEffect.setColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha * mesh.visibility);\r\n\r\n if (defines.SPECULARTERM) {\r\n this._activeEffect.setColor4(\"vSpecularColor\", this.specularColor, this.specularPower);\r\n }\r\n\r\n if (scene.lightsEnabled && !this.disableLighting) {\r\n BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);\r\n }\r\n\r\n // View\r\n if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n }\r\n\r\n // Fog\r\n BindFogParameters(scene, mesh, this._activeEffect);\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n public override getAnimatables(): IAnimatable[] {\r\n const results = [];\r\n\r\n if (this.mixTexture && this.mixTexture.animations && this.mixTexture.animations.length > 0) {\r\n results.push(this.mixTexture);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n public override getActiveTextures(): BaseTexture[] {\r\n const activeTextures = super.getActiveTextures();\r\n\r\n if (this._diffuseTextureX) {\r\n activeTextures.push(this._diffuseTextureX);\r\n }\r\n\r\n if (this._diffuseTextureY) {\r\n activeTextures.push(this._diffuseTextureY);\r\n }\r\n\r\n if (this._diffuseTextureZ) {\r\n activeTextures.push(this._diffuseTextureZ);\r\n }\r\n\r\n if (this._normalTextureX) {\r\n activeTextures.push(this._normalTextureX);\r\n }\r\n\r\n if (this._normalTextureY) {\r\n activeTextures.push(this._normalTextureY);\r\n }\r\n\r\n if (this._normalTextureZ) {\r\n activeTextures.push(this._normalTextureZ);\r\n }\r\n\r\n return activeTextures;\r\n }\r\n\r\n public override hasTexture(texture: BaseTexture): boolean {\r\n if (super.hasTexture(texture)) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTextureX === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTextureY === texture) {\r\n return true;\r\n }\r\n\r\n if (this._diffuseTextureZ === texture) {\r\n return true;\r\n }\r\n\r\n if (this._normalTextureX === texture) {\r\n return true;\r\n }\r\n\r\n if (this._normalTextureY === texture) {\r\n return true;\r\n }\r\n\r\n if (this._normalTextureZ === texture) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public override dispose(forceDisposeEffect?: boolean): void {\r\n if (this.mixTexture) {\r\n this.mixTexture.dispose();\r\n }\r\n\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public override clone(name: string): TriPlanarMaterial {\r\n return SerializationHelper.Clone(() => new TriPlanarMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.TriPlanarMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"TriPlanarMaterial\";\r\n }\r\n\r\n // Statics\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial {\r\n return SerializationHelper.Parse(() => new TriPlanarMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TriPlanarMaterial\", TriPlanarMaterial);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"waterMaterial.js","sourceRoot":"","sources":["../../../../dev/materials/src/water/waterMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2CAA6B;AAC9H,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AACzE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAClE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,KAAK,EAAE,4CAA8B;AAE9C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,mBAAmB,EAAE,kEAAoD;AAElF,OAAO,EAAE,eAAe,EAAE,qDAAuC;AAEjE,OAAO,EAAE,4BAA4B,EAA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S,EAAE;uDAC0B;AAK/B;IADN,iBAAiB,EAAE;kDACmC;AAKhD;IADN,SAAS,EAAE;wDAC2B;AAKhC;IADN,SAAS,EAAE;iDACoB;AAMzB;IADN,SAAS,EAAE;gDACmB;AAMxB;IADN,SAAS,EAAE;gDACkB;AAMvB;IADN,SAAS,EAAE;uDAC6B;AAQjC;IADP,SAAS,CAAC,uCAAuC,CAAC;6EACI;AAEhD;IADN,gBAAgB,CAAC,8BAA8B,CAAC;4EACK;AA6nB1D,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { serializeAsVector2, serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Matrix, Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Plane } from \"core/Maths/math.plane\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { SmartArray } from \"core/Misc/smartArray\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport type { IImageProcessingConfigurationDefines } from \"core/Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"core/Materials/imageProcessingConfiguration\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { MaterialFlags } from \"core/Materials/materialFlags\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\nimport \"./water.fragment\";\r\nimport \"./water.vertex\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { CreateGround } from \"core/Meshes/Builders/groundBuilder\";\r\nimport { addClipPlaneUniforms, bindClipPlane } from \"core/Materials/clipPlaneMaterialHelper\";\r\nimport {\r\n BindBonesParameters,\r\n BindFogParameters,\r\n BindLights,\r\n BindLogDepth,\r\n HandleFallbacksForShadows,\r\n PrepareAttributesForBones,\r\n PrepareAttributesForInstances,\r\n PrepareDefinesForAttributes,\r\n PrepareDefinesForFrameBoundValues,\r\n PrepareDefinesForLights,\r\n PrepareDefinesForMisc,\r\n PrepareUniformsAndSamplersList,\r\n} from \"core/Materials/materialHelper.functions\";\r\n\r\nimport \"core/Rendering/boundingBoxRenderer\";\r\n\r\nclass WaterMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {\r\n public BUMP = false;\r\n public REFLECTION = false;\r\n public CLIPPLANE = false;\r\n public CLIPPLANE2 = false;\r\n public CLIPPLANE3 = false;\r\n public CLIPPLANE4 = false;\r\n public CLIPPLANE5 = false;\r\n public CLIPPLANE6 = false;\r\n public ALPHATEST = false;\r\n public DEPTHPREPASS = false;\r\n public POINTSIZE = false;\r\n public FOG = false;\r\n public NORMAL = false;\r\n public UV1 = false;\r\n public UV2 = false;\r\n public VERTEXCOLOR = false;\r\n public VERTEXALPHA = false;\r\n public NUM_BONE_INFLUENCERS = 0;\r\n public BonesPerMesh = 0;\r\n public INSTANCES = false;\r\n public INSTANCESCOLOR = false;\r\n public SPECULARTERM = false;\r\n public LOGARITHMICDEPTH = false;\r\n public USE_REVERSE_DEPTHBUFFER = false;\r\n public FRESNELSEPARATE = false;\r\n public BUMPSUPERIMPOSE = false;\r\n public BUMPAFFECTSREFLECTION = false;\r\n public USE_WORLD_COORDINATES = false;\r\n\r\n public IMAGEPROCESSING = false;\r\n public VIGNETTE = false;\r\n public VIGNETTEBLENDMODEMULTIPLY = false;\r\n public VIGNETTEBLENDMODEOPAQUE = false;\r\n public TONEMAPPING = 0;\r\n public CONTRAST = false;\r\n public EXPOSURE = false;\r\n public COLORCURVES = false;\r\n public COLORGRADING = false;\r\n public COLORGRADING3D = false;\r\n public SAMPLER3DGREENDEPTH = false;\r\n public SAMPLER3DBGRMAP = false;\r\n public DITHER = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class WaterMaterial extends PushMaterial {\r\n /*\r\n * Public members\r\n */\r\n @serializeAsTexture(\"bumpTexture\")\r\n private _bumpTexture: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: BaseTexture;\r\n\r\n @serializeAsColor3()\r\n public diffuseColor = new Color3(1, 1, 1);\r\n\r\n @serializeAsColor3()\r\n public specularColor = new Color3(0, 0, 0);\r\n\r\n @serialize()\r\n public specularPower = 64;\r\n\r\n @serialize(\"disableLighting\")\r\n private _disableLighting = false;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting: boolean;\r\n\r\n @serialize(\"maxSimultaneousLights\")\r\n private _maxSimultaneousLights = 4;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights: number;\r\n\r\n /**\r\n * Defines the wind force.\r\n */\r\n @serialize()\r\n public windForce: number = 6;\r\n /**\r\n * Defines the direction of the wind in the plane (X, Z).\r\n */\r\n @serializeAsVector2()\r\n public windDirection: Vector2 = new Vector2(0, 1);\r\n /**\r\n * Defines the height of the waves.\r\n */\r\n @serialize()\r\n public waveHeight: number = 0.4;\r\n /**\r\n * Defines the bump height related to the bump map.\r\n */\r\n @serialize()\r\n public bumpHeight: number = 0.4;\r\n /**\r\n * Defines wether or not: to add a smaller moving bump to less steady waves.\r\n */\r\n @serialize(\"bumpSuperimpose\")\r\n private _bumpSuperimpose = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public bumpSuperimpose: boolean;\r\n\r\n /**\r\n * Defines wether or not color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.\r\n */\r\n @serialize(\"fresnelSeparate\")\r\n private _fresnelSeparate = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public fresnelSeparate: boolean;\r\n\r\n /**\r\n * Defines wether or not bump Wwves modify the reflection.\r\n */\r\n @serialize(\"bumpAffectsReflection\")\r\n private _bumpAffectsReflection = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public bumpAffectsReflection: boolean;\r\n\r\n /**\r\n * Defines the water color blended with the refraction (near).\r\n */\r\n @serializeAsColor3()\r\n public waterColor: Color3 = new Color3(0.1, 0.1, 0.6);\r\n /**\r\n * Defines the blend factor related to the water color.\r\n */\r\n @serialize()\r\n public colorBlendFactor: number = 0.2;\r\n /**\r\n * Defines the water color blended with the reflection (far).\r\n */\r\n @serializeAsColor3()\r\n public waterColor2: Color3 = new Color3(0.1, 0.1, 0.6);\r\n /**\r\n * Defines the blend factor related to the water color (reflection, far).\r\n */\r\n @serialize()\r\n public colorBlendFactor2: number = 0.2;\r\n /**\r\n * Defines the maximum length of a wave.\r\n */\r\n @serialize()\r\n public waveLength: number = 0.1;\r\n\r\n /**\r\n * Defines the waves speed.\r\n */\r\n @serialize()\r\n public waveSpeed: number = 1.0;\r\n\r\n /**\r\n * Defines the number of times waves are repeated. This is typically used to adjust waves count according to the ground's size where the material is applied on.\r\n */\r\n @serialize()\r\n public waveCount: number = 20;\r\n /**\r\n * Sets or gets whether or not automatic clipping should be enabled or not. Setting to true will save performances and\r\n * will avoid calculating useless pixels in the pixel shader of the water material.\r\n */\r\n @serialize()\r\n public disableClipPlane: boolean = false;\r\n\r\n /**\r\n * Defines whether or not to use world coordinates for wave deformations.\r\n * The default value is false, meaning that the deformation is applied in object (local) space.\r\n * You will probably need to set it to true if you are using instances or thin instances for your water objects.\r\n */\r\n @serialize(\"useWorldCoordinatesForWaveDeformation\")\r\n private _useWorldCoordinatesForWaveDeformation = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public useWorldCoordinatesForWaveDeformation: boolean;\r\n\r\n protected _renderTargets = new SmartArray<RenderTargetTexture>(16);\r\n\r\n /*\r\n * Private members\r\n */\r\n private _mesh: Nullable<AbstractMesh> = null;\r\n\r\n private _refractionRTT: Nullable<RenderTargetTexture>;\r\n private _reflectionRTT: Nullable<RenderTargetTexture>;\r\n\r\n private _reflectionTransform: Matrix = Matrix.Zero();\r\n private _lastTime: number = 0;\r\n private _lastDeltaTime: number = 0;\r\n\r\n private _waitingRenderList: Nullable<string[]>;\r\n\r\n private _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;\r\n private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n */\r\n public override get hasRenderTargetTextures(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Constructor\r\n * @param name\r\n * @param scene\r\n * @param renderTargetSize\r\n */\r\n constructor(\r\n name: string,\r\n scene?: Scene,\r\n public renderTargetSize: Vector2 = new Vector2(512, 512)\r\n ) {\r\n super(name, scene);\r\n\r\n this._createRenderTargets(this.getScene(), renderTargetSize);\r\n\r\n // Create render targets\r\n this.getRenderTargetTextures = (): SmartArray<RenderTargetTexture> => {\r\n this._renderTargets.reset();\r\n this._renderTargets.push(<RenderTargetTexture>this._reflectionRTT);\r\n this._renderTargets.push(<RenderTargetTexture>this._refractionRTT);\r\n\r\n return this._renderTargets;\r\n };\r\n\r\n this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;\r\n if (this._imageProcessingConfiguration) {\r\n this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {\r\n this._markAllSubMeshesAsImageProcessingDirty();\r\n });\r\n }\r\n }\r\n\r\n // Get / Set\r\n public get refractionTexture(): Nullable<RenderTargetTexture> {\r\n return this._refractionRTT;\r\n }\r\n\r\n public get reflectionTexture(): Nullable<RenderTargetTexture> {\r\n return this._reflectionRTT;\r\n }\r\n\r\n // Methods\r\n public addToRenderList(node: any): void {\r\n if (this._refractionRTT && this._refractionRTT.renderList) {\r\n this._refractionRTT.renderList.push(node);\r\n }\r\n\r\n if (this._reflectionRTT && this._reflectionRTT.renderList) {\r\n this._reflectionRTT.renderList.push(node);\r\n }\r\n }\r\n\r\n public removeFromRenderList(node: any): void {\r\n if (this._refractionRTT && this._refractionRTT.renderList) {\r\n const idx = this._refractionRTT.renderList.indexOf(node);\r\n if (idx !== -1) {\r\n this._refractionRTT.renderList.splice(idx, 1);\r\n }\r\n }\r\n\r\n if (this._reflectionRTT && this._reflectionRTT.renderList) {\r\n const idx = this._reflectionRTT.renderList.indexOf(node);\r\n if (idx !== -1) {\r\n this._reflectionRTT.renderList.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n public enableRenderTargets(enable: boolean): void {\r\n const refreshRate = enable ? 1 : 0;\r\n\r\n if (this._refractionRTT) {\r\n this._refractionRTT.refreshRate = refreshRate;\r\n }\r\n\r\n if (this._reflectionRTT) {\r\n this._reflectionRTT.refreshRate = refreshRate;\r\n }\r\n }\r\n\r\n public getRenderList(): Nullable<AbstractMesh[]> {\r\n return this._refractionRTT ? this._refractionRTT.renderList : [];\r\n }\r\n\r\n public get renderTargetsEnabled(): boolean {\r\n return !(this._refractionRTT && this._refractionRTT.refreshRate === 0);\r\n }\r\n\r\n public override needAlphaBlending(): boolean {\r\n return this.alpha < 1.0;\r\n }\r\n\r\n public override needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public override getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n public override isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new WaterMaterialDefines();\r\n }\r\n\r\n const defines = <WaterMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Textures\r\n if (defines._areTexturesDirty) {\r\n defines._needUVs = false;\r\n if (scene.texturesEnabled) {\r\n if (this.bumpTexture && MaterialFlags.BumpTextureEnabled) {\r\n if (!this.bumpTexture.isReady()) {\r\n return false;\r\n } else {\r\n defines._needUVs = true;\r\n defines.BUMP = true;\r\n }\r\n }\r\n\r\n if (MaterialFlags.ReflectionTextureEnabled) {\r\n defines.REFLECTION = true;\r\n }\r\n }\r\n }\r\n\r\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances ? true : false);\r\n\r\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);\r\n\r\n if (defines._areMiscDirty) {\r\n defines.FRESNELSEPARATE = this._fresnelSeparate;\r\n defines.BUMPSUPERIMPOSE = this._bumpSuperimpose;\r\n defines.BUMPAFFECTSREFLECTION = this._bumpAffectsReflection;\r\n defines.USE_WORLD_COORDINATES = this._useWorldCoordinatesForWaveDeformation;\r\n }\r\n\r\n // Lights\r\n defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);\r\n\r\n // Image processing\r\n if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {\r\n if (!this._imageProcessingConfiguration.isReady()) {\r\n return false;\r\n }\r\n\r\n this._imageProcessingConfiguration.prepareDefines(defines);\r\n\r\n defines.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace;\r\n defines.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;\r\n }\r\n\r\n // Attribs\r\n PrepareDefinesForAttributes(mesh, defines, true, true);\r\n\r\n // Configure this\r\n this._mesh = mesh;\r\n\r\n if (this._waitingRenderList) {\r\n for (let i = 0; i < this._waitingRenderList.length; i++) {\r\n this.addToRenderList(scene.getNodeById(this._waitingRenderList[i]));\r\n }\r\n\r\n this._waitingRenderList = null;\r\n }\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n if (defines.LOGARITHMICDEPTH) {\r\n fallbacks.addFallback(0, \"LOGARITHMICDEPTH\");\r\n }\r\n\r\n HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);\r\n\r\n if (defines.NUM_BONE_INFLUENCERS > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n PrepareAttributesForBones(attribs, mesh, defines, fallbacks);\r\n PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"water\";\r\n const join = defines.toString();\r\n const uniforms = [\r\n \"world\",\r\n \"view\",\r\n \"viewProjection\",\r\n \"vEyePosition\",\r\n \"vLightsType\",\r\n \"vDiffuseColor\",\r\n \"vSpecularColor\",\r\n \"vFogInfos\",\r\n \"vFogColor\",\r\n \"pointSize\",\r\n \"vNormalInfos\",\r\n \"mBones\",\r\n \"normalMatrix\",\r\n \"logarithmicDepthConstant\",\r\n\r\n // Water\r\n \"reflectionViewProjection\",\r\n \"windDirection\",\r\n \"waveLength\",\r\n \"time\",\r\n \"windForce\",\r\n \"cameraPosition\",\r\n \"bumpHeight\",\r\n \"waveHeight\",\r\n \"waterColor\",\r\n \"waterColor2\",\r\n \"colorBlendFactor\",\r\n \"colorBlendFactor2\",\r\n \"waveSpeed\",\r\n \"waveCount\",\r\n ];\r\n const samplers = [\r\n \"normalSampler\",\r\n // Water\r\n \"refractionSampler\",\r\n \"reflectionSampler\",\r\n ];\r\n const uniformBuffers: string[] = [];\r\n\r\n if (ImageProcessingConfiguration) {\r\n ImageProcessingConfiguration.PrepareUniforms(uniforms, defines);\r\n ImageProcessingConfiguration.PrepareSamplers(samplers, defines);\r\n }\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: this.maxSimultaneousLights,\r\n });\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n drawWrapper._wasPreviouslyUsingInstances = !!useInstances;\r\n\r\n return true;\r\n }\r\n\r\n public override bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <WaterMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect || !this._mesh) {\r\n return;\r\n }\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n\r\n // Bones\r\n BindBonesParameters(mesh, this._activeEffect);\r\n\r\n if (this._mustRebind(scene, effect, subMesh)) {\r\n // Textures\r\n if (this.bumpTexture && MaterialFlags.BumpTextureEnabled) {\r\n this._activeEffect.setTexture(\"normalSampler\", this.bumpTexture);\r\n\r\n this._activeEffect.setFloat2(\"vNormalInfos\", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);\r\n this._activeEffect.setMatrix(\"normalMatrix\", this.bumpTexture.getTextureMatrix());\r\n }\r\n // Clip plane\r\n bindClipPlane(effect, this, scene);\r\n\r\n // Point size\r\n if (this.pointsCloud) {\r\n this._activeEffect.setFloat(\"pointSize\", this.pointSize);\r\n }\r\n\r\n // Log. depth\r\n if (this._useLogarithmicDepth) {\r\n BindLogDepth(defines, effect, scene);\r\n }\r\n\r\n scene.bindEyePosition(effect);\r\n }\r\n\r\n this._activeEffect.setColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha * mesh.visibility);\r\n\r\n if (defines.SPECULARTERM) {\r\n this._activeEffect.setColor4(\"vSpecularColor\", this.specularColor, this.specularPower);\r\n }\r\n\r\n if (scene.lightsEnabled && !this.disableLighting) {\r\n BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);\r\n }\r\n\r\n // View\r\n if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n }\r\n\r\n // Fog\r\n BindFogParameters(scene, mesh, this._activeEffect);\r\n\r\n // Log. depth\r\n BindLogDepth(defines, this._activeEffect, scene);\r\n\r\n // Water\r\n if (MaterialFlags.ReflectionTextureEnabled) {\r\n this._activeEffect.setTexture(\"refractionSampler\", this._refractionRTT);\r\n this._activeEffect.setTexture(\"reflectionSampler\", this._reflectionRTT);\r\n }\r\n\r\n const wrvp = this._reflectionTransform.multiply(scene.getProjectionMatrix());\r\n\r\n // Add delta time. Prevent adding delta time if it hasn't changed.\r\n const deltaTime = scene.getEngine().getDeltaTime();\r\n if (deltaTime !== this._lastDeltaTime) {\r\n this._lastDeltaTime = deltaTime;\r\n this._lastTime += this._lastDeltaTime;\r\n }\r\n\r\n this._activeEffect.setMatrix(\"reflectionViewProjection\", wrvp);\r\n this._activeEffect.setVector2(\"windDirection\", this.windDirection);\r\n this._activeEffect.setFloat(\"waveLength\", this.waveLength);\r\n this._activeEffect.setFloat(\"time\", this._lastTime / 100000);\r\n this._activeEffect.setFloat(\"windForce\", this.windForce);\r\n this._activeEffect.setFloat(\"waveHeight\", this.waveHeight);\r\n this._activeEffect.setFloat(\"bumpHeight\", this.bumpHeight);\r\n this._activeEffect.setColor4(\"waterColor\", this.waterColor, 1.0);\r\n this._activeEffect.setFloat(\"colorBlendFactor\", this.colorBlendFactor);\r\n this._activeEffect.setColor4(\"waterColor2\", this.waterColor2, 1.0);\r\n this._activeEffect.setFloat(\"colorBlendFactor2\", this.colorBlendFactor2);\r\n this._activeEffect.setFloat(\"waveSpeed\", this.waveSpeed);\r\n this._activeEffect.setFloat(\"waveCount\", this.waveCount);\r\n\r\n // image processing\r\n if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {\r\n this._imageProcessingConfiguration.bind(this._activeEffect);\r\n }\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n private _createRenderTargets(scene: Scene, renderTargetSize: Vector2): void {\r\n // Render targets\r\n this._refractionRTT = new RenderTargetTexture(name + \"_refraction\", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);\r\n this._refractionRTT.wrapU = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._refractionRTT.wrapV = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._refractionRTT.ignoreCameraViewport = true;\r\n\r\n let boundingBoxRendererEnabled = false;\r\n this._refractionRTT.onBeforeRenderObservable.add(() => {\r\n boundingBoxRendererEnabled = scene.getBoundingBoxRenderer().enabled;\r\n scene.getBoundingBoxRenderer().enabled = false;\r\n });\r\n this._refractionRTT.onAfterRenderObservable.add(() => {\r\n scene.getBoundingBoxRenderer().enabled = boundingBoxRendererEnabled;\r\n });\r\n\r\n this._reflectionRTT = new RenderTargetTexture(name + \"_reflection\", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);\r\n this._reflectionRTT.wrapU = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._reflectionRTT.wrapV = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._reflectionRTT.ignoreCameraViewport = true;\r\n\r\n let isVisible: boolean;\r\n let clipPlane: Nullable<Plane> = null;\r\n let savedViewMatrix: Matrix;\r\n const mirrorMatrix = Matrix.Zero();\r\n\r\n this._refractionRTT.onBeforeRender = () => {\r\n if (this._mesh) {\r\n isVisible = this._mesh.isVisible;\r\n this._mesh.isVisible = false;\r\n }\r\n\r\n // Clip plane\r\n if (!this.disableClipPlane) {\r\n clipPlane = scene.clipPlane;\r\n\r\n const positiony = this._mesh ? this._mesh.absolutePosition.y : 0.0;\r\n scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony + 0.05, 0), new Vector3(0, 1, 0));\r\n }\r\n };\r\n\r\n this._refractionRTT.onAfterRender = () => {\r\n if (this._mesh) {\r\n this._mesh.isVisible = isVisible;\r\n }\r\n\r\n // Clip plane\r\n if (!this.disableClipPlane) {\r\n scene.clipPlane = clipPlane;\r\n }\r\n };\r\n\r\n this._reflectionRTT.onBeforeRender = () => {\r\n if (this._mesh) {\r\n isVisible = this._mesh.isVisible;\r\n this._mesh.isVisible = false;\r\n }\r\n\r\n // Clip plane\r\n if (!this.disableClipPlane) {\r\n clipPlane = scene.clipPlane;\r\n\r\n const positiony = this._mesh ? this._mesh.absolutePosition.y : 0.0;\r\n scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony - 0.05, 0), new Vector3(0, -1, 0));\r\n\r\n Matrix.ReflectionToRef(scene.clipPlane, mirrorMatrix);\r\n }\r\n\r\n // Transform\r\n savedViewMatrix = scene.getViewMatrix();\r\n\r\n mirrorMatrix.multiplyToRef(savedViewMatrix, this._reflectionTransform);\r\n scene.setTransformMatrix(this._reflectionTransform, scene.getProjectionMatrix());\r\n scene._mirroredCameraPosition = Vector3.TransformCoordinates((<Camera>scene.activeCamera).position, mirrorMatrix);\r\n };\r\n\r\n this._reflectionRTT.onAfterRender = () => {\r\n if (this._mesh) {\r\n this._mesh.isVisible = isVisible;\r\n }\r\n\r\n // Clip plane\r\n scene.clipPlane = clipPlane;\r\n\r\n // Transform\r\n scene.setTransformMatrix(savedViewMatrix, scene.getProjectionMatrix());\r\n scene._mirroredCameraPosition = null;\r\n };\r\n }\r\n\r\n public override getAnimatables(): IAnimatable[] {\r\n const results = [];\r\n\r\n if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) {\r\n results.push(this.bumpTexture);\r\n }\r\n if (this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0) {\r\n results.push(this._reflectionRTT);\r\n }\r\n if (this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0) {\r\n results.push(this._refractionRTT);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n public override getActiveTextures(): BaseTexture[] {\r\n const activeTextures = super.getActiveTextures();\r\n\r\n if (this._bumpTexture) {\r\n activeTextures.push(this._bumpTexture);\r\n }\r\n\r\n return activeTextures;\r\n }\r\n\r\n public override hasTexture(texture: BaseTexture): boolean {\r\n if (super.hasTexture(texture)) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture === texture) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public override dispose(forceDisposeEffect?: boolean): void {\r\n if (this.bumpTexture) {\r\n this.bumpTexture.dispose();\r\n }\r\n\r\n let index = this.getScene().customRenderTargets.indexOf(<RenderTargetTexture>this._refractionRTT);\r\n if (index != -1) {\r\n this.getScene().customRenderTargets.splice(index, 1);\r\n }\r\n index = -1;\r\n index = this.getScene().customRenderTargets.indexOf(<RenderTargetTexture>this._reflectionRTT);\r\n if (index != -1) {\r\n this.getScene().customRenderTargets.splice(index, 1);\r\n }\r\n\r\n if (this._reflectionRTT) {\r\n this._reflectionRTT.dispose();\r\n }\r\n if (this._refractionRTT) {\r\n this._refractionRTT.dispose();\r\n }\r\n\r\n // Remove image-processing observer\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public override clone(name: string): WaterMaterial {\r\n return SerializationHelper.Clone(() => new WaterMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.WaterMaterial\";\r\n\r\n serializationObject.renderList = [];\r\n if (this._refractionRTT && this._refractionRTT.renderList) {\r\n for (let i = 0; i < this._refractionRTT.renderList.length; i++) {\r\n serializationObject.renderList.push(this._refractionRTT.renderList[i].id);\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"WaterMaterial\";\r\n }\r\n\r\n // Statics\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial {\r\n const mat = SerializationHelper.Parse(() => new WaterMaterial(source.name, scene), source, scene, rootUrl);\r\n mat._waitingRenderList = source.renderList;\r\n\r\n return mat;\r\n }\r\n\r\n public static CreateDefaultMesh(name: string, scene: Scene): Mesh {\r\n const mesh = CreateGround(name, { width: 512, height: 512, subdivisions: 32, updatable: false }, scene);\r\n return mesh;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.WaterMaterial\", WaterMaterial);\r\n"]}
1
+ {"version":3,"file":"waterMaterial.js","sourceRoot":"","sources":["../../../../dev/materials/src/water/waterMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,2CAA6B;AAC9H,OAAO,EAAE,mBAAmB,EAAE,yDAA2C;AACzE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAClE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,KAAK,EAAE,4CAA8B;AAE9C,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,mBAAmB,EAAE,kEAAoD;AAElF,OAAO,EAAE,eAAe,EAAE,qDAAuC;AAEjE,OAAO,EAAE,4BAA4B,EAAE,kEAAoD;AAC3F,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,aAAa,EAAE,mDAAqC;AAC7D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAKnD,OAAO,EAAE,KAAK,EAAE,iCAAmB;AACnC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,YAAY,EAAE,yDAA2C;AAClE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,6DAA+C;AAC7F,OAAO,EACH,mBAAmB,EACnB,iBAAiB,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B;AAKzB;IADN,SAAS,EAAE;iDACoB;AAKxB;IADP,SAAS,CAAC,iBAAiB,CAAC;uDACI;AAE1B;IADN,gBAAgB,CAAC,8BAA8B,CAAC;sDACjB;AAMxB;IADP,SAAS,CAAC,iBAAiB,CAAC;uDACI;AAE1B;IADN,gBAAgB,CAAC,8BAA8B,CAAC;sDACjB;AAMxB;IADP,SAAS,CAAC,uBAAuB,CAAC;6DACI;AAEhC;IADN,gBAAgB,CAAC,8BAA8B,CAAC;4DACX;AAM/B;IADN,iBAAiB,EAAE;iDACkC;AAK/C;IADN,SAAS,EAAE;uDAC0B;AAK/B;IADN,iBAAiB,EAAE;kDACmC;AAKhD;IADN,SAAS,EAAE;wDAC2B;AAKhC;IADN,SAAS,EAAE;iDACoB;AAMzB;IADN,SAAS,EAAE;gDACmB;AAMxB;IADN,SAAS,EAAE;gDACkB;AAMvB;IADN,SAAS,EAAE;uDAC6B;AAQjC;IADP,SAAS,CAAC,uCAAuC,CAAC;6EACI;AAEhD;IADN,gBAAgB,CAAC,8BAA8B,CAAC;4EACK;AA6nB1D,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { serializeAsVector2, serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from \"core/Misc/decorators\";\r\nimport { SerializationHelper } from \"core/Misc/decorators.serialization\";\r\nimport { Matrix, Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { Plane } from \"core/Maths/math.plane\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { SmartArray } from \"core/Misc/smartArray\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport type { IImageProcessingConfigurationDefines } from \"core/Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"core/Materials/imageProcessingConfiguration\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { MaterialFlags } from \"core/Materials/materialFlags\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\nimport \"./water.fragment\";\r\nimport \"./water.vertex\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { CreateGround } from \"core/Meshes/Builders/groundBuilder\";\r\nimport { addClipPlaneUniforms, bindClipPlane } from \"core/Materials/clipPlaneMaterialHelper\";\r\nimport {\r\n BindBonesParameters,\r\n BindFogParameters,\r\n BindLights,\r\n BindLogDepth,\r\n HandleFallbacksForShadows,\r\n PrepareAttributesForBones,\r\n PrepareAttributesForInstances,\r\n PrepareDefinesForAttributes,\r\n PrepareDefinesForFrameBoundValues,\r\n PrepareDefinesForLights,\r\n PrepareDefinesForMisc,\r\n PrepareUniformsAndSamplersList,\r\n} from \"core/Materials/materialHelper.functions\";\r\n\r\nimport \"core/Rendering/boundingBoxRenderer\";\r\n\r\nclass WaterMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {\r\n public BUMP = false;\r\n public REFLECTION = false;\r\n public CLIPPLANE = false;\r\n public CLIPPLANE2 = false;\r\n public CLIPPLANE3 = false;\r\n public CLIPPLANE4 = false;\r\n public CLIPPLANE5 = false;\r\n public CLIPPLANE6 = false;\r\n public ALPHATEST = false;\r\n public DEPTHPREPASS = false;\r\n public POINTSIZE = false;\r\n public FOG = false;\r\n public NORMAL = false;\r\n public UV1 = false;\r\n public UV2 = false;\r\n public VERTEXCOLOR = false;\r\n public VERTEXALPHA = false;\r\n public NUM_BONE_INFLUENCERS = 0;\r\n public BonesPerMesh = 0;\r\n public INSTANCES = false;\r\n public INSTANCESCOLOR = false;\r\n public SPECULARTERM = false;\r\n public LOGARITHMICDEPTH = false;\r\n public USE_REVERSE_DEPTHBUFFER = false;\r\n public FRESNELSEPARATE = false;\r\n public BUMPSUPERIMPOSE = false;\r\n public BUMPAFFECTSREFLECTION = false;\r\n public USE_WORLD_COORDINATES = false;\r\n\r\n public IMAGEPROCESSING = false;\r\n public VIGNETTE = false;\r\n public VIGNETTEBLENDMODEMULTIPLY = false;\r\n public VIGNETTEBLENDMODEOPAQUE = false;\r\n public TONEMAPPING = 0;\r\n public CONTRAST = false;\r\n public EXPOSURE = false;\r\n public COLORCURVES = false;\r\n public COLORGRADING = false;\r\n public COLORGRADING3D = false;\r\n public SAMPLER3DGREENDEPTH = false;\r\n public SAMPLER3DBGRMAP = false;\r\n public DITHER = false;\r\n public IMAGEPROCESSINGPOSTPROCESS = false;\r\n public SKIPFINALCOLORCLAMP = false;\r\n\r\n constructor() {\r\n super();\r\n this.rebuild();\r\n }\r\n}\r\n\r\nexport class WaterMaterial extends PushMaterial {\r\n /*\r\n * Public members\r\n */\r\n @serializeAsTexture(\"bumpTexture\")\r\n private _bumpTexture: BaseTexture;\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: BaseTexture;\r\n\r\n @serializeAsColor3()\r\n public diffuseColor = new Color3(1, 1, 1);\r\n\r\n @serializeAsColor3()\r\n public specularColor = new Color3(0, 0, 0);\r\n\r\n @serialize()\r\n public specularPower = 64;\r\n\r\n @serialize(\"disableLighting\")\r\n private _disableLighting = false;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting: boolean;\r\n\r\n @serialize(\"maxSimultaneousLights\")\r\n private _maxSimultaneousLights = 4;\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights: number;\r\n\r\n /**\r\n * Defines the wind force.\r\n */\r\n @serialize()\r\n public windForce: number = 6;\r\n /**\r\n * Defines the direction of the wind in the plane (X, Z).\r\n */\r\n @serializeAsVector2()\r\n public windDirection: Vector2 = new Vector2(0, 1);\r\n /**\r\n * Defines the height of the waves.\r\n */\r\n @serialize()\r\n public waveHeight: number = 0.4;\r\n /**\r\n * Defines the bump height related to the bump map.\r\n */\r\n @serialize()\r\n public bumpHeight: number = 0.4;\r\n /**\r\n * Defines wether or not: to add a smaller moving bump to less steady waves.\r\n */\r\n @serialize(\"bumpSuperimpose\")\r\n private _bumpSuperimpose = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public bumpSuperimpose: boolean;\r\n\r\n /**\r\n * Defines wether or not color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.\r\n */\r\n @serialize(\"fresnelSeparate\")\r\n private _fresnelSeparate = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public fresnelSeparate: boolean;\r\n\r\n /**\r\n * Defines wether or not bump Wwves modify the reflection.\r\n */\r\n @serialize(\"bumpAffectsReflection\")\r\n private _bumpAffectsReflection = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public bumpAffectsReflection: boolean;\r\n\r\n /**\r\n * Defines the water color blended with the refraction (near).\r\n */\r\n @serializeAsColor3()\r\n public waterColor: Color3 = new Color3(0.1, 0.1, 0.6);\r\n /**\r\n * Defines the blend factor related to the water color.\r\n */\r\n @serialize()\r\n public colorBlendFactor: number = 0.2;\r\n /**\r\n * Defines the water color blended with the reflection (far).\r\n */\r\n @serializeAsColor3()\r\n public waterColor2: Color3 = new Color3(0.1, 0.1, 0.6);\r\n /**\r\n * Defines the blend factor related to the water color (reflection, far).\r\n */\r\n @serialize()\r\n public colorBlendFactor2: number = 0.2;\r\n /**\r\n * Defines the maximum length of a wave.\r\n */\r\n @serialize()\r\n public waveLength: number = 0.1;\r\n\r\n /**\r\n * Defines the waves speed.\r\n */\r\n @serialize()\r\n public waveSpeed: number = 1.0;\r\n\r\n /**\r\n * Defines the number of times waves are repeated. This is typically used to adjust waves count according to the ground's size where the material is applied on.\r\n */\r\n @serialize()\r\n public waveCount: number = 20;\r\n /**\r\n * Sets or gets whether or not automatic clipping should be enabled or not. Setting to true will save performances and\r\n * will avoid calculating useless pixels in the pixel shader of the water material.\r\n */\r\n @serialize()\r\n public disableClipPlane: boolean = false;\r\n\r\n /**\r\n * Defines whether or not to use world coordinates for wave deformations.\r\n * The default value is false, meaning that the deformation is applied in object (local) space.\r\n * You will probably need to set it to true if you are using instances or thin instances for your water objects.\r\n */\r\n @serialize(\"useWorldCoordinatesForWaveDeformation\")\r\n private _useWorldCoordinatesForWaveDeformation = false;\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public useWorldCoordinatesForWaveDeformation: boolean;\r\n\r\n protected _renderTargets = new SmartArray<RenderTargetTexture>(16);\r\n\r\n /*\r\n * Private members\r\n */\r\n private _mesh: Nullable<AbstractMesh> = null;\r\n\r\n private _refractionRTT: Nullable<RenderTargetTexture>;\r\n private _reflectionRTT: Nullable<RenderTargetTexture>;\r\n\r\n private _reflectionTransform: Matrix = Matrix.Zero();\r\n private _lastTime: number = 0;\r\n private _lastDeltaTime: number = 0;\r\n\r\n private _waitingRenderList: Nullable<string[]>;\r\n\r\n private _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;\r\n private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n */\r\n public override get hasRenderTargetTextures(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Constructor\r\n * @param name\r\n * @param scene\r\n * @param renderTargetSize\r\n */\r\n constructor(\r\n name: string,\r\n scene?: Scene,\r\n public renderTargetSize: Vector2 = new Vector2(512, 512)\r\n ) {\r\n super(name, scene);\r\n\r\n this._createRenderTargets(this.getScene(), renderTargetSize);\r\n\r\n // Create render targets\r\n this.getRenderTargetTextures = (): SmartArray<RenderTargetTexture> => {\r\n this._renderTargets.reset();\r\n this._renderTargets.push(<RenderTargetTexture>this._reflectionRTT);\r\n this._renderTargets.push(<RenderTargetTexture>this._refractionRTT);\r\n\r\n return this._renderTargets;\r\n };\r\n\r\n this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;\r\n if (this._imageProcessingConfiguration) {\r\n this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {\r\n this._markAllSubMeshesAsImageProcessingDirty();\r\n });\r\n }\r\n }\r\n\r\n // Get / Set\r\n public get refractionTexture(): Nullable<RenderTargetTexture> {\r\n return this._refractionRTT;\r\n }\r\n\r\n public get reflectionTexture(): Nullable<RenderTargetTexture> {\r\n return this._reflectionRTT;\r\n }\r\n\r\n // Methods\r\n public addToRenderList(node: any): void {\r\n if (this._refractionRTT && this._refractionRTT.renderList) {\r\n this._refractionRTT.renderList.push(node);\r\n }\r\n\r\n if (this._reflectionRTT && this._reflectionRTT.renderList) {\r\n this._reflectionRTT.renderList.push(node);\r\n }\r\n }\r\n\r\n public removeFromRenderList(node: any): void {\r\n if (this._refractionRTT && this._refractionRTT.renderList) {\r\n const idx = this._refractionRTT.renderList.indexOf(node);\r\n if (idx !== -1) {\r\n this._refractionRTT.renderList.splice(idx, 1);\r\n }\r\n }\r\n\r\n if (this._reflectionRTT && this._reflectionRTT.renderList) {\r\n const idx = this._reflectionRTT.renderList.indexOf(node);\r\n if (idx !== -1) {\r\n this._reflectionRTT.renderList.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n public enableRenderTargets(enable: boolean): void {\r\n const refreshRate = enable ? 1 : 0;\r\n\r\n if (this._refractionRTT) {\r\n this._refractionRTT.refreshRate = refreshRate;\r\n }\r\n\r\n if (this._reflectionRTT) {\r\n this._reflectionRTT.refreshRate = refreshRate;\r\n }\r\n }\r\n\r\n public getRenderList(): Nullable<AbstractMesh[]> {\r\n return this._refractionRTT ? this._refractionRTT.renderList : [];\r\n }\r\n\r\n public get renderTargetsEnabled(): boolean {\r\n return !(this._refractionRTT && this._refractionRTT.refreshRate === 0);\r\n }\r\n\r\n public override needAlphaBlending(): boolean {\r\n return this.alpha < 1.0;\r\n }\r\n\r\n public override needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public override getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n public override isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {\r\n const drawWrapper = subMesh._drawWrapper;\r\n\r\n if (this.isFrozen) {\r\n if (drawWrapper.effect && drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new WaterMaterialDefines();\r\n }\r\n\r\n const defines = <WaterMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Textures\r\n if (defines._areTexturesDirty) {\r\n defines._needUVs = false;\r\n if (scene.texturesEnabled) {\r\n if (this.bumpTexture && MaterialFlags.BumpTextureEnabled) {\r\n if (!this.bumpTexture.isReady()) {\r\n return false;\r\n } else {\r\n defines._needUVs = true;\r\n defines.BUMP = true;\r\n }\r\n }\r\n\r\n if (MaterialFlags.ReflectionTextureEnabled) {\r\n defines.REFLECTION = true;\r\n }\r\n }\r\n }\r\n\r\n PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances ? true : false);\r\n\r\n PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);\r\n\r\n if (defines._areMiscDirty) {\r\n defines.FRESNELSEPARATE = this._fresnelSeparate;\r\n defines.BUMPSUPERIMPOSE = this._bumpSuperimpose;\r\n defines.BUMPAFFECTSREFLECTION = this._bumpAffectsReflection;\r\n defines.USE_WORLD_COORDINATES = this._useWorldCoordinatesForWaveDeformation;\r\n }\r\n\r\n // Lights\r\n defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);\r\n\r\n // Image processing\r\n if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {\r\n if (!this._imageProcessingConfiguration.isReady()) {\r\n return false;\r\n }\r\n\r\n this._imageProcessingConfiguration.prepareDefines(defines);\r\n\r\n defines.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace;\r\n defines.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;\r\n }\r\n\r\n // Attribs\r\n PrepareDefinesForAttributes(mesh, defines, true, true);\r\n\r\n // Configure this\r\n this._mesh = mesh;\r\n\r\n if (this._waitingRenderList) {\r\n for (let i = 0; i < this._waitingRenderList.length; i++) {\r\n this.addToRenderList(scene.getNodeById(this._waitingRenderList[i]));\r\n }\r\n\r\n this._waitingRenderList = null;\r\n }\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n if (defines.LOGARITHMICDEPTH) {\r\n fallbacks.addFallback(0, \"LOGARITHMICDEPTH\");\r\n }\r\n\r\n HandleFallbacksForShadows(defines, fallbacks, this.maxSimultaneousLights);\r\n\r\n if (defines.NUM_BONE_INFLUENCERS > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n PrepareAttributesForBones(attribs, mesh, defines, fallbacks);\r\n PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"water\";\r\n const join = defines.toString();\r\n const uniforms = [\r\n \"world\",\r\n \"view\",\r\n \"viewProjection\",\r\n \"vEyePosition\",\r\n \"vLightsType\",\r\n \"vDiffuseColor\",\r\n \"vSpecularColor\",\r\n \"vFogInfos\",\r\n \"vFogColor\",\r\n \"pointSize\",\r\n \"vNormalInfos\",\r\n \"mBones\",\r\n \"normalMatrix\",\r\n \"logarithmicDepthConstant\",\r\n\r\n // Water\r\n \"reflectionViewProjection\",\r\n \"windDirection\",\r\n \"waveLength\",\r\n \"time\",\r\n \"windForce\",\r\n \"cameraPosition\",\r\n \"bumpHeight\",\r\n \"waveHeight\",\r\n \"waterColor\",\r\n \"waterColor2\",\r\n \"colorBlendFactor\",\r\n \"colorBlendFactor2\",\r\n \"waveSpeed\",\r\n \"waveCount\",\r\n ];\r\n const samplers = [\r\n \"normalSampler\",\r\n // Water\r\n \"refractionSampler\",\r\n \"reflectionSampler\",\r\n ];\r\n const uniformBuffers: string[] = [];\r\n\r\n if (ImageProcessingConfiguration) {\r\n ImageProcessingConfiguration.PrepareUniforms(uniforms, defines);\r\n ImageProcessingConfiguration.PrepareSamplers(samplers, defines);\r\n }\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: this.maxSimultaneousLights,\r\n });\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n drawWrapper._wasPreviouslyReady = true;\r\n drawWrapper._wasPreviouslyUsingInstances = !!useInstances;\r\n\r\n return true;\r\n }\r\n\r\n public override bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const scene = this.getScene();\r\n\r\n const defines = <WaterMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect || !this._mesh) {\r\n return;\r\n }\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n\r\n // Bones\r\n BindBonesParameters(mesh, this._activeEffect);\r\n\r\n if (this._mustRebind(scene, effect, subMesh)) {\r\n // Textures\r\n if (this.bumpTexture && MaterialFlags.BumpTextureEnabled) {\r\n this._activeEffect.setTexture(\"normalSampler\", this.bumpTexture);\r\n\r\n this._activeEffect.setFloat2(\"vNormalInfos\", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);\r\n this._activeEffect.setMatrix(\"normalMatrix\", this.bumpTexture.getTextureMatrix());\r\n }\r\n // Clip plane\r\n bindClipPlane(effect, this, scene);\r\n\r\n // Point size\r\n if (this.pointsCloud) {\r\n this._activeEffect.setFloat(\"pointSize\", this.pointSize);\r\n }\r\n\r\n // Log. depth\r\n if (this._useLogarithmicDepth) {\r\n BindLogDepth(defines, effect, scene);\r\n }\r\n\r\n scene.bindEyePosition(effect);\r\n }\r\n\r\n this._activeEffect.setColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha * mesh.visibility);\r\n\r\n if (defines.SPECULARTERM) {\r\n this._activeEffect.setColor4(\"vSpecularColor\", this.specularColor, this.specularPower);\r\n }\r\n\r\n if (scene.lightsEnabled && !this.disableLighting) {\r\n BindLights(scene, mesh, this._activeEffect, defines, this.maxSimultaneousLights);\r\n }\r\n\r\n // View\r\n if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {\r\n this._activeEffect.setMatrix(\"view\", scene.getViewMatrix());\r\n }\r\n\r\n // Fog\r\n BindFogParameters(scene, mesh, this._activeEffect);\r\n\r\n // Log. depth\r\n BindLogDepth(defines, this._activeEffect, scene);\r\n\r\n // Water\r\n if (MaterialFlags.ReflectionTextureEnabled) {\r\n this._activeEffect.setTexture(\"refractionSampler\", this._refractionRTT);\r\n this._activeEffect.setTexture(\"reflectionSampler\", this._reflectionRTT);\r\n }\r\n\r\n const wrvp = this._reflectionTransform.multiply(scene.getProjectionMatrix());\r\n\r\n // Add delta time. Prevent adding delta time if it hasn't changed.\r\n const deltaTime = scene.getEngine().getDeltaTime();\r\n if (deltaTime !== this._lastDeltaTime) {\r\n this._lastDeltaTime = deltaTime;\r\n this._lastTime += this._lastDeltaTime;\r\n }\r\n\r\n this._activeEffect.setMatrix(\"reflectionViewProjection\", wrvp);\r\n this._activeEffect.setVector2(\"windDirection\", this.windDirection);\r\n this._activeEffect.setFloat(\"waveLength\", this.waveLength);\r\n this._activeEffect.setFloat(\"time\", this._lastTime / 100000);\r\n this._activeEffect.setFloat(\"windForce\", this.windForce);\r\n this._activeEffect.setFloat(\"waveHeight\", this.waveHeight);\r\n this._activeEffect.setFloat(\"bumpHeight\", this.bumpHeight);\r\n this._activeEffect.setColor4(\"waterColor\", this.waterColor, 1.0);\r\n this._activeEffect.setFloat(\"colorBlendFactor\", this.colorBlendFactor);\r\n this._activeEffect.setColor4(\"waterColor2\", this.waterColor2, 1.0);\r\n this._activeEffect.setFloat(\"colorBlendFactor2\", this.colorBlendFactor2);\r\n this._activeEffect.setFloat(\"waveSpeed\", this.waveSpeed);\r\n this._activeEffect.setFloat(\"waveCount\", this.waveCount);\r\n\r\n // image processing\r\n if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {\r\n this._imageProcessingConfiguration.bind(this._activeEffect);\r\n }\r\n\r\n this._afterBind(mesh, this._activeEffect, subMesh);\r\n }\r\n\r\n private _createRenderTargets(scene: Scene, renderTargetSize: Vector2): void {\r\n // Render targets\r\n this._refractionRTT = new RenderTargetTexture(name + \"_refraction\", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);\r\n this._refractionRTT.wrapU = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._refractionRTT.wrapV = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._refractionRTT.ignoreCameraViewport = true;\r\n\r\n let boundingBoxRendererEnabled = false;\r\n this._refractionRTT.onBeforeRenderObservable.add(() => {\r\n boundingBoxRendererEnabled = scene.getBoundingBoxRenderer().enabled;\r\n scene.getBoundingBoxRenderer().enabled = false;\r\n });\r\n this._refractionRTT.onAfterRenderObservable.add(() => {\r\n scene.getBoundingBoxRenderer().enabled = boundingBoxRendererEnabled;\r\n });\r\n\r\n this._reflectionRTT = new RenderTargetTexture(name + \"_reflection\", { width: renderTargetSize.x, height: renderTargetSize.y }, scene, false, true);\r\n this._reflectionRTT.wrapU = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._reflectionRTT.wrapV = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n this._reflectionRTT.ignoreCameraViewport = true;\r\n\r\n let isVisible: boolean;\r\n let clipPlane: Nullable<Plane> = null;\r\n let savedViewMatrix: Matrix;\r\n const mirrorMatrix = Matrix.Zero();\r\n\r\n this._refractionRTT.onBeforeRender = () => {\r\n if (this._mesh) {\r\n isVisible = this._mesh.isVisible;\r\n this._mesh.isVisible = false;\r\n }\r\n\r\n // Clip plane\r\n if (!this.disableClipPlane) {\r\n clipPlane = scene.clipPlane;\r\n\r\n const positiony = this._mesh ? this._mesh.absolutePosition.y : 0.0;\r\n scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony + 0.05, 0), new Vector3(0, 1, 0));\r\n }\r\n };\r\n\r\n this._refractionRTT.onAfterRender = () => {\r\n if (this._mesh) {\r\n this._mesh.isVisible = isVisible;\r\n }\r\n\r\n // Clip plane\r\n if (!this.disableClipPlane) {\r\n scene.clipPlane = clipPlane;\r\n }\r\n };\r\n\r\n this._reflectionRTT.onBeforeRender = () => {\r\n if (this._mesh) {\r\n isVisible = this._mesh.isVisible;\r\n this._mesh.isVisible = false;\r\n }\r\n\r\n // Clip plane\r\n if (!this.disableClipPlane) {\r\n clipPlane = scene.clipPlane;\r\n\r\n const positiony = this._mesh ? this._mesh.absolutePosition.y : 0.0;\r\n scene.clipPlane = Plane.FromPositionAndNormal(new Vector3(0, positiony - 0.05, 0), new Vector3(0, -1, 0));\r\n\r\n Matrix.ReflectionToRef(scene.clipPlane, mirrorMatrix);\r\n }\r\n\r\n // Transform\r\n savedViewMatrix = scene.getViewMatrix();\r\n\r\n mirrorMatrix.multiplyToRef(savedViewMatrix, this._reflectionTransform);\r\n scene.setTransformMatrix(this._reflectionTransform, scene.getProjectionMatrix());\r\n scene._mirroredCameraPosition = Vector3.TransformCoordinates((<Camera>scene.activeCamera).position, mirrorMatrix);\r\n };\r\n\r\n this._reflectionRTT.onAfterRender = () => {\r\n if (this._mesh) {\r\n this._mesh.isVisible = isVisible;\r\n }\r\n\r\n // Clip plane\r\n scene.clipPlane = clipPlane;\r\n\r\n // Transform\r\n scene.setTransformMatrix(savedViewMatrix, scene.getProjectionMatrix());\r\n scene._mirroredCameraPosition = null;\r\n };\r\n }\r\n\r\n public override getAnimatables(): IAnimatable[] {\r\n const results = [];\r\n\r\n if (this.bumpTexture && this.bumpTexture.animations && this.bumpTexture.animations.length > 0) {\r\n results.push(this.bumpTexture);\r\n }\r\n if (this._reflectionRTT && this._reflectionRTT.animations && this._reflectionRTT.animations.length > 0) {\r\n results.push(this._reflectionRTT);\r\n }\r\n if (this._refractionRTT && this._refractionRTT.animations && this._refractionRTT.animations.length > 0) {\r\n results.push(this._refractionRTT);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n public override getActiveTextures(): BaseTexture[] {\r\n const activeTextures = super.getActiveTextures();\r\n\r\n if (this._bumpTexture) {\r\n activeTextures.push(this._bumpTexture);\r\n }\r\n\r\n return activeTextures;\r\n }\r\n\r\n public override hasTexture(texture: BaseTexture): boolean {\r\n if (super.hasTexture(texture)) {\r\n return true;\r\n }\r\n\r\n if (this._bumpTexture === texture) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public override dispose(forceDisposeEffect?: boolean): void {\r\n if (this.bumpTexture) {\r\n this.bumpTexture.dispose();\r\n }\r\n\r\n let index = this.getScene().customRenderTargets.indexOf(<RenderTargetTexture>this._refractionRTT);\r\n if (index != -1) {\r\n this.getScene().customRenderTargets.splice(index, 1);\r\n }\r\n index = -1;\r\n index = this.getScene().customRenderTargets.indexOf(<RenderTargetTexture>this._reflectionRTT);\r\n if (index != -1) {\r\n this.getScene().customRenderTargets.splice(index, 1);\r\n }\r\n\r\n if (this._reflectionRTT) {\r\n this._reflectionRTT.dispose();\r\n }\r\n if (this._refractionRTT) {\r\n this._refractionRTT.dispose();\r\n }\r\n\r\n // Remove image-processing observer\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n super.dispose(forceDisposeEffect);\r\n }\r\n\r\n public override clone(name: string): WaterMaterial {\r\n return SerializationHelper.Clone(() => new WaterMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.WaterMaterial\";\r\n\r\n serializationObject.renderList = [];\r\n if (this._refractionRTT && this._refractionRTT.renderList) {\r\n for (let i = 0; i < this._refractionRTT.renderList.length; i++) {\r\n serializationObject.renderList.push(this._refractionRTT.renderList[i].id);\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"WaterMaterial\";\r\n }\r\n\r\n // Statics\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial {\r\n const mat = SerializationHelper.Parse(() => new WaterMaterial(source.name, scene), source, scene, rootUrl);\r\n mat._waitingRenderList = source.renderList;\r\n\r\n return mat;\r\n }\r\n\r\n public static CreateDefaultMesh(name: string, scene: Scene): Mesh {\r\n const mesh = CreateGround(name, { width: 512, height: 512, subdivisions: 32, updatable: false }, scene);\r\n return mesh;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.WaterMaterial\", WaterMaterial);\r\n"]}