@babylonjs/viewer 7.41.1-alpha → 7.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration/configuration.d.ts +107 -0
- package/configuration/configuration.js +16 -0
- package/configuration/configuration.js.map +1 -0
- package/configuration/configurationCompatibility.d.ts +8 -0
- package/configuration/configurationCompatibility.js +66 -0
- package/configuration/configurationCompatibility.js.map +1 -0
- package/configuration/configurationContainer.d.ts +10 -0
- package/configuration/configurationContainer.js +10 -0
- package/configuration/configurationContainer.js.map +1 -0
- package/configuration/globals.d.ts +6 -0
- package/configuration/globals.js +18 -0
- package/configuration/globals.js.map +1 -0
- package/configuration/index.d.ts +2 -0
- package/configuration/index.js +4 -0
- package/configuration/index.js.map +1 -0
- package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
- package/configuration/interfaces/cameraConfiguration.js +2 -0
- package/configuration/interfaces/cameraConfiguration.js.map +1 -0
- package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
- package/configuration/interfaces/colorGradingConfiguration.js +2 -0
- package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
- package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
- package/configuration/interfaces/environmentMapConfiguration.js +2 -0
- package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
- package/configuration/interfaces/groundConfiguration.d.ts +24 -0
- package/configuration/interfaces/groundConfiguration.js +2 -0
- package/configuration/interfaces/groundConfiguration.js.map +1 -0
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
- package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
- package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
- package/configuration/interfaces/index.d.ts +15 -0
- package/configuration/interfaces/index.js +16 -0
- package/configuration/interfaces/index.js.map +1 -0
- package/configuration/interfaces/lightConfiguration.d.ts +60 -0
- package/configuration/interfaces/lightConfiguration.js +2 -0
- package/configuration/interfaces/lightConfiguration.js.map +1 -0
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
- package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
- package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
- package/configuration/interfaces/modelConfiguration.d.ts +65 -0
- package/configuration/interfaces/modelConfiguration.js +2 -0
- package/configuration/interfaces/modelConfiguration.js.map +1 -0
- package/configuration/interfaces/observersConfiguration.d.ts +5 -0
- package/configuration/interfaces/observersConfiguration.js +2 -0
- package/configuration/interfaces/observersConfiguration.js.map +1 -0
- package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
- package/configuration/interfaces/sceneConfiguration.js +2 -0
- package/configuration/interfaces/sceneConfiguration.js.map +1 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
- package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
- package/configuration/interfaces/skyboxConfiguration.js +2 -0
- package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
- package/configuration/interfaces/templateConfiguration.d.ts +67 -0
- package/configuration/interfaces/templateConfiguration.js +2 -0
- package/configuration/interfaces/templateConfiguration.js.map +1 -0
- package/configuration/interfaces/vrConfiguration.d.ts +16 -0
- package/configuration/interfaces/vrConfiguration.js +2 -0
- package/configuration/interfaces/vrConfiguration.js.map +1 -0
- package/configuration/loader.d.ts +4 -0
- package/configuration/loader.js +17 -0
- package/configuration/loader.js.map +1 -0
- package/configuration/mappers.d.ts +43 -0
- package/configuration/mappers.js +193 -0
- package/configuration/mappers.js.map +1 -0
- package/configuration/renderOnlyLoader.d.ts +33 -0
- package/configuration/renderOnlyLoader.js +162 -0
- package/configuration/renderOnlyLoader.js.map +1 -0
- package/configuration/types/default.d.ts +6 -0
- package/configuration/types/default.js +121 -0
- package/configuration/types/default.js.map +1 -0
- package/configuration/types/environmentMap.d.ts +5 -0
- package/configuration/types/environmentMap.js +14 -0
- package/configuration/types/environmentMap.js.map +1 -0
- package/configuration/types/extended.d.ts +6 -0
- package/configuration/types/extended.js +317 -0
- package/configuration/types/extended.js.map +1 -0
- package/configuration/types/index.d.ts +14 -0
- package/configuration/types/index.js +51 -0
- package/configuration/types/index.js.map +1 -0
- package/configuration/types/minimal.d.ts +6 -0
- package/configuration/types/minimal.js +43 -0
- package/configuration/types/minimal.js.map +1 -0
- package/configuration/types/renderOnlyDefault.d.ts +30 -0
- package/configuration/types/renderOnlyDefault.js +31 -0
- package/configuration/types/renderOnlyDefault.js.map +1 -0
- package/configuration/types/shadowLight.d.ts +9 -0
- package/configuration/types/shadowLight.js +64 -0
- package/configuration/types/shadowLight.js.map +1 -0
- package/helper/index.d.ts +29 -0
- package/helper/index.js +66 -0
- package/helper/index.js.map +1 -0
- package/index.d.ts +30 -0
- package/index.js +46 -0
- package/index.js.map +1 -0
- package/initializer.d.ts +11 -0
- package/initializer.js +35 -0
- package/initializer.js.map +1 -0
- package/interfaces.d.ts +5 -0
- package/interfaces.js +7 -0
- package/interfaces.js.map +1 -0
- package/labs/environmentSerializer.d.ts +126 -0
- package/labs/environmentSerializer.js +191 -0
- package/labs/environmentSerializer.js.map +1 -0
- package/labs/texture.d.ts +183 -0
- package/labs/texture.js +351 -0
- package/labs/texture.js.map +1 -0
- package/labs/viewerLabs.d.ts +51 -0
- package/labs/viewerLabs.js +134 -0
- package/labs/viewerLabs.js.map +1 -0
- package/loader/modelLoader.d.ts +56 -0
- package/loader/modelLoader.js +202 -0
- package/loader/modelLoader.js.map +1 -0
- package/loader/plugins/applyMaterialConfig.d.ts +12 -0
- package/loader/plugins/applyMaterialConfig.js +16 -0
- package/loader/plugins/applyMaterialConfig.js.map +1 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
- package/loader/plugins/index.d.ts +19 -0
- package/loader/plugins/index.js +44 -0
- package/loader/plugins/index.js.map +1 -0
- package/loader/plugins/loaderPlugin.d.ts +24 -0
- package/loader/plugins/loaderPlugin.js +2 -0
- package/loader/plugins/loaderPlugin.js.map +1 -0
- package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
- package/loader/plugins/msftLodLoaderPlugin.js +21 -0
- package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
- package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
- package/loader/plugins/telemetryLoaderPlugin.js +36 -0
- package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
- package/managers/observablesManager.d.ts +66 -0
- package/managers/observablesManager.js +35 -0
- package/managers/observablesManager.js.map +1 -0
- package/managers/sceneManager.d.ts +245 -0
- package/managers/sceneManager.js +1375 -0
- package/managers/sceneManager.js.map +1 -0
- package/managers/telemetryManager.d.ts +78 -0
- package/managers/telemetryManager.js +117 -0
- package/managers/telemetryManager.js.map +1 -0
- package/model/modelAnimation.d.ts +215 -0
- package/model/modelAnimation.js +237 -0
- package/model/modelAnimation.js.map +1 -0
- package/model/viewerModel.d.ts +233 -0
- package/model/viewerModel.js +673 -0
- package/model/viewerModel.js.map +1 -0
- package/optimizer/custom/extended.d.ts +13 -0
- package/optimizer/custom/extended.js +101 -0
- package/optimizer/custom/extended.js.map +1 -0
- package/optimizer/custom/index.d.ts +9 -0
- package/optimizer/custom/index.js +26 -0
- package/optimizer/custom/index.js.map +1 -0
- package/package.json +28 -19
- package/readme.md +28 -28
- package/renderOnlyIndex.d.ts +11 -0
- package/renderOnlyIndex.js +18 -0
- package/renderOnlyIndex.js.map +1 -0
- package/templating/eventManager.d.ts +35 -0
- package/templating/eventManager.js +66 -0
- package/templating/eventManager.js.map +1 -0
- package/templating/plugins/hdButtonPlugin.d.ts +9 -0
- package/templating/plugins/hdButtonPlugin.js +22 -0
- package/templating/plugins/hdButtonPlugin.js.map +1 -0
- package/templating/plugins/printButton.d.ts +9 -0
- package/templating/plugins/printButton.js +41 -0
- package/templating/plugins/printButton.js.map +1 -0
- package/templating/templateManager.d.ts +197 -0
- package/templating/templateManager.js +561 -0
- package/templating/templateManager.js.map +1 -0
- package/templating/viewerTemplatePlugin.d.ts +21 -0
- package/templating/viewerTemplatePlugin.js +69 -0
- package/templating/viewerTemplatePlugin.js.map +1 -0
- package/viewer/defaultViewer.d.ts +130 -0
- package/viewer/defaultViewer.js +672 -0
- package/viewer/defaultViewer.js.map +1 -0
- package/viewer/renderOnlyViewer.d.ts +9 -0
- package/viewer/renderOnlyViewer.js +46 -0
- package/viewer/renderOnlyViewer.js.map +1 -0
- package/viewer/viewer.d.ts +258 -0
- package/viewer/viewer.js +783 -0
- package/viewer/viewer.js.map +1 -0
- package/viewer/viewerManager.d.ts +58 -0
- package/viewer/viewerManager.js +91 -0
- package/viewer/viewerManager.js.map +1 -0
- package/viewer/viewerWithTemplate.d.ts +9 -0
- package/viewer/viewerWithTemplate.js +20 -0
- package/viewer/viewerWithTemplate.js.map +1 -0
- package/assets/photoStudio.env +0 -0
- package/dist/babylon-viewer.esm.js +0 -2
- package/dist/babylon-viewer.esm.js.map +0 -1
- package/dist/babylon-viewer.esm.min.js +0 -2
- package/dist/babylon-viewer.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js +0 -84
- package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js +0 -171
- package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js +0 -86
- package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js +0 -2
- package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js +0 -134
- package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js +0 -2
- package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js +0 -44
- package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js +0 -43
- package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js +0 -64
- package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js +0 -2
- package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js +0 -2
- package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js +0 -352
- package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js +0 -2
- package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js +0 -610
- package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js.map +0 -1
- package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js +0 -2
- package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js.map +0 -1
- package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js +0 -4033
- package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js +0 -581
- package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js +0 -2
- package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js +0 -65
- package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js +0 -96
- package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js +0 -97
- package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js +0 -62
- package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js +0 -55
- package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js +0 -64
- package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js +0 -72
- package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js +0 -81
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js +0 -85
- package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js +0 -75
- package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js +0 -307
- package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js +0 -74
- package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js +0 -262
- package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js +0 -87
- package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js +0 -2
- package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js +0 -26
- package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js.map +0 -1
- package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js +0 -39
- package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js.map +0 -1
- package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js +0 -2
- package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js +0 -2
- package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js +0 -46
- package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js +0 -43
- package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js +0 -63
- package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js +0 -51
- package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js +0 -2
- package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js +0 -2
- package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js +0 -2201
- package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js.map +0 -1
- package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js +0 -337
- package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js.map +0 -1
- package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js +0 -2
- package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js +0 -2
- package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js +0 -46
- package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js +0 -47
- package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js +0 -2
- package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js.map +0 -1
- package/dist/chunks/animationGroup-8TJDgymS.esm.js +0 -2482
- package/dist/chunks/animationGroup-8TJDgymS.esm.js.map +0 -1
- package/dist/chunks/animationGroup-toXtd3a1.esm.min.js +0 -2
- package/dist/chunks/animationGroup-toXtd3a1.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-7pMDUaac.esm.min.js +0 -2
- package/dist/chunks/assetContainer-7pMDUaac.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-DYzO0AbX.esm.js +0 -1720
- package/dist/chunks/assetContainer-DYzO0AbX.esm.js.map +0 -1
- package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js +0 -2
- package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js.map +0 -1
- package/dist/chunks/audioEngine-peiGqjr6.esm.js +0 -305
- package/dist/chunks/audioEngine-peiGqjr6.esm.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js +0 -2
- package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js +0 -114
- package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js.map +0 -1
- package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js +0 -600
- package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js.map +0 -1
- package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js +0 -2
- package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js.map +0 -1
- package/dist/chunks/dds-6EdM5O6M.esm.js +0 -540
- package/dist/chunks/dds-6EdM5O6M.esm.js.map +0 -1
- package/dist/chunks/dds-DVX_K9B3.esm.min.js +0 -2
- package/dist/chunks/dds-DVX_K9B3.esm.min.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js +0 -2
- package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js +0 -88
- package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js.map +0 -1
- package/dist/chunks/decalFragment-C_Cews3-.esm.js +0 -18
- package/dist/chunks/decalFragment-C_Cews3-.esm.js.map +0 -1
- package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js +0 -2
- package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js +0 -2
- package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js +0 -2
- package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-CyFHDykY.esm.js +0 -446
- package/dist/chunks/default.fragment-CyFHDykY.esm.js.map +0 -1
- package/dist/chunks/default.fragment-ej-2z5tS.esm.js +0 -515
- package/dist/chunks/default.fragment-ej-2z5tS.esm.js.map +0 -1
- package/dist/chunks/default.vertex-16mVOFgT.esm.js +0 -211
- package/dist/chunks/default.vertex-16mVOFgT.esm.js.map +0 -1
- package/dist/chunks/default.vertex-D--q2At3.esm.min.js +0 -2
- package/dist/chunks/default.vertex-D--q2At3.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-DDlgZTrR.esm.js +0 -190
- package/dist/chunks/default.vertex-DDlgZTrR.esm.js.map +0 -1
- package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js +0 -2
- package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js +0 -15
- package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js +0 -13
- package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js.map +0 -1
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +0 -11
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +0 -1
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +0 -2
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +0 -1
- package/dist/chunks/dumpTools-Bhux0wvM.esm.js +0 -200
- package/dist/chunks/dumpTools-Bhux0wvM.esm.js.map +0 -1
- package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js +0 -2
- package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js.map +0 -1
- package/dist/chunks/engine-DF_zE4qj.esm.js +0 -2213
- package/dist/chunks/engine-DF_zE4qj.esm.js.map +0 -1
- package/dist/chunks/engine-DVmdDcyP.esm.min.js +0 -2
- package/dist/chunks/engine-DVmdDcyP.esm.min.js.map +0 -1
- package/dist/chunks/engine.common-CvOmoKru.esm.js +0 -1162
- package/dist/chunks/engine.common-CvOmoKru.esm.js.map +0 -1
- package/dist/chunks/engine.common-DpTzktQJ.esm.min.js +0 -2
- package/dist/chunks/engine.common-DpTzktQJ.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js +0 -64
- package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js.map +0 -1
- package/dist/chunks/envTextureLoader-DMQui088.esm.min.js +0 -2
- package/dist/chunks/envTextureLoader-DMQui088.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js +0 -2
- package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js +0 -382
- package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js.map +0 -1
- package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js +0 -1683
- package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js.map +0 -1
- package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js +0 -2
- package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-BrGGFaiu.esm.js +0 -101
- package/dist/chunks/fogFragment-BrGGFaiu.esm.js.map +0 -1
- package/dist/chunks/fogFragment-ByOwwQur.esm.min.js +0 -2
- package/dist/chunks/fogFragment-ByOwwQur.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-Chod24nu.esm.min.js +0 -2
- package/dist/chunks/fogFragment-Chod24nu.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-gZfybCpt.esm.js +0 -102
- package/dist/chunks/fogFragment-gZfybCpt.esm.js.map +0 -1
- package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js +0 -2
- package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js.map +0 -1
- package/dist/chunks/fresnelFunction-DBlxfmri.esm.js +0 -12
- package/dist/chunks/fresnelFunction-DBlxfmri.esm.js.map +0 -1
- package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js +0 -2
- package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoader-fUFiWvYb.esm.js +0 -7693
- package/dist/chunks/glTFLoader-fUFiWvYb.esm.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js +0 -2
- package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js +0 -77
- package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js.map +0 -1
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js +0 -34
- package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js +0 -35
- package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js +0 -253
- package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js +0 -2
- package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-C66wRWtu.esm.js +0 -110
- package/dist/chunks/helperFunctions-C66wRWtu.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-gnki_9Kj.esm.js +0 -83
- package/dist/chunks/helperFunctions-gnki_9Kj.esm.js.map +0 -1
- package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js +0 -189
- package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js.map +0 -1
- package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js +0 -2
- package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js.map +0 -1
- package/dist/chunks/index-C6hXZyZb.esm.js +0 -74889
- package/dist/chunks/index-C6hXZyZb.esm.js.map +0 -1
- package/dist/chunks/index-rZVkfTE6.esm.min.js +0 -57
- package/dist/chunks/index-rZVkfTE6.esm.min.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js +0 -814
- package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js +0 -2
- package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js +0 -11
- package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js +0 -35
- package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-DKPfA10X.esm.js +0 -81
- package/dist/chunks/logDepthVertex-DKPfA10X.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-ojTShW5I.esm.js +0 -77
- package/dist/chunks/logDepthVertex-ojTShW5I.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js.map +0 -1
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +0 -119
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +0 -1
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +0 -2
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js +0 -26
- package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js +0 -2
- package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js.map +0 -1
- package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js +0 -2
- package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js.map +0 -1
- package/dist/chunks/objFileLoader-BPwrX8RK.esm.js +0 -1338
- package/dist/chunks/objFileLoader-BPwrX8RK.esm.js.map +0 -1
- package/dist/chunks/oitFragment-CmcWUhsZ.esm.js +0 -1240
- package/dist/chunks/oitFragment-CmcWUhsZ.esm.js.map +0 -1
- package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js +0 -1078
- package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js.map +0 -1
- package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js +0 -2
- package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js +0 -2
- package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment--XRaXRhU.esm.js +0 -15
- package/dist/chunks/pass.fragment--XRaXRhU.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js +0 -15
- package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js +0 -3269
- package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-fky04gH_.esm.js +0 -3222
- package/dist/chunks/pbr.fragment-fky04gH_.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js +0 -223
- package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-BXcMYADF.esm.js +0 -348
- package/dist/chunks/pbr.vertex-BXcMYADF.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js.map +0 -1
- package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js +0 -2
- package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js.map +0 -1
- package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js +0 -20
- package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js.map +0 -1
- package/dist/chunks/rawTexture-CWiRIto8.esm.js +0 -191
- package/dist/chunks/rawTexture-CWiRIto8.esm.js.map +0 -1
- package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js +0 -2
- package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js.map +0 -1
- package/dist/chunks/ray-ix7SqYNQ.esm.min.js +0 -2
- package/dist/chunks/ray-ix7SqYNQ.esm.min.js.map +0 -1
- package/dist/chunks/ray-nTZBkOil.esm.js +0 -946
- package/dist/chunks/ray-nTZBkOil.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js +0 -13
- package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js +0 -13
- package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js +0 -13
- package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js +0 -13
- package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js.map +0 -1
- package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js +0 -2
- package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js.map +0 -1
- package/dist/chunks/splatFileLoader-Dp33YOem.esm.js +0 -3379
- package/dist/chunks/splatFileLoader-Dp33YOem.esm.js.map +0 -1
- package/dist/chunks/spotLight-C0NmKeem.esm.js +0 -701
- package/dist/chunks/spotLight-C0NmKeem.esm.js.map +0 -1
- package/dist/chunks/spotLight-CcuCNdES.esm.min.js +0 -2
- package/dist/chunks/spotLight-CcuCNdES.esm.min.js.map +0 -1
- package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js +0 -2
- package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js.map +0 -1
- package/dist/chunks/standardMaterial-v_D8QA4q.esm.js +0 -1807
- package/dist/chunks/standardMaterial-v_D8QA4q.esm.js.map +0 -1
- package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js +0 -2
- package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js.map +0 -1
- package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js +0 -238
- package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js +0 -349
- package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js +0 -2
- package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js.map +0 -1
- package/dist/chunks/thinEngine-DksimP2U.esm.js +0 -3848
- package/dist/chunks/thinEngine-DksimP2U.esm.js.map +0 -1
- package/dist/chunks/thinEngine-tsALaFYH.esm.min.js +0 -2
- package/dist/chunks/thinEngine-tsALaFYH.esm.min.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js +0 -314
- package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js +0 -2
- package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-D9917nJN.esm.js +0 -428
- package/dist/chunks/vertexColorMixing-D9917nJN.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js +0 -538
- package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js.map +0 -1
- package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js +0 -2
- package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js.map +0 -1
- package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js +0 -11533
- package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js.map +0 -1
- package/dist/chunks/workerPool-BUOov2K1.esm.js +0 -122
- package/dist/chunks/workerPool-BUOov2K1.esm.js.map +0 -1
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +0 -2
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +0 -1
- package/lib/index.d.ts +0 -591
- package/lib/index.js +0 -2165
- package/lib/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_sheen-BfZe6ZFu.esm.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_sheen.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_sheen\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_sheen/README.md)\n * [Playground Sample](https://www.babylonjs-playground.com/frame.html#BNIZX6#4)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_sheen {\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 = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\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.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSheenPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSheenPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n babylonMaterial.sheen.isEnabled = true;\n babylonMaterial.sheen.intensity = 1;\n if (properties.sheenColorFactor != undefined) {\n babylonMaterial.sheen.color = Color3.FromArray(properties.sheenColorFactor);\n }\n else {\n babylonMaterial.sheen.color = Color3.Black();\n }\n if (properties.sheenColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenColorTexture`, properties.sheenColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Color)`;\n babylonMaterial.sheen.texture = texture;\n }));\n }\n if (properties.sheenRoughnessFactor !== undefined) {\n babylonMaterial.sheen.roughness = properties.sheenRoughnessFactor;\n }\n else {\n babylonMaterial.sheen.roughness = 0;\n }\n if (properties.sheenRoughnessTexture) {\n properties.sheenRoughnessTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenRoughnessTexture`, properties.sheenRoughnessTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Roughness)`;\n babylonMaterial.sheen.textureRoughness = texture;\n }));\n }\n babylonMaterial.sheen.albedoScaling = true;\n babylonMaterial.sheen.useRoughnessFromMainTexture = false;\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_sheen(loader));\n//# sourceMappingURL=KHR_materials_sheen.js.map"],"names":[],"mappings":";;;;;;AAIA,MAAM,IAAI,GAAG,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACO,MAAM,mBAAmB,CAAC;AACjC;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB;AACA;AACA;AACA,QAAQ,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E,aAAa,CAAC,CAAC;AACf;AACA,QAAQ,eAAe,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI;AAClD,QAAQ,eAAe,CAAC,KAAK,CAAC,2BAA2B,GAAG,KAAK;AACjE,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AACpD;AACA;AACA,uBAAuB,CAAC,IAAI,CAAC;AAC7B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a$ as e,s,aQ as n,aR as o}from"./index-rZVkfTE6.esm.min.js";import{G as r}from"./glTFLoader-D4C1IGb3.esm.min.js";import"./rawTexture-DX8V9PEj.esm.min.js";import"./assetContainer-7pMDUaac.esm.min.js";import"./glTFLoaderAnimation-BB_Vw079.esm.min.js";const t="KHR_materials_sheen";class a{constructor(e){this.name=t,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,n){return r.LoadExtensionAsync(e,s,this.name,((o,r)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(e,s,n)),t.push(this._loadSheenPropertiesAsync(o,r,n)),Promise.all(t).then((()=>{}))}))}_loadSheenPropertiesAsync(n,o,r){if(!(r instanceof e))throw new Error(`${n}: Material type not supported`);const t=new Array;return r.sheen.isEnabled=!0,r.sheen.intensity=1,null!=o.sheenColorFactor?r.sheen.color=s.FromArray(o.sheenColorFactor):r.sheen.color=s.Black(),o.sheenColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${n}/sheenColorTexture`,o.sheenColorTexture,(e=>{e.name=`${r.name} (Sheen Color)`,r.sheen.texture=e}))),void 0!==o.sheenRoughnessFactor?r.sheen.roughness=o.sheenRoughnessFactor:r.sheen.roughness=0,o.sheenRoughnessTexture&&(o.sheenRoughnessTexture.nonColorData=!0,t.push(this._loader.loadTextureInfoAsync(`${n}/sheenRoughnessTexture`,o.sheenRoughnessTexture,(e=>{e.name=`${r.name} (Sheen Roughness)`,r.sheen.textureRoughness=e})))),r.sheen.albedoScaling=!0,r.sheen.useRoughnessFromMainTexture=!1,Promise.all(t).then((()=>{}))}}n(t),o(t,!0,(e=>new a(e)));export{a as KHR_materials_sheen};
|
|
2
|
-
//# sourceMappingURL=KHR_materials_sheen-OWjuK2V4.esm.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_sheen-OWjuK2V4.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_sheen.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_sheen\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_sheen/README.md)\n * [Playground Sample](https://www.babylonjs-playground.com/frame.html#BNIZX6#4)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_sheen {\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 = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\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.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSheenPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSheenPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n babylonMaterial.sheen.isEnabled = true;\n babylonMaterial.sheen.intensity = 1;\n if (properties.sheenColorFactor != undefined) {\n babylonMaterial.sheen.color = Color3.FromArray(properties.sheenColorFactor);\n }\n else {\n babylonMaterial.sheen.color = Color3.Black();\n }\n if (properties.sheenColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenColorTexture`, properties.sheenColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Color)`;\n babylonMaterial.sheen.texture = texture;\n }));\n }\n if (properties.sheenRoughnessFactor !== undefined) {\n babylonMaterial.sheen.roughness = properties.sheenRoughnessFactor;\n }\n else {\n babylonMaterial.sheen.roughness = 0;\n }\n if (properties.sheenRoughnessTexture) {\n properties.sheenRoughnessTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenRoughnessTexture`, properties.sheenRoughnessTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Roughness)`;\n babylonMaterial.sheen.textureRoughness = texture;\n }));\n }\n babylonMaterial.sheen.albedoScaling = true;\n babylonMaterial.sheen.useRoughnessFromMainTexture = false;\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_sheen(loader));\n//# sourceMappingURL=KHR_materials_sheen.js.map"],"names":["NAME","KHR_materials_sheen","constructor","loader","this","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","GLTFLoader","LoadExtensionAsync","extensionContext","extension","promises","Array","push","_loadSheenPropertiesAsync","Promise","all","then","properties","PBRMaterial","Error","sheen","isEnabled","intensity","undefined","sheenColorFactor","color","Color3","FromArray","Black","sheenColorTexture","loadTextureInfoAsync","texture","sheenRoughnessFactor","roughness","sheenRoughnessTexture","nonColorData","textureRoughness","albedoScaling","useRoughnessFromMainTexture","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"gQAIA,MAAMA,EAAO,sBAMN,MAAMC,EAIT,WAAAC,CAAYC,GAIRC,KAAKC,KAAOL,EAIZI,KAAKE,MAAQ,IACbF,KAAKG,QAAUJ,EACfC,KAAKI,QAAUJ,KAAKG,QAAQE,gBAAgBT,EACpD,CAEI,OAAAU,GACIN,KAAKG,QAAU,IACvB,CAII,2BAAAI,CAA4BC,EAASC,EAAUC,GAC3C,OAAOC,EAAWC,mBAAmBJ,EAASC,EAAUT,KAAKC,MAAM,CAACY,EAAkBC,KAClF,MAAMC,EAAW,IAAIC,MAGrB,OAFAD,EAASE,KAAKjB,KAAKG,QAAQI,4BAA4BC,EAASC,EAAUC,IAC1EK,EAASE,KAAKjB,KAAKkB,0BAA0BL,EAAkBC,EAAWJ,IACnES,QAAQC,IAAIL,GAAUM,MAAK,QAAU,GAExD,CACI,yBAAAH,CAA0BV,EAASc,EAAYZ,GAC3C,KAAMA,aAA2Ba,GAC7B,MAAM,IAAIC,MAAM,GAAGhB,kCAEvB,MAAMO,EAAW,IAAIC,MA8BrB,OA7BAN,EAAgBe,MAAMC,WAAY,EAClChB,EAAgBe,MAAME,UAAY,EACCC,MAA/BN,EAAWO,iBACXnB,EAAgBe,MAAMK,MAAQC,EAAOC,UAAUV,EAAWO,kBAG1DnB,EAAgBe,MAAMK,MAAQC,EAAOE,QAErCX,EAAWY,mBACXnB,EAASE,KAAKjB,KAAKG,QAAQgC,qBAAqB,GAAG3B,sBAA6Bc,EAAWY,mBAAoBE,IAC3GA,EAAQnC,KAAO,GAAGS,EAAgBT,qBAClCS,EAAgBe,MAAMW,QAAUA,CAAO,UAGPR,IAApCN,EAAWe,qBACX3B,EAAgBe,MAAMa,UAAYhB,EAAWe,qBAG7C3B,EAAgBe,MAAMa,UAAY,EAElChB,EAAWiB,wBACXjB,EAAWiB,sBAAsBC,cAAe,EAChDzB,EAASE,KAAKjB,KAAKG,QAAQgC,qBAAqB,GAAG3B,0BAAiCc,EAAWiB,uBAAwBH,IACnHA,EAAQnC,KAAO,GAAGS,EAAgBT,yBAClCS,EAAgBe,MAAMgB,iBAAmBL,CAAO,MAGxD1B,EAAgBe,MAAMiB,eAAgB,EACtChC,EAAgBe,MAAMkB,6BAA8B,EAC7CxB,QAAQC,IAAIL,GAAUM,MAAK,QAC1C,EAEAuB,EAAwBhD,GACxBiD,EAAsBjD,GAAM,GAAOG,GAAW,IAAIF,EAAoBE"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { a$ as PBRMaterial, s as Color3, aQ as unregisterGLTFExtension, aR as registerGLTFExtension } from './index-C6hXZyZb.esm.js';
|
|
2
|
-
import { G as GLTFLoader } from './glTFLoader-fUFiWvYb.esm.js';
|
|
3
|
-
import './rawTexture-CWiRIto8.esm.js';
|
|
4
|
-
import './assetContainer-DYzO0AbX.esm.js';
|
|
5
|
-
import './glTFLoaderAnimation-CttmY50U.esm.js';
|
|
6
|
-
|
|
7
|
-
const NAME = "KHR_materials_specular";
|
|
8
|
-
/**
|
|
9
|
-
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
-
class KHR_materials_specular {
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
constructor(loader) {
|
|
17
|
-
/**
|
|
18
|
-
* The name of this extension.
|
|
19
|
-
*/
|
|
20
|
-
this.name = NAME;
|
|
21
|
-
/**
|
|
22
|
-
* Defines a number that determines the order the extensions are applied.
|
|
23
|
-
*/
|
|
24
|
-
this.order = 190;
|
|
25
|
-
this._loader = loader;
|
|
26
|
-
this.enabled = this._loader.isExtensionUsed(NAME);
|
|
27
|
-
}
|
|
28
|
-
/** @internal */
|
|
29
|
-
dispose() {
|
|
30
|
-
this._loader = null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
loadMaterialPropertiesAsync(context, material, babylonMaterial) {
|
|
36
|
-
return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {
|
|
37
|
-
const promises = new Array();
|
|
38
|
-
promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
|
39
|
-
promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial));
|
|
40
|
-
return Promise.all(promises).then(() => { });
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
_loadSpecularPropertiesAsync(context, properties, babylonMaterial) {
|
|
44
|
-
if (!(babylonMaterial instanceof PBRMaterial)) {
|
|
45
|
-
throw new Error(`${context}: Material type not supported`);
|
|
46
|
-
}
|
|
47
|
-
const promises = new Array();
|
|
48
|
-
if (properties.specularFactor !== undefined) {
|
|
49
|
-
babylonMaterial.metallicF0Factor = properties.specularFactor;
|
|
50
|
-
}
|
|
51
|
-
if (properties.specularColorFactor !== undefined) {
|
|
52
|
-
babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor);
|
|
53
|
-
}
|
|
54
|
-
if (properties.specularTexture) {
|
|
55
|
-
properties.specularTexture.nonColorData = true;
|
|
56
|
-
promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {
|
|
57
|
-
texture.name = `${babylonMaterial.name} (Specular)`;
|
|
58
|
-
babylonMaterial.metallicReflectanceTexture = texture;
|
|
59
|
-
babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true;
|
|
60
|
-
}));
|
|
61
|
-
}
|
|
62
|
-
if (properties.specularColorTexture) {
|
|
63
|
-
promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {
|
|
64
|
-
texture.name = `${babylonMaterial.name} (Specular Color)`;
|
|
65
|
-
babylonMaterial.reflectanceTexture = texture;
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
return Promise.all(promises).then(() => { });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
unregisterGLTFExtension(NAME);
|
|
72
|
-
registerGLTFExtension(NAME, true, (loader) => new KHR_materials_specular(loader));
|
|
73
|
-
|
|
74
|
-
export { KHR_materials_specular };
|
|
75
|
-
//# sourceMappingURL=KHR_materials_specular-dowPxbW3.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_specular-dowPxbW3.esm.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_specular.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_specular\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_specular {\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 = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\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.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSpecularPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n if (properties.specularFactor !== undefined) {\n babylonMaterial.metallicF0Factor = properties.specularFactor;\n }\n if (properties.specularColorFactor !== undefined) {\n babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor);\n }\n if (properties.specularTexture) {\n properties.specularTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular)`;\n babylonMaterial.metallicReflectanceTexture = texture;\n babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true;\n }));\n }\n if (properties.specularColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular Color)`;\n babylonMaterial.reflectanceTexture = texture;\n }));\n }\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_specular(loader));\n//# sourceMappingURL=KHR_materials_specular.js.map"],"names":[],"mappings":";;;;;;AAIA,MAAM,IAAI,GAAG,wBAAwB;AACrC;AACA;AACA;AACA;AACO,MAAM,sBAAsB,CAAC;AACpC;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,KAAK,GAAG,GAAG;AACxB,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM;AAC7B,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;AACzD;AACA;AACA,IAAI,OAAO,GAAG;AACd,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI;AAC3B;AACA;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE;AAC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,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,OAAO,KAAK;AACnI,gBAAgB,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;AACnE,gBAAgB,eAAe,CAAC,0BAA0B,GAAG,OAAO;AACpE,gBAAgB,eAAe,CAAC,6CAA6C,GAAG,IAAI;AACpF,aAAa,CAAC,CAAC;AACf;AACA,QAAQ,IAAI,UAAU,CAAC,oBAAoB,EAAE;AAC7C,YAAY,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAAE,UAAU,CAAC,oBAAoB,EAAE,CAAC,OAAO,KAAK;AAC7I,gBAAgB,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC;AACzE,gBAAgB,eAAe,CAAC,kBAAkB,GAAG,OAAO;AAC5D,aAAa,CAAC,CAAC;AACf;AACA,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AACpD;AACA;AACA,uBAAuB,CAAC,IAAI,CAAC;AAC7B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a$ as e,s as r,aQ as a,aR as s}from"./index-rZVkfTE6.esm.min.js";import{G as o}from"./glTFLoader-D4C1IGb3.esm.min.js";import"./rawTexture-DX8V9PEj.esm.min.js";import"./assetContainer-7pMDUaac.esm.min.js";import"./glTFLoaderAnimation-BB_Vw079.esm.min.js";const t="KHR_materials_specular";class l{constructor(e){this.name=t,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,r,a){return o.LoadExtensionAsync(e,r,this.name,((s,o)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(e,r,a)),t.push(this._loadSpecularPropertiesAsync(s,o,a)),Promise.all(t).then((()=>{}))}))}_loadSpecularPropertiesAsync(a,s,o){if(!(o instanceof e))throw new Error(`${a}: Material type not supported`);const t=new Array;return void 0!==s.specularFactor&&(o.metallicF0Factor=s.specularFactor),void 0!==s.specularColorFactor&&(o.metallicReflectanceColor=r.FromArray(s.specularColorFactor)),s.specularTexture&&(s.specularTexture.nonColorData=!0,t.push(this._loader.loadTextureInfoAsync(`${a}/specularTexture`,s.specularTexture,(e=>{e.name=`${o.name} (Specular)`,o.metallicReflectanceTexture=e,o.useOnlyMetallicFromMetallicReflectanceTexture=!0})))),s.specularColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${a}/specularColorTexture`,s.specularColorTexture,(e=>{e.name=`${o.name} (Specular Color)`,o.reflectanceTexture=e}))),Promise.all(t).then((()=>{}))}}a(t),s(t,!0,(e=>new l(e)));export{l as KHR_materials_specular};
|
|
2
|
-
//# sourceMappingURL=KHR_materials_specular-nWeBZu0R.esm.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_specular-nWeBZu0R.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_specular.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_specular\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_specular {\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 = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\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.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSpecularPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n if (properties.specularFactor !== undefined) {\n babylonMaterial.metallicF0Factor = properties.specularFactor;\n }\n if (properties.specularColorFactor !== undefined) {\n babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor);\n }\n if (properties.specularTexture) {\n properties.specularTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular)`;\n babylonMaterial.metallicReflectanceTexture = texture;\n babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true;\n }));\n }\n if (properties.specularColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular Color)`;\n babylonMaterial.reflectanceTexture = texture;\n }));\n }\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_specular(loader));\n//# sourceMappingURL=KHR_materials_specular.js.map"],"names":["NAME","KHR_materials_specular","constructor","loader","this","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","GLTFLoader","LoadExtensionAsync","extensionContext","extension","promises","Array","push","_loadSpecularPropertiesAsync","Promise","all","then","properties","PBRMaterial","Error","undefined","specularFactor","metallicF0Factor","specularColorFactor","metallicReflectanceColor","Color3","FromArray","specularTexture","nonColorData","loadTextureInfoAsync","texture","metallicReflectanceTexture","useOnlyMetallicFromMetallicReflectanceTexture","specularColorTexture","reflectanceTexture","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"qQAIA,MAAMA,EAAO,yBAKN,MAAMC,EAIT,WAAAC,CAAYC,GAIRC,KAAKC,KAAOL,EAIZI,KAAKE,MAAQ,IACbF,KAAKG,QAAUJ,EACfC,KAAKI,QAAUJ,KAAKG,QAAQE,gBAAgBT,EACpD,CAEI,OAAAU,GACIN,KAAKG,QAAU,IACvB,CAII,2BAAAI,CAA4BC,EAASC,EAAUC,GAC3C,OAAOC,EAAWC,mBAAmBJ,EAASC,EAAUT,KAAKC,MAAM,CAACY,EAAkBC,KAClF,MAAMC,EAAW,IAAIC,MAGrB,OAFAD,EAASE,KAAKjB,KAAKG,QAAQI,4BAA4BC,EAASC,EAAUC,IAC1EK,EAASE,KAAKjB,KAAKkB,6BAA6BL,EAAkBC,EAAWJ,IACtES,QAAQC,IAAIL,GAAUM,MAAK,QAAU,GAExD,CACI,4BAAAH,CAA6BV,EAASc,EAAYZ,GAC9C,KAAMA,aAA2Ba,GAC7B,MAAM,IAAIC,MAAM,GAAGhB,kCAEvB,MAAMO,EAAW,IAAIC,MAqBrB,YApBkCS,IAA9BH,EAAWI,iBACXhB,EAAgBiB,iBAAmBL,EAAWI,qBAEXD,IAAnCH,EAAWM,sBACXlB,EAAgBmB,yBAA2BC,EAAOC,UAAUT,EAAWM,sBAEvEN,EAAWU,kBACXV,EAAWU,gBAAgBC,cAAe,EAC1ClB,EAASE,KAAKjB,KAAKG,QAAQ+B,qBAAqB,GAAG1B,oBAA2Bc,EAAWU,iBAAkBG,IACvGA,EAAQlC,KAAO,GAAGS,EAAgBT,kBAClCS,EAAgB0B,2BAA6BD,EAC7CzB,EAAgB2B,+CAAgD,CAAI,MAGxEf,EAAWgB,sBACXvB,EAASE,KAAKjB,KAAKG,QAAQ+B,qBAAqB,GAAG1B,yBAAgCc,EAAWgB,sBAAuBH,IACjHA,EAAQlC,KAAO,GAAGS,EAAgBT,wBAClCS,EAAgB6B,mBAAqBJ,CAAO,KAG7ChB,QAAQC,IAAIL,GAAUM,MAAK,QAC1C,EAEAmB,EAAwB5C,GACxB6C,EAAsB7C,GAAM,GAAOG,GAAW,IAAIF,EAAuBE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a$ as e,aQ as s,aR as t,C as r,aV as a,T as n,bC as i}from"./index-rZVkfTE6.esm.min.js";import{G as o}from"./glTFLoader-D4C1IGb3.esm.min.js";import"./rawTexture-DX8V9PEj.esm.min.js";import"./assetContainer-7pMDUaac.esm.min.js";import"./glTFLoaderAnimation-BB_Vw079.esm.min.js";class h{static _GetDefaultOptions(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:r.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}constructor(e,s){this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options={...h._GetDefaultOptions(),...e},this._scene=s,this._scene._transmissionHelper=this,this.onErrorObservable=new a,this._scene.onDisposeObservable.addOnce((()=>{this.dispose()})),this._parseScene(),this._setupRenderTargets()}updateOptions(e){if(!Object.keys(e).filter((s=>this._options[s]!==e[s])).length)return;const s={...this._options,...e},t=this._options;this._options=s,s.renderSize===t.renderSize&&s.renderTargetTextureType===t.renderTargetTextureType&&s.generateMipmaps===t.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=s.samples,this._opaqueRenderTarget.lodGenerationScale=s.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=s.lodGenerationOffset):this._setupRenderTargets()}getOpaqueTarget(){return this._opaqueRenderTarget}_shouldRenderAsTransmission(s){return!!s&&!!(s instanceof e&&s.subSurface.isRefractionEnabled)}_addMesh(e){this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),n.SetImmediate((()=>{this._shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=this._opaqueRenderTarget,-1===this._transparentMeshesCache.indexOf(e)&&this._transparentMeshesCache.push(e)):-1===this._opaqueMeshesCache.indexOf(e)&&this._opaqueMeshesCache.push(e)}))}_removeMesh(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];let s=this._transparentMeshesCache.indexOf(e);-1!==s&&this._transparentMeshesCache.splice(s,1),s=this._opaqueMeshesCache.indexOf(e),-1!==s&&this._opaqueMeshesCache.splice(s,1)}_parseScene(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}_onMeshMaterialChanged(s){const t=this._transparentMeshesCache.indexOf(s),r=this._opaqueMeshesCache.indexOf(s);this._shouldRenderAsTransmission(s.material)?(s.material instanceof e&&(s.material.subSurface.refractionTexture=this._opaqueRenderTarget),-1!==r?(this._opaqueMeshesCache.splice(r,1),this._transparentMeshesCache.push(s)):-1===t&&this._transparentMeshesCache.push(s)):-1!==t?(this._transparentMeshesCache.splice(t,1),this._opaqueMeshesCache.push(s)):-1===r&&this._opaqueMeshesCache.push(s)}_isRenderTargetValid(){return null!==this._opaqueRenderTarget?.getInternalTexture()}_setupRenderTargets(){let e,s;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new i("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=this._options.clearColor?.clone()??this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.onBeforeBindObservable.add((t=>{s=this._scene.environmentIntensity,this._scene.environmentIntensity=1,e=this._scene.imageProcessingConfiguration.applyByPostProcess,this._options.clearColor?t.clearColor.copyFrom(this._options.clearColor):this._scene.clearColor.toLinearSpaceToRef(t.clearColor,this._scene.getEngine().useExactSrgbConversions),this._scene.imageProcessingConfiguration._applyByPostProcess=!0})),this._opaqueRenderTarget.onAfterUnbindObservable.add((()=>{this._scene.environmentIntensity=s,this._scene.imageProcessingConfiguration._applyByPostProcess=e})),this._transparentMeshesCache.forEach((e=>{this._shouldRenderAsTransmission(e.material)&&(e.material.refractionTexture=this._opaqueRenderTarget)}))}dispose(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}const p="KHR_materials_transmission";class d{constructor(e){this.name=p,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(p),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,t){return o.LoadExtensionAsync(e,s,this.name,((r,a)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(e,s,t)),n.push(this._loadTransparentPropertiesAsync(r,s,t,a)),Promise.all(n).then((()=>{}))}))}_loadTransparentPropertiesAsync(s,t,r,a){if(!(r instanceof e))throw new Error(`${s}: Material type not supported`);const n=r;if(n.subSurface.isRefractionEnabled=!0,n.subSurface.volumeIndexOfRefraction=1,n.subSurface.useAlbedoToTintRefraction=!0,void 0===a.transmissionFactor)return n.subSurface.refractionIntensity=0,n.subSurface.isRefractionEnabled=!1,Promise.resolve();{n.subSurface.refractionIntensity=a.transmissionFactor;const e=n.getScene();n.subSurface.refractionIntensity&&!e._transmissionHelper?new h({},n.getScene()):n.subSurface.refractionIntensity&&!e._transmissionHelper?._isRenderTargetValid()&&e._transmissionHelper?._setupRenderTargets()}return n.subSurface.minimumThickness=0,n.subSurface.maximumThickness=0,a.transmissionTexture?(a.transmissionTexture.nonColorData=!0,this._loader.loadTextureInfoAsync(`${s}/transmissionTexture`,a.transmissionTexture,void 0).then((e=>{e.name=`${r.name} (Transmission)`,n.subSurface.refractionIntensityTexture=e,n.subSurface.useGltfStyleTextures=!0}))):Promise.resolve()}}s(p),t(p,!0,(e=>new d(e)));export{d as KHR_materials_transmission};
|
|
2
|
-
//# sourceMappingURL=KHR_materials_transmission-BPNQkK0O.esm.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_transmission-BPNQkK0O.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_transmission.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\nimport { Observable } from \"core/Misc/observable\";\nimport { Constants } from \"core/Engines/constants\";\nimport { Tools } from \"core/Misc/tools\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\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.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 texture.name = `${babylonMaterial.name} (Transmission)`;\n pbrMaterial.subSurface.refractionIntensityTexture = texture;\n pbrMaterial.subSurface.useGltfStyleTextures = true;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_transmission(loader));\n//# sourceMappingURL=KHR_materials_transmission.js.map"],"names":["TransmissionHelper","_GetDefaultOptions","renderSize","samples","lodGenerationScale","lodGenerationOffset","renderTargetTextureType","Constants","TEXTURETYPE_HALF_FLOAT","generateMipmaps","constructor","options","scene","this","_opaqueRenderTarget","_opaqueMeshesCache","_transparentMeshesCache","_materialObservers","_options","_scene","_transmissionHelper","onErrorObservable","Observable","onDisposeObservable","addOnce","dispose","_parseScene","_setupRenderTargets","updateOptions","Object","keys","filter","key","length","newOptions","oldOptions","getOpaqueTarget","_shouldRenderAsTransmission","material","PBRMaterial","subSurface","isRefractionEnabled","_addMesh","mesh","uniqueId","onMaterialChangedObservable","add","_onMeshMaterialChanged","bind","Tools","SetImmediate","refractionTexture","indexOf","push","_removeMesh","remove","idx","splice","meshes","forEach","onNewMeshAddedObservable","onMeshRemovedObservable","transparentIdx","opaqueIdx","_isRenderTargetValid","getInternalTexture","sceneImageProcessingapplyByPostProcess","saveSceneEnvIntensity","RenderTargetTexture","undefined","ignoreCameraViewport","renderList","clearColor","clone","gammaSpace","renderSprites","renderParticles","onBeforeBindObservable","opaqueRenderTarget","environmentIntensity","imageProcessingConfiguration","applyByPostProcess","copyFrom","toLinearSpaceToRef","getEngine","useExactSrgbConversions","_applyByPostProcess","onAfterUnbindObservable","NAME","KHR_materials_transmission","loader","name","order","_loader","enabled","isExtensionUsed","parent","transparencyAsCoverage","loadMaterialPropertiesAsync","context","babylonMaterial","GLTFLoader","LoadExtensionAsync","extensionContext","extension","promises","Array","_loadTransparentPropertiesAsync","Promise","all","then","Error","pbrMaterial","volumeIndexOfRefraction","useAlbedoToTintRefraction","transmissionFactor","refractionIntensity","resolve","getScene","minimumThickness","maximumThickness","transmissionTexture","nonColorData","loadTextureInfoAsync","texture","refractionIntensityTexture","useGltfStyleTextures","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"4RAUA,MAAMA,EAKF,yBAAOC,GACH,MAAO,CACHC,WAAY,KACZC,QAAS,EACTC,mBAAoB,EACpBC,qBAAsB,EACtBC,wBAAyBC,EAAUC,uBACnCC,iBAAiB,EAE7B,CAMI,WAAAC,CAAYC,EAASC,GACjBC,KAAKC,oBAAsB,KAC3BD,KAAKE,mBAAqB,GAC1BF,KAAKG,wBAA0B,GAC/BH,KAAKI,mBAAqB,CAAE,EAC5BJ,KAAKK,SAAW,IACTlB,EAAmBC,wBACnBU,GAEPE,KAAKM,OAASP,EACdC,KAAKM,OAAOC,oBAAsBP,KAClCA,KAAKQ,kBAAoB,IAAIC,EAC7BT,KAAKM,OAAOI,oBAAoBC,SAAQ,KACpCX,KAAKY,SAAS,IAElBZ,KAAKa,cACLb,KAAKc,qBACb,CAKI,aAAAC,CAAcjB,GAGV,IADkBkB,OAAOC,KAAKnB,GAASoB,QAAQC,GAAQnB,KAAKK,SAASc,KAASrB,EAAQqB,KACvEC,OACX,OAEJ,MAAMC,EAAa,IACZrB,KAAKK,YACLP,GAEDwB,EAAatB,KAAKK,SAC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
-
import { a$ as PBRMaterial, aQ as unregisterGLTFExtension, aR as registerGLTFExtension, C as Constants, aV as Observable, T as Tools, bC as RenderTargetTexture } from './index-C6hXZyZb.esm.js';
|
|
2
|
-
import { G as GLTFLoader } from './glTFLoader-fUFiWvYb.esm.js';
|
|
3
|
-
import './rawTexture-CWiRIto8.esm.js';
|
|
4
|
-
import './assetContainer-DYzO0AbX.esm.js';
|
|
5
|
-
import './glTFLoaderAnimation-CttmY50U.esm.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A class to handle setting up the rendering of opaque objects to be shown through transmissive objects.
|
|
9
|
-
*/
|
|
10
|
-
class TransmissionHelper {
|
|
11
|
-
/**
|
|
12
|
-
* Creates the default options for the helper.
|
|
13
|
-
* @returns the default options
|
|
14
|
-
*/
|
|
15
|
-
static _GetDefaultOptions() {
|
|
16
|
-
return {
|
|
17
|
-
renderSize: 1024,
|
|
18
|
-
samples: 4,
|
|
19
|
-
lodGenerationScale: 1,
|
|
20
|
-
lodGenerationOffset: -4,
|
|
21
|
-
renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
22
|
-
generateMipmaps: true,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* constructor
|
|
27
|
-
* @param options Defines the options we want to customize the helper
|
|
28
|
-
* @param scene The scene to add the material to
|
|
29
|
-
*/
|
|
30
|
-
constructor(options, scene) {
|
|
31
|
-
this._opaqueRenderTarget = null;
|
|
32
|
-
this._opaqueMeshesCache = [];
|
|
33
|
-
this._transparentMeshesCache = [];
|
|
34
|
-
this._materialObservers = {};
|
|
35
|
-
this._options = {
|
|
36
|
-
...TransmissionHelper._GetDefaultOptions(),
|
|
37
|
-
...options,
|
|
38
|
-
};
|
|
39
|
-
this._scene = scene;
|
|
40
|
-
this._scene._transmissionHelper = this;
|
|
41
|
-
this.onErrorObservable = new Observable();
|
|
42
|
-
this._scene.onDisposeObservable.addOnce(() => {
|
|
43
|
-
this.dispose();
|
|
44
|
-
});
|
|
45
|
-
this._parseScene();
|
|
46
|
-
this._setupRenderTargets();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Updates the background according to the new options
|
|
50
|
-
* @param options
|
|
51
|
-
*/
|
|
52
|
-
updateOptions(options) {
|
|
53
|
-
// First check if any options are actually being changed. If not, exit.
|
|
54
|
-
const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]);
|
|
55
|
-
if (!newValues.length) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const newOptions = {
|
|
59
|
-
...this._options,
|
|
60
|
-
...options,
|
|
61
|
-
};
|
|
62
|
-
const oldOptions = this._options;
|
|
63
|
-
this._options = newOptions;
|
|
64
|
-
// If size changes, recreate everything
|
|
65
|
-
if (newOptions.renderSize !== oldOptions.renderSize ||
|
|
66
|
-
newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType ||
|
|
67
|
-
newOptions.generateMipmaps !== oldOptions.generateMipmaps ||
|
|
68
|
-
!this._opaqueRenderTarget) {
|
|
69
|
-
this._setupRenderTargets();
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this._opaqueRenderTarget.samples = newOptions.samples;
|
|
73
|
-
this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale;
|
|
74
|
-
this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @returns the opaque render target texture or null if not available.
|
|
79
|
-
*/
|
|
80
|
-
getOpaqueTarget() {
|
|
81
|
-
return this._opaqueRenderTarget;
|
|
82
|
-
}
|
|
83
|
-
_shouldRenderAsTransmission(material) {
|
|
84
|
-
if (!material) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
if (material instanceof PBRMaterial && material.subSurface.isRefractionEnabled) {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
_addMesh(mesh) {
|
|
93
|
-
this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this));
|
|
94
|
-
// we need to defer the processing because _addMesh may be called as part as an instance mesh creation, in which case some
|
|
95
|
-
// internal properties are not setup yet, like _sourceMesh (needed when doing mesh.material below)
|
|
96
|
-
Tools.SetImmediate(() => {
|
|
97
|
-
if (this._shouldRenderAsTransmission(mesh.material)) {
|
|
98
|
-
mesh.material.refractionTexture = this._opaqueRenderTarget;
|
|
99
|
-
if (this._transparentMeshesCache.indexOf(mesh) === -1) {
|
|
100
|
-
this._transparentMeshesCache.push(mesh);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
if (this._opaqueMeshesCache.indexOf(mesh) === -1) {
|
|
105
|
-
this._opaqueMeshesCache.push(mesh);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
_removeMesh(mesh) {
|
|
111
|
-
mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]);
|
|
112
|
-
delete this._materialObservers[mesh.uniqueId];
|
|
113
|
-
let idx = this._transparentMeshesCache.indexOf(mesh);
|
|
114
|
-
if (idx !== -1) {
|
|
115
|
-
this._transparentMeshesCache.splice(idx, 1);
|
|
116
|
-
}
|
|
117
|
-
idx = this._opaqueMeshesCache.indexOf(mesh);
|
|
118
|
-
if (idx !== -1) {
|
|
119
|
-
this._opaqueMeshesCache.splice(idx, 1);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
_parseScene() {
|
|
123
|
-
this._scene.meshes.forEach(this._addMesh.bind(this));
|
|
124
|
-
// Listen for when a mesh is added to the scene and add it to our cache lists.
|
|
125
|
-
this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this));
|
|
126
|
-
// Listen for when a mesh is removed from to the scene and remove it from our cache lists.
|
|
127
|
-
this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));
|
|
128
|
-
}
|
|
129
|
-
// When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.
|
|
130
|
-
_onMeshMaterialChanged(mesh) {
|
|
131
|
-
const transparentIdx = this._transparentMeshesCache.indexOf(mesh);
|
|
132
|
-
const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh);
|
|
133
|
-
// If the material is transparent, make sure that it's added to the transparent list and removed from the opaque list
|
|
134
|
-
const useTransmission = this._shouldRenderAsTransmission(mesh.material);
|
|
135
|
-
if (useTransmission) {
|
|
136
|
-
if (mesh.material instanceof PBRMaterial) {
|
|
137
|
-
mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget;
|
|
138
|
-
}
|
|
139
|
-
if (opaqueIdx !== -1) {
|
|
140
|
-
this._opaqueMeshesCache.splice(opaqueIdx, 1);
|
|
141
|
-
this._transparentMeshesCache.push(mesh);
|
|
142
|
-
}
|
|
143
|
-
else if (transparentIdx === -1) {
|
|
144
|
-
this._transparentMeshesCache.push(mesh);
|
|
145
|
-
}
|
|
146
|
-
// If the material is opaque, make sure that it's added to the opaque list and removed from the transparent list
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
if (transparentIdx !== -1) {
|
|
150
|
-
this._transparentMeshesCache.splice(transparentIdx, 1);
|
|
151
|
-
this._opaqueMeshesCache.push(mesh);
|
|
152
|
-
}
|
|
153
|
-
else if (opaqueIdx === -1) {
|
|
154
|
-
this._opaqueMeshesCache.push(mesh);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* @internal
|
|
160
|
-
* Check if the opaque render target has not been disposed and can still be used.
|
|
161
|
-
* @returns
|
|
162
|
-
*/
|
|
163
|
-
_isRenderTargetValid() {
|
|
164
|
-
return this._opaqueRenderTarget?.getInternalTexture() !== null;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* @internal
|
|
168
|
-
* Setup the render targets according to the specified options.
|
|
169
|
-
*/
|
|
170
|
-
_setupRenderTargets() {
|
|
171
|
-
if (this._opaqueRenderTarget) {
|
|
172
|
-
this._opaqueRenderTarget.dispose();
|
|
173
|
-
}
|
|
174
|
-
this._opaqueRenderTarget = new RenderTargetTexture("opaqueSceneTexture", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType);
|
|
175
|
-
this._opaqueRenderTarget.ignoreCameraViewport = true;
|
|
176
|
-
this._opaqueRenderTarget.renderList = this._opaqueMeshesCache;
|
|
177
|
-
this._opaqueRenderTarget.clearColor = this._options.clearColor?.clone() ?? this._scene.clearColor.clone();
|
|
178
|
-
this._opaqueRenderTarget.gammaSpace = false;
|
|
179
|
-
this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale;
|
|
180
|
-
this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset;
|
|
181
|
-
this._opaqueRenderTarget.samples = this._options.samples;
|
|
182
|
-
this._opaqueRenderTarget.renderSprites = true;
|
|
183
|
-
this._opaqueRenderTarget.renderParticles = true;
|
|
184
|
-
let sceneImageProcessingapplyByPostProcess;
|
|
185
|
-
let saveSceneEnvIntensity;
|
|
186
|
-
this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => {
|
|
187
|
-
saveSceneEnvIntensity = this._scene.environmentIntensity;
|
|
188
|
-
this._scene.environmentIntensity = 1.0;
|
|
189
|
-
sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;
|
|
190
|
-
if (!this._options.clearColor) {
|
|
191
|
-
this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor);
|
|
195
|
-
}
|
|
196
|
-
// we do not use the applyByPostProcess setter to avoid flagging all the materials as "image processing dirty"!
|
|
197
|
-
this._scene.imageProcessingConfiguration._applyByPostProcess = true;
|
|
198
|
-
});
|
|
199
|
-
this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {
|
|
200
|
-
this._scene.environmentIntensity = saveSceneEnvIntensity;
|
|
201
|
-
this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;
|
|
202
|
-
});
|
|
203
|
-
this._transparentMeshesCache.forEach((mesh) => {
|
|
204
|
-
if (this._shouldRenderAsTransmission(mesh.material)) {
|
|
205
|
-
mesh.material.refractionTexture = this._opaqueRenderTarget;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Dispose all the elements created by the Helper.
|
|
211
|
-
*/
|
|
212
|
-
dispose() {
|
|
213
|
-
this._scene._transmissionHelper = undefined;
|
|
214
|
-
if (this._opaqueRenderTarget) {
|
|
215
|
-
this._opaqueRenderTarget.dispose();
|
|
216
|
-
this._opaqueRenderTarget = null;
|
|
217
|
-
}
|
|
218
|
-
this._transparentMeshesCache = [];
|
|
219
|
-
this._opaqueMeshesCache = [];
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
const NAME = "KHR_materials_transmission";
|
|
223
|
-
/**
|
|
224
|
-
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)
|
|
225
|
-
*/
|
|
226
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
227
|
-
class KHR_materials_transmission {
|
|
228
|
-
/**
|
|
229
|
-
* @internal
|
|
230
|
-
*/
|
|
231
|
-
constructor(loader) {
|
|
232
|
-
/**
|
|
233
|
-
* The name of this extension.
|
|
234
|
-
*/
|
|
235
|
-
this.name = NAME;
|
|
236
|
-
/**
|
|
237
|
-
* Defines a number that determines the order the extensions are applied.
|
|
238
|
-
*/
|
|
239
|
-
this.order = 175;
|
|
240
|
-
this._loader = loader;
|
|
241
|
-
this.enabled = this._loader.isExtensionUsed(NAME);
|
|
242
|
-
if (this.enabled) {
|
|
243
|
-
loader.parent.transparencyAsCoverage = true;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
/** @internal */
|
|
247
|
-
dispose() {
|
|
248
|
-
this._loader = null;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* @internal
|
|
252
|
-
*/
|
|
253
|
-
loadMaterialPropertiesAsync(context, material, babylonMaterial) {
|
|
254
|
-
return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {
|
|
255
|
-
const promises = new Array();
|
|
256
|
-
promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
|
257
|
-
promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension));
|
|
258
|
-
return Promise.all(promises).then(() => { });
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
_loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {
|
|
262
|
-
if (!(babylonMaterial instanceof PBRMaterial)) {
|
|
263
|
-
throw new Error(`${context}: Material type not supported`);
|
|
264
|
-
}
|
|
265
|
-
const pbrMaterial = babylonMaterial;
|
|
266
|
-
// Enables "refraction" texture which represents transmitted light.
|
|
267
|
-
pbrMaterial.subSurface.isRefractionEnabled = true;
|
|
268
|
-
// Since this extension models thin-surface transmission only, we must make IOR = 1.0
|
|
269
|
-
pbrMaterial.subSurface.volumeIndexOfRefraction = 1.0;
|
|
270
|
-
// Albedo colour will tint transmission.
|
|
271
|
-
pbrMaterial.subSurface.useAlbedoToTintRefraction = true;
|
|
272
|
-
if (extension.transmissionFactor !== undefined) {
|
|
273
|
-
pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;
|
|
274
|
-
const scene = pbrMaterial.getScene();
|
|
275
|
-
if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper) {
|
|
276
|
-
new TransmissionHelper({}, pbrMaterial.getScene());
|
|
277
|
-
}
|
|
278
|
-
else if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper?._isRenderTargetValid()) {
|
|
279
|
-
// If the render target is not valid, recreate it.
|
|
280
|
-
scene._transmissionHelper?._setupRenderTargets();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
pbrMaterial.subSurface.refractionIntensity = 0.0;
|
|
285
|
-
pbrMaterial.subSurface.isRefractionEnabled = false;
|
|
286
|
-
return Promise.resolve();
|
|
287
|
-
}
|
|
288
|
-
pbrMaterial.subSurface.minimumThickness = 0.0;
|
|
289
|
-
pbrMaterial.subSurface.maximumThickness = 0.0;
|
|
290
|
-
if (extension.transmissionTexture) {
|
|
291
|
-
extension.transmissionTexture.nonColorData = true;
|
|
292
|
-
return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then((texture) => {
|
|
293
|
-
texture.name = `${babylonMaterial.name} (Transmission)`;
|
|
294
|
-
pbrMaterial.subSurface.refractionIntensityTexture = texture;
|
|
295
|
-
pbrMaterial.subSurface.useGltfStyleTextures = true;
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
return Promise.resolve();
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
unregisterGLTFExtension(NAME);
|
|
304
|
-
registerGLTFExtension(NAME, true, (loader) => new KHR_materials_transmission(loader));
|
|
305
|
-
|
|
306
|
-
export { KHR_materials_transmission };
|
|
307
|
-
//# sourceMappingURL=KHR_materials_transmission-CHr_yLLX.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_transmission-CHr_yLLX.esm.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_transmission.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\nimport { Observable } from \"core/Misc/observable\";\nimport { Constants } from \"core/Engines/constants\";\nimport { Tools } from \"core/Misc/tools\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\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.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 texture.name = `${babylonMaterial.name} (Transmission)`;\n pbrMaterial.subSurface.refractionIntensityTexture = texture;\n pbrMaterial.subSurface.useGltfStyleTextures = true;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_transmission(loader));\n//# sourceMappingURL=KHR_materials_transmission.js.map"],"names":[],"mappings":";;;;;;AAOA;AACA;AACA;AACA,MAAM,kBAAkB,CAAC;AACzB;AACA;AACA;AACA;AACA,IAAI,OAAO,kBAAkB,GAAG;AAChC,QAAQ,OAAO;AACf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B,CAAC,IAAI,CAAC;AAC7B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a$ as e,s as o,aQ as r,aR as s}from"./index-rZVkfTE6.esm.min.js";import{G as a}from"./glTFLoader-D4C1IGb3.esm.min.js";import"./rawTexture-DX8V9PEj.esm.min.js";import"./assetContainer-7pMDUaac.esm.min.js";import"./glTFLoaderAnimation-BB_Vw079.esm.min.js";const t="KHR_materials_unlit";class i{constructor(e){this.name=t,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,o,r){return a.LoadExtensionAsync(e,o,this.name,(()=>this._loadUnlitPropertiesAsync(e,o,r)))}_loadUnlitPropertiesAsync(r,s,a){if(!(a instanceof e))throw new Error(`${r}: Material type not supported`);const t=new Array;a.unlit=!0;const i=s.pbrMetallicRoughness;return i&&(i.baseColorFactor?(a.albedoColor=o.FromArray(i.baseColorFactor),a.alpha=i.baseColorFactor[3]):a.albedoColor=o.White(),i.baseColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${r}/baseColorTexture`,i.baseColorTexture,(e=>{e.name=`${a.name} (Base Color)`,a.albedoTexture=e})))),s.doubleSided&&(a.backFaceCulling=!1,a.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(r,s,a),Promise.all(t).then((()=>{}))}}r(t),s(t,!0,(e=>new i(e)));export{i as KHR_materials_unlit};
|
|
2
|
-
//# sourceMappingURL=KHR_materials_unlit-BYXpcsdj.esm.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KHR_materials_unlit-BYXpcsdj.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_unlit.js"],"sourcesContent":["import { Color3 } from \"core/Maths/math.color\";\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_unlit\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_unlit/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_unlit {\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 = 210;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\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, () => {\n return this._loadUnlitPropertiesAsync(context, material, babylonMaterial);\n });\n }\n _loadUnlitPropertiesAsync(context, material, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n babylonMaterial.unlit = true;\n const properties = material.pbrMetallicRoughness;\n if (properties) {\n if (properties.baseColorFactor) {\n babylonMaterial.albedoColor = Color3.FromArray(properties.baseColorFactor);\n babylonMaterial.alpha = properties.baseColorFactor[3];\n }\n else {\n babylonMaterial.albedoColor = Color3.White();\n }\n if (properties.baseColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Base Color)`;\n babylonMaterial.albedoTexture = texture;\n }));\n }\n }\n if (material.doubleSided) {\n babylonMaterial.backFaceCulling = false;\n babylonMaterial.twoSidedLighting = true;\n }\n this._loader.loadMaterialAlphaProperties(context, material, babylonMaterial);\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_unlit(loader));\n//# sourceMappingURL=KHR_materials_unlit.js.map"],"names":["NAME","KHR_materials_unlit","constructor","loader","this","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","GLTFLoader","LoadExtensionAsync","_loadUnlitPropertiesAsync","PBRMaterial","Error","promises","Array","unlit","properties","pbrMetallicRoughness","baseColorFactor","albedoColor","Color3","FromArray","alpha","White","baseColorTexture","push","loadTextureInfoAsync","texture","albedoTexture","doubleSided","backFaceCulling","twoSidedLighting","loadMaterialAlphaProperties","Promise","all","then","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"qQAIA,MAAMA,EAAO,sBAKN,MAAMC,EAIT,WAAAC,CAAYC,GAIRC,KAAKC,KAAOL,EAIZI,KAAKE,MAAQ,IACbF,KAAKG,QAAUJ,EACfC,KAAKI,QAAUJ,KAAKG,QAAQE,gBAAgBT,EACpD,CAEI,OAAAU,GACIN,KAAKG,QAAU,IACvB,CAII,2BAAAI,CAA4BC,EAASC,EAAUC,GAC3C,OAAOC,EAAWC,mBAAmBJ,EAASC,EAAUT,KAAKC,MAAM,IACxDD,KAAKa,0BAA0BL,EAASC,EAAUC,IAErE,CACI,yBAAAG,CAA0BL,EAASC,EAAUC,GACzC,KAAMA,aAA2BI,GAC7B,MAAM,IAAIC,MAAM,GAAGP,kCAEvB,MAAMQ,EAAW,IAAIC,MACrBP,EAAgBQ,OAAQ,EACxB,MAAMC,EAAaV,EAASW,qBAqB5B,OApBID,IACIA,EAAWE,iBACXX,EAAgBY,YAAcC,EAAOC,UAAUL,EAAWE,iBAC1DX,EAAgBe,MAAQN,EAAWE,gBAAgB,IAGnDX,EAAgBY,YAAcC,EAAOG,QAErCP,EAAWQ,kBACXX,EAASY,KAAK5B,KAAKG,QAAQ0B,qBAAqB,GAAGrB,qBAA4BW,EAAWQ,kBAAmBG,IACzGA,EAAQ7B,KAAO,GAAGS,EAAgBT,oBAClCS,EAAgBqB,cAAgBD,CAAO,MAI/CrB,EAASuB,cACTtB,EAAgBuB,iBAAkB,EAClCvB,EAAgBwB,kBAAmB,GAEvClC,KAAKG,QAAQgC,4BAA4B3B,EAASC,EAAUC,GACrD0B,QAAQC,IAAIrB,GAAUsB,MAAK,QAC1C,EAEAC,EAAwB3C,GACxB4C,EAAsB5C,GAAM,GAAOG,GAAW,IAAIF,EAAoBE"}
|