1 |
- {"ast":null,"code":"import { PBRMaterial } from \"@babylonjs/core/Materials/PBR/pbrMaterial.js\";\nimport { GLTFLoader } from \"../glTFLoader.js\";\nimport { RenderTargetTexture } from \"@babylonjs/core/Materials/Textures/renderTargetTexture.js\";\nimport { Observable } from \"@babylonjs/core/Misc/observable.js\";\nimport { Constants } from \"@babylonjs/core/Engines/constants.js\";\nimport { Tools } from \"@babylonjs/core/Misc/tools.js\";\n/**\n * A class to handle setting up the rendering of opaque objects to be shown through transmissive objects.\n */\nclass TransmissionHelper {\n /**\n * Creates the default options for the helper.\n * @returns the default options\n */\n static _GetDefaultOptions() {\n return {\n renderSize: 1024,\n samples: 4,\n lodGenerationScale: 1,\n lodGenerationOffset: -4,\n renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT,\n generateMipmaps: true\n };\n }\n /**\n * constructor\n * @param options Defines the options we want to customize the helper\n * @param scene The scene to add the material to\n */\n constructor(options, scene) {\n this._opaqueRenderTarget = null;\n this._opaqueMeshesCache = [];\n this._transparentMeshesCache = [];\n this._materialObservers = {};\n this._options = {\n ...TransmissionHelper._GetDefaultOptions(),\n ...options\n };\n this._scene = scene;\n this._scene._transmissionHelper = this;\n this.onErrorObservable = new Observable();\n this._scene.onDisposeObservable.addOnce(() => {\n this.dispose();\n });\n this._parseScene();\n this._setupRenderTargets();\n }\n /**\n * Updates the background according to the new options\n * @param options\n */\n updateOptions(options) {\n // First check if any options are actually being changed. If not, exit.\n const newValues = Object.keys(options).filter(key => this._options[key] !== options[key]);\n if (!newValues.length) {\n return;\n }\n const newOptions = {\n ...this._options,\n ...options\n };\n const oldOptions = this._options;\n this._options = newOptions;\n // If size changes, recreate everything\n if (newOptions.renderSize !== oldOptions.renderSize || newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType || newOptions.generateMipmaps !== oldOptions.generateMipmaps || !this._opaqueRenderTarget) {\n this._setupRenderTargets();\n } else {\n this._opaqueRenderTarget.samples = newOptions.samples;\n this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset;\n }\n }\n /**\n * @returns the opaque render target texture or null if not available.\n */\n getOpaqueTarget() {\n return this._opaqueRenderTarget;\n }\n _shouldRenderAsTransmission(material) {\n if (!material) {\n return false;\n }\n if (material instanceof PBRMaterial && material.subSurface.isRefractionEnabled) {\n return true;\n }\n return false;\n }\n _addMesh(mesh) {\n this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this));\n // we need to defer the processing because _addMesh may be called as part as an instance mesh creation, in which case some\n // internal properties are not setup yet, like _sourceMesh (needed when doing mesh.material below)\n Tools.SetImmediate(() => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n if (this._transparentMeshesCache.indexOf(mesh) === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n } else {\n if (this._opaqueMeshesCache.indexOf(mesh) === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n });\n }\n _removeMesh(mesh) {\n mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]);\n delete this._materialObservers[mesh.uniqueId];\n let idx = this._transparentMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._transparentMeshesCache.splice(idx, 1);\n }\n idx = this._opaqueMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._opaqueMeshesCache.splice(idx, 1);\n }\n }\n _parseScene() {\n this._scene.meshes.forEach(this._addMesh.bind(this));\n // Listen for when a mesh is added to the scene and add it to our cache lists.\n this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this));\n // Listen for when a mesh is removed from to the scene and remove it from our cache lists.\n this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));\n }\n // When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.\n _onMeshMaterialChanged(mesh) {\n const transparentIdx = this._transparentMeshesCache.indexOf(mesh);\n const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh);\n // If the material is transparent, make sure that it's added to the transparent list and removed from the opaque list\n const useTransmission = this._shouldRenderAsTransmission(mesh.material);\n if (useTransmission) {\n if (mesh.material instanceof PBRMaterial) {\n mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget;\n }\n if (opaqueIdx !== -1) {\n this._opaqueMeshesCache.splice(opaqueIdx, 1);\n this._transparentMeshesCache.push(mesh);\n } else if (transparentIdx === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n // If the material is opaque, make sure that it's added to the opaque list and removed from the transparent list\n } else {\n if (transparentIdx !== -1) {\n this._transparentMeshesCache.splice(transparentIdx, 1);\n this._opaqueMeshesCache.push(mesh);\n } else if (opaqueIdx === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n }\n /**\n * @internal\n * Check if the opaque render target has not been disposed and can still be used.\n * @returns\n */\n _isRenderTargetValid() {\n var _this$_opaqueRenderTa;\n return ((_this$_opaqueRenderTa = this._opaqueRenderTarget) === null || _this$_opaqueRenderTa === void 0 ? void 0 : _this$_opaqueRenderTa.getInternalTexture()) !== null;\n }\n /**\n * @internal\n * Setup the render targets according to the specified options.\n */\n _setupRenderTargets() {\n var _this$_options$clearC, _this$_options$clearC2;\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n }\n this._opaqueRenderTarget = new RenderTargetTexture(\"opaqueSceneTexture\", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType);\n this._opaqueRenderTarget.ignoreCameraViewport = true;\n this._opaqueRenderTarget.renderList = this._opaqueMeshesCache;\n this._opaqueRenderTarget.clearColor = (_this$_options$clearC = (_this$_options$clearC2 = this._options.clearColor) === null || _this$_options$clearC2 === void 0 ? void 0 : _this$_options$clearC2.clone()) !== null && _this$_options$clearC !== void 0 ? _this$_options$clearC : this._scene.clearColor.clone();\n this._opaqueRenderTarget.gammaSpace = false;\n this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset;\n this._opaqueRenderTarget.samples = this._options.samples;\n this._opaqueRenderTarget.renderSprites = true;\n this._opaqueRenderTarget.renderParticles = true;\n let sceneImageProcessingapplyByPostProcess;\n let saveSceneEnvIntensity;\n this._opaqueRenderTarget.onBeforeBindObservable.add(opaqueRenderTarget => {\n saveSceneEnvIntensity = this._scene.environmentIntensity;\n this._scene.environmentIntensity = 1.0;\n sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;\n if (!this._options.clearColor) {\n this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions);\n } else {\n opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor);\n }\n // we do not use the applyByPostProcess setter to avoid flagging all the materials as \"image processing dirty\"!\n this._scene.imageProcessingConfiguration._applyByPostProcess = true;\n });\n this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {\n this._scene.environmentIntensity = saveSceneEnvIntensity;\n this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;\n });\n this._transparentMeshesCache.forEach(mesh => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n }\n });\n }\n /**\n * Dispose all the elements created by the Helper.\n */\n dispose() {\n this._scene._transmissionHelper = undefined;\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n this._opaqueRenderTarget = null;\n }\n this._transparentMeshesCache = [];\n this._opaqueMeshesCache = [];\n }\n}\nconst NAME = \"KHR_materials_transmission\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_transmission {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 175;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n if (this.enabled) {\n loader.parent.transparencyAsCoverage = true;\n }\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension));\n return Promise.all(promises).then(() => {});\n });\n }\n _loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const pbrMaterial = babylonMaterial;\n // Enables \"refraction\" texture which represents transmitted light.\n pbrMaterial.subSurface.isRefractionEnabled = true;\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\n pbrMaterial.subSurface.volumeIndexOfRefraction = 1.0;\n // Albedo colour will tint transmission.\n pbrMaterial.subSurface.useAlbedoToTintRefraction = true;\n if (extension.transmissionFactor !== undefined) {\n var _scene$_transmissionH;\n pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;\n const scene = pbrMaterial.getScene();\n if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper) {\n new TransmissionHelper({}, pbrMaterial.getScene());\n } else if (pbrMaterial.subSurface.refractionIntensity && !((_scene$_transmissionH = scene._transmissionHelper) !== null && _scene$_transmissionH !== void 0 && _scene$_transmissionH._isRenderTargetValid())) {\n var _scene$_transmissionH2;\n // If the render target is not valid, recreate it.\n (_scene$_transmissionH2 = scene._transmissionHelper) === null || _scene$_transmissionH2 === void 0 || _scene$_transmissionH2._setupRenderTargets();\n }\n } else {\n pbrMaterial.subSurface.refractionIntensity = 0.0;\n pbrMaterial.subSurface.isRefractionEnabled = false;\n return Promise.resolve();\n }\n pbrMaterial.subSurface.minimumThickness = 0.0;\n pbrMaterial.subSurface.maximumThickness = 0.0;\n if (extension.transmissionTexture) {\n extension.transmissionTexture.nonColorData = true;\n return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then(texture => {\n pbrMaterial.subSurface.refractionIntensityTexture = texture;\n pbrMaterial.subSurface.useGltfStyleTextures = true;\n });\n } else {\n return Promise.resolve();\n }\n }\n}\nGLTFLoader.RegisterExtension(NAME, loader => new KHR_materials_transmission(loader));","map":{"version":3,"names":["PBRMaterial","GLTFLoader","RenderTargetTexture","Observable","Constants","Tools","TransmissionHelper","_GetDefaultOptions","renderSize","samples","lodGenerationScale","lodGenerationOffset","renderTargetTextureType","TEXTURETYPE_HALF_FLOAT","generateMipmaps","constructor","options","scene","_opaqueRenderTarget","_opaqueMeshesCache","_transparentMeshesCache","_materialObservers","_options","_scene","_transmissionHelper","onErrorObservable","onDisposeObservable","addOnce","dispose","_parseScene","_setupRenderTargets","updateOptions","newValues","Object","keys","filter","key","length","newOptions","oldOptions","getOpaqueTarget","_shouldRenderAsTransmission","material","subSurface","isRefractionEnabled","_addMesh","mesh","uniqueId","onMaterialChangedObservable","add","_onMeshMaterialChanged","bind","SetImmediate","refractionTexture","indexOf","push","_removeMesh","remove","idx","splice","meshes","forEach","onNewMeshAddedObservable","onMeshRemovedObservable","transparentIdx","opaqueIdx","useTransmission","_isRenderTargetValid","_this$_opaqueRenderTa","getInternalTexture","_this$_options$clearC","_this$_options$clearC2","undefined","ignoreCameraViewport","renderList","clearColor","clone","gammaSpace","renderSprites","renderParticles","sceneImageProcessingapplyByPostProcess","saveSceneEnvIntensity","onBeforeBindObservable","opaqueRenderTarget","environmentIntensity","imageProcessingConfiguration","applyByPostProcess","toLinearSpaceToRef","getEngine","useExactSrgbConversions","copyFrom","_applyByPostProcess","onAfterUnbindObservable","NAME","KHR_materials_transmission","loader","name","order","_loader","enabled","isExtensionUsed","parent","transparencyAsCoverage","loadMaterialPropertiesAsync","context","babylonMaterial","LoadExtensionAsync","extensionContext","extension","promises","Array","loadMaterialBasePropertiesAsync","_loadTransparentPropertiesAsync","Promise","all","then","Error","pbrMaterial","volumeIndexOfRefraction","useAlbedoToTintRefraction","transmissionFactor","_scene$_transmissionH","refractionIntensity","getScene","_scene$_transmissionH2","resolve","minimumThickness","maximumThickness","transmissionTexture","nonColorData","loadTextureInfoAsync","texture","refractionIntensityTexture","useGltfStyleTextures","RegisterExtension"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_transmission.js"],"sourcesContent":["import { PBRMaterial } from \"@babylonjs/core/Materials/PBR/pbrMaterial.js\";\nimport { GLTFLoader } from \"../glTFLoader.js\";\nimport { RenderTargetTexture } from \"@babylonjs/core/Materials/Textures/renderTargetTexture.js\";\nimport { Observable } from \"@babylonjs/core/Misc/observable.js\";\nimport { Constants } from \"@babylonjs/core/Engines/constants.js\";\nimport { Tools } from \"@babylonjs/core/Misc/tools.js\";\n/**\n * A class to handle setting up the rendering of opaque objects to be shown through transmissive objects.\n */\nclass TransmissionHelper {\n /**\n * Creates the default options for the helper.\n * @returns the default options\n */\n static _GetDefaultOptions() {\n return {\n renderSize: 1024,\n samples: 4,\n lodGenerationScale: 1,\n lodGenerationOffset: -4,\n renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT,\n generateMipmaps: true,\n };\n }\n /**\n * constructor\n * @param options Defines the options we want to customize the helper\n * @param scene The scene to add the material to\n */\n constructor(options, scene) {\n this._opaqueRenderTarget = null;\n this._opaqueMeshesCache = [];\n this._transparentMeshesCache = [];\n this._materialObservers = {};\n this._options = {\n ...TransmissionHelper._GetDefaultOptions(),\n ...options,\n };\n this._scene = scene;\n this._scene._transmissionHelper = this;\n this.onErrorObservable = new Observable();\n this._scene.onDisposeObservable.addOnce(() => {\n this.dispose();\n });\n this._parseScene();\n this._setupRenderTargets();\n }\n /**\n * Updates the background according to the new options\n * @param options\n */\n updateOptions(options) {\n // First check if any options are actually being changed. If not, exit.\n const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]);\n if (!newValues.length) {\n return;\n }\n const newOptions = {\n ...this._options,\n ...options,\n };\n const oldOptions = this._options;\n this._options = newOptions;\n // If size changes, recreate everything\n if (newOptions.renderSize !== oldOptions.renderSize ||\n newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType ||\n newOptions.generateMipmaps !== oldOptions.generateMipmaps ||\n !this._opaqueRenderTarget) {\n this._setupRenderTargets();\n }\n else {\n this._opaqueRenderTarget.samples = newOptions.samples;\n this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset;\n }\n }\n /**\n * @returns the opaque render target texture or null if not available.\n */\n getOpaqueTarget() {\n return this._opaqueRenderTarget;\n }\n _shouldRenderAsTransmission(material) {\n if (!material) {\n return false;\n }\n if (material instanceof PBRMaterial && material.subSurface.isRefractionEnabled) {\n return true;\n }\n return false;\n }\n _addMesh(mesh) {\n this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this));\n // we need to defer the processing because _addMesh may be called as part as an instance mesh creation, in which case some\n // internal properties are not setup yet, like _sourceMesh (needed when doing mesh.material below)\n Tools.SetImmediate(() => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n if (this._transparentMeshesCache.indexOf(mesh) === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n }\n else {\n if (this._opaqueMeshesCache.indexOf(mesh) === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n });\n }\n _removeMesh(mesh) {\n mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]);\n delete this._materialObservers[mesh.uniqueId];\n let idx = this._transparentMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._transparentMeshesCache.splice(idx, 1);\n }\n idx = this._opaqueMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._opaqueMeshesCache.splice(idx, 1);\n }\n }\n _parseScene() {\n this._scene.meshes.forEach(this._addMesh.bind(this));\n // Listen for when a mesh is added to the scene and add it to our cache lists.\n this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this));\n // Listen for when a mesh is removed from to the scene and remove it from our cache lists.\n this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));\n }\n // When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.\n _onMeshMaterialChanged(mesh) {\n const transparentIdx = this._transparentMeshesCache.indexOf(mesh);\n const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh);\n // If the material is transparent, make sure that it's added to the transparent list and removed from the opaque list\n const useTransmission = this._shouldRenderAsTransmission(mesh.material);\n if (useTransmission) {\n if (mesh.material instanceof PBRMaterial) {\n mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget;\n }\n if (opaqueIdx !== -1) {\n this._opaqueMeshesCache.splice(opaqueIdx, 1);\n this._transparentMeshesCache.push(mesh);\n }\n else if (transparentIdx === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n // If the material is opaque, make sure that it's added to the opaque list and removed from the transparent list\n }\n else {\n if (transparentIdx !== -1) {\n this._transparentMeshesCache.splice(transparentIdx, 1);\n this._opaqueMeshesCache.push(mesh);\n }\n else if (opaqueIdx === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n }\n /**\n * @internal\n * Check if the opaque render target has not been disposed and can still be used.\n * @returns\n */\n _isRenderTargetValid() {\n return this._opaqueRenderTarget?.getInternalTexture() !== null;\n }\n /**\n * @internal\n * Setup the render targets according to the specified options.\n */\n _setupRenderTargets() {\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n }\n this._opaqueRenderTarget = new RenderTargetTexture(\"opaqueSceneTexture\", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType);\n this._opaqueRenderTarget.ignoreCameraViewport = true;\n this._opaqueRenderTarget.renderList = this._opaqueMeshesCache;\n this._opaqueRenderTarget.clearColor = this._options.clearColor?.clone() ?? this._scene.clearColor.clone();\n this._opaqueRenderTarget.gammaSpace = false;\n this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset;\n this._opaqueRenderTarget.samples = this._options.samples;\n this._opaqueRenderTarget.renderSprites = true;\n this._opaqueRenderTarget.renderParticles = true;\n let sceneImageProcessingapplyByPostProcess;\n let saveSceneEnvIntensity;\n this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => {\n saveSceneEnvIntensity = this._scene.environmentIntensity;\n this._scene.environmentIntensity = 1.0;\n sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;\n if (!this._options.clearColor) {\n this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions);\n }\n else {\n opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor);\n }\n // we do not use the applyByPostProcess setter to avoid flagging all the materials as \"image processing dirty\"!\n this._scene.imageProcessingConfiguration._applyByPostProcess = true;\n });\n this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {\n this._scene.environmentIntensity = saveSceneEnvIntensity;\n this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;\n });\n this._transparentMeshesCache.forEach((mesh) => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n }\n });\n }\n /**\n * Dispose all the elements created by the Helper.\n */\n dispose() {\n this._scene._transmissionHelper = undefined;\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n this._opaqueRenderTarget = null;\n }\n this._transparentMeshesCache = [];\n this._opaqueMeshesCache = [];\n }\n}\nconst NAME = \"KHR_materials_transmission\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_transmission {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 175;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n if (this.enabled) {\n loader.parent.transparencyAsCoverage = true;\n }\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const pbrMaterial = babylonMaterial;\n // Enables \"refraction\" texture which represents transmitted light.\n pbrMaterial.subSurface.isRefractionEnabled = true;\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\n pbrMaterial.subSurface.volumeIndexOfRefraction = 1.0;\n // Albedo colour will tint transmission.\n pbrMaterial.subSurface.useAlbedoToTintRefraction = true;\n if (extension.transmissionFactor !== undefined) {\n pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;\n const scene = pbrMaterial.getScene();\n if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper) {\n new TransmissionHelper({}, pbrMaterial.getScene());\n }\n else if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper?._isRenderTargetValid()) {\n // If the render target is not valid, recreate it.\n scene._transmissionHelper?._setupRenderTargets();\n }\n }\n else {\n pbrMaterial.subSurface.refractionIntensity = 0.0;\n pbrMaterial.subSurface.isRefractionEnabled = false;\n return Promise.resolve();\n }\n pbrMaterial.subSurface.minimumThickness = 0.0;\n pbrMaterial.subSurface.maximumThickness = 0.0;\n if (extension.transmissionTexture) {\n extension.transmissionTexture.nonColorData = true;\n return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then((texture) => {\n pbrMaterial.subSurface.refractionIntensityTexture = texture;\n pbrMaterial.subSurface.useGltfStyleTextures = true;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n}\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_transmission(loader));\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,8CAA8C;AAC1E,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,mBAAmB,QAAQ,2DAA2D;AAC/F,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,SAASC,SAAS,QAAQ,sCAAsC;AAChE,SAASC,KAAK,QAAQ,+BAA+B;AACrD;AACA;AACA;AACA,MAAMC,kBAAkB,CAAC;EACrB;AACJ;AACA;AACA;EACI,OAAOC,kBAAkBA,CAAA,EAAG;IACxB,OAAO;MACHC,UAAU,EAAE,IAAI;MAChBC,OAAO,EAAE,CAAC;MACVC,kBAAkB,EAAE,CAAC;MACrBC,mBAAmB,EAAE,CAAC,CAAC;MACvBC,uBAAuB,EAAER,SAAS,CAACS,sBAAsB;MACzDC,eAAe,EAAE;IACrB,CAAC;EACL;EACA;AACJ;AACA;AACA;AACA;EACIC,WAAWA,CAACC,OAAO,EAAEC,KAAK,EAAE;IACxB,IAAI,CAACC,mBAAmB,GAAG,IAAI;IAC/B,IAAI,CAACC,kBAAkB,GAAG,EAAE;IAC5B,IAAI,CAACC,uBAAuB,GAAG,EAAE;IACjC,IAAI,CAACC,kBAAkB,GAAG,CAAC,CAAC;IAC5B,IAAI,CAACC,QAAQ,GAAG;MACZ,GAAGhB,kBAAkB,CAACC,kBAAkB,C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