dc30852b60091f286ec50bdd5406822298d294853bf2e4029592d01e4b6fb356.json 41 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { InputBlock } from \"../Input/inputBlock.js\";\nimport { NodeMaterialConnectionPointCustomObject } from \"../../nodeMaterialConnectionPointCustomObject.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock.js\";\nimport { CubeTexture } from \"../../../Textures/cubeTexture.js\";\nimport { Texture } from \"../../../Textures/texture.js\";\nimport { NodeMaterialSystemValues } from \"../../Enums/nodeMaterialSystemValues.js\";\n/**\n * Block used to implement the refraction part of the sub surface module of the PBR material\n */\nexport class RefractionBlock extends NodeMaterialBlock {\n /**\n * Create a new RefractionBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment);\n /**\n * This parameters will make the material used its opacity to control how much it is refracting against not.\n * Materials half opaque for instance using refraction could benefit from this control.\n */\n this.linkRefractionWithTransparency = false;\n /**\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\n */\n this.invertRefractionY = false;\n /**\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\n */\n this.useThicknessAsDepth = false;\n this._isUnique = true;\n this.registerInput(\"intensity\", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);\n this.registerInput(\"tintAtDistance\", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);\n this.registerInput(\"volumeIndexOfRefraction\", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);\n this.registerOutput(\"refraction\", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject(\"refraction\", this, 1 /* NodeMaterialConnectionPointDirection.Output */, RefractionBlock, \"RefractionBlock\"));\n }\n /**\n * Initialize the block and prepare the context for build\n * @param state defines the state that will be used for the build\n */\n initialize(state) {\n state._excludeVariableName(\"vRefractionPosition\");\n state._excludeVariableName(\"vRefractionSize\");\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"RefractionBlock\";\n }\n /**\n * Gets the intensity input component\n */\n get intensity() {\n return this._inputs[0];\n }\n /**\n * Gets the tint at distance input component\n */\n get tintAtDistance() {\n return this._inputs[1];\n }\n /**\n * Gets the volume index of refraction input component\n */\n get volumeIndexOfRefraction() {\n return this._inputs[2];\n }\n /**\n * Gets the view input component\n */\n get view() {\n return this.viewConnectionPoint;\n }\n /**\n * Gets the refraction object output component\n */\n get refraction() {\n return this._outputs[0];\n }\n /**\n * Returns true if the block has a texture\n */\n get hasTexture() {\n return !!this._getTexture();\n }\n _getTexture() {\n if (this.texture) {\n return this.texture;\n }\n return this._scene.environmentTexture;\n }\n autoConfigure(material, additionalFilteringInfo = () => true) {\n if (!this.intensity.isConnected) {\n const intensityInput = new InputBlock(\"Refraction intensity\", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);\n intensityInput.value = 1;\n intensityInput.output.connectTo(this.intensity);\n }\n if (this.view && !this.view.isConnected) {\n let viewInput = material.getInputBlockByPredicate(b => b.systemValue === NodeMaterialSystemValues.View && additionalFilteringInfo(b));\n if (!viewInput) {\n viewInput = new InputBlock(\"view\");\n viewInput.setAsSystemValue(NodeMaterialSystemValues.View);\n }\n viewInput.output.connectTo(this.view);\n }\n }\n prepareDefines(mesh, nodeMaterial, defines) {\n super.prepareDefines(mesh, nodeMaterial, defines);\n const refractionTexture = this._getTexture();\n const refraction = refractionTexture && refractionTexture.getTextureMatrix;\n defines.setValue(\"SS_REFRACTION\", refraction, true);\n if (!refraction) {\n return;\n }\n defines.setValue(this._define3DName, refractionTexture.isCube, true);\n defines.setValue(this._defineLODRefractionAlpha, refractionTexture.lodLevelInAlpha, true);\n defines.setValue(this._defineLinearSpecularRefraction, refractionTexture.linearSpecularLOD, true);\n defines.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem && refractionTexture.isCube ? !refractionTexture.invertZ : refractionTexture.invertZ, true);\n defines.setValue(\"SS_LINKREFRACTIONTOTRANSPARENCY\", this.linkRefractionWithTransparency, true);\n defines.setValue(\"SS_GAMMAREFRACTION\", refractionTexture.gammaSpace, true);\n defines.setValue(\"SS_RGBDREFRACTION\", refractionTexture.isRGBD, true);\n defines.setValue(\"SS_USE_LOCAL_REFRACTIONMAP_CUBIC\", refractionTexture.boundingBoxSize ? true : false, true);\n defines.setValue(\"SS_USE_THICKNESS_AS_DEPTH\", this.useThicknessAsDepth, true);\n }\n isReady() {\n const texture = this._getTexture();\n if (texture && !texture.isReadyOrNotBlocking()) {\n return false;\n }\n return true;\n }\n bind(effect, nodeMaterial, mesh) {\n var _ref, _this$volumeIndexOfRe, _this$volumeIndexOfRe2, _this$indexOfRefracti;\n super.bind(effect, nodeMaterial, mesh);\n const refractionTexture = this._getTexture();\n if (!refractionTexture) {\n return;\n }\n if (refractionTexture.isCube) {\n effect.setTexture(this._cubeSamplerName, refractionTexture);\n } else {\n effect.setTexture(this._2DSamplerName, refractionTexture);\n }\n effect.setMatrix(this._refractionMatrixName, refractionTexture.getRefractionTextureMatrix());\n let depth = 1.0;\n if (!refractionTexture.isCube) {\n if (refractionTexture.depth) {\n depth = refractionTexture.depth;\n }\n }\n const indexOfRefraction = (_ref = (_this$volumeIndexOfRe = (_this$volumeIndexOfRe2 = this.volumeIndexOfRefraction.connectInputBlock) === null || _this$volumeIndexOfRe2 === void 0 ? void 0 : _this$volumeIndexOfRe2.value) !== null && _this$volumeIndexOfRe !== void 0 ? _this$volumeIndexOfRe : (_this$indexOfRefracti = this.indexOfRefractionConnectionPoint.connectInputBlock) === null || _this$indexOfRefracti === void 0 ? void 0 : _this$indexOfRefracti.value) !== null && _ref !== void 0 ? _ref : 1.5;\n effect.setFloat4(this._vRefractionInfosName, refractionTexture.level, 1 / indexOfRefraction, depth, this.invertRefractionY ? -1 : 1);\n effect.setFloat4(this._vRefractionMicrosurfaceInfosName, refractionTexture.getSize().width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset, 1 / indexOfRefraction);\n const width = refractionTexture.getSize().width;\n effect.setFloat2(this._vRefractionFilteringInfoName, width, Math.log2(width));\n if (refractionTexture.boundingBoxSize) {\n const cubeTexture = refractionTexture;\n effect.setVector3(\"vRefractionPosition\", cubeTexture.boundingBoxPosition);\n effect.setVector3(\"vRefractionSize\", cubeTexture.boundingBoxSize);\n }\n }\n /**\n * Gets the main code of the block (fragment side)\n * @param state current state of the node material building\n * @returns the shader code\n */\n getCode(state) {\n const code = \"\";\n state.sharedData.blockingBlocks.push(this);\n state.sharedData.textureBlocks.push(this);\n // Samplers\n this._cubeSamplerName = state._getFreeVariableName(this.name + \"CubeSampler\");\n state.samplers.push(this._cubeSamplerName);\n this._2DSamplerName = state._getFreeVariableName(this.name + \"2DSampler\");\n state.samplers.push(this._2DSamplerName);\n this._define3DName = state._getFreeDefineName(\"SS_REFRACTIONMAP_3D\");\n const refractionTexture = this._getTexture();\n if (refractionTexture) {\n state._samplerDeclaration += `#ifdef ${this._define3DName}\\n`;\n state._emitCubeSampler(this._cubeSamplerName, undefined, true);\n state._samplerDeclaration += `#else\\n`;\n state._emit2DSampler(this._2DSamplerName, undefined, true);\n state._samplerDeclaration += `#endif\\n`;\n }\n // Fragment\n state.sharedData.blocksWithDefines.push(this);\n state.sharedData.bindableBlocks.push(this);\n this._defineLODRefractionAlpha = state._getFreeDefineName(\"SS_LODINREFRACTIONALPHA\");\n this._defineLinearSpecularRefraction = state._getFreeDefineName(\"SS_LINEARSPECULARREFRACTION\");\n this._defineOppositeZ = state._getFreeDefineName(\"SS_REFRACTIONMAP_OPPOSITEZ\");\n this._refractionMatrixName = state._getFreeVariableName(\"refractionMatrix\");\n state._emitUniformFromString(this._refractionMatrixName, NodeMaterialBlockConnectionPointTypes.Matrix);\n if (state.shaderLanguage !== 1 /* ShaderLanguage.WGSL */) {\n state._emitFunction(\"sampleRefraction\", `\n #ifdef ${this._define3DName}\n #define sampleRefraction(s, c) textureCube(s, c)\n #else\n #define sampleRefraction(s, c) texture2D(s, c)\n #endif\\n`, `//${this.name}`);\n state._emitFunction(\"sampleRefractionLod\", `\n #ifdef ${this._define3DName}\n #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\n #else\n #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\n #endif\\n`, `//${this.name}`);\n }\n this._vRefractionMicrosurfaceInfosName = state._getFreeVariableName(\"vRefractionMicrosurfaceInfos\");\n state._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, NodeMaterialBlockConnectionPointTypes.Vector4);\n this._vRefractionInfosName = state._getFreeVariableName(\"vRefractionInfos\");\n state._emitUniformFromString(this._vRefractionInfosName, NodeMaterialBlockConnectionPointTypes.Vector4);\n this._vRefractionFilteringInfoName = state._getFreeVariableName(\"vRefractionFilteringInfo\");\n state._emitUniformFromString(this._vRefractionFilteringInfoName, NodeMaterialBlockConnectionPointTypes.Vector2);\n state._emitUniformFromString(\"vRefractionPosition\", NodeMaterialBlockConnectionPointTypes.Vector3);\n state._emitUniformFromString(\"vRefractionSize\", NodeMaterialBlockConnectionPointTypes.Vector3);\n return code;\n }\n _buildBlock(state) {\n this._scene = state.sharedData.scene;\n return this;\n }\n _dumpPropertiesCode() {\n let codeString = super._dumpPropertiesCode();\n if (this.texture) {\n if (this.texture.isCube) {\n codeString = `${this._codeVariableName}.texture = new BABYLON.CubeTexture(\"${this.texture.name}\");\\n`;\n } else {\n codeString = `${this._codeVariableName}.texture = new BABYLON.Texture(\"${this.texture.name}\");\\n`;\n }\n codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\\n`;\n }\n codeString += `${this._codeVariableName}.linkRefractionWithTransparency = ${this.linkRefractionWithTransparency};\\n`;\n codeString += `${this._codeVariableName}.invertRefractionY = ${this.invertRefractionY};\\n`;\n codeString += `${this._codeVariableName}.useThicknessAsDepth = ${this.useThicknessAsDepth};\\n`;\n return codeString;\n }\n serialize() {\n const serializationObject = super.serialize();\n if (this.texture && !this.texture.isRenderTarget) {\n serializationObject.texture = this.texture.serialize();\n }\n serializationObject.linkRefractionWithTransparency = this.linkRefractionWithTransparency;\n serializationObject.invertRefractionY = this.invertRefractionY;\n serializationObject.useThicknessAsDepth = this.useThicknessAsDepth;\n return serializationObject;\n }\n _deserialize(serializationObject, scene, rootUrl) {\n super._deserialize(serializationObject, scene, rootUrl);\n if (serializationObject.texture) {\n rootUrl = serializationObject.texture.url.indexOf(\"data:\") === 0 ? \"\" : rootUrl;\n if (serializationObject.texture.isCube) {\n this.texture = CubeTexture.Parse(serializationObject.texture, scene, rootUrl);\n } else {\n this.texture = Texture.Parse(serializationObject.texture, scene, rootUrl);\n }\n }\n this.linkRefractionWithTransparency = serializationObject.linkRefractionWithTransparency;\n this.invertRefractionY = serializationObject.invertRefractionY;\n this.useThicknessAsDepth = !!serializationObject.useThicknessAsDepth;\n }\n}\n__decorate([editableInPropertyPage(\"Link refraction to transparency\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", {\n embedded: true,\n notifiers: {\n update: true\n }\n})], RefractionBlock.prototype, \"linkRefractionWithTransparency\", void 0);\n__decorate([editableInPropertyPage(\"Invert refraction Y\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", {\n embedded: true,\n notifiers: {\n update: true\n }\n})], RefractionBlock.prototype, \"invertRefractionY\", void 0);\n__decorate([editableInPropertyPage(\"Use thickness as depth\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", {\n embedded: true,\n notifiers: {\n update: true\n }\n})], RefractionBlock.prototype, \"useThicknessAsDepth\", void 0);\nRegisterClass(\"BABYLON.RefractionBlock\", RefractionBlock);","map":{"version":3,"names":["__decorate","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","InputBlock","NodeMaterialConnectionPointCustomObject","editableInPropertyPage","NodeMaterialBlock","CubeTexture","Texture","NodeMaterialSystemValues","RefractionBlock","constructor","name","Fragment","linkRefractionWithTransparency","invertRefractionY","useThicknessAsDepth","_isUnique","registerInput","Float","registerOutput","Object","initialize","state","_excludeVariableName","getClassName","intensity","_inputs","tintAtDistance","volumeIndexOfRefraction","view","viewConnectionPoint","refraction","_outputs","hasTexture","_getTexture","texture","_scene","environmentTexture","autoConfigure","material","additionalFilteringInfo","isConnected","intensityInput","value","output","connectTo","viewInput","getInputBlockByPredicate","b","systemValue","View","setAsSystemValue","prepareDefines","mesh","nodeMaterial","defines","refractionTexture","getTextureMatrix","setValue","_define3DName","isCube","_defineLODRefractionAlpha","lodLevelInAlpha","_defineLinearSpecularRefraction","linearSpecularLOD","_defineOppositeZ","useRightHandedSystem","invertZ","gammaSpace","isRGBD","boundingBoxSize","isReady","isReadyOrNotBlocking","bind","effect","_ref","_this$volumeIndexOfRe","_this$volumeIndexOfRe2","_this$indexOfRefracti","setTexture","_cubeSamplerName","_2DSamplerName","setMatrix","_refractionMatrixName","getRefractionTextureMatrix","depth","indexOfRefraction","connectInputBlock","indexOfRefractionConnectionPoint","setFloat4","_vRefractionInfosName","level","_vRefractionMicrosurfaceInfosName","getSize","width","lodGenerationScale","lodGenerationOffset","setFloat2","_vRefractionFilteringInfoName","Math","log2","cubeTexture","setVector3","boundingBoxPosition","getCode","code","sharedData","blockingBlocks","push","textureBlocks","_getFreeVariableName","samplers","_getFreeDefineName","_samplerDeclaration","_emitCubeSampler","undefined","_emit2DSampler","blocksWithDefines","bindableBlocks","_emitUniformFromString","Matrix","shaderLanguage","_emitFunction","Vector4","Vector2","Vector3","_buildBlock","scene","_dumpPropertiesCode","codeString","_codeVariableName","coordinatesMode","serialize","serializationObject","isRenderTarget","_deserialize","rootUrl","url","indexOf","Parse","embedded","notifiers","update","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/PBR/refractionBlock.js"],"sourcesContent":["import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { InputBlock } from \"../Input/inputBlock.js\";\nimport { NodeMaterialConnectionPointCustomObject } from \"../../nodeMaterialConnectionPointCustomObject.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock.js\";\nimport { CubeTexture } from \"../../../Textures/cubeTexture.js\";\nimport { Texture } from \"../../../Textures/texture.js\";\nimport { NodeMaterialSystemValues } from \"../../Enums/nodeMaterialSystemValues.js\";\n/**\n * Block used to implement the refraction part of the sub surface module of the PBR material\n */\nexport class RefractionBlock extends NodeMaterialBlock {\n /**\n * Create a new RefractionBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment);\n /**\n * This parameters will make the material used its opacity to control how much it is refracting against not.\n * Materials half opaque for instance using refraction could benefit from this control.\n */\n this.linkRefractionWithTransparency = false;\n /**\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\n */\n this.invertRefractionY = false;\n /**\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\n */\n this.useThicknessAsDepth = false;\n this._isUnique = true;\n this.registerInput(\"intensity\", NodeMaterialBlockConnectionPointTypes.Float, false, NodeMaterialBlockTargets.Fragment);\n this.registerInput(\"tintAtDistance\", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);\n this.registerInput(\"volumeIndexOfRefraction\", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);\n this.registerOutput(\"refraction\", NodeMaterialBlockConnectionPointTypes.Object, NodeMaterialBlockTargets.Fragment, new NodeMaterialConnectionPointCustomObject(\"refraction\", this, 1 /* NodeMaterialConnectionPointDirection.Output */, RefractionBlock, \"RefractionBlock\"));\n }\n /**\n * Initialize the block and prepare the context for build\n * @param state defines the state that will be used for the build\n */\n initialize(state) {\n state._excludeVariableName(\"vRefractionPosition\");\n state._excludeVariableName(\"vRefractionSize\");\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"RefractionBlock\";\n }\n /**\n * Gets the intensity input component\n */\n get intensity() {\n return this._inputs[0];\n }\n /**\n * Gets the tint at distance input component\n */\n get tintAtDistance() {\n return this._inputs[1];\n }\n /**\n * Gets the volume index of refraction input component\n */\n get volumeIndexOfRefraction() {\n return this._inputs[2];\n }\n /**\n * Gets the view input component\n */\n get view() {\n return this.viewConnectionPoint;\n }\n /**\n * Gets the refraction object output component\n */\n get refraction() {\n return this._outputs[0];\n }\n /**\n * Returns true if the block has a texture\n */\n get hasTexture() {\n return !!this._getTexture();\n }\n _getTexture() {\n if (this.texture) {\n return this.texture;\n }\n return this._scene.environmentTexture;\n }\n autoConfigure(material, additionalFilteringInfo = () => true) {\n if (!this.intensity.isConnected) {\n const intensityInput = new InputBlock(\"Refraction intensity\", NodeMaterialBlockTargets.Fragment, NodeMaterialBlockConnectionPointTypes.Float);\n intensityInput.value = 1;\n intensityInput.output.connectTo(this.intensity);\n }\n if (this.view && !this.view.isConnected) {\n let viewInput = material.getInputBlockByPredicate((b) => b.systemValue === NodeMaterialSystemValues.View && additionalFilteringInfo(b));\n if (!viewInput) {\n viewInput = new InputBlock(\"view\");\n viewInput.setAsSystemValue(NodeMaterialSystemValues.View);\n }\n viewInput.output.connectTo(this.view);\n }\n }\n prepareDefines(mesh, nodeMaterial, defines) {\n super.prepareDefines(mesh, nodeMaterial, defines);\n const refractionTexture = this._getTexture();\n const refraction = refractionTexture && refractionTexture.getTextureMatrix;\n defines.setValue(\"SS_REFRACTION\", refraction, true);\n if (!refraction) {\n return;\n }\n defines.setValue(this._define3DName, refractionTexture.isCube, true);\n defines.setValue(this._defineLODRefractionAlpha, refractionTexture.lodLevelInAlpha, true);\n defines.setValue(this._defineLinearSpecularRefraction, refractionTexture.linearSpecularLOD, true);\n defines.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem && refractionTexture.isCube ? !refractionTexture.invertZ : refractionTexture.invertZ, true);\n defines.setValue(\"SS_LINKREFRACTIONTOTRANSPARENCY\", this.linkRefractionWithTransparency, true);\n defines.setValue(\"SS_GAMMAREFRACTION\", refractionTexture.gammaSpace, true);\n defines.setValue(\"SS_RGBDREFRACTION\", refractionTexture.isRGBD, true);\n defines.setValue(\"SS_USE_LOCAL_REFRACTIONMAP_CUBIC\", refractionTexture.boundingBoxSize ? true : false, true);\n defines.setValue(\"SS_USE_THICKNESS_AS_DEPTH\", this.useThicknessAsDepth, true);\n }\n isReady() {\n const texture = this._getTexture();\n if (texture && !texture.isReadyOrNotBlocking()) {\n return false;\n }\n return true;\n }\n bind(effect, nodeMaterial, mesh) {\n super.bind(effect, nodeMaterial, mesh);\n const refractionTexture = this._getTexture();\n if (!refractionTexture) {\n return;\n }\n if (refractionTexture.isCube) {\n effect.setTexture(this._cubeSamplerName, refractionTexture);\n }\n else {\n effect.setTexture(this._2DSamplerName, refractionTexture);\n }\n effect.setMatrix(this._refractionMatrixName, refractionTexture.getRefractionTextureMatrix());\n let depth = 1.0;\n if (!refractionTexture.isCube) {\n if (refractionTexture.depth) {\n depth = refractionTexture.depth;\n }\n }\n const indexOfRefraction = this.volumeIndexOfRefraction.connectInputBlock?.value ?? this.indexOfRefractionConnectionPoint.connectInputBlock?.value ?? 1.5;\n effect.setFloat4(this._vRefractionInfosName, refractionTexture.level, 1 / indexOfRefraction, depth, this.invertRefractionY ? -1 : 1);\n effect.setFloat4(this._vRefractionMicrosurfaceInfosName, refractionTexture.getSize().width, refractionTexture.lodGenerationScale, refractionTexture.lodGenerationOffset, 1 / indexOfRefraction);\n const width = refractionTexture.getSize().width;\n effect.setFloat2(this._vRefractionFilteringInfoName, width, Math.log2(width));\n if (refractionTexture.boundingBoxSize) {\n const cubeTexture = refractionTexture;\n effect.setVector3(\"vRefractionPosition\", cubeTexture.boundingBoxPosition);\n effect.setVector3(\"vRefractionSize\", cubeTexture.boundingBoxSize);\n }\n }\n /**\n * Gets the main code of the block (fragment side)\n * @param state current state of the node material building\n * @returns the shader code\n */\n getCode(state) {\n const code = \"\";\n state.sharedData.blockingBlocks.push(this);\n state.sharedData.textureBlocks.push(this);\n // Samplers\n this._cubeSamplerName = state._getFreeVariableName(this.name + \"CubeSampler\");\n state.samplers.push(this._cubeSamplerName);\n this._2DSamplerName = state._getFreeVariableName(this.name + \"2DSampler\");\n state.samplers.push(this._2DSamplerName);\n this._define3DName = state._getFreeDefineName(\"SS_REFRACTIONMAP_3D\");\n const refractionTexture = this._getTexture();\n if (refractionTexture) {\n state._samplerDeclaration += `#ifdef ${this._define3DName}\\n`;\n state._emitCubeSampler(this._cubeSamplerName, undefined, true);\n state._samplerDeclaration += `#else\\n`;\n state._emit2DSampler(this._2DSamplerName, undefined, true);\n state._samplerDeclaration += `#endif\\n`;\n }\n // Fragment\n state.sharedData.blocksWithDefines.push(this);\n state.sharedData.bindableBlocks.push(this);\n this._defineLODRefractionAlpha = state._getFreeDefineName(\"SS_LODINREFRACTIONALPHA\");\n this._defineLinearSpecularRefraction = state._getFreeDefineName(\"SS_LINEARSPECULARREFRACTION\");\n this._defineOppositeZ = state._getFreeDefineName(\"SS_REFRACTIONMAP_OPPOSITEZ\");\n this._refractionMatrixName = state._getFreeVariableName(\"refractionMatrix\");\n state._emitUniformFromString(this._refractionMatrixName, NodeMaterialBlockConnectionPointTypes.Matrix);\n if (state.shaderLanguage !== 1 /* ShaderLanguage.WGSL */) {\n state._emitFunction(\"sampleRefraction\", `\r\n #ifdef ${this._define3DName}\r\n #define sampleRefraction(s, c) textureCube(s, c)\r\n #else\r\n #define sampleRefraction(s, c) texture2D(s, c)\r\n #endif\\n`, `//${this.name}`);\n state._emitFunction(\"sampleRefractionLod\", `\r\n #ifdef ${this._define3DName}\r\n #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\r\n #else\r\n #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\r\n #endif\\n`, `//${this.name}`);\n }\n this._vRefractionMicrosurfaceInfosName = state._getFreeVariableName(\"vRefractionMicrosurfaceInfos\");\n state._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, NodeMaterialBlockConnectionPointTypes.Vector4);\n this._vRefractionInfosName = state._getFreeVariableName(\"vRefractionInfos\");\n state._emitUniformFromString(this._vRefractionInfosName, NodeMaterialBlockConnectionPointTypes.Vector4);\n this._vRefractionFilteringInfoName = state._getFreeVariableName(\"vRefractionFilteringInfo\");\n state._emitUniformFromString(this._vRefractionFilteringInfoName, NodeMaterialBlockConnectionPointTypes.Vector2);\n state._emitUniformFromString(\"vRefractionPosition\", NodeMaterialBlockConnectionPointTypes.Vector3);\n state._emitUniformFromString(\"vRefractionSize\", NodeMaterialBlockConnectionPointTypes.Vector3);\n return code;\n }\n _buildBlock(state) {\n this._scene = state.sharedData.scene;\n return this;\n }\n _dumpPropertiesCode() {\n let codeString = super._dumpPropertiesCode();\n if (this.texture) {\n if (this.texture.isCube) {\n codeString = `${this._codeVariableName}.texture = new BABYLON.CubeTexture(\"${this.texture.name}\");\\n`;\n }\n else {\n codeString = `${this._codeVariableName}.texture = new BABYLON.Texture(\"${this.texture.name}\");\\n`;\n }\n codeString += `${this._codeVariableName}.texture.coordinatesMode = ${this.texture.coordinatesMode};\\n`;\n }\n codeString += `${this._codeVariableName}.linkRefractionWithTransparency = ${this.linkRefractionWithTransparency};\\n`;\n codeString += `${this._codeVariableName}.invertRefractionY = ${this.invertRefractionY};\\n`;\n codeString += `${this._codeVariableName}.useThicknessAsDepth = ${this.useThicknessAsDepth};\\n`;\n return codeString;\n }\n serialize() {\n const serializationObject = super.serialize();\n if (this.texture && !this.texture.isRenderTarget) {\n serializationObject.texture = this.texture.serialize();\n }\n serializationObject.linkRefractionWithTransparency = this.linkRefractionWithTransparency;\n serializationObject.invertRefractionY = this.invertRefractionY;\n serializationObject.useThicknessAsDepth = this.useThicknessAsDepth;\n return serializationObject;\n }\n _deserialize(serializationObject, scene, rootUrl) {\n super._deserialize(serializationObject, scene, rootUrl);\n if (serializationObject.texture) {\n rootUrl = serializationObject.texture.url.indexOf(\"data:\") === 0 ? \"\" : rootUrl;\n if (serializationObject.texture.isCube) {\n this.texture = CubeTexture.Parse(serializationObject.texture, scene, rootUrl);\n }\n else {\n this.texture = Texture.Parse(serializationObject.texture, scene, rootUrl);\n }\n }\n this.linkRefractionWithTransparency = serializationObject.linkRefractionWithTransparency;\n this.invertRefractionY = serializationObject.invertRefractionY;\n this.useThicknessAsDepth = !!serializationObject.useThicknessAsDepth;\n }\n}\n__decorate([\n editableInPropertyPage(\"Link refraction to transparency\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", { embedded: true, notifiers: { update: true } })\n], RefractionBlock.prototype, \"linkRefractionWithTransparency\", void 0);\n__decorate([\n editableInPropertyPage(\"Invert refraction Y\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", { embedded: true, notifiers: { update: true } })\n], RefractionBlock.prototype, \"invertRefractionY\", void 0);\n__decorate([\n editableInPropertyPage(\"Use thickness as depth\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", { embedded: true, notifiers: { update: true } })\n], RefractionBlock.prototype, \"useThicknessAsDepth\", void 0);\nRegisterClass(\"BABYLON.RefractionBlock\", RefractionBlock);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD,SAASC,qCAAqC,QAAQ,sDAAsD;AAC5G,SAASC,wBAAwB,QAAQ,yCAAyC;AAClF,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,UAAU,QA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