cf4aad05273d53ad804e38b25958f60d07abd195213b6a525b6b2f46c11b1e08.json 41 KB

1
  1. {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { Matrix } from \"../Maths/math.vector.js\";\nimport { ShaderMaterial } from \"../Materials/shaderMaterial.js\";\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture.js\";\nimport { Color4 } from \"../Maths/math.color.js\";\nimport { PostProcess } from \"../PostProcesses/postProcess.js\";\n/**\n * Class used to render in the mesh UV space\n * @since 5.49.1\n */\nexport class MeshUVSpaceRenderer {\n static _GetShader(scene, shaderLanguage) {\n if (!scene._meshUVSpaceRendererShader) {\n const shader = new ShaderMaterial(\"meshUVSpaceRendererShader\", scene, {\n vertex: \"meshUVSpaceRenderer\",\n fragment: \"meshUVSpaceRenderer\"\n }, {\n attributes: [\"position\", \"normal\", \"uv\"],\n uniforms: [\"world\", \"projMatrix\"],\n samplers: [\"textureSampler\"],\n needAlphaBlending: true,\n shaderLanguage: shaderLanguage\n });\n shader.backFaceCulling = false;\n shader.alphaMode = 2;\n scene.onDisposeObservable.add(() => {\n var _scene$_meshUVSpaceRe;\n (_scene$_meshUVSpaceRe = scene._meshUVSpaceRendererShader) === null || _scene$_meshUVSpaceRe === void 0 || _scene$_meshUVSpaceRe.dispose();\n scene._meshUVSpaceRendererShader = null;\n });\n scene._meshUVSpaceRendererShader = shader;\n }\n return scene._meshUVSpaceRendererShader;\n }\n static _GetMaskShader(scene, shaderLanguage) {\n if (!scene._meshUVSpaceRendererMaskShader) {\n const shader = new ShaderMaterial(\"meshUVSpaceRendererMaskShader\", scene, {\n vertex: \"meshUVSpaceRendererMasker\",\n fragment: \"meshUVSpaceRendererMasker\"\n }, {\n attributes: [\"position\", \"uv\"],\n uniforms: [\"worldViewProjection\"],\n shaderLanguage: shaderLanguage\n });\n shader.backFaceCulling = false;\n shader.alphaMode = 2;\n scene.onDisposeObservable.add(() => {\n var _scene$_meshUVSpaceRe2;\n (_scene$_meshUVSpaceRe2 = scene._meshUVSpaceRendererMaskShader) === null || _scene$_meshUVSpaceRe2 === void 0 || _scene$_meshUVSpaceRe2.dispose();\n scene._meshUVSpaceRendererMaskShader = null;\n });\n scene._meshUVSpaceRendererMaskShader = shader;\n }\n return scene._meshUVSpaceRendererMaskShader;\n }\n static _IsRenderTargetTexture(texture) {\n return texture.renderList !== undefined;\n }\n /**\n * Gets the shader language used in this material.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n /**\n * Creates a new MeshUVSpaceRenderer\n * @param mesh The mesh used for the source UV space\n * @param scene The scene the mesh belongs to\n * @param options The options to use when creating the texture\n */\n constructor(mesh, scene, options) {\n this._textureCreatedInternally = false;\n this._configureUserCreatedTexture = true;\n this._maskTexture = null;\n this._finalPostProcess = null;\n this._shadersLoaded = false;\n this._isDisposed = false;\n /**\n * Clear color of the texture\n */\n this.clearColor = new Color4(0, 0, 0, 0);\n /**\n * Target texture used for rendering\n * If you don't set the property, a RenderTargetTexture will be created internally given the options provided to the constructor.\n * If you provide a RenderTargetTexture, it will be used directly.\n */\n this.texture = null;\n /** Shader language used by the material */\n this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n this._mesh = mesh;\n this._scene = scene;\n this._options = {\n width: 1024,\n height: 1024,\n textureType: 0,\n generateMipMaps: true,\n optimizeUVAllocation: true,\n uvEdgeBlending: false,\n ...options\n };\n this._initShaderSourceAsync();\n }\n _initShaderSourceAsync() {\n var _this = this;\n return _asyncToGenerator(function* () {\n const engine = _this._scene.getEngine();\n if (engine.isWebGPU) {\n _this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n yield Promise.all([import(\"../ShadersWGSL/meshUVSpaceRenderer.vertex.js\"), import(\"../ShadersWGSL/meshUVSpaceRenderer.fragment.js\"), import(\"../ShadersWGSL/meshUVSpaceRendererMasker.vertex.js\"), import(\"../ShadersWGSL/meshUVSpaceRendererMasker.fragment.js\"), import(\"../ShadersWGSL/meshUVSpaceRendererFinaliser.vertex.js\"), import(\"../ShadersWGSL/meshUVSpaceRendererFinaliser.fragment.js\")]);\n } else {\n yield Promise.all([import(\"../Shaders/meshUVSpaceRenderer.vertex.js\"), import(\"../Shaders/meshUVSpaceRenderer.fragment.js\"), import(\"../Shaders/meshUVSpaceRendererMasker.vertex.js\"), import(\"../Shaders/meshUVSpaceRendererMasker.fragment.js\"), import(\"../Shaders/meshUVSpaceRendererFinaliser.vertex.js\"), import(\"../Shaders/meshUVSpaceRendererFinaliser.fragment.js\")]);\n }\n if (_this._isDisposed) {\n return;\n }\n _this._shadersLoaded = true;\n })();\n }\n /**\n * Checks if the texture is ready to be used\n * @returns true if the texture is ready to be used\n */\n isReady() {\n var _this$_maskTexture$is, _this$_maskTexture, _this$_finalPostProce, _this$_finalPostProce2;\n if (!this._shadersLoaded) {\n return false;\n }\n if (!this.texture) {\n this._createDiffuseRTT();\n } else if (this._configureUserCreatedTexture) {\n this._configureUserCreatedRTT();\n }\n // this.texture is guaranteed to be non-null here as it is created in _createDiffuseRTT above\n const textureIsReady = MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) ? this.texture.isReadyForRendering() : this.texture.isReady();\n const maskIsReady = (_this$_maskTexture$is = (_this$_maskTexture = this._maskTexture) === null || _this$_maskTexture === void 0 ? void 0 : _this$_maskTexture.isReadyForRendering()) !== null && _this$_maskTexture$is !== void 0 ? _this$_maskTexture$is : true;\n const postProcessIsReady = (_this$_finalPostProce = (_this$_finalPostProce2 = this._finalPostProcess) === null || _this$_finalPostProce2 === void 0 ? void 0 : _this$_finalPostProce2.isReady()) !== null && _this$_finalPostProce !== void 0 ? _this$_finalPostProce : true;\n return textureIsReady && maskIsReady && postProcessIsReady;\n }\n /**\n * Projects and renders a texture in the mesh UV space\n * @param texture The texture\n * @param position The position of the center of projection (world space coordinates)\n * @param normal The direction of the projection (world space coordinates)\n * @param size The size of the projection\n * @param angle The rotation angle around the direction of the projection (default: 0)\n * @param checkIsReady If true, it will check if the texture is ready before rendering (default: true). If the texture is not ready, a new attempt will be scheduled in 16ms\n */\n renderTexture(texture, position, normal, size, angle = 0, checkIsReady = true) {\n if (checkIsReady && !this.isReady()) {\n setTimeout(() => {\n this.renderTexture(texture, position, normal, size, angle, checkIsReady);\n }, 16);\n return;\n }\n if (!this.texture) {\n this._createDiffuseRTT();\n } else if (this._configureUserCreatedTexture) {\n this._configureUserCreatedRTT();\n }\n // this.texture is guaranteed to be non-null here as it is created in _createDiffuseRTT above\n if (MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) {\n const matrix = this._createProjectionMatrix(position, normal, size, angle);\n const shader = MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage);\n shader.setTexture(\"textureSampler\", texture);\n shader.setMatrix(\"projMatrix\", matrix);\n this.texture.render();\n // We needed the texture only once for the render() call above, so we can remove it from the shader.\n // It's important to do that, because this texture could be disposed by the user, meaning that shader.isReady() would return false as part of the this.texture.isReadyForRendering() call of isReady()\n shader.removeTexture(\"textureSampler\");\n }\n }\n /**\n * Clears the texture map\n */\n clear() {\n var _this$_finalPostProce3;\n if (this.texture && MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) && this.texture.renderTarget) {\n const engine = this._scene.getEngine();\n engine.bindFramebuffer(this.texture.renderTarget);\n engine.clear(this.clearColor, true, true, true);\n engine.unBindFramebuffer(this.texture.renderTarget);\n }\n if ((_this$_finalPostProce3 = this._finalPostProcess) !== null && _this$_finalPostProce3 !== void 0 && _this$_finalPostProce3.inputTexture) {\n var _this$_finalPostProce4, _this$_finalPostProce5;\n const engine = this._scene.getEngine();\n engine.bindFramebuffer((_this$_finalPostProce4 = this._finalPostProcess) === null || _this$_finalPostProce4 === void 0 ? void 0 : _this$_finalPostProce4.inputTexture);\n engine.clear(this.clearColor, true, true, true);\n engine.unBindFramebuffer((_this$_finalPostProce5 = this._finalPostProcess) === null || _this$_finalPostProce5 === void 0 ? void 0 : _this$_finalPostProce5.inputTexture);\n }\n }\n /**\n * Disposes of the resources\n */\n dispose() {\n var _this$_maskTexture2, _this$_finalPostProce6;\n if (this._textureCreatedInternally) {\n var _this$texture;\n (_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.dispose();\n this._textureCreatedInternally = false;\n }\n this._configureUserCreatedTexture = true;\n (_this$_maskTexture2 = this._maskTexture) === null || _this$_maskTexture2 === void 0 || _this$_maskTexture2.dispose();\n this._maskTexture = null;\n (_this$_finalPostProce6 = this._finalPostProcess) === null || _this$_finalPostProce6 === void 0 || _this$_finalPostProce6.dispose();\n this._finalPostProcess = null;\n this._isDisposed = true;\n }\n _configureUserCreatedRTT() {\n this._configureUserCreatedTexture = false;\n if (this.texture && MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) {\n this.texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage));\n this.texture.onClearObservable.add(() => {});\n this.texture.renderList = [this._mesh];\n if (this._options.uvEdgeBlending) {\n this._createMaskTexture();\n this._createPostProcess();\n this.texture.addPostProcess(this._finalPostProcess);\n }\n }\n }\n _createDiffuseRTT() {\n this._textureCreatedInternally = true;\n const texture = this._createRenderTargetTexture(this._options.width, this._options.height);\n texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage));\n this.texture = texture;\n this._configureUserCreatedTexture = false;\n if (this._options.uvEdgeBlending) {\n this._createMaskTexture();\n this._createPostProcess();\n texture.addPostProcess(this._finalPostProcess);\n }\n }\n _createMaskTexture() {\n if (this._maskTexture) {\n return;\n }\n this._maskTexture = new RenderTargetTexture(this._mesh.name + \"_maskTexture\", {\n width: this._options.width,\n height: this._options.height\n }, this._scene, false,\n // No mipmaps for the mask texture\n true, 0, false, 2, undefined, undefined, undefined, 6);\n this._maskTexture.clearColor = new Color4(0, 0, 0, 0);\n // Render the mesh with the mask material to the mask texture\n this._maskTexture.renderList.push(this._mesh);\n this._maskTexture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetMaskShader(this._scene, this._shaderLanguage));\n // Ensure the mask texture is updated\n this._maskTexture.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;\n this._scene.customRenderTargets.push(this._maskTexture);\n }\n _createPostProcess() {\n if (this._finalPostProcess) {\n return;\n }\n this._finalPostProcess = new PostProcess(this._mesh.name + \"_fixSeamsPostProcess\", \"meshUVSpaceRendererFinaliser\", [\"textureSize\"], [\"textureSampler\", \"maskTextureSampler\"], 1.0, null, 1, this._scene.getEngine(), false, null, this._options.textureType, undefined, undefined, undefined, undefined, this._shaderLanguage);\n this._finalPostProcess.onApplyObservable.add(effect => {\n effect.setTexture(\"maskTextureSampler\", this._maskTexture);\n effect.setFloat2(\"textureSize\", this._options.width, this._options.height);\n });\n }\n _createRenderTargetTexture(width, height) {\n const rtt = new RenderTargetTexture(this._mesh.name + \"_uvspaceTexture\", {\n width,\n height\n }, this._scene, this._options.generateMipMaps, true, this._options.textureType, false, this._options.generateMipMaps ? 3 : 2, false, false, false, 5);\n rtt.renderParticles = false;\n rtt.optimizeUVAllocation = !!this._options.optimizeUVAllocation;\n rtt.onClearObservable.addOnce(() => {\n this._scene.getEngine().clear(this.clearColor, true, true, true);\n rtt.onClearObservable.add(() => {}); // this disables clearing the texture for the next frames\n });\n rtt.renderList = [this._mesh];\n return rtt;\n }\n _createProjectionMatrix(position, normal, size, angle = 0) {\n const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2;\n const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z);\n const pitch = Math.atan2(normal.y, len);\n const p = position.add(normal.scale(size.z * 0.5));\n const projWorldMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, angle).multiply(Matrix.Translation(p.x, p.y, p.z));\n const inverseProjWorldMatrix = Matrix.Invert(projWorldMatrix);\n const projMatrix = Matrix.FromArray([2 / size.x, 0, 0, 0, 0, 2 / size.y, 0, 0, 0, 0, 1 / size.z, 0, 0, 0, 0, 1]);\n const screenMatrix = Matrix.FromArray([0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0.5, 0.5, 0.0, 1]);\n return inverseProjWorldMatrix.multiply(projMatrix).multiply(screenMatrix);\n }\n}","map":{"version":3,"names":["Matrix","ShaderMaterial","RenderTargetTexture","Color4","PostProcess","MeshUVSpaceRenderer","_GetShader","scene","shaderLanguage","_meshUVSpaceRendererShader","shader","vertex","fragment","attributes","uniforms","samplers","needAlphaBlending","backFaceCulling","alphaMode","onDisposeObservable","add","_scene$_meshUVSpaceRe","dispose","_GetMaskShader","_meshUVSpaceRendererMaskShader","_scene$_meshUVSpaceRe2","_IsRenderTargetTexture","texture","renderList","undefined","_shaderLanguage","constructor","mesh","options","_textureCreatedInternally","_configureUserCreatedTexture","_maskTexture","_finalPostProcess","_shadersLoaded","_isDisposed","clearColor","_mesh","_scene","_options","width","height","textureType","generateMipMaps","optimizeUVAllocation","uvEdgeBlending","_initShaderSourceAsync","_this","_asyncToGenerator","engine","getEngine","isWebGPU","Promise","all","isReady","_this$_maskTexture$is","_this$_maskTexture","_this$_finalPostProce","_this$_finalPostProce2","_createDiffuseRTT","_configureUserCreatedRTT","textureIsReady","isReadyForRendering","maskIsReady","postProcessIsReady","renderTexture","position","normal","size","angle","checkIsReady","setTimeout","matrix","_createProjectionMatrix","setTexture","setMatrix","render","removeTexture","clear","_this$_finalPostProce3","renderTarget","bindFramebuffer","unBindFramebuffer","inputTexture","_this$_finalPostProce4","_this$_finalPostProce5","_this$_maskTexture2","_this$_finalPostProce6","_this$texture","setMaterialForRendering","onClearObservable","_createMaskTexture","_createPostProcess","addPostProcess","_createRenderTargetTexture","name","push","refreshRate","REFRESHRATE_RENDER_ONCE","customRenderTargets","onApplyObservable","effect","setFloat2","rtt","renderParticles","addOnce","yaw","Math","atan2","z","x","PI","len","sqrt","pitch","y","p","scale","projWorldMatrix","RotationYawPitchRoll","multiply","Translation","inverseProjWorldMatrix","Invert","projMatrix","FromArray","screenMatrix"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/meshUVSpaceRenderer.js"],"sourcesContent":["import { Matrix } from \"../Maths/math.vector.js\";\n\nimport { ShaderMaterial } from \"../Materials/shaderMaterial.js\";\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture.js\";\nimport { Color4 } from \"../Maths/math.color.js\";\nimport { PostProcess } from \"../PostProcesses/postProcess.js\";\n/**\n * Class used to render in the mesh UV space\n * @since 5.49.1\n */\nexport class MeshUVSpaceRenderer {\n static _GetShader(scene, shaderLanguage) {\n if (!scene._meshUVSpaceRendererShader) {\n const shader = new ShaderMaterial(\"meshUVSpaceRendererShader\", scene, {\n vertex: \"meshUVSpaceRenderer\",\n fragment: \"meshUVSpaceRenderer\",\n }, {\n attributes: [\"position\", \"normal\", \"uv\"],\n uniforms: [\"world\", \"projMatrix\"],\n samplers: [\"textureSampler\"],\n needAlphaBlending: true,\n shaderLanguage: shaderLanguage,\n });\n shader.backFaceCulling = false;\n shader.alphaMode = 2;\n scene.onDisposeObservable.add(() => {\n scene._meshUVSpaceRendererShader?.dispose();\n scene._meshUVSpaceRendererShader = null;\n });\n scene._meshUVSpaceRendererShader = shader;\n }\n return scene._meshUVSpaceRendererShader;\n }\n static _GetMaskShader(scene, shaderLanguage) {\n if (!scene._meshUVSpaceRendererMaskShader) {\n const shader = new ShaderMaterial(\"meshUVSpaceRendererMaskShader\", scene, {\n vertex: \"meshUVSpaceRendererMasker\",\n fragment: \"meshUVSpaceRendererMasker\",\n }, {\n attributes: [\"position\", \"uv\"],\n uniforms: [\"worldViewProjection\"],\n shaderLanguage: shaderLanguage,\n });\n shader.backFaceCulling = false;\n shader.alphaMode = 2;\n scene.onDisposeObservable.add(() => {\n scene._meshUVSpaceRendererMaskShader?.dispose();\n scene._meshUVSpaceRendererMaskShader = null;\n });\n scene._meshUVSpaceRendererMaskShader = shader;\n }\n return scene._meshUVSpaceRendererMaskShader;\n }\n static _IsRenderTargetTexture(texture) {\n return texture.renderList !== undefined;\n }\n /**\n * Gets the shader language used in this material.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n /**\n * Creates a new MeshUVSpaceRenderer\n * @param mesh The mesh used for the source UV space\n * @param scene The scene the mesh belongs to\n * @param options The options to use when creating the texture\n */\n constructor(mesh, scene, options) {\n this._textureCreatedInternally = false;\n this._configureUserCreatedTexture = true;\n this._maskTexture = null;\n this._finalPostProcess = null;\n this._shadersLoaded = false;\n this._isDisposed = false;\n /**\n * Clear color of the texture\n */\n this.clearColor = new Color4(0, 0, 0, 0);\n /**\n * Target texture used for rendering\n * If you don't set the property, a RenderTargetTexture will be created internally given the options provided to the constructor.\n * If you provide a RenderTargetTexture, it will be used directly.\n */\n this.texture = null;\n /** Shader language used by the material */\n this._shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n this._mesh = mesh;\n this._scene = scene;\n this._options = {\n width: 1024,\n height: 1024,\n textureType: 0,\n generateMipMaps: true,\n optimizeUVAllocation: true,\n uvEdgeBlending: false,\n ...options,\n };\n this._initShaderSourceAsync();\n }\n async _initShaderSourceAsync() {\n const engine = this._scene.getEngine();\n if (engine.isWebGPU) {\n this._shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n await Promise.all([\n import(\"../ShadersWGSL/meshUVSpaceRenderer.vertex.js\"),\n import(\"../ShadersWGSL/meshUVSpaceRenderer.fragment.js\"),\n import(\"../ShadersWGSL/meshUVSpaceRendererMasker.vertex.js\"),\n import(\"../ShadersWGSL/meshUVSpaceRendererMasker.fragment.js\"),\n import(\"../ShadersWGSL/meshUVSpaceRendererFinaliser.vertex.js\"),\n import(\"../ShadersWGSL/meshUVSpaceRendererFinaliser.fragment.js\"),\n ]);\n }\n else {\n await Promise.all([\n import(\"../Shaders/meshUVSpaceRenderer.vertex.js\"),\n import(\"../Shaders/meshUVSpaceRenderer.fragment.js\"),\n import(\"../Shaders/meshUVSpaceRendererMasker.vertex.js\"),\n import(\"../Shaders/meshUVSpaceRendererMasker.fragment.js\"),\n import(\"../Shaders/meshUVSpaceRendererFinaliser.vertex.js\"),\n import(\"../Shaders/meshUVSpaceRendererFinaliser.fragment.js\"),\n ]);\n }\n if (this._isDisposed) {\n return;\n }\n this._shadersLoaded = true;\n }\n /**\n * Checks if the texture is ready to be used\n * @returns true if the texture is ready to be used\n */\n isReady() {\n if (!this._shadersLoaded) {\n return false;\n }\n if (!this.texture) {\n this._createDiffuseRTT();\n }\n else if (this._configureUserCreatedTexture) {\n this._configureUserCreatedRTT();\n }\n // this.texture is guaranteed to be non-null here as it is created in _createDiffuseRTT above\n const textureIsReady = MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) ? this.texture.isReadyForRendering() : this.texture.isReady();\n const maskIsReady = this._maskTexture?.isReadyForRendering() ?? true;\n const postProcessIsReady = this._finalPostProcess?.isReady() ?? true;\n return textureIsReady && maskIsReady && postProcessIsReady;\n }\n /**\n * Projects and renders a texture in the mesh UV space\n * @param texture The texture\n * @param position The position of the center of projection (world space coordinates)\n * @param normal The direction of the projection (world space coordinates)\n * @param size The size of the projection\n * @param angle The rotation angle around the direction of the projection (default: 0)\n * @param checkIsReady If true, it will check if the texture is ready before rendering (default: true). If the texture is not ready, a new attempt will be scheduled in 16ms\n */\n renderTexture(texture, position, normal, size, angle = 0, checkIsReady = true) {\n if (checkIsReady && !this.isReady()) {\n setTimeout(() => {\n this.renderTexture(texture, position, normal, size, angle, checkIsReady);\n }, 16);\n return;\n }\n if (!this.texture) {\n this._createDiffuseRTT();\n }\n else if (this._configureUserCreatedTexture) {\n this._configureUserCreatedRTT();\n }\n // this.texture is guaranteed to be non-null here as it is created in _createDiffuseRTT above\n if (MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) {\n const matrix = this._createProjectionMatrix(position, normal, size, angle);\n const shader = MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage);\n shader.setTexture(\"textureSampler\", texture);\n shader.setMatrix(\"projMatrix\", matrix);\n this.texture.render();\n // We needed the texture only once for the render() call above, so we can remove it from the shader.\n // It's important to do that, because this texture could be disposed by the user, meaning that shader.isReady() would return false as part of the this.texture.isReadyForRendering() call of isReady()\n shader.removeTexture(\"textureSampler\");\n }\n }\n /**\n * Clears the texture map\n */\n clear() {\n if (this.texture && MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture) && this.texture.renderTarget) {\n const engine = this._scene.getEngine();\n engine.bindFramebuffer(this.texture.renderTarget);\n engine.clear(this.clearColor, true, true, true);\n engine.unBindFramebuffer(this.texture.renderTarget);\n }\n if (this._finalPostProcess?.inputTexture) {\n const engine = this._scene.getEngine();\n engine.bindFramebuffer(this._finalPostProcess?.inputTexture);\n engine.clear(this.clearColor, true, true, true);\n engine.unBindFramebuffer(this._finalPostProcess?.inputTexture);\n }\n }\n /**\n * Disposes of the resources\n */\n dispose() {\n if (this._textureCreatedInternally) {\n this.texture?.dispose();\n this._textureCreatedInternally = false;\n }\n this._configureUserCreatedTexture = true;\n this._maskTexture?.dispose();\n this._maskTexture = null;\n this._finalPostProcess?.dispose();\n this._finalPostProcess = null;\n this._isDisposed = true;\n }\n _configureUserCreatedRTT() {\n this._configureUserCreatedTexture = false;\n if (this.texture && MeshUVSpaceRenderer._IsRenderTargetTexture(this.texture)) {\n this.texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage));\n this.texture.onClearObservable.add(() => { });\n this.texture.renderList = [this._mesh];\n if (this._options.uvEdgeBlending) {\n this._createMaskTexture();\n this._createPostProcess();\n this.texture.addPostProcess(this._finalPostProcess);\n }\n }\n }\n _createDiffuseRTT() {\n this._textureCreatedInternally = true;\n const texture = this._createRenderTargetTexture(this._options.width, this._options.height);\n texture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetShader(this._scene, this._shaderLanguage));\n this.texture = texture;\n this._configureUserCreatedTexture = false;\n if (this._options.uvEdgeBlending) {\n this._createMaskTexture();\n this._createPostProcess();\n texture.addPostProcess(this._finalPostProcess);\n }\n }\n _createMaskTexture() {\n if (this._maskTexture) {\n return;\n }\n this._maskTexture = new RenderTargetTexture(this._mesh.name + \"_maskTexture\", { width: this._options.width, height: this._options.height }, this._scene, false, // No mipmaps for the mask texture\n true, 0, false, 2, undefined, undefined, undefined, 6);\n this._maskTexture.clearColor = new Color4(0, 0, 0, 0);\n // Render the mesh with the mask material to the mask texture\n this._maskTexture.renderList.push(this._mesh);\n this._maskTexture.setMaterialForRendering(this._mesh, MeshUVSpaceRenderer._GetMaskShader(this._scene, this._shaderLanguage));\n // Ensure the mask texture is updated\n this._maskTexture.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;\n this._scene.customRenderTargets.push(this._maskTexture);\n }\n _createPostProcess() {\n if (this._finalPostProcess) {\n return;\n }\n this._finalPostProcess = new PostProcess(this._mesh.name + \"_fixSeamsPostProcess\", \"meshUVSpaceRendererFinaliser\", [\"textureSize\"], [\"textureSampler\", \"maskTextureSampler\"], 1.0, null, 1, this._scene.getEngine(), false, null, this._options.textureType, undefined, undefined, undefined, undefined, this._shaderLanguage);\n this._finalPostProcess.onApplyObservable.add((effect) => {\n effect.setTexture(\"maskTextureSampler\", this._maskTexture);\n effect.setFloat2(\"textureSize\", this._options.width, this._options.height);\n });\n }\n _createRenderTargetTexture(width, height) {\n const rtt = new RenderTargetTexture(this._mesh.name + \"_uvspaceTexture\", { width, height }, this._scene, this._options.generateMipMaps, true, this._options.textureType, false, this._options.generateMipMaps ? 3 : 2, false, false, false, 5);\n rtt.renderParticles = false;\n rtt.optimizeUVAllocation = !!this._options.optimizeUVAllocation;\n rtt.onClearObservable.addOnce(() => {\n this._scene.getEngine().clear(this.clearColor, true, true, true);\n rtt.onClearObservable.add(() => { }); // this disables clearing the texture for the next frames\n });\n rtt.renderList = [this._mesh];\n return rtt;\n }\n _createProjectionMatrix(position, normal, size, angle = 0) {\n const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2;\n const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z);\n const pitch = Math.atan2(normal.y, len);\n const p = position.add(normal.scale(size.z * 0.5));\n const projWorldMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, angle).multiply(Matrix.Translation(p.x, p.y, p.z));\n const inverseProjWorldMatrix = Matrix.Invert(projWorldMatrix);\n const projMatrix = Matrix.FromArray([2 / size.x, 0, 0, 0, 0, 2 / size.y, 0, 0, 0, 0, 1 / size.z, 0, 0, 0, 0, 1]);\n const screenMatrix = Matrix.FromArray([0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0.5, 0.5, 0.0, 1]);\n return inverseProjWorldMatrix.multiply(projMatrix).multiply(screenMatrix);\n }\n}\n"],"mappings":";AAAA,SAASA,MAAM,QAAQ,yBAAyB;AAEhD,SAASC,cAAc,QAAQ,gCAAgC;AAC/D,SAASC,mBAAmB,QAAQ,8CAA8C;AAClF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,WAAW,QAAQ,iCAAiC;AAC7D;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,CAAC;EAC7B,OAAOC,UAAUA,CAACC,KAAK,EAAEC,cAAc,EAAE;IACrC,IAAI,CAACD,KAAK,CAACE,0BAA0B,EAAE;MACnC,MAAMC,MAAM,GAAG,IAAIT,cAAc,CAAC,2BAA2B,EAAEM,KAAK,EAAE;QAClEI,MAAM,EAAE,qBAAqB;QAC7BC,QAAQ,EAAE;MACd,CAAC,EAAE;QACCC,UAAU,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC;QACxCC,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;QACjCC,QAAQ,EAAE,CAAC,gBAAgB,CAAC;QAC5BC,iBAAiB,EAAE,IAAI;QACvBR,cAAc,EAAEA;MACpB,CAAC,CAAC;MACFE,MAAM,CAACO,eAAe,GAAG,KAAK;MAC9BP,MAAM,CAACQ,SAAS,GAAG,CAAC;MACpBX,KAAK,CAACY,mBAAmB,CAACC,GAAG,CAAC,MAAM;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