@babylonjs/viewer 7.40.4-alpha → 7.40.4
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-B7tVMCka.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_ies-B7tVMCka.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_ies-T0Tkc0j0.esm.js +0 -84
- package/dist/chunks/EXT_lights_ies-T0Tkc0j0.esm.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-CyoPcoDC.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_image_based-CyoPcoDC.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-TRLY00MY.esm.js +0 -171
- package/dist/chunks/EXT_lights_image_based-TRLY00MY.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-CNSWr-2o.esm.js +0 -86
- package/dist/chunks/EXT_mesh_gpu_instancing-CNSWr-2o.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-DvkytavO.esm.min.js +0 -2
- package/dist/chunks/EXT_mesh_gpu_instancing-DvkytavO.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-C5Jf55Kx.esm.min.js +0 -2
- package/dist/chunks/EXT_meshopt_compression-C5Jf55Kx.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-CWVLJCmT.esm.js +0 -134
- package/dist/chunks/EXT_meshopt_compression-CWVLJCmT.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-Bv2Pa-Lr.esm.js +0 -44
- package/dist/chunks/EXT_texture_avif-Bv2Pa-Lr.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-DZmsorD-.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_avif-DZmsorD-.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-CBpWQrqC.esm.js +0 -43
- package/dist/chunks/EXT_texture_webp-CBpWQrqC.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-D6RSOJSe.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_webp-D6RSOJSe.esm.min.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-6ZohdbjJ.esm.js +0 -64
- package/dist/chunks/ExtrasAsMetadata-6ZohdbjJ.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-CrG2l0Kf.esm.min.js +0 -2
- package/dist/chunks/ExtrasAsMetadata-CrG2l0Kf.esm.min.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-Cvu5a-gj.esm.js +0 -352
- package/dist/chunks/KHR_animation_pointer-Cvu5a-gj.esm.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-Rk2uzfDp.esm.min.js +0 -2
- package/dist/chunks/KHR_animation_pointer-Rk2uzfDp.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-BrXprwd5.esm.js +0 -610
- package/dist/chunks/KHR_draco_mesh_compression-BrXprwd5.esm.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-Iv3q50MG.esm.min.js +0 -2
- package/dist/chunks/KHR_draco_mesh_compression-Iv3q50MG.esm.min.js.map +0 -1
- package/dist/chunks/KHR_interactivity-B4iFgkk7.esm.min.js +0 -2
- package/dist/chunks/KHR_interactivity-B4iFgkk7.esm.min.js.map +0 -1
- package/dist/chunks/KHR_interactivity-Db4iHU65.esm.js +0 -4033
- package/dist/chunks/KHR_interactivity-Db4iHU65.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-B7yNiRZy.esm.min.js +0 -2
- package/dist/chunks/KHR_lights_punctual-B7yNiRZy.esm.min.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-iZl19DTA.esm.js +0 -581
- package/dist/chunks/KHR_lights_punctual-iZl19DTA.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-Bk9K0k0q.esm.js +0 -65
- package/dist/chunks/KHR_materials_anisotropy-Bk9K0k0q.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-DlDnL4o4.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_anisotropy-DlDnL4o4.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-BrT4VgMS.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_clearcoat-BrT4VgMS.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-DXAyxIfA.esm.js +0 -96
- package/dist/chunks/KHR_materials_clearcoat-DXAyxIfA.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-CRqI4Umg.esm.js +0 -97
- package/dist/chunks/KHR_materials_diffuse_transmission-CRqI4Umg.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-jyVvmpFx.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_diffuse_transmission-jyVvmpFx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-BwXQSsRC.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_dispersion-BwXQSsRC.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-DTMaHZal.esm.js +0 -62
- package/dist/chunks/KHR_materials_dispersion-DTMaHZal.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-BCWSR6Zg.esm.js +0 -55
- package/dist/chunks/KHR_materials_emissive_strength-BCWSR6Zg.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-dEqNWrU4.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_emissive_strength-dEqNWrU4.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-DXmoDlX8.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_ior-DXmoDlX8.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-NvWqR2ZR.esm.js +0 -64
- package/dist/chunks/KHR_materials_ior-NvWqR2ZR.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-2VKZo_Mv.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_iridescence-2VKZo_Mv.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-B2wLtYQ4.esm.js +0 -72
- package/dist/chunks/KHR_materials_iridescence-B2wLtYQ4.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DYK5fci0.esm.js +0 -81
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DYK5fci0.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-PlzNRHwZ.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-PlzNRHwZ.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-CvA19viC.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_sheen-CvA19viC.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-DY8Hlw2C.esm.js +0 -85
- package/dist/chunks/KHR_materials_sheen-DY8Hlw2C.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-DPankAYO.esm.js +0 -75
- package/dist/chunks/KHR_materials_specular-DPankAYO.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-SFjYTaHn.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_specular-SFjYTaHn.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-CBvCfGeN.esm.js +0 -307
- package/dist/chunks/KHR_materials_transmission-CBvCfGeN.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-DeRHqgMd.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_transmission-DeRHqgMd.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-Dp-VzfY2.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_unlit-Dp-VzfY2.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-xG3eIsVn.esm.js +0 -74
- package/dist/chunks/KHR_materials_unlit-xG3eIsVn.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-DtTs7enl.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_variants-DtTs7enl.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-POauQPs7.esm.js +0 -262
- package/dist/chunks/KHR_materials_variants-POauQPs7.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-BO1lvsUq.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_volume-BO1lvsUq.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-BqCunks7.esm.js +0 -87
- package/dist/chunks/KHR_materials_volume-BqCunks7.esm.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-3ON-a5Bz.esm.js +0 -26
- package/dist/chunks/KHR_mesh_quantization-3ON-a5Bz.esm.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-C1uR5Lci.esm.min.js +0 -2
- package/dist/chunks/KHR_mesh_quantization-C1uR5Lci.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_hoverability-CZIi0X9e.esm.js +0 -39
- package/dist/chunks/KHR_node_hoverability-CZIi0X9e.esm.js.map +0 -1
- package/dist/chunks/KHR_node_hoverability-gPD0oS5c.esm.min.js +0 -2
- package/dist/chunks/KHR_node_hoverability-gPD0oS5c.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-B5fFI1TX.esm.js +0 -46
- package/dist/chunks/KHR_node_visibility-B5fFI1TX.esm.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-DPw-0W4p.esm.min.js +0 -2
- package/dist/chunks/KHR_node_visibility-DPw-0W4p.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-D6tStneN.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_basisu-D6tStneN.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-Did7TM-4.esm.js +0 -43
- package/dist/chunks/KHR_texture_basisu-Did7TM-4.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-Da5NeRUm.esm.js +0 -63
- package/dist/chunks/KHR_texture_transform-Da5NeRUm.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-jNMzm3zb.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_transform-jNMzm3zb.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-D514my_a.esm.js +0 -51
- package/dist/chunks/KHR_xmp_json_ld-D514my_a.esm.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-D5Gbko_w.esm.min.js +0 -2
- package/dist/chunks/KHR_xmp_json_ld-D5Gbko_w.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-CiB3yG6v.esm.js +0 -2201
- package/dist/chunks/MSFT_audio_emitter-CiB3yG6v.esm.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-Cn-DCgMh.esm.min.js +0 -2
- package/dist/chunks/MSFT_audio_emitter-Cn-DCgMh.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_lod-BDP9fUoB.esm.js +0 -337
- package/dist/chunks/MSFT_lod-BDP9fUoB.esm.js.map +0 -1
- package/dist/chunks/MSFT_lod-BEbIdncN.esm.min.js +0 -2
- package/dist/chunks/MSFT_lod-BEbIdncN.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-jASzndfE.esm.min.js +0 -2
- package/dist/chunks/MSFT_minecraftMesh-jASzndfE.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-mKnNUrKI.esm.js +0 -46
- package/dist/chunks/MSFT_minecraftMesh-mKnNUrKI.esm.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-B1Bk1U5N.esm.min.js +0 -2
- package/dist/chunks/MSFT_sRGBFactors-B1Bk1U5N.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-IZnSmmDU.esm.js +0 -47
- package/dist/chunks/MSFT_sRGBFactors-IZnSmmDU.esm.js.map +0 -1
- package/dist/chunks/animationGroup-B1YyqoTa.esm.js +0 -2482
- package/dist/chunks/animationGroup-B1YyqoTa.esm.js.map +0 -1
- package/dist/chunks/animationGroup-C9C7qST_.esm.min.js +0 -2
- package/dist/chunks/animationGroup-C9C7qST_.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-BzlRl_4x.esm.js +0 -1720
- package/dist/chunks/assetContainer-BzlRl_4x.esm.js.map +0 -1
- package/dist/chunks/assetContainer-D7C3a-Xn.esm.min.js +0 -2
- package/dist/chunks/assetContainer-D7C3a-Xn.esm.min.js.map +0 -1
- package/dist/chunks/audioEngine-BZB34VjD.esm.js +0 -305
- package/dist/chunks/audioEngine-BZB34VjD.esm.js.map +0 -1
- package/dist/chunks/audioEngine-BoxJPZL7.esm.min.js +0 -2
- package/dist/chunks/audioEngine-BoxJPZL7.esm.min.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-BQki1eZ4.esm.min.js +0 -2
- package/dist/chunks/bakedVertexAnimation-BQki1eZ4.esm.min.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-DpSHNKcC.esm.js +0 -114
- package/dist/chunks/bakedVertexAnimation-DpSHNKcC.esm.js.map +0 -1
- package/dist/chunks/basisTextureLoader-C3RlzqZl.esm.min.js +0 -2
- package/dist/chunks/basisTextureLoader-C3RlzqZl.esm.min.js.map +0 -1
- package/dist/chunks/basisTextureLoader-D6uyehp2.esm.js +0 -600
- package/dist/chunks/basisTextureLoader-D6uyehp2.esm.js.map +0 -1
- package/dist/chunks/dds-C1QgDMMC.esm.min.js +0 -2
- package/dist/chunks/dds-C1QgDMMC.esm.min.js.map +0 -1
- package/dist/chunks/dds-zApWiwah.esm.js +0 -540
- package/dist/chunks/dds-zApWiwah.esm.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-CSYQAUdw.esm.js +0 -88
- package/dist/chunks/ddsTextureLoader-CSYQAUdw.esm.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-Dyl2CjaG.esm.min.js +0 -2
- package/dist/chunks/ddsTextureLoader-Dyl2CjaG.esm.min.js.map +0 -1
- package/dist/chunks/decalFragment-BbsT8PSx.esm.min.js +0 -2
- package/dist/chunks/decalFragment-BbsT8PSx.esm.min.js.map +0 -1
- package/dist/chunks/decalFragment-DqgT4NiX.esm.js +0 -18
- package/dist/chunks/decalFragment-DqgT4NiX.esm.js.map +0 -1
- package/dist/chunks/default.fragment-Bpw23SLq.esm.min.js +0 -2
- package/dist/chunks/default.fragment-Bpw23SLq.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-C8lcinV9.esm.js +0 -446
- package/dist/chunks/default.fragment-C8lcinV9.esm.js.map +0 -1
- package/dist/chunks/default.fragment-De3FJCJD.esm.js +0 -515
- package/dist/chunks/default.fragment-De3FJCJD.esm.js.map +0 -1
- package/dist/chunks/default.fragment-b__nAv93.esm.min.js +0 -2
- package/dist/chunks/default.fragment-b__nAv93.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-BnpZVKdz.esm.min.js +0 -2
- package/dist/chunks/default.vertex-BnpZVKdz.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-CD2qxrmB.esm.js +0 -190
- package/dist/chunks/default.vertex-CD2qxrmB.esm.js.map +0 -1
- package/dist/chunks/default.vertex-CN5WYROZ.esm.min.js +0 -2
- package/dist/chunks/default.vertex-CN5WYROZ.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-DRHq60qX.esm.js +0 -211
- package/dist/chunks/default.vertex-DRHq60qX.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-C0gMCjYL.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-C0gMCjYL.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-CGRrluBg.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-CGRrluBg.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-DCybxQ0F.esm.js +0 -13
- package/dist/chunks/defaultUboDeclaration-DCybxQ0F.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-xxIrKyXf.esm.js +0 -15
- package/dist/chunks/defaultUboDeclaration-xxIrKyXf.esm.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-BOVGklo2.esm.min.js +0 -2
- package/dist/chunks/dumpTools-BOVGklo2.esm.min.js.map +0 -1
- package/dist/chunks/dumpTools-Dy-fD64p.esm.js +0 -200
- package/dist/chunks/dumpTools-Dy-fD64p.esm.js.map +0 -1
- package/dist/chunks/engine-CBGABL2W.esm.min.js +0 -2
- package/dist/chunks/engine-CBGABL2W.esm.min.js.map +0 -1
- package/dist/chunks/engine-D9Sn-BC6.esm.js +0 -2213
- package/dist/chunks/engine-D9Sn-BC6.esm.js.map +0 -1
- package/dist/chunks/engine.common-BM1GAef8.esm.js +0 -1162
- package/dist/chunks/engine.common-BM1GAef8.esm.js.map +0 -1
- package/dist/chunks/engine.common-xMH7x2b0.esm.min.js +0 -2
- package/dist/chunks/engine.common-xMH7x2b0.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-BRdNaVH2.esm.min.js +0 -2
- package/dist/chunks/envTextureLoader-BRdNaVH2.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-DT_xwrde.esm.js +0 -64
- package/dist/chunks/envTextureLoader-DT_xwrde.esm.js.map +0 -1
- package/dist/chunks/environmentTextureTools-BxWsgzT8.esm.min.js +0 -2
- package/dist/chunks/environmentTextureTools-BxWsgzT8.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-DuNLB_SE.esm.js +0 -382
- package/dist/chunks/environmentTextureTools-DuNLB_SE.esm.js.map +0 -1
- package/dist/chunks/exrTextureLoader-BBL1-v_g.esm.min.js +0 -2
- package/dist/chunks/exrTextureLoader-BBL1-v_g.esm.min.js.map +0 -1
- package/dist/chunks/exrTextureLoader-CUiWw4Oh.esm.js +0 -1683
- package/dist/chunks/exrTextureLoader-CUiWw4Oh.esm.js.map +0 -1
- package/dist/chunks/fogFragment-BCz1GIrJ.esm.min.js +0 -2
- package/dist/chunks/fogFragment-BCz1GIrJ.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-BQLWFsYl.esm.min.js +0 -2
- package/dist/chunks/fogFragment-BQLWFsYl.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-DANl-YQk.esm.js +0 -102
- package/dist/chunks/fogFragment-DANl-YQk.esm.js.map +0 -1
- package/dist/chunks/fogFragment-DptoygQ5.esm.js +0 -101
- package/dist/chunks/fogFragment-DptoygQ5.esm.js.map +0 -1
- package/dist/chunks/fresnelFunction-3-z89NGn.esm.js +0 -12
- package/dist/chunks/fresnelFunction-3-z89NGn.esm.js.map +0 -1
- package/dist/chunks/fresnelFunction-CbnLfwWn.esm.min.js +0 -2
- package/dist/chunks/fresnelFunction-CbnLfwWn.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoader-Qw5JObwf.esm.js +0 -7658
- package/dist/chunks/glTFLoader-Qw5JObwf.esm.js.map +0 -1
- package/dist/chunks/glTFLoader-iKlvKEG-.esm.min.js +0 -2
- package/dist/chunks/glTFLoader-iKlvKEG-.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-BCUZthxT.esm.js +0 -77
- package/dist/chunks/glTFLoaderAnimation-BCUZthxT.esm.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-DnTkRibM.esm.min.js +0 -2
- package/dist/chunks/glTFLoaderAnimation-DnTkRibM.esm.min.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-19PWyV81.esm.js +0 -34
- package/dist/chunks/harmonicsFunctions-19PWyV81.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-D4sp7bHN.esm.js +0 -35
- package/dist/chunks/harmonicsFunctions-D4sp7bHN.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-DSpaTpH7.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-DSpaTpH7.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-DvH68s1g.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-DvH68s1g.esm.min.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-ChbZ5_1g.esm.min.js +0 -2
- package/dist/chunks/hdrTextureLoader-ChbZ5_1g.esm.min.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-OJaopXAb.esm.js +0 -253
- package/dist/chunks/hdrTextureLoader-OJaopXAb.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-CNCeKea7.esm.js +0 -81
- package/dist/chunks/helperFunctions-CNCeKea7.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-Crs36Q3w.esm.js +0 -109
- package/dist/chunks/helperFunctions-Crs36Q3w.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-DKz6om6i.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-DKz6om6i.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-bZhuioWn.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-bZhuioWn.esm.min.js.map +0 -1
- package/dist/chunks/iesTextureLoader-BTOaWdIK.esm.js +0 -189
- package/dist/chunks/iesTextureLoader-BTOaWdIK.esm.js.map +0 -1
- package/dist/chunks/iesTextureLoader-CKnu1maC.esm.min.js +0 -2
- package/dist/chunks/iesTextureLoader-CKnu1maC.esm.min.js.map +0 -1
- package/dist/chunks/index-5L5wXyrx.esm.js +0 -74870
- package/dist/chunks/index-5L5wXyrx.esm.js.map +0 -1
- package/dist/chunks/index-B5KLkjYm.esm.min.js +0 -57
- package/dist/chunks/index-B5KLkjYm.esm.min.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-CMfHt5rp.esm.js +0 -814
- package/dist/chunks/ktxTextureLoader-CMfHt5rp.esm.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-DCyzShol.esm.min.js +0 -2
- package/dist/chunks/ktxTextureLoader-DCyzShol.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-8CuoGLY6.esm.js +0 -35
- package/dist/chunks/logDepthDeclaration-8CuoGLY6.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-BC68Ktb0.esm.js +0 -11
- package/dist/chunks/logDepthDeclaration-BC68Ktb0.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-CgPuLaM9.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-CgPuLaM9.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-iNYm9mSn.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-iNYm9mSn.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-BOepIJij.esm.js +0 -77
- package/dist/chunks/logDepthVertex-BOepIJij.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-Bno6ozc-.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-Bno6ozc-.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-CU3WBwOA.esm.js +0 -81
- package/dist/chunks/logDepthVertex-CU3WBwOA.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-DjeubcPn.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-DjeubcPn.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-C_Am-o4e.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-C_Am-o4e.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CuSqEhkE.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-CuSqEhkE.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-DxqJq0-m.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-DxqJq0-m.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-oZF0xIut.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-oZF0xIut.esm.min.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-BWuUYN5-.esm.js +0 -26
- package/dist/chunks/meshUboDeclaration-BWuUYN5-.esm.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-D-9f-79D.esm.min.js +0 -2
- package/dist/chunks/meshUboDeclaration-D-9f-79D.esm.min.js.map +0 -1
- package/dist/chunks/objFileLoader-B3PzHlWB.esm.min.js +0 -2
- package/dist/chunks/objFileLoader-B3PzHlWB.esm.min.js.map +0 -1
- package/dist/chunks/objFileLoader-BjHr-pn1.esm.js +0 -1338
- package/dist/chunks/objFileLoader-BjHr-pn1.esm.js.map +0 -1
- package/dist/chunks/oitFragment-BypZDJVo.esm.min.js +0 -2
- package/dist/chunks/oitFragment-BypZDJVo.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-D3g8w3hO.esm.js +0 -1078
- package/dist/chunks/oitFragment-D3g8w3hO.esm.js.map +0 -1
- package/dist/chunks/oitFragment-Db3h4DV5.esm.min.js +0 -2
- package/dist/chunks/oitFragment-Db3h4DV5.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-tQJLudg5.esm.js +0 -1240
- package/dist/chunks/oitFragment-tQJLudg5.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-C8CWeVkM.esm.js +0 -15
- package/dist/chunks/pass.fragment-C8CWeVkM.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-CSK2ynPe.esm.js +0 -15
- package/dist/chunks/pass.fragment-CSK2ynPe.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-CdgLWa1Q.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-CdgLWa1Q.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment-ONNyQPrD.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-ONNyQPrD.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-Be9mZgL7.esm.js +0 -3269
- package/dist/chunks/pbr.fragment-Be9mZgL7.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-C13t4f7Z.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-C13t4f7Z.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-CiAe6mgr.esm.js +0 -3222
- package/dist/chunks/pbr.fragment-CiAe6mgr.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-I66pqwoX.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-I66pqwoX.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-BlqPEcZe.esm.js +0 -223
- package/dist/chunks/pbr.vertex-BlqPEcZe.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-C1r_QFvZ.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-C1r_QFvZ.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-DE9NTHal.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-DE9NTHal.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-oQpu2zia.esm.js +0 -348
- package/dist/chunks/pbr.vertex-oQpu2zia.esm.js.map +0 -1
- package/dist/chunks/postprocess.vertex-D3XLqa14.esm.js +0 -20
- package/dist/chunks/postprocess.vertex-D3XLqa14.esm.js.map +0 -1
- package/dist/chunks/postprocess.vertex-IkQbrBQH.esm.min.js +0 -2
- package/dist/chunks/postprocess.vertex-IkQbrBQH.esm.min.js.map +0 -1
- package/dist/chunks/rawTexture-BVf9vm87.esm.js +0 -191
- package/dist/chunks/rawTexture-BVf9vm87.esm.js.map +0 -1
- package/dist/chunks/rawTexture-CNxyCiVq.esm.min.js +0 -2
- package/dist/chunks/rawTexture-CNxyCiVq.esm.min.js.map +0 -1
- package/dist/chunks/ray-BLVbie8S.esm.min.js +0 -2
- package/dist/chunks/ray-BLVbie8S.esm.min.js.map +0 -1
- package/dist/chunks/ray-C7H9vp-x.esm.js +0 -946
- package/dist/chunks/ray-C7H9vp-x.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-9dPOcBOA.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-9dPOcBOA.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-ApyH83v_.esm.js +0 -13
- package/dist/chunks/rgbdDecode.fragment-ApyH83v_.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-Bt75XOUV.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-Bt75XOUV.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-DDIJs9ID.esm.js +0 -13
- package/dist/chunks/rgbdDecode.fragment-DDIJs9ID.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-CSquf6K4.esm.js +0 -13
- package/dist/chunks/rgbdEncode.fragment-CSquf6K4.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-Cpudy2qT.esm.js +0 -13
- package/dist/chunks/rgbdEncode.fragment-Cpudy2qT.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-DZs59_tV.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-DZs59_tV.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-Djxd-azW.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-Djxd-azW.esm.min.js.map +0 -1
- package/dist/chunks/splatFileLoader-BkExyfY6.esm.js +0 -3379
- package/dist/chunks/splatFileLoader-BkExyfY6.esm.js.map +0 -1
- package/dist/chunks/splatFileLoader-DLc_wKu4.esm.min.js +0 -2
- package/dist/chunks/splatFileLoader-DLc_wKu4.esm.min.js.map +0 -1
- package/dist/chunks/spotLight-CFGRpcFc.esm.js +0 -701
- package/dist/chunks/spotLight-CFGRpcFc.esm.js.map +0 -1
- package/dist/chunks/spotLight-z5HIEQmM.esm.min.js +0 -2
- package/dist/chunks/spotLight-z5HIEQmM.esm.min.js.map +0 -1
- package/dist/chunks/standardMaterial-B5u9Vzil.esm.min.js +0 -2
- package/dist/chunks/standardMaterial-B5u9Vzil.esm.min.js.map +0 -1
- package/dist/chunks/standardMaterial-BJzDZ72T.esm.js +0 -1806
- package/dist/chunks/standardMaterial-BJzDZ72T.esm.js.map +0 -1
- package/dist/chunks/stlFileLoader-B3Y6u4L6.esm.min.js +0 -2
- package/dist/chunks/stlFileLoader-B3Y6u4L6.esm.min.js.map +0 -1
- package/dist/chunks/stlFileLoader-Bd1GgkYU.esm.js +0 -238
- package/dist/chunks/stlFileLoader-Bd1GgkYU.esm.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-BD_A6gyw.esm.min.js +0 -2
- package/dist/chunks/tgaTextureLoader-BD_A6gyw.esm.min.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-DnUiJRBO.esm.js +0 -349
- package/dist/chunks/tgaTextureLoader-DnUiJRBO.esm.js.map +0 -1
- package/dist/chunks/thinEngine-CRNAFHqA.esm.min.js +0 -2
- package/dist/chunks/thinEngine-CRNAFHqA.esm.min.js.map +0 -1
- package/dist/chunks/thinEngine-DGyFDxzW.esm.js +0 -3853
- package/dist/chunks/thinEngine-DGyFDxzW.esm.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-B-f1KNB2.esm.min.js +0 -2
- package/dist/chunks/thinInstanceMesh-B-f1KNB2.esm.min.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-D-cofgbF.esm.js +0 -314
- package/dist/chunks/thinInstanceMesh-D-cofgbF.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-BUqoiJkS.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-BUqoiJkS.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-CBpXxGvM.esm.js +0 -421
- package/dist/chunks/vertexColorMixing-CBpXxGvM.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-ChUhO7eS.esm.js +0 -531
- package/dist/chunks/vertexColorMixing-ChUhO7eS.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-DbmkfWMo.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-DbmkfWMo.esm.min.js.map +0 -1
- package/dist/chunks/webgpuEngine-DqprhQ4L.esm.js +0 -11538
- package/dist/chunks/webgpuEngine-DqprhQ4L.esm.js.map +0 -1
- package/dist/chunks/webgpuEngine-LpKjcEuV.esm.min.js +0 -2
- package/dist/chunks/webgpuEngine-LpKjcEuV.esm.min.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,814 +0,0 @@
|
|
|
1
|
-
import { L as Logger, T as Tools, C as Constants } from './index-5L5wXyrx.esm.js';
|
|
2
|
-
import { A as AutoReleaseWorkerPool } from './workerPool-BUOov2K1.esm.js';
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
5
|
-
/**
|
|
6
|
-
* for description see https://www.khronos.org/opengles/sdk/tools/KTX/
|
|
7
|
-
* for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
|
|
8
|
-
*/
|
|
9
|
-
class KhronosTextureContainer {
|
|
10
|
-
/**
|
|
11
|
-
* Creates a new KhronosTextureContainer
|
|
12
|
-
* @param data contents of the KTX container file
|
|
13
|
-
* @param facesExpected should be either 1 or 6, based whether a cube texture or or
|
|
14
|
-
*/
|
|
15
|
-
constructor(
|
|
16
|
-
/** contents of the KTX container file */
|
|
17
|
-
data, facesExpected) {
|
|
18
|
-
this.data = data;
|
|
19
|
-
/**
|
|
20
|
-
* If the container has been made invalid (eg. constructor failed to correctly load array buffer)
|
|
21
|
-
*/
|
|
22
|
-
this.isInvalid = false;
|
|
23
|
-
if (!KhronosTextureContainer.IsValid(data)) {
|
|
24
|
-
this.isInvalid = true;
|
|
25
|
-
Logger.Error("texture missing KTX identifier");
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// load the reset of the header in native 32 bit uint
|
|
29
|
-
const dataSize = Uint32Array.BYTES_PER_ELEMENT;
|
|
30
|
-
const headerDataView = new DataView(this.data.buffer, this.data.byteOffset + 12, 13 * dataSize);
|
|
31
|
-
const endianness = headerDataView.getUint32(0, true);
|
|
32
|
-
const littleEndian = endianness === 0x04030201;
|
|
33
|
-
this.glType = headerDataView.getUint32(1 * dataSize, littleEndian); // must be 0 for compressed textures
|
|
34
|
-
this.glTypeSize = headerDataView.getUint32(2 * dataSize, littleEndian); // must be 1 for compressed textures
|
|
35
|
-
this.glFormat = headerDataView.getUint32(3 * dataSize, littleEndian); // must be 0 for compressed textures
|
|
36
|
-
this.glInternalFormat = headerDataView.getUint32(4 * dataSize, littleEndian); // the value of arg passed to gl.compressedTexImage2D(,,x,,,,)
|
|
37
|
-
this.glBaseInternalFormat = headerDataView.getUint32(5 * dataSize, littleEndian); // specify GL_RGB, GL_RGBA, GL_ALPHA, etc (un-compressed only)
|
|
38
|
-
this.pixelWidth = headerDataView.getUint32(6 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage2D(,,,x,,,)
|
|
39
|
-
this.pixelHeight = headerDataView.getUint32(7 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage2D(,,,,x,,)
|
|
40
|
-
this.pixelDepth = headerDataView.getUint32(8 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage3D(,,,,,x,,)
|
|
41
|
-
this.numberOfArrayElements = headerDataView.getUint32(9 * dataSize, littleEndian); // used for texture arrays
|
|
42
|
-
this.numberOfFaces = headerDataView.getUint32(10 * dataSize, littleEndian); // used for cubemap textures, should either be 1 or 6
|
|
43
|
-
this.numberOfMipmapLevels = headerDataView.getUint32(11 * dataSize, littleEndian); // number of levels; disregard possibility of 0 for compressed textures
|
|
44
|
-
this.bytesOfKeyValueData = headerDataView.getUint32(12 * dataSize, littleEndian); // the amount of space after the header for meta-data
|
|
45
|
-
// Make sure we have a compressed type. Not only reduces work, but probably better to let dev know they are not compressing.
|
|
46
|
-
if (this.glType !== 0) {
|
|
47
|
-
Logger.Error("only compressed formats currently supported");
|
|
48
|
-
this.isInvalid = true;
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// value of zero is an indication to generate mipmaps @ runtime. Not usually allowed for compressed, so disregard.
|
|
53
|
-
this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels);
|
|
54
|
-
}
|
|
55
|
-
if (this.pixelHeight === 0 || this.pixelDepth !== 0) {
|
|
56
|
-
Logger.Error("only 2D textures currently supported");
|
|
57
|
-
this.isInvalid = true;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (this.numberOfArrayElements !== 0) {
|
|
61
|
-
Logger.Error("texture arrays not currently supported");
|
|
62
|
-
this.isInvalid = true;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (this.numberOfFaces !== facesExpected) {
|
|
66
|
-
Logger.Error("number of faces expected" + facesExpected + ", but found " + this.numberOfFaces);
|
|
67
|
-
this.isInvalid = true;
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
// we now have a completely validated file, so could use existence of loadType as success
|
|
71
|
-
// would need to make this more elaborate & adjust checks above to support more than one load type
|
|
72
|
-
this.loadType = KhronosTextureContainer.COMPRESSED_2D;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Uploads KTX content to a Babylon Texture.
|
|
76
|
-
* It is assumed that the texture has already been created & is currently bound
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
uploadLevels(texture, loadMipmaps) {
|
|
80
|
-
switch (this.loadType) {
|
|
81
|
-
case KhronosTextureContainer.COMPRESSED_2D:
|
|
82
|
-
this._upload2DCompressedLevels(texture, loadMipmaps);
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
_upload2DCompressedLevels(texture, loadMipmaps) {
|
|
87
|
-
// initialize width & height for level 1
|
|
88
|
-
let dataOffset = KhronosTextureContainer.HEADER_LEN + this.bytesOfKeyValueData;
|
|
89
|
-
let width = this.pixelWidth;
|
|
90
|
-
let height = this.pixelHeight;
|
|
91
|
-
const mipmapCount = loadMipmaps ? this.numberOfMipmapLevels : 1;
|
|
92
|
-
for (let level = 0; level < mipmapCount; level++) {
|
|
93
|
-
const imageSize = new Int32Array(this.data.buffer, this.data.byteOffset + dataOffset, 1)[0]; // size per face, since not supporting array cubemaps
|
|
94
|
-
dataOffset += 4; //image data starts from next multiple of 4 offset. Each face refers to same imagesize field above.
|
|
95
|
-
for (let face = 0; face < this.numberOfFaces; face++) {
|
|
96
|
-
const byteArray = new Uint8Array(this.data.buffer, this.data.byteOffset + dataOffset, imageSize);
|
|
97
|
-
const engine = texture.getEngine();
|
|
98
|
-
engine._uploadCompressedDataToTextureDirectly(texture, texture.format, width, height, byteArray, face, level);
|
|
99
|
-
dataOffset += imageSize; // add size of the image for the next face/mipmap
|
|
100
|
-
dataOffset += 3 - ((imageSize + 3) % 4); // add padding for odd sized image
|
|
101
|
-
}
|
|
102
|
-
width = Math.max(1.0, width * 0.5);
|
|
103
|
-
height = Math.max(1.0, height * 0.5);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Checks if the given data starts with a KTX file identifier.
|
|
108
|
-
* @param data the data to check
|
|
109
|
-
* @returns true if the data is a KTX file or false otherwise
|
|
110
|
-
*/
|
|
111
|
-
static IsValid(data) {
|
|
112
|
-
if (data.byteLength >= 12) {
|
|
113
|
-
// '«', 'K', 'T', 'X', ' ', '1', '1', '»', '\r', '\n', '\x1A', '\n'
|
|
114
|
-
const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);
|
|
115
|
-
if (identifier[0] === 0xab &&
|
|
116
|
-
identifier[1] === 0x4b &&
|
|
117
|
-
identifier[2] === 0x54 &&
|
|
118
|
-
identifier[3] === 0x58 &&
|
|
119
|
-
identifier[4] === 0x20 &&
|
|
120
|
-
identifier[5] === 0x31 &&
|
|
121
|
-
identifier[6] === 0x31 &&
|
|
122
|
-
identifier[7] === 0xbb &&
|
|
123
|
-
identifier[8] === 0x0d &&
|
|
124
|
-
identifier[9] === 0x0a &&
|
|
125
|
-
identifier[10] === 0x1a &&
|
|
126
|
-
identifier[11] === 0x0a) {
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
KhronosTextureContainer.HEADER_LEN = 12 + 13 * 4; // identifier + header elements (not including key value meta-data pairs)
|
|
134
|
-
// load types
|
|
135
|
-
KhronosTextureContainer.COMPRESSED_2D = 0; // uses a gl.compressedTexImage2D()
|
|
136
|
-
KhronosTextureContainer.COMPRESSED_3D = 1; // uses a gl.compressedTexImage3D()
|
|
137
|
-
KhronosTextureContainer.TEX_2D = 2; // uses a gl.texImage2D()
|
|
138
|
-
KhronosTextureContainer.TEX_3D = 3; // uses a gl.texImage3D()
|
|
139
|
-
|
|
140
|
-
var SourceTextureFormat;
|
|
141
|
-
(function (SourceTextureFormat) {
|
|
142
|
-
SourceTextureFormat[SourceTextureFormat["ETC1S"] = 0] = "ETC1S";
|
|
143
|
-
SourceTextureFormat[SourceTextureFormat["UASTC4x4"] = 1] = "UASTC4x4";
|
|
144
|
-
})(SourceTextureFormat || (SourceTextureFormat = {}));
|
|
145
|
-
var TranscodeTarget;
|
|
146
|
-
(function (TranscodeTarget) {
|
|
147
|
-
TranscodeTarget[TranscodeTarget["ASTC_4X4_RGBA"] = 0] = "ASTC_4X4_RGBA";
|
|
148
|
-
TranscodeTarget[TranscodeTarget["BC7_RGBA"] = 1] = "BC7_RGBA";
|
|
149
|
-
TranscodeTarget[TranscodeTarget["BC3_RGBA"] = 2] = "BC3_RGBA";
|
|
150
|
-
TranscodeTarget[TranscodeTarget["BC1_RGB"] = 3] = "BC1_RGB";
|
|
151
|
-
TranscodeTarget[TranscodeTarget["PVRTC1_4_RGBA"] = 4] = "PVRTC1_4_RGBA";
|
|
152
|
-
TranscodeTarget[TranscodeTarget["PVRTC1_4_RGB"] = 5] = "PVRTC1_4_RGB";
|
|
153
|
-
TranscodeTarget[TranscodeTarget["ETC2_RGBA"] = 6] = "ETC2_RGBA";
|
|
154
|
-
TranscodeTarget[TranscodeTarget["ETC1_RGB"] = 7] = "ETC1_RGB";
|
|
155
|
-
TranscodeTarget[TranscodeTarget["RGBA32"] = 8] = "RGBA32";
|
|
156
|
-
TranscodeTarget[TranscodeTarget["R8"] = 9] = "R8";
|
|
157
|
-
TranscodeTarget[TranscodeTarget["RG8"] = 10] = "RG8";
|
|
158
|
-
})(TranscodeTarget || (TranscodeTarget = {}));
|
|
159
|
-
var EngineFormat;
|
|
160
|
-
(function (EngineFormat) {
|
|
161
|
-
EngineFormat[EngineFormat["COMPRESSED_RGBA_BPTC_UNORM_EXT"] = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT";
|
|
162
|
-
EngineFormat[EngineFormat["COMPRESSED_RGBA_ASTC_4X4_KHR"] = 37808] = "COMPRESSED_RGBA_ASTC_4X4_KHR";
|
|
163
|
-
EngineFormat[EngineFormat["COMPRESSED_RGB_S3TC_DXT1_EXT"] = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT";
|
|
164
|
-
EngineFormat[EngineFormat["COMPRESSED_RGBA_S3TC_DXT5_EXT"] = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT";
|
|
165
|
-
EngineFormat[EngineFormat["COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"] = 35842] = "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG";
|
|
166
|
-
EngineFormat[EngineFormat["COMPRESSED_RGB_PVRTC_4BPPV1_IMG"] = 35840] = "COMPRESSED_RGB_PVRTC_4BPPV1_IMG";
|
|
167
|
-
EngineFormat[EngineFormat["COMPRESSED_RGBA8_ETC2_EAC"] = 37496] = "COMPRESSED_RGBA8_ETC2_EAC";
|
|
168
|
-
EngineFormat[EngineFormat["COMPRESSED_RGB8_ETC2"] = 37492] = "COMPRESSED_RGB8_ETC2";
|
|
169
|
-
EngineFormat[EngineFormat["COMPRESSED_RGB_ETC1_WEBGL"] = 36196] = "COMPRESSED_RGB_ETC1_WEBGL";
|
|
170
|
-
EngineFormat[EngineFormat["RGBA8Format"] = 32856] = "RGBA8Format";
|
|
171
|
-
EngineFormat[EngineFormat["R8Format"] = 33321] = "R8Format";
|
|
172
|
-
EngineFormat[EngineFormat["RG8Format"] = 33323] = "RG8Format";
|
|
173
|
-
})(EngineFormat || (EngineFormat = {}));
|
|
174
|
-
|
|
175
|
-
function applyConfig(urls, binariesAndModulesContainer) {
|
|
176
|
-
const KTX2DecoderModule = binariesAndModulesContainer?.jsDecoderModule || KTX2DECODER;
|
|
177
|
-
if (urls) {
|
|
178
|
-
if (urls.wasmUASTCToASTC) {
|
|
179
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_ASTC.WasmModuleURL = urls.wasmUASTCToASTC;
|
|
180
|
-
}
|
|
181
|
-
if (urls.wasmUASTCToBC7) {
|
|
182
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_BC7.WasmModuleURL = urls.wasmUASTCToBC7;
|
|
183
|
-
}
|
|
184
|
-
if (urls.wasmUASTCToRGBA_UNORM) {
|
|
185
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = urls.wasmUASTCToRGBA_UNORM;
|
|
186
|
-
}
|
|
187
|
-
if (urls.wasmUASTCToRGBA_SRGB) {
|
|
188
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = urls.wasmUASTCToRGBA_SRGB;
|
|
189
|
-
}
|
|
190
|
-
if (urls.wasmUASTCToR8_UNORM) {
|
|
191
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_R8_UNORM.WasmModuleURL = urls.wasmUASTCToR8_UNORM;
|
|
192
|
-
}
|
|
193
|
-
if (urls.wasmUASTCToRG8_UNORM) {
|
|
194
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_RG8_UNORM.WasmModuleURL = urls.wasmUASTCToRG8_UNORM;
|
|
195
|
-
}
|
|
196
|
-
if (urls.jsMSCTranscoder) {
|
|
197
|
-
KTX2DecoderModule.MSCTranscoder.JSModuleURL = urls.jsMSCTranscoder;
|
|
198
|
-
}
|
|
199
|
-
if (urls.wasmMSCTranscoder) {
|
|
200
|
-
KTX2DecoderModule.MSCTranscoder.WasmModuleURL = urls.wasmMSCTranscoder;
|
|
201
|
-
}
|
|
202
|
-
if (urls.wasmZSTDDecoder) {
|
|
203
|
-
KTX2DecoderModule.ZSTDDecoder.WasmModuleURL = urls.wasmZSTDDecoder;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
if (binariesAndModulesContainer) {
|
|
207
|
-
if (binariesAndModulesContainer.wasmUASTCToASTC) {
|
|
208
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_ASTC.WasmBinary = binariesAndModulesContainer.wasmUASTCToASTC;
|
|
209
|
-
}
|
|
210
|
-
if (binariesAndModulesContainer.wasmUASTCToBC7) {
|
|
211
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_BC7.WasmBinary = binariesAndModulesContainer.wasmUASTCToBC7;
|
|
212
|
-
}
|
|
213
|
-
if (binariesAndModulesContainer.wasmUASTCToRGBA_UNORM) {
|
|
214
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_UNORM.WasmBinary = binariesAndModulesContainer.wasmUASTCToRGBA_UNORM;
|
|
215
|
-
}
|
|
216
|
-
if (binariesAndModulesContainer.wasmUASTCToRGBA_SRGB) {
|
|
217
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_RGBA_SRGB.WasmBinary = binariesAndModulesContainer.wasmUASTCToRGBA_SRGB;
|
|
218
|
-
}
|
|
219
|
-
if (binariesAndModulesContainer.wasmUASTCToR8_UNORM) {
|
|
220
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_R8_UNORM.WasmBinary = binariesAndModulesContainer.wasmUASTCToR8_UNORM;
|
|
221
|
-
}
|
|
222
|
-
if (binariesAndModulesContainer.wasmUASTCToRG8_UNORM) {
|
|
223
|
-
KTX2DecoderModule.LiteTranscoder_UASTC_RG8_UNORM.WasmBinary = binariesAndModulesContainer.wasmUASTCToRG8_UNORM;
|
|
224
|
-
}
|
|
225
|
-
if (binariesAndModulesContainer.jsMSCTranscoder) {
|
|
226
|
-
KTX2DecoderModule.MSCTranscoder.JSModule = binariesAndModulesContainer.jsMSCTranscoder;
|
|
227
|
-
}
|
|
228
|
-
if (binariesAndModulesContainer.wasmMSCTranscoder) {
|
|
229
|
-
KTX2DecoderModule.MSCTranscoder.WasmBinary = binariesAndModulesContainer.wasmMSCTranscoder;
|
|
230
|
-
}
|
|
231
|
-
if (binariesAndModulesContainer.wasmZSTDDecoder) {
|
|
232
|
-
KTX2DecoderModule.ZSTDDecoder.WasmBinary = binariesAndModulesContainer.wasmZSTDDecoder;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
function workerFunction(KTX2DecoderModule) {
|
|
237
|
-
if (typeof KTX2DecoderModule === "undefined" && typeof KTX2DECODER !== "undefined") {
|
|
238
|
-
KTX2DecoderModule = KTX2DECODER;
|
|
239
|
-
}
|
|
240
|
-
let ktx2Decoder;
|
|
241
|
-
onmessage = (event) => {
|
|
242
|
-
if (!event.data) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
switch (event.data.action) {
|
|
246
|
-
case "init": {
|
|
247
|
-
const urls = event.data.urls;
|
|
248
|
-
if (urls) {
|
|
249
|
-
if (urls.jsDecoderModule && typeof KTX2DecoderModule === "undefined") {
|
|
250
|
-
importScripts(urls.jsDecoderModule);
|
|
251
|
-
// assuming global namespace populated by the script (UMD pattern)
|
|
252
|
-
KTX2DecoderModule = KTX2DECODER;
|
|
253
|
-
}
|
|
254
|
-
applyConfig(urls);
|
|
255
|
-
}
|
|
256
|
-
if (event.data.wasmBinaries) {
|
|
257
|
-
applyConfig(undefined, { ...event.data.wasmBinaries, jsDecoderModule: KTX2DecoderModule });
|
|
258
|
-
}
|
|
259
|
-
ktx2Decoder = new KTX2DecoderModule.KTX2Decoder();
|
|
260
|
-
postMessage({ action: "init" });
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
case "setDefaultDecoderOptions": {
|
|
264
|
-
KTX2DecoderModule.KTX2Decoder.DefaultDecoderOptions = event.data.options;
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
267
|
-
case "decode":
|
|
268
|
-
ktx2Decoder
|
|
269
|
-
.decode(event.data.data, event.data.caps, event.data.options)
|
|
270
|
-
.then((data) => {
|
|
271
|
-
const buffers = [];
|
|
272
|
-
for (let mip = 0; mip < data.mipmaps.length; ++mip) {
|
|
273
|
-
const mipmap = data.mipmaps[mip];
|
|
274
|
-
if (mipmap && mipmap.data) {
|
|
275
|
-
buffers.push(mipmap.data.buffer);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
postMessage({ action: "decoded", success: true, decodedData: data }, buffers);
|
|
279
|
-
})
|
|
280
|
-
.catch((reason) => {
|
|
281
|
-
postMessage({ action: "decoded", success: false, msg: reason });
|
|
282
|
-
});
|
|
283
|
-
break;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function initializeWebWorker(worker, wasmBinaries, urls) {
|
|
288
|
-
return new Promise((resolve, reject) => {
|
|
289
|
-
const onError = (error) => {
|
|
290
|
-
worker.removeEventListener("error", onError);
|
|
291
|
-
worker.removeEventListener("message", onMessage);
|
|
292
|
-
reject(error);
|
|
293
|
-
};
|
|
294
|
-
const onMessage = (message) => {
|
|
295
|
-
if (message.data.action === "init") {
|
|
296
|
-
worker.removeEventListener("error", onError);
|
|
297
|
-
worker.removeEventListener("message", onMessage);
|
|
298
|
-
resolve(worker);
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
worker.addEventListener("error", onError);
|
|
302
|
-
worker.addEventListener("message", onMessage);
|
|
303
|
-
worker.postMessage({
|
|
304
|
-
action: "init",
|
|
305
|
-
urls,
|
|
306
|
-
wasmBinaries,
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Class that defines the default KTX2 decoder options.
|
|
313
|
-
*
|
|
314
|
-
* This class is useful for providing options to the KTX2 decoder to control how the source data is transcoded.
|
|
315
|
-
*/
|
|
316
|
-
class DefaultKTX2DecoderOptions {
|
|
317
|
-
constructor() {
|
|
318
|
-
this._isDirty = true;
|
|
319
|
-
this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = true;
|
|
320
|
-
this._ktx2DecoderOptions = {};
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Gets the dirty flag
|
|
324
|
-
*/
|
|
325
|
-
get isDirty() {
|
|
326
|
-
return this._isDirty;
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* force a (uncompressed) RGBA transcoded format if transcoding a UASTC source format and ASTC + BC7 are not available as a compressed transcoded format
|
|
330
|
-
*/
|
|
331
|
-
get useRGBAIfASTCBC7NotAvailableWhenUASTC() {
|
|
332
|
-
return this._useRGBAIfASTCBC7NotAvailableWhenUASTC;
|
|
333
|
-
}
|
|
334
|
-
set useRGBAIfASTCBC7NotAvailableWhenUASTC(value) {
|
|
335
|
-
if (this._useRGBAIfASTCBC7NotAvailableWhenUASTC === value) {
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
this._useRGBAIfASTCBC7NotAvailableWhenUASTC = value;
|
|
339
|
-
this._isDirty = true;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* force a (uncompressed) RGBA transcoded format if transcoding a UASTC source format and only BC1 or BC3 are available as a compressed transcoded format.
|
|
343
|
-
* This property is true by default to favor speed over memory, because currently transcoding from UASTC to BC1/3 is slow because the transcoder transcodes
|
|
344
|
-
* to uncompressed and then recompresses the texture
|
|
345
|
-
*/
|
|
346
|
-
get useRGBAIfOnlyBC1BC3AvailableWhenUASTC() {
|
|
347
|
-
return this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC;
|
|
348
|
-
}
|
|
349
|
-
set useRGBAIfOnlyBC1BC3AvailableWhenUASTC(value) {
|
|
350
|
-
if (this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC === value) {
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
this._useRGBAIfOnlyBC1BC3AvailableWhenUASTC = value;
|
|
354
|
-
this._isDirty = true;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* force to always use (uncompressed) RGBA for transcoded format
|
|
358
|
-
*/
|
|
359
|
-
get forceRGBA() {
|
|
360
|
-
return this._forceRGBA;
|
|
361
|
-
}
|
|
362
|
-
set forceRGBA(value) {
|
|
363
|
-
if (this._forceRGBA === value) {
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
this._forceRGBA = value;
|
|
367
|
-
this._isDirty = true;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* force to always use (uncompressed) R8 for transcoded format
|
|
371
|
-
*/
|
|
372
|
-
get forceR8() {
|
|
373
|
-
return this._forceR8;
|
|
374
|
-
}
|
|
375
|
-
set forceR8(value) {
|
|
376
|
-
if (this._forceR8 === value) {
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
this._forceR8 = value;
|
|
380
|
-
this._isDirty = true;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* force to always use (uncompressed) RG8 for transcoded format
|
|
384
|
-
*/
|
|
385
|
-
get forceRG8() {
|
|
386
|
-
return this._forceRG8;
|
|
387
|
-
}
|
|
388
|
-
set forceRG8(value) {
|
|
389
|
-
if (this._forceRG8 === value) {
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
this._forceRG8 = value;
|
|
393
|
-
this._isDirty = true;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* list of transcoders to bypass when looking for a suitable transcoder. The available transcoders are:
|
|
397
|
-
* UniversalTranscoder_UASTC_ASTC
|
|
398
|
-
* UniversalTranscoder_UASTC_BC7
|
|
399
|
-
* UniversalTranscoder_UASTC_RGBA_UNORM
|
|
400
|
-
* UniversalTranscoder_UASTC_RGBA_SRGB
|
|
401
|
-
* UniversalTranscoder_UASTC_R8_UNORM
|
|
402
|
-
* UniversalTranscoder_UASTC_RG8_UNORM
|
|
403
|
-
* MSCTranscoder
|
|
404
|
-
*/
|
|
405
|
-
get bypassTranscoders() {
|
|
406
|
-
return this._bypassTranscoders;
|
|
407
|
-
}
|
|
408
|
-
set bypassTranscoders(value) {
|
|
409
|
-
if (this._bypassTranscoders === value) {
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
this._bypassTranscoders = value;
|
|
413
|
-
this._isDirty = true;
|
|
414
|
-
}
|
|
415
|
-
/** @internal */
|
|
416
|
-
_getKTX2DecoderOptions() {
|
|
417
|
-
if (!this._isDirty) {
|
|
418
|
-
return this._ktx2DecoderOptions;
|
|
419
|
-
}
|
|
420
|
-
this._isDirty = false;
|
|
421
|
-
const options = {
|
|
422
|
-
useRGBAIfASTCBC7NotAvailableWhenUASTC: this._useRGBAIfASTCBC7NotAvailableWhenUASTC,
|
|
423
|
-
forceRGBA: this._forceRGBA,
|
|
424
|
-
forceR8: this._forceR8,
|
|
425
|
-
forceRG8: this._forceRG8,
|
|
426
|
-
bypassTranscoders: this._bypassTranscoders,
|
|
427
|
-
};
|
|
428
|
-
if (this.useRGBAIfOnlyBC1BC3AvailableWhenUASTC) {
|
|
429
|
-
options.transcodeFormatDecisionTree = {
|
|
430
|
-
UASTC: {
|
|
431
|
-
transcodeFormat: [TranscodeTarget.BC1_RGB, TranscodeTarget.BC3_RGBA],
|
|
432
|
-
yes: {
|
|
433
|
-
transcodeFormat: TranscodeTarget.RGBA32,
|
|
434
|
-
engineFormat: 32856 /* EngineFormat.RGBA8Format */,
|
|
435
|
-
roundToMultiple4: false,
|
|
436
|
-
},
|
|
437
|
-
},
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
this._ktx2DecoderOptions = options;
|
|
441
|
-
return options;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Class for loading KTX2 files
|
|
446
|
-
*/
|
|
447
|
-
class KhronosTextureContainer2 {
|
|
448
|
-
static GetDefaultNumWorkers() {
|
|
449
|
-
if (typeof navigator !== "object" || !navigator.hardwareConcurrency) {
|
|
450
|
-
return 1;
|
|
451
|
-
}
|
|
452
|
-
// Use 50% of the available logical processors but capped at 4.
|
|
453
|
-
return Math.min(Math.floor(navigator.hardwareConcurrency * 0.5), 4);
|
|
454
|
-
}
|
|
455
|
-
static _Initialize(numWorkers) {
|
|
456
|
-
if (KhronosTextureContainer2._WorkerPoolPromise || KhronosTextureContainer2._DecoderModulePromise) {
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
const urls = {
|
|
460
|
-
jsDecoderModule: Tools.GetBabylonScriptURL(this.URLConfig.jsDecoderModule, true),
|
|
461
|
-
wasmUASTCToASTC: Tools.GetBabylonScriptURL(this.URLConfig.wasmUASTCToASTC, true),
|
|
462
|
-
wasmUASTCToBC7: Tools.GetBabylonScriptURL(this.URLConfig.wasmUASTCToBC7, true),
|
|
463
|
-
wasmUASTCToRGBA_UNORM: Tools.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_UNORM, true),
|
|
464
|
-
wasmUASTCToRGBA_SRGB: Tools.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRGBA_SRGB, true),
|
|
465
|
-
wasmUASTCToR8_UNORM: Tools.GetBabylonScriptURL(this.URLConfig.wasmUASTCToR8_UNORM, true),
|
|
466
|
-
wasmUASTCToRG8_UNORM: Tools.GetBabylonScriptURL(this.URLConfig.wasmUASTCToRG8_UNORM, true),
|
|
467
|
-
jsMSCTranscoder: Tools.GetBabylonScriptURL(this.URLConfig.jsMSCTranscoder, true),
|
|
468
|
-
wasmMSCTranscoder: Tools.GetBabylonScriptURL(this.URLConfig.wasmMSCTranscoder, true),
|
|
469
|
-
wasmZSTDDecoder: Tools.GetBabylonScriptURL(this.URLConfig.wasmZSTDDecoder, true),
|
|
470
|
-
};
|
|
471
|
-
if (numWorkers && typeof Worker === "function" && typeof URL !== "undefined") {
|
|
472
|
-
KhronosTextureContainer2._WorkerPoolPromise = new Promise((resolve) => {
|
|
473
|
-
const workerContent = `${applyConfig}(${workerFunction})()`;
|
|
474
|
-
const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: "application/javascript" }));
|
|
475
|
-
resolve(new AutoReleaseWorkerPool(numWorkers, () => initializeWebWorker(new Worker(workerBlobUrl), undefined, urls)));
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
else {
|
|
479
|
-
if (typeof KhronosTextureContainer2._KTX2DecoderModule === "undefined") {
|
|
480
|
-
KhronosTextureContainer2._DecoderModulePromise = Tools.LoadBabylonScriptAsync(urls.jsDecoderModule).then(() => {
|
|
481
|
-
KhronosTextureContainer2._KTX2DecoderModule = KTX2DECODER;
|
|
482
|
-
KhronosTextureContainer2._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread = false;
|
|
483
|
-
KhronosTextureContainer2._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread = true;
|
|
484
|
-
applyConfig(urls, KhronosTextureContainer2._KTX2DecoderModule);
|
|
485
|
-
return new KhronosTextureContainer2._KTX2DecoderModule.KTX2Decoder();
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
489
|
-
KhronosTextureContainer2._KTX2DecoderModule.MSCTranscoder.UseFromWorkerThread = false;
|
|
490
|
-
KhronosTextureContainer2._KTX2DecoderModule.WASMMemoryManager.LoadBinariesFromCurrentThread = true;
|
|
491
|
-
KhronosTextureContainer2._DecoderModulePromise = Promise.resolve(new KhronosTextureContainer2._KTX2DecoderModule.KTX2Decoder());
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Constructor
|
|
497
|
-
* @param engine The engine to use
|
|
498
|
-
* @param numWorkersOrOptions The number of workers for async operations. Specify `0` to disable web workers and run synchronously in the current context.
|
|
499
|
-
*/
|
|
500
|
-
constructor(engine, numWorkersOrOptions = KhronosTextureContainer2.DefaultNumWorkers) {
|
|
501
|
-
this._engine = engine;
|
|
502
|
-
const workerPoolOption = (typeof numWorkersOrOptions === "object" && numWorkersOrOptions.workerPool) || KhronosTextureContainer2.WorkerPool;
|
|
503
|
-
if (workerPoolOption) {
|
|
504
|
-
KhronosTextureContainer2._WorkerPoolPromise = Promise.resolve(workerPoolOption);
|
|
505
|
-
}
|
|
506
|
-
else {
|
|
507
|
-
// set the KTX2 decoder module
|
|
508
|
-
if (typeof numWorkersOrOptions === "object") {
|
|
509
|
-
KhronosTextureContainer2._KTX2DecoderModule = numWorkersOrOptions?.binariesAndModulesContainer?.jsDecoderModule;
|
|
510
|
-
}
|
|
511
|
-
else if (typeof KTX2DECODER !== "undefined") {
|
|
512
|
-
KhronosTextureContainer2._KTX2DecoderModule = KTX2DECODER;
|
|
513
|
-
}
|
|
514
|
-
const numberOfWorkers = typeof numWorkersOrOptions === "number" ? numWorkersOrOptions : (numWorkersOrOptions.numWorkers ?? KhronosTextureContainer2.DefaultNumWorkers);
|
|
515
|
-
KhronosTextureContainer2._Initialize(numberOfWorkers);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
/**
|
|
519
|
-
* @internal
|
|
520
|
-
*/
|
|
521
|
-
_uploadAsync(data, internalTexture, options) {
|
|
522
|
-
const caps = this._engine.getCaps();
|
|
523
|
-
const compressedTexturesCaps = {
|
|
524
|
-
astc: !!caps.astc,
|
|
525
|
-
bptc: !!caps.bptc,
|
|
526
|
-
s3tc: !!caps.s3tc,
|
|
527
|
-
pvrtc: !!caps.pvrtc,
|
|
528
|
-
etc2: !!caps.etc2,
|
|
529
|
-
etc1: !!caps.etc1,
|
|
530
|
-
};
|
|
531
|
-
if (KhronosTextureContainer2._WorkerPoolPromise) {
|
|
532
|
-
return KhronosTextureContainer2._WorkerPoolPromise.then((workerPool) => {
|
|
533
|
-
return new Promise((resolve, reject) => {
|
|
534
|
-
workerPool.push((worker, onComplete) => {
|
|
535
|
-
const onError = (error) => {
|
|
536
|
-
worker.removeEventListener("error", onError);
|
|
537
|
-
worker.removeEventListener("message", onMessage);
|
|
538
|
-
reject(error);
|
|
539
|
-
onComplete();
|
|
540
|
-
};
|
|
541
|
-
const onMessage = (message) => {
|
|
542
|
-
if (message.data.action === "decoded") {
|
|
543
|
-
worker.removeEventListener("error", onError);
|
|
544
|
-
worker.removeEventListener("message", onMessage);
|
|
545
|
-
if (!message.data.success) {
|
|
546
|
-
reject({ message: message.data.msg });
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
try {
|
|
550
|
-
this._createTexture(message.data.decodedData, internalTexture, options);
|
|
551
|
-
resolve();
|
|
552
|
-
}
|
|
553
|
-
catch (err) {
|
|
554
|
-
reject({ message: err });
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
onComplete();
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
worker.addEventListener("error", onError);
|
|
561
|
-
worker.addEventListener("message", onMessage);
|
|
562
|
-
worker.postMessage({ action: "setDefaultDecoderOptions", options: KhronosTextureContainer2.DefaultDecoderOptions._getKTX2DecoderOptions() });
|
|
563
|
-
const dataCopy = new Uint8Array(data.byteLength);
|
|
564
|
-
dataCopy.set(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
|
|
565
|
-
worker.postMessage({ action: "decode", data: dataCopy, caps: compressedTexturesCaps, options }, [dataCopy.buffer]);
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
else if (KhronosTextureContainer2._DecoderModulePromise) {
|
|
571
|
-
return KhronosTextureContainer2._DecoderModulePromise.then((decoder) => {
|
|
572
|
-
if (KhronosTextureContainer2.DefaultDecoderOptions.isDirty) {
|
|
573
|
-
KhronosTextureContainer2._KTX2DecoderModule.KTX2Decoder.DefaultDecoderOptions = KhronosTextureContainer2.DefaultDecoderOptions._getKTX2DecoderOptions();
|
|
574
|
-
}
|
|
575
|
-
return new Promise((resolve, reject) => {
|
|
576
|
-
decoder
|
|
577
|
-
.decode(data, caps)
|
|
578
|
-
.then((data) => {
|
|
579
|
-
this._createTexture(data, internalTexture);
|
|
580
|
-
resolve();
|
|
581
|
-
})
|
|
582
|
-
.catch((reason) => {
|
|
583
|
-
reject({ message: reason });
|
|
584
|
-
});
|
|
585
|
-
});
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
throw new Error("KTX2 decoder module is not available");
|
|
589
|
-
}
|
|
590
|
-
_createTexture(data, internalTexture, options) {
|
|
591
|
-
const oglTexture2D = 3553; // gl.TEXTURE_2D
|
|
592
|
-
this._engine._bindTextureDirectly(oglTexture2D, internalTexture);
|
|
593
|
-
if (options) {
|
|
594
|
-
// return back some information about the decoded data
|
|
595
|
-
options.transcodedFormat = data.transcodedFormat;
|
|
596
|
-
options.isInGammaSpace = data.isInGammaSpace;
|
|
597
|
-
options.hasAlpha = data.hasAlpha;
|
|
598
|
-
options.transcoderName = data.transcoderName;
|
|
599
|
-
}
|
|
600
|
-
let isUncompressedFormat = true;
|
|
601
|
-
switch (data.transcodedFormat) {
|
|
602
|
-
case 0x8058 /* RGBA8 */:
|
|
603
|
-
internalTexture.type = Constants.TEXTURETYPE_UNSIGNED_BYTE;
|
|
604
|
-
internalTexture.format = Constants.TEXTUREFORMAT_RGBA;
|
|
605
|
-
break;
|
|
606
|
-
case 0x8229 /* R8 */:
|
|
607
|
-
internalTexture.type = Constants.TEXTURETYPE_UNSIGNED_BYTE;
|
|
608
|
-
internalTexture.format = Constants.TEXTUREFORMAT_R;
|
|
609
|
-
break;
|
|
610
|
-
case 0x822b /* RG8 */:
|
|
611
|
-
internalTexture.type = Constants.TEXTURETYPE_UNSIGNED_BYTE;
|
|
612
|
-
internalTexture.format = Constants.TEXTUREFORMAT_RG;
|
|
613
|
-
break;
|
|
614
|
-
default:
|
|
615
|
-
internalTexture.format = data.transcodedFormat;
|
|
616
|
-
isUncompressedFormat = false;
|
|
617
|
-
break;
|
|
618
|
-
}
|
|
619
|
-
internalTexture._gammaSpace = data.isInGammaSpace;
|
|
620
|
-
internalTexture.generateMipMaps = data.mipmaps.length > 1;
|
|
621
|
-
if (data.errors) {
|
|
622
|
-
throw new Error("KTX2 container - could not transcode the data. " + data.errors);
|
|
623
|
-
}
|
|
624
|
-
for (let t = 0; t < data.mipmaps.length; ++t) {
|
|
625
|
-
const mipmap = data.mipmaps[t];
|
|
626
|
-
if (!mipmap || !mipmap.data) {
|
|
627
|
-
throw new Error("KTX2 container - could not transcode one of the image");
|
|
628
|
-
}
|
|
629
|
-
if (isUncompressedFormat) {
|
|
630
|
-
// uncompressed RGBA / R8 / RG8
|
|
631
|
-
internalTexture.width = mipmap.width; // need to set width/height so that the call to _uploadDataToTextureDirectly uses the right dimensions
|
|
632
|
-
internalTexture.height = mipmap.height;
|
|
633
|
-
this._engine._uploadDataToTextureDirectly(internalTexture, mipmap.data, 0, t, undefined, true);
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
this._engine._uploadCompressedDataToTextureDirectly(internalTexture, data.transcodedFormat, mipmap.width, mipmap.height, mipmap.data, 0, t);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
internalTexture._extension = ".ktx2";
|
|
640
|
-
internalTexture.width = data.mipmaps[0].width;
|
|
641
|
-
internalTexture.height = data.mipmaps[0].height;
|
|
642
|
-
internalTexture.isReady = true;
|
|
643
|
-
this._engine._bindTextureDirectly(oglTexture2D, null);
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Checks if the given data starts with a KTX2 file identifier.
|
|
647
|
-
* @param data the data to check
|
|
648
|
-
* @returns true if the data is a KTX2 file or false otherwise
|
|
649
|
-
*/
|
|
650
|
-
static IsValid(data) {
|
|
651
|
-
if (data.byteLength >= 12) {
|
|
652
|
-
// '«', 'K', 'T', 'X', ' ', '2', '0', '»', '\r', '\n', '\x1A', '\n'
|
|
653
|
-
const identifier = new Uint8Array(data.buffer, data.byteOffset, 12);
|
|
654
|
-
if (identifier[0] === 0xab &&
|
|
655
|
-
identifier[1] === 0x4b &&
|
|
656
|
-
identifier[2] === 0x54 &&
|
|
657
|
-
identifier[3] === 0x58 &&
|
|
658
|
-
identifier[4] === 0x20 &&
|
|
659
|
-
identifier[5] === 0x32 &&
|
|
660
|
-
identifier[6] === 0x30 &&
|
|
661
|
-
identifier[7] === 0xbb &&
|
|
662
|
-
identifier[8] === 0x0d &&
|
|
663
|
-
identifier[9] === 0x0a &&
|
|
664
|
-
identifier[10] === 0x1a &&
|
|
665
|
-
identifier[11] === 0x0a) {
|
|
666
|
-
return true;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
return false;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
/**
|
|
673
|
-
* URLs to use when loading the KTX2 decoder module as well as its dependencies
|
|
674
|
-
* If a url is null, the default url is used (pointing to https://preview.babylonjs.com)
|
|
675
|
-
* Note that jsDecoderModule can't be null and that the other dependencies will only be loaded if necessary
|
|
676
|
-
* Urls you can change:
|
|
677
|
-
* URLConfig.jsDecoderModule
|
|
678
|
-
* URLConfig.wasmUASTCToASTC
|
|
679
|
-
* URLConfig.wasmUASTCToBC7
|
|
680
|
-
* URLConfig.wasmUASTCToRGBA_UNORM
|
|
681
|
-
* URLConfig.wasmUASTCToRGBA_SRGB
|
|
682
|
-
* URLConfig.wasmUASTCToR8_UNORM
|
|
683
|
-
* URLConfig.wasmUASTCToRG8_UNORM
|
|
684
|
-
* URLConfig.jsMSCTranscoder
|
|
685
|
-
* URLConfig.wasmMSCTranscoder
|
|
686
|
-
* URLConfig.wasmZSTDDecoder
|
|
687
|
-
* You can see their default values in this PG: https://playground.babylonjs.com/#EIJH8L#29
|
|
688
|
-
*/
|
|
689
|
-
KhronosTextureContainer2.URLConfig = {
|
|
690
|
-
jsDecoderModule: "https://cdn.babylonjs.com/babylon.ktx2Decoder.js",
|
|
691
|
-
wasmUASTCToASTC: null,
|
|
692
|
-
wasmUASTCToBC7: null,
|
|
693
|
-
wasmUASTCToRGBA_UNORM: null,
|
|
694
|
-
wasmUASTCToRGBA_SRGB: null,
|
|
695
|
-
wasmUASTCToR8_UNORM: null,
|
|
696
|
-
wasmUASTCToRG8_UNORM: null,
|
|
697
|
-
jsMSCTranscoder: null,
|
|
698
|
-
wasmMSCTranscoder: null,
|
|
699
|
-
wasmZSTDDecoder: null,
|
|
700
|
-
};
|
|
701
|
-
/**
|
|
702
|
-
* Default number of workers used to handle data decoding
|
|
703
|
-
*/
|
|
704
|
-
KhronosTextureContainer2.DefaultNumWorkers = KhronosTextureContainer2.GetDefaultNumWorkers();
|
|
705
|
-
/**
|
|
706
|
-
* Default configuration for the KTX2 decoder.
|
|
707
|
-
* The options defined in this way have priority over those passed when creating a KTX2 texture with new Texture(...).
|
|
708
|
-
*/
|
|
709
|
-
KhronosTextureContainer2.DefaultDecoderOptions = new DefaultKTX2DecoderOptions();
|
|
710
|
-
|
|
711
|
-
function mapSRGBToLinear(format) {
|
|
712
|
-
switch (format) {
|
|
713
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT:
|
|
714
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1;
|
|
715
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
|
|
716
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3;
|
|
717
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
|
|
718
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5;
|
|
719
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2:
|
|
720
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2;
|
|
721
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
|
|
722
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC;
|
|
723
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
|
|
724
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
|
|
725
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
|
|
726
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4;
|
|
727
|
-
case Constants.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:
|
|
728
|
-
return Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM;
|
|
729
|
-
}
|
|
730
|
-
return null;
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Implementation of the KTX Texture Loader.
|
|
734
|
-
* @internal
|
|
735
|
-
*/
|
|
736
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
737
|
-
class _KTXTextureLoader {
|
|
738
|
-
constructor() {
|
|
739
|
-
/**
|
|
740
|
-
* Defines whether the loader supports cascade loading the different faces.
|
|
741
|
-
*/
|
|
742
|
-
this.supportCascades = false;
|
|
743
|
-
}
|
|
744
|
-
/**
|
|
745
|
-
* Uploads the cube texture data to the WebGL texture. It has already been bound.
|
|
746
|
-
* @param data contains the texture data
|
|
747
|
-
* @param texture defines the BabylonJS internal texture
|
|
748
|
-
* @param createPolynomials will be true if polynomials have been requested
|
|
749
|
-
* @param onLoad defines the callback to trigger once the texture is ready
|
|
750
|
-
*/
|
|
751
|
-
loadCubeData(data, texture, createPolynomials, onLoad) {
|
|
752
|
-
if (Array.isArray(data)) {
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
// Need to invert vScale as invertY via UNPACK_FLIP_Y_WEBGL is not supported by compressed texture
|
|
756
|
-
texture._invertVScale = !texture.invertY;
|
|
757
|
-
const engine = texture.getEngine();
|
|
758
|
-
const ktx = new KhronosTextureContainer(data, 6);
|
|
759
|
-
const loadMipmap = ktx.numberOfMipmapLevels > 1 && texture.generateMipMaps;
|
|
760
|
-
engine._unpackFlipY(true);
|
|
761
|
-
ktx.uploadLevels(texture, texture.generateMipMaps);
|
|
762
|
-
texture.width = ktx.pixelWidth;
|
|
763
|
-
texture.height = ktx.pixelHeight;
|
|
764
|
-
engine._setCubeMapTextureParams(texture, loadMipmap, ktx.numberOfMipmapLevels - 1);
|
|
765
|
-
texture.isReady = true;
|
|
766
|
-
texture.onLoadedObservable.notifyObservers(texture);
|
|
767
|
-
texture.onLoadedObservable.clear();
|
|
768
|
-
if (onLoad) {
|
|
769
|
-
onLoad();
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
/**
|
|
773
|
-
* Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
|
|
774
|
-
* @param data contains the texture data
|
|
775
|
-
* @param texture defines the BabylonJS internal texture
|
|
776
|
-
* @param callback defines the method to call once ready to upload
|
|
777
|
-
* @param options
|
|
778
|
-
*/
|
|
779
|
-
loadData(data, texture, callback, options) {
|
|
780
|
-
if (KhronosTextureContainer.IsValid(data)) {
|
|
781
|
-
// Need to invert vScale as invertY via UNPACK_FLIP_Y_WEBGL is not supported by compressed texture
|
|
782
|
-
texture._invertVScale = !texture.invertY;
|
|
783
|
-
const ktx = new KhronosTextureContainer(data, 1);
|
|
784
|
-
const mappedFormat = mapSRGBToLinear(ktx.glInternalFormat);
|
|
785
|
-
if (mappedFormat) {
|
|
786
|
-
texture.format = mappedFormat;
|
|
787
|
-
texture._useSRGBBuffer = texture.getEngine()._getUseSRGBBuffer(true, texture.generateMipMaps);
|
|
788
|
-
texture._gammaSpace = true;
|
|
789
|
-
}
|
|
790
|
-
else {
|
|
791
|
-
texture.format = ktx.glInternalFormat;
|
|
792
|
-
}
|
|
793
|
-
callback(ktx.pixelWidth, ktx.pixelHeight, texture.generateMipMaps, true, () => {
|
|
794
|
-
ktx.uploadLevels(texture, texture.generateMipMaps);
|
|
795
|
-
}, ktx.isInvalid);
|
|
796
|
-
}
|
|
797
|
-
else if (KhronosTextureContainer2.IsValid(data)) {
|
|
798
|
-
const ktx2 = new KhronosTextureContainer2(texture.getEngine());
|
|
799
|
-
ktx2._uploadAsync(data, texture, options).then(() => {
|
|
800
|
-
callback(texture.width, texture.height, texture.generateMipMaps, true, () => { }, false);
|
|
801
|
-
}, (error) => {
|
|
802
|
-
Logger.Warn(`Failed to load KTX2 texture data: ${error.message}`);
|
|
803
|
-
callback(0, 0, false, false, () => { }, true);
|
|
804
|
-
});
|
|
805
|
-
}
|
|
806
|
-
else {
|
|
807
|
-
Logger.Error("texture missing KTX identifier");
|
|
808
|
-
callback(0, 0, false, false, () => { }, true);
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
export { _KTXTextureLoader };
|
|
814
|
-
//# sourceMappingURL=ktxTextureLoader-CMfHt5rp.esm.js.map
|