@babylonjs/viewer 7.40.2-alpha → 7.40.2
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-BrhvRw2-.esm.js +0 -84
- package/dist/chunks/EXT_lights_ies-BrhvRw2-.esm.js.map +0 -1
- package/dist/chunks/EXT_lights_ies-Ddw_Gk8Q.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_ies-Ddw_Gk8Q.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-BjoWM5tf.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_image_based-BjoWM5tf.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-Bt2TW49Q.esm.js +0 -171
- package/dist/chunks/EXT_lights_image_based-Bt2TW49Q.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-Cy595I0S.esm.js +0 -86
- package/dist/chunks/EXT_mesh_gpu_instancing-Cy595I0S.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-DbVyjoq7.esm.min.js +0 -2
- package/dist/chunks/EXT_mesh_gpu_instancing-DbVyjoq7.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-PLPAdJXy.esm.min.js +0 -2
- package/dist/chunks/EXT_meshopt_compression-PLPAdJXy.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-ynnPogtK.esm.js +0 -134
- package/dist/chunks/EXT_meshopt_compression-ynnPogtK.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-D2N-IXnv.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_avif-D2N-IXnv.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-Vt2hSGI5.esm.js +0 -44
- package/dist/chunks/EXT_texture_avif-Vt2hSGI5.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-CWz2PiP_.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_webp-CWz2PiP_.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-i_LM5STR.esm.js +0 -43
- package/dist/chunks/EXT_texture_webp-i_LM5STR.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-BPRuILS3.esm.js +0 -64
- package/dist/chunks/ExtrasAsMetadata-BPRuILS3.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-BpKCYcU-.esm.min.js +0 -2
- package/dist/chunks/ExtrasAsMetadata-BpKCYcU-.esm.min.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-D25vJZ-D.esm.js +0 -352
- package/dist/chunks/KHR_animation_pointer-D25vJZ-D.esm.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-WM3ggesH.esm.min.js +0 -2
- package/dist/chunks/KHR_animation_pointer-WM3ggesH.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-6AbT2wN8.esm.min.js +0 -2
- package/dist/chunks/KHR_draco_mesh_compression-6AbT2wN8.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-Bn3cig1r.esm.js +0 -617
- package/dist/chunks/KHR_draco_mesh_compression-Bn3cig1r.esm.js.map +0 -1
- package/dist/chunks/KHR_interactivity-BN92hPs7.esm.js +0 -4033
- package/dist/chunks/KHR_interactivity-BN92hPs7.esm.js.map +0 -1
- package/dist/chunks/KHR_interactivity-B_CAm57j.esm.min.js +0 -2
- package/dist/chunks/KHR_interactivity-B_CAm57j.esm.min.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-BGKxFRu8.esm.js +0 -581
- package/dist/chunks/KHR_lights_punctual-BGKxFRu8.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-DCOXnpRP.esm.min.js +0 -2
- package/dist/chunks/KHR_lights_punctual-DCOXnpRP.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-Dav3eIQr.esm.js +0 -65
- package/dist/chunks/KHR_materials_anisotropy-Dav3eIQr.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-I_WlXBtU.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_anisotropy-I_WlXBtU.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-D_Vx4NDv.esm.js +0 -96
- package/dist/chunks/KHR_materials_clearcoat-D_Vx4NDv.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-DrU2oJzb.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_clearcoat-DrU2oJzb.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-C8j8KtbL.esm.js +0 -97
- package/dist/chunks/KHR_materials_diffuse_transmission-C8j8KtbL.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-YyXsJa9T.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_diffuse_transmission-YyXsJa9T.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-3Dk8ELun.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_dispersion-3Dk8ELun.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-8_vd0eka.esm.js +0 -62
- package/dist/chunks/KHR_materials_dispersion-8_vd0eka.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-6VqWp9kS.esm.js +0 -55
- package/dist/chunks/KHR_materials_emissive_strength-6VqWp9kS.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-Bpd-wcN6.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_emissive_strength-Bpd-wcN6.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-BGPYY59r.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_ior-BGPYY59r.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-Cs0X7UR6.esm.js +0 -64
- package/dist/chunks/KHR_materials_ior-Cs0X7UR6.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-BI7_Q9V2.esm.js +0 -72
- package/dist/chunks/KHR_materials_iridescence-BI7_Q9V2.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-CvIyjrbg.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_iridescence-CvIyjrbg.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BFUvgZ3P.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-BFUvgZ3P.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C3famAnb.esm.js +0 -81
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C3famAnb.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-B4V2NlWD.esm.js +0 -85
- package/dist/chunks/KHR_materials_sheen-B4V2NlWD.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-CegUHCDa.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_sheen-CegUHCDa.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-CC5wN1RR.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_specular-CC5wN1RR.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-TypCUJDx.esm.js +0 -75
- package/dist/chunks/KHR_materials_specular-TypCUJDx.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-BY9yIcAF.esm.js +0 -307
- package/dist/chunks/KHR_materials_transmission-BY9yIcAF.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-SU6SJMhP.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_transmission-SU6SJMhP.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-DOjLjYi4.esm.js +0 -74
- package/dist/chunks/KHR_materials_unlit-DOjLjYi4.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-DwCYujyL.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_unlit-DwCYujyL.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-BJUrgDp4.esm.js +0 -262
- package/dist/chunks/KHR_materials_variants-BJUrgDp4.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-BXHHmDq_.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_variants-BXHHmDq_.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-D8a4cCjx.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_volume-D8a4cCjx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-cyXWRVXR.esm.js +0 -87
- package/dist/chunks/KHR_materials_volume-cyXWRVXR.esm.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-BJCC5tJC.esm.min.js +0 -2
- package/dist/chunks/KHR_mesh_quantization-BJCC5tJC.esm.min.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-BhTbEUzk.esm.js +0 -26
- package/dist/chunks/KHR_mesh_quantization-BhTbEUzk.esm.js.map +0 -1
- package/dist/chunks/KHR_node_hoverability-C2Bud6ES.esm.min.js +0 -2
- package/dist/chunks/KHR_node_hoverability-C2Bud6ES.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_hoverability-DlRIeNZh.esm.js +0 -39
- package/dist/chunks/KHR_node_hoverability-DlRIeNZh.esm.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-CB2d0WsR.esm.js +0 -46
- package/dist/chunks/KHR_node_visibility-CB2d0WsR.esm.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-CFk6SMES.esm.min.js +0 -2
- package/dist/chunks/KHR_node_visibility-CFk6SMES.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-B68Sil5v.esm.js +0 -43
- package/dist/chunks/KHR_texture_basisu-B68Sil5v.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-C2OGAWY7.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_basisu-C2OGAWY7.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-Bk2KMc5C.esm.js +0 -63
- package/dist/chunks/KHR_texture_transform-Bk2KMc5C.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-D9MJQRee.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_transform-D9MJQRee.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-BkiGlm_U.esm.min.js +0 -2
- package/dist/chunks/KHR_xmp_json_ld-BkiGlm_U.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-a9-wGW9D.esm.js +0 -51
- package/dist/chunks/KHR_xmp_json_ld-a9-wGW9D.esm.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-B7aM8Qaz.esm.min.js +0 -2
- package/dist/chunks/MSFT_audio_emitter-B7aM8Qaz.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-D0Z8eJZb.esm.js +0 -2207
- package/dist/chunks/MSFT_audio_emitter-D0Z8eJZb.esm.js.map +0 -1
- package/dist/chunks/MSFT_lod-BjIiS7t9.esm.js +0 -337
- package/dist/chunks/MSFT_lod-BjIiS7t9.esm.js.map +0 -1
- package/dist/chunks/MSFT_lod-DIOF_rM4.esm.min.js +0 -2
- package/dist/chunks/MSFT_lod-DIOF_rM4.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-Bx5s-9FS.esm.js +0 -46
- package/dist/chunks/MSFT_minecraftMesh-Bx5s-9FS.esm.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-EqwVrdf4.esm.min.js +0 -2
- package/dist/chunks/MSFT_minecraftMesh-EqwVrdf4.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-BJH-moQl.esm.min.js +0 -2
- package/dist/chunks/MSFT_sRGBFactors-BJH-moQl.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-Db1zWU4o.esm.js +0 -47
- package/dist/chunks/MSFT_sRGBFactors-Db1zWU4o.esm.js.map +0 -1
- package/dist/chunks/animationGroup-DjpN6ul8.esm.js +0 -2482
- package/dist/chunks/animationGroup-DjpN6ul8.esm.js.map +0 -1
- package/dist/chunks/animationGroup-Duijaphk.esm.min.js +0 -2
- package/dist/chunks/animationGroup-Duijaphk.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-2ZDjmTJ7.esm.min.js +0 -2
- package/dist/chunks/assetContainer-2ZDjmTJ7.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-nATkXNwM.esm.js +0 -1720
- package/dist/chunks/assetContainer-nATkXNwM.esm.js.map +0 -1
- package/dist/chunks/audioEngine-C2kMlYrt.esm.js +0 -305
- package/dist/chunks/audioEngine-C2kMlYrt.esm.js.map +0 -1
- package/dist/chunks/audioEngine-iEjhOdSs.esm.min.js +0 -2
- package/dist/chunks/audioEngine-iEjhOdSs.esm.min.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-CX_LYhI-.esm.js +0 -114
- package/dist/chunks/bakedVertexAnimation-CX_LYhI-.esm.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-Duhv1yIp.esm.min.js +0 -2
- package/dist/chunks/bakedVertexAnimation-Duhv1yIp.esm.min.js.map +0 -1
- package/dist/chunks/basisTextureLoader-BJrbh335.esm.min.js +0 -2
- package/dist/chunks/basisTextureLoader-BJrbh335.esm.min.js.map +0 -1
- package/dist/chunks/basisTextureLoader-KDTm6Vl6.esm.js +0 -600
- package/dist/chunks/basisTextureLoader-KDTm6Vl6.esm.js.map +0 -1
- package/dist/chunks/dds-BiituSHb.esm.min.js +0 -2
- package/dist/chunks/dds-BiituSHb.esm.min.js.map +0 -1
- package/dist/chunks/dds-CeXwQQLK.esm.js +0 -540
- package/dist/chunks/dds-CeXwQQLK.esm.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-D38C-6i9.esm.min.js +0 -2
- package/dist/chunks/ddsTextureLoader-D38C-6i9.esm.min.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-DZgDhz39.esm.js +0 -88
- package/dist/chunks/ddsTextureLoader-DZgDhz39.esm.js.map +0 -1
- package/dist/chunks/decalFragment-B0hAgbHQ.esm.js +0 -18
- package/dist/chunks/decalFragment-B0hAgbHQ.esm.js.map +0 -1
- package/dist/chunks/decalFragment-BisNb1SA.esm.min.js +0 -2
- package/dist/chunks/decalFragment-BisNb1SA.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-BKDPVw0f.esm.min.js +0 -2
- package/dist/chunks/default.fragment-BKDPVw0f.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-CKRvFrOX.esm.min.js +0 -2
- package/dist/chunks/default.fragment-CKRvFrOX.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-DBNZgft_.esm.js +0 -515
- package/dist/chunks/default.fragment-DBNZgft_.esm.js.map +0 -1
- package/dist/chunks/default.fragment-mEUMwg3j.esm.js +0 -446
- package/dist/chunks/default.fragment-mEUMwg3j.esm.js.map +0 -1
- package/dist/chunks/default.vertex-BIMZfH9h.esm.min.js +0 -2
- package/dist/chunks/default.vertex-BIMZfH9h.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-BYGJcupS.esm.js +0 -181
- package/dist/chunks/default.vertex-BYGJcupS.esm.js.map +0 -1
- package/dist/chunks/default.vertex-D-mtahDc.esm.min.js +0 -2
- package/dist/chunks/default.vertex-D-mtahDc.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-uhPv4tjg.esm.js +0 -202
- package/dist/chunks/default.vertex-uhPv4tjg.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-CRSLp0Ab.esm.js +0 -13
- package/dist/chunks/defaultUboDeclaration-CRSLp0Ab.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-CWb_GB6I.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-CWb_GB6I.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-Coy2X5Tb.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-Coy2X5Tb.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-vQgTvkEe.esm.js +0 -15
- package/dist/chunks/defaultUboDeclaration-vQgTvkEe.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-DO-b-FSI.esm.js +0 -200
- package/dist/chunks/dumpTools-DO-b-FSI.esm.js.map +0 -1
- package/dist/chunks/dumpTools-a-Jxv0UI.esm.min.js +0 -2
- package/dist/chunks/dumpTools-a-Jxv0UI.esm.min.js.map +0 -1
- package/dist/chunks/engine-BcUVpC0R.esm.js +0 -2216
- package/dist/chunks/engine-BcUVpC0R.esm.js.map +0 -1
- package/dist/chunks/engine-CBJrzwFS.esm.min.js +0 -2
- package/dist/chunks/engine-CBJrzwFS.esm.min.js.map +0 -1
- package/dist/chunks/engine.common-CSbFYR6g.esm.min.js +0 -2
- package/dist/chunks/engine.common-CSbFYR6g.esm.min.js.map +0 -1
- package/dist/chunks/engine.common-MyFhbP5R.esm.js +0 -1162
- package/dist/chunks/engine.common-MyFhbP5R.esm.js.map +0 -1
- package/dist/chunks/envTextureLoader-DFF091wY.esm.min.js +0 -2
- package/dist/chunks/envTextureLoader-DFF091wY.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-Mp-YE5HT.esm.js +0 -64
- package/dist/chunks/envTextureLoader-Mp-YE5HT.esm.js.map +0 -1
- package/dist/chunks/environmentTextureTools-B2Hu-wcq.esm.min.js +0 -2
- package/dist/chunks/environmentTextureTools-B2Hu-wcq.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-Dd-a4rbC.esm.js +0 -382
- package/dist/chunks/environmentTextureTools-Dd-a4rbC.esm.js.map +0 -1
- package/dist/chunks/exrTextureLoader-DqVtC6Vz.esm.min.js +0 -2
- package/dist/chunks/exrTextureLoader-DqVtC6Vz.esm.min.js.map +0 -1
- package/dist/chunks/exrTextureLoader-yzAS6vzg.esm.js +0 -1683
- package/dist/chunks/exrTextureLoader-yzAS6vzg.esm.js.map +0 -1
- package/dist/chunks/fogFragment-B6w-VW0A.esm.js +0 -102
- package/dist/chunks/fogFragment-B6w-VW0A.esm.js.map +0 -1
- package/dist/chunks/fogFragment-BdwYc4_S.esm.js +0 -101
- package/dist/chunks/fogFragment-BdwYc4_S.esm.js.map +0 -1
- package/dist/chunks/fogFragment-CKVFmHTL.esm.min.js +0 -2
- package/dist/chunks/fogFragment-CKVFmHTL.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-CrTUuKN1.esm.min.js +0 -2
- package/dist/chunks/fogFragment-CrTUuKN1.esm.min.js.map +0 -1
- package/dist/chunks/fresnelFunction-BeTviBu9.esm.js +0 -12
- package/dist/chunks/fresnelFunction-BeTviBu9.esm.js.map +0 -1
- package/dist/chunks/fresnelFunction-BsRBgxHr.esm.min.js +0 -2
- package/dist/chunks/fresnelFunction-BsRBgxHr.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoader-BNxQLfRc.esm.min.js +0 -2
- package/dist/chunks/glTFLoader-BNxQLfRc.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoader-C3ib4SHM.esm.js +0 -7586
- package/dist/chunks/glTFLoader-C3ib4SHM.esm.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-BNIOeHW6.esm.min.js +0 -2
- package/dist/chunks/glTFLoaderAnimation-BNIOeHW6.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-CIZW3HpB.esm.js +0 -77
- package/dist/chunks/glTFLoaderAnimation-CIZW3HpB.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-BEk7hjTV.esm.js +0 -35
- package/dist/chunks/harmonicsFunctions-BEk7hjTV.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-DNd3DvtK.esm.js +0 -34
- package/dist/chunks/harmonicsFunctions-DNd3DvtK.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-Dcle49vi.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-Dcle49vi.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-yt7loS1y.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-yt7loS1y.esm.min.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-CVa1eQ0k.esm.min.js +0 -2
- package/dist/chunks/hdrTextureLoader-CVa1eQ0k.esm.min.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-vBST57Sm.esm.js +0 -253
- package/dist/chunks/hdrTextureLoader-vBST57Sm.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-CZ3iJ2Zw.esm.js +0 -108
- package/dist/chunks/helperFunctions-CZ3iJ2Zw.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-D0BgwVW1.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-D0BgwVW1.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-DjXuKfJE.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-DjXuKfJE.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-utyx3wAA.esm.js +0 -80
- package/dist/chunks/helperFunctions-utyx3wAA.esm.js.map +0 -1
- package/dist/chunks/iesTextureLoader-CROHHiJh.esm.js +0 -189
- package/dist/chunks/iesTextureLoader-CROHHiJh.esm.js.map +0 -1
- package/dist/chunks/iesTextureLoader-WrbecGoP.esm.min.js +0 -2
- package/dist/chunks/iesTextureLoader-WrbecGoP.esm.min.js.map +0 -1
- package/dist/chunks/index-DnSap2FI.esm.js +0 -74799
- package/dist/chunks/index-DnSap2FI.esm.js.map +0 -1
- package/dist/chunks/index-j2tloO6T.esm.min.js +0 -57
- package/dist/chunks/index-j2tloO6T.esm.min.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-BiAsvhuB.esm.js +0 -814
- package/dist/chunks/ktxTextureLoader-BiAsvhuB.esm.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-DdTyaRVu.esm.min.js +0 -2
- package/dist/chunks/ktxTextureLoader-DdTyaRVu.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-B3OVyLof.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-B3OVyLof.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-B7WZlAEH.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-B7WZlAEH.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-C4zeVBON.esm.js +0 -11
- package/dist/chunks/logDepthDeclaration-C4zeVBON.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-CWmx6aVd.esm.js +0 -35
- package/dist/chunks/logDepthDeclaration-CWmx6aVd.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-7PIzO8Uh.esm.js +0 -81
- package/dist/chunks/logDepthVertex-7PIzO8Uh.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-CplbMCm2.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-CplbMCm2.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-bHa3hoU5.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-bHa3hoU5.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-vHSzwfZ-.esm.js +0 -77
- package/dist/chunks/logDepthVertex-vHSzwfZ-.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CNqYA-gB.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-CNqYA-gB.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CeQvcMfP.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-CeQvcMfP.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CvsL0qYU.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-CvsL0qYU.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-utHd2T0O.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-utHd2T0O.esm.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-BJPUJrXy.esm.min.js +0 -2
- package/dist/chunks/meshUboDeclaration-BJPUJrXy.esm.min.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-VYoDYbYC.esm.js +0 -26
- package/dist/chunks/meshUboDeclaration-VYoDYbYC.esm.js.map +0 -1
- package/dist/chunks/objFileLoader-8afS-_hY.esm.js +0 -1338
- package/dist/chunks/objFileLoader-8afS-_hY.esm.js.map +0 -1
- package/dist/chunks/objFileLoader-BzLe6gaH.esm.min.js +0 -2
- package/dist/chunks/objFileLoader-BzLe6gaH.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-CHqqW65b.esm.js +0 -1240
- package/dist/chunks/oitFragment-CHqqW65b.esm.js.map +0 -1
- package/dist/chunks/oitFragment-CeyJ_Jg6.esm.min.js +0 -2
- package/dist/chunks/oitFragment-CeyJ_Jg6.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-D_sf5Zw1.esm.min.js +0 -2
- package/dist/chunks/oitFragment-D_sf5Zw1.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-alnyZbc9.esm.js +0 -1078
- package/dist/chunks/oitFragment-alnyZbc9.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-CwG7GshA.esm.js +0 -15
- package/dist/chunks/pass.fragment-CwG7GshA.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-DfyFrxFg.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-DfyFrxFg.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment-DvFaAVdg.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-DvFaAVdg.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment-ZOmfFzXO.esm.js +0 -15
- package/dist/chunks/pass.fragment-ZOmfFzXO.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-C3zMQTsB.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-C3zMQTsB.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-CwRrGfA1.esm.js +0 -3232
- package/dist/chunks/pbr.fragment-CwRrGfA1.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-nFI8xyI0.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-nFI8xyI0.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-q5uFa6s9.esm.js +0 -3273
- package/dist/chunks/pbr.fragment-q5uFa6s9.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-CTHhPDZF.esm.js +0 -214
- package/dist/chunks/pbr.vertex-CTHhPDZF.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-CzNCwEDt.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-CzNCwEDt.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-CzdtHEkI.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-CzdtHEkI.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-xNnroO_M.esm.js +0 -339
- package/dist/chunks/pbr.vertex-xNnroO_M.esm.js.map +0 -1
- package/dist/chunks/postprocess.vertex-BYAf7HA1.esm.min.js +0 -2
- package/dist/chunks/postprocess.vertex-BYAf7HA1.esm.min.js.map +0 -1
- package/dist/chunks/postprocess.vertex-CbyPpEkq.esm.js +0 -20
- package/dist/chunks/postprocess.vertex-CbyPpEkq.esm.js.map +0 -1
- package/dist/chunks/rawTexture-CBbxz3pc.esm.js +0 -191
- package/dist/chunks/rawTexture-CBbxz3pc.esm.js.map +0 -1
- package/dist/chunks/rawTexture-DPGXBgNz.esm.min.js +0 -2
- package/dist/chunks/rawTexture-DPGXBgNz.esm.min.js.map +0 -1
- package/dist/chunks/ray-C_Cg5Enj.esm.js +0 -946
- package/dist/chunks/ray-C_Cg5Enj.esm.js.map +0 -1
- package/dist/chunks/ray-VbeIB6un.esm.min.js +0 -2
- package/dist/chunks/ray-VbeIB6un.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-C8j9F7Bp.esm.js +0 -13
- package/dist/chunks/rgbdDecode.fragment-C8j9F7Bp.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-CcXKr577.esm.js +0 -13
- package/dist/chunks/rgbdDecode.fragment-CcXKr577.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-Cwx1U7TE.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-Cwx1U7TE.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-DAz-9d4q.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-DAz-9d4q.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-B-B_-l4T.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-B-B_-l4T.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-C-IhOuE7.esm.js +0 -13
- package/dist/chunks/rgbdEncode.fragment-C-IhOuE7.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-D2kStupC.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-D2kStupC.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-DqeaHLSx.esm.js +0 -13
- package/dist/chunks/rgbdEncode.fragment-DqeaHLSx.esm.js.map +0 -1
- package/dist/chunks/splatFileLoader-CM4z7s6S.esm.min.js +0 -2
- package/dist/chunks/splatFileLoader-CM4z7s6S.esm.min.js.map +0 -1
- package/dist/chunks/splatFileLoader-DE83jdwc.esm.js +0 -3379
- package/dist/chunks/splatFileLoader-DE83jdwc.esm.js.map +0 -1
- package/dist/chunks/spotLight-98FksSI3.esm.min.js +0 -2
- package/dist/chunks/spotLight-98FksSI3.esm.min.js.map +0 -1
- package/dist/chunks/spotLight-DuWkoiV8.esm.js +0 -701
- package/dist/chunks/spotLight-DuWkoiV8.esm.js.map +0 -1
- package/dist/chunks/standardMaterial-Bp1mTX1d.esm.js +0 -1805
- package/dist/chunks/standardMaterial-Bp1mTX1d.esm.js.map +0 -1
- package/dist/chunks/standardMaterial-D8kKjcZn.esm.min.js +0 -2
- package/dist/chunks/standardMaterial-D8kKjcZn.esm.min.js.map +0 -1
- package/dist/chunks/stlFileLoader-BFPumqQB.esm.js +0 -238
- package/dist/chunks/stlFileLoader-BFPumqQB.esm.js.map +0 -1
- package/dist/chunks/stlFileLoader-BosbmaNZ.esm.min.js +0 -2
- package/dist/chunks/stlFileLoader-BosbmaNZ.esm.min.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-CKRrtbo-.esm.min.js +0 -2
- package/dist/chunks/tgaTextureLoader-CKRrtbo-.esm.min.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-PEVGE0SY.esm.js +0 -349
- package/dist/chunks/tgaTextureLoader-PEVGE0SY.esm.js.map +0 -1
- package/dist/chunks/thinEngine-kKYV_9vd.esm.js +0 -3848
- package/dist/chunks/thinEngine-kKYV_9vd.esm.js.map +0 -1
- package/dist/chunks/thinEngine-x_AyHrxY.esm.min.js +0 -2
- package/dist/chunks/thinEngine-x_AyHrxY.esm.min.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-BlVs6kyh.esm.js +0 -314
- package/dist/chunks/thinInstanceMesh-BlVs6kyh.esm.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-CNDaksPN.esm.min.js +0 -2
- package/dist/chunks/thinInstanceMesh-CNDaksPN.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-2eNeJSgA.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-2eNeJSgA.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-BjOdZrk-.esm.js +0 -412
- package/dist/chunks/vertexColorMixing-BjOdZrk-.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-BpqdwwOR.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-BpqdwwOR.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-CuP50ad9.esm.js +0 -522
- package/dist/chunks/vertexColorMixing-CuP50ad9.esm.js.map +0 -1
- package/dist/chunks/webgpuEngine-BW5Z2CFp.esm.min.js +0 -2
- package/dist/chunks/webgpuEngine-BW5Z2CFp.esm.min.js.map +0 -1
- package/dist/chunks/webgpuEngine-Cwdi0UKo.esm.js +0 -11533
- package/dist/chunks/webgpuEngine-Cwdi0UKo.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
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
|
2
|
+
import { CubeTexture } from "@babylonjs/core/Materials/Textures/cubeTexture.js";
|
|
3
|
+
import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
|
4
|
+
/**
|
|
5
|
+
* WebGL Pixel Formats
|
|
6
|
+
*/
|
|
7
|
+
export declare const enum PixelFormat {
|
|
8
|
+
DEPTH_COMPONENT = 6402,
|
|
9
|
+
ALPHA = 6406,
|
|
10
|
+
RGB = 6407,
|
|
11
|
+
RGBA = 6408,
|
|
12
|
+
LUMINANCE = 6409,
|
|
13
|
+
LUMINANCE_ALPHA = 6410
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* WebGL Pixel Types
|
|
17
|
+
*/
|
|
18
|
+
export declare const enum PixelType {
|
|
19
|
+
UNSIGNED_BYTE = 5121,
|
|
20
|
+
UNSIGNED_SHORT_4_4_4_4 = 32819,
|
|
21
|
+
UNSIGNED_SHORT_5_5_5_1 = 32820,
|
|
22
|
+
UNSIGNED_SHORT_5_6_5 = 33635
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* WebGL Texture Magnification Filter
|
|
26
|
+
*/
|
|
27
|
+
export declare const enum TextureMagFilter {
|
|
28
|
+
NEAREST = 9728,
|
|
29
|
+
LINEAR = 9729
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* WebGL Texture Minification Filter
|
|
33
|
+
*/
|
|
34
|
+
export declare const enum TextureMinFilter {
|
|
35
|
+
NEAREST = 9728,
|
|
36
|
+
LINEAR = 9729,
|
|
37
|
+
NEAREST_MIPMAP_NEAREST = 9984,
|
|
38
|
+
LINEAR_MIPMAP_NEAREST = 9985,
|
|
39
|
+
NEAREST_MIPMAP_LINEAR = 9986,
|
|
40
|
+
LINEAR_MIPMAP_LINEAR = 9987
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* WebGL Texture Wrap Modes
|
|
44
|
+
*/
|
|
45
|
+
export declare const enum TextureWrapMode {
|
|
46
|
+
REPEAT = 10497,
|
|
47
|
+
CLAMP_TO_EDGE = 33071,
|
|
48
|
+
MIRRORED_REPEAT = 33648
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Raw texture data and descriptor sufficient for WebGL texture upload
|
|
52
|
+
*/
|
|
53
|
+
export interface TextureData {
|
|
54
|
+
/**
|
|
55
|
+
* Width of image
|
|
56
|
+
*/
|
|
57
|
+
width: number;
|
|
58
|
+
/**
|
|
59
|
+
* Height of image
|
|
60
|
+
*/
|
|
61
|
+
height: number;
|
|
62
|
+
/**
|
|
63
|
+
* Format of pixels in data
|
|
64
|
+
*/
|
|
65
|
+
format: PixelFormat;
|
|
66
|
+
/**
|
|
67
|
+
* Row byte alignment of pixels in data
|
|
68
|
+
*/
|
|
69
|
+
alignment: number;
|
|
70
|
+
/**
|
|
71
|
+
* Pixel data
|
|
72
|
+
*/
|
|
73
|
+
data: ArrayBufferView;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Wraps sampling parameters for a WebGL texture
|
|
77
|
+
*/
|
|
78
|
+
export interface SamplingParameters {
|
|
79
|
+
/**
|
|
80
|
+
* Magnification mode when upsampling from a WebGL texture
|
|
81
|
+
*/
|
|
82
|
+
magFilter?: TextureMagFilter;
|
|
83
|
+
/**
|
|
84
|
+
* Minification mode when upsampling from a WebGL texture
|
|
85
|
+
*/
|
|
86
|
+
minFilter?: TextureMinFilter;
|
|
87
|
+
/**
|
|
88
|
+
* X axis wrapping mode when sampling out of a WebGL texture bounds
|
|
89
|
+
*/
|
|
90
|
+
wrapS?: TextureWrapMode;
|
|
91
|
+
/**
|
|
92
|
+
* Y axis wrapping mode when sampling out of a WebGL texture bounds
|
|
93
|
+
*/
|
|
94
|
+
wrapT?: TextureWrapMode;
|
|
95
|
+
/**
|
|
96
|
+
* Anisotropic filtering samples
|
|
97
|
+
*/
|
|
98
|
+
maxAnisotropy?: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Represents a valid WebGL texture source for use in texImage2D
|
|
102
|
+
*/
|
|
103
|
+
export type TextureSource = TextureData | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
|
|
104
|
+
/**
|
|
105
|
+
* A generic set of texture mipmaps (where index 0 has the largest dimension)
|
|
106
|
+
*/
|
|
107
|
+
export type Mipmaps<T> = Array<T>;
|
|
108
|
+
/**
|
|
109
|
+
* A set of 6 cubemap arranged in the order [+x, -x, +y, -y, +z, -z]
|
|
110
|
+
*/
|
|
111
|
+
export type Faces<T> = Array<T>;
|
|
112
|
+
/**
|
|
113
|
+
* A set of texture mipmaps specifically for 2D textures in WebGL (where index 0 has the largest dimension)
|
|
114
|
+
*/
|
|
115
|
+
export type Mipmaps2D = Mipmaps<TextureSource>;
|
|
116
|
+
/**
|
|
117
|
+
* A set of texture mipmaps specifically for cubemap textures in WebGL (where index 0 has the largest dimension)
|
|
118
|
+
*/
|
|
119
|
+
export type MipmapsCube = Mipmaps<Faces<TextureSource>>;
|
|
120
|
+
/**
|
|
121
|
+
* A minimal WebGL cubemap descriptor
|
|
122
|
+
*/
|
|
123
|
+
export declare class TextureCube {
|
|
124
|
+
internalFormat: PixelFormat;
|
|
125
|
+
type: PixelType;
|
|
126
|
+
source: MipmapsCube;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the width of a face of the texture or 0 if not available
|
|
129
|
+
*/
|
|
130
|
+
get Width(): number;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the height of a face of the texture or 0 if not available
|
|
133
|
+
*/
|
|
134
|
+
get Height(): number;
|
|
135
|
+
/**
|
|
136
|
+
* constructor
|
|
137
|
+
* @param internalFormat WebGL pixel format for the texture on the GPU
|
|
138
|
+
* @param type WebGL pixel type of the supplied data and texture on the GPU
|
|
139
|
+
* @param source An array containing mipmap levels of faces, where each mipmap level is an array of faces and each face is a TextureSource object
|
|
140
|
+
*/
|
|
141
|
+
constructor(internalFormat: PixelFormat, type: PixelType, source?: MipmapsCube);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* A static class providing methods to aid working with Bablyon textures.
|
|
145
|
+
*/
|
|
146
|
+
export declare class TextureUtils {
|
|
147
|
+
/**
|
|
148
|
+
* A prefix used when storing a babylon texture object reference on a Spectre texture object
|
|
149
|
+
*/
|
|
150
|
+
static BabylonTextureKeyPrefix: string;
|
|
151
|
+
/**
|
|
152
|
+
* Controls anisotropic filtering for deserialized textures.
|
|
153
|
+
*/
|
|
154
|
+
static MaxAnisotropy: number;
|
|
155
|
+
/**
|
|
156
|
+
* Returns a BabylonCubeTexture instance from a Spectre texture cube, subject to sampling parameters.
|
|
157
|
+
* If such a texture has already been requested in the past, this texture will be returned, otherwise a new one will be created.
|
|
158
|
+
* The advantage of this is to enable working with texture objects without the need to initialize on the GPU until desired.
|
|
159
|
+
* @param scene A Babylon Scene instance
|
|
160
|
+
* @param textureCube A Spectre TextureCube object
|
|
161
|
+
* @param automaticMipmaps Pass true to enable automatic mipmap generation where possible (requires power of images)
|
|
162
|
+
* @param environment Specifies that the texture will be used as an environment
|
|
163
|
+
* @param singleLod Specifies that the texture will be a singleLod (for environment)
|
|
164
|
+
* @returns Babylon cube texture
|
|
165
|
+
*/
|
|
166
|
+
static GetBabylonCubeTexture(scene: Scene, textureCube: TextureCube, automaticMipmaps: boolean, environment?: boolean, singleLod?: boolean): CubeTexture;
|
|
167
|
+
/**
|
|
168
|
+
* Applies Spectre SamplingParameters to a Babylon texture by directly setting texture parameters on the internal WebGLTexture as well as setting Babylon fields
|
|
169
|
+
* @param babylonTexture Babylon texture to apply texture to (requires the Babylon texture has an initialize _texture field)
|
|
170
|
+
* @param parameters Spectre SamplingParameters to apply
|
|
171
|
+
*/
|
|
172
|
+
static ApplySamplingParameters(babylonTexture: BaseTexture, parameters: SamplingParameters): void;
|
|
173
|
+
private static _EnvironmentSampling;
|
|
174
|
+
private static _EnvironmentSingleMipSampling;
|
|
175
|
+
/**
|
|
176
|
+
* Environment preprocessing dedicated value (Internal Use or Advanced only).
|
|
177
|
+
*/
|
|
178
|
+
static EnvironmentLODScale: number;
|
|
179
|
+
/**
|
|
180
|
+
* Environment preprocessing dedicated value (Internal Use or Advanced only)..
|
|
181
|
+
*/
|
|
182
|
+
static EnvironmentLODOffset: number;
|
|
183
|
+
}
|
package/labs/texture.js
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { CubeTexture } from "@babylonjs/core/Materials/Textures/cubeTexture.js";
|
|
2
|
+
import { InternalTexture } from "@babylonjs/core/Materials/Textures/internalTexture.js";
|
|
3
|
+
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
4
|
+
/**
|
|
5
|
+
* WebGL Pixel Formats
|
|
6
|
+
*/
|
|
7
|
+
export var PixelFormat;
|
|
8
|
+
(function (PixelFormat) {
|
|
9
|
+
PixelFormat[PixelFormat["DEPTH_COMPONENT"] = 6402] = "DEPTH_COMPONENT";
|
|
10
|
+
PixelFormat[PixelFormat["ALPHA"] = 6406] = "ALPHA";
|
|
11
|
+
PixelFormat[PixelFormat["RGB"] = 6407] = "RGB";
|
|
12
|
+
PixelFormat[PixelFormat["RGBA"] = 6408] = "RGBA";
|
|
13
|
+
PixelFormat[PixelFormat["LUMINANCE"] = 6409] = "LUMINANCE";
|
|
14
|
+
PixelFormat[PixelFormat["LUMINANCE_ALPHA"] = 6410] = "LUMINANCE_ALPHA";
|
|
15
|
+
})(PixelFormat || (PixelFormat = {}));
|
|
16
|
+
/**
|
|
17
|
+
* WebGL Pixel Types
|
|
18
|
+
*/
|
|
19
|
+
export var PixelType;
|
|
20
|
+
(function (PixelType) {
|
|
21
|
+
PixelType[PixelType["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE";
|
|
22
|
+
PixelType[PixelType["UNSIGNED_SHORT_4_4_4_4"] = 32819] = "UNSIGNED_SHORT_4_4_4_4";
|
|
23
|
+
PixelType[PixelType["UNSIGNED_SHORT_5_5_5_1"] = 32820] = "UNSIGNED_SHORT_5_5_5_1";
|
|
24
|
+
PixelType[PixelType["UNSIGNED_SHORT_5_6_5"] = 33635] = "UNSIGNED_SHORT_5_6_5";
|
|
25
|
+
})(PixelType || (PixelType = {}));
|
|
26
|
+
/**
|
|
27
|
+
* WebGL Texture Magnification Filter
|
|
28
|
+
*/
|
|
29
|
+
export var TextureMagFilter;
|
|
30
|
+
(function (TextureMagFilter) {
|
|
31
|
+
TextureMagFilter[TextureMagFilter["NEAREST"] = 9728] = "NEAREST";
|
|
32
|
+
TextureMagFilter[TextureMagFilter["LINEAR"] = 9729] = "LINEAR";
|
|
33
|
+
})(TextureMagFilter || (TextureMagFilter = {}));
|
|
34
|
+
/**
|
|
35
|
+
* WebGL Texture Minification Filter
|
|
36
|
+
*/
|
|
37
|
+
export var TextureMinFilter;
|
|
38
|
+
(function (TextureMinFilter) {
|
|
39
|
+
TextureMinFilter[TextureMinFilter["NEAREST"] = 9728] = "NEAREST";
|
|
40
|
+
TextureMinFilter[TextureMinFilter["LINEAR"] = 9729] = "LINEAR";
|
|
41
|
+
TextureMinFilter[TextureMinFilter["NEAREST_MIPMAP_NEAREST"] = 9984] = "NEAREST_MIPMAP_NEAREST";
|
|
42
|
+
TextureMinFilter[TextureMinFilter["LINEAR_MIPMAP_NEAREST"] = 9985] = "LINEAR_MIPMAP_NEAREST";
|
|
43
|
+
TextureMinFilter[TextureMinFilter["NEAREST_MIPMAP_LINEAR"] = 9986] = "NEAREST_MIPMAP_LINEAR";
|
|
44
|
+
TextureMinFilter[TextureMinFilter["LINEAR_MIPMAP_LINEAR"] = 9987] = "LINEAR_MIPMAP_LINEAR";
|
|
45
|
+
})(TextureMinFilter || (TextureMinFilter = {}));
|
|
46
|
+
/**
|
|
47
|
+
* WebGL Texture Wrap Modes
|
|
48
|
+
*/
|
|
49
|
+
export var TextureWrapMode;
|
|
50
|
+
(function (TextureWrapMode) {
|
|
51
|
+
TextureWrapMode[TextureWrapMode["REPEAT"] = 10497] = "REPEAT";
|
|
52
|
+
TextureWrapMode[TextureWrapMode["CLAMP_TO_EDGE"] = 33071] = "CLAMP_TO_EDGE";
|
|
53
|
+
TextureWrapMode[TextureWrapMode["MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT";
|
|
54
|
+
})(TextureWrapMode || (TextureWrapMode = {}));
|
|
55
|
+
/**
|
|
56
|
+
* A minimal WebGL cubemap descriptor
|
|
57
|
+
*/
|
|
58
|
+
var TextureCube = /** @class */ (function () {
|
|
59
|
+
/**
|
|
60
|
+
* constructor
|
|
61
|
+
* @param internalFormat WebGL pixel format for the texture on the GPU
|
|
62
|
+
* @param type WebGL pixel type of the supplied data and texture on the GPU
|
|
63
|
+
* @param source An array containing mipmap levels of faces, where each mipmap level is an array of faces and each face is a TextureSource object
|
|
64
|
+
*/
|
|
65
|
+
function TextureCube(internalFormat, type, source) {
|
|
66
|
+
if (source === void 0) { source = []; }
|
|
67
|
+
this.internalFormat = internalFormat;
|
|
68
|
+
this.type = type;
|
|
69
|
+
this.source = source;
|
|
70
|
+
}
|
|
71
|
+
Object.defineProperty(TextureCube.prototype, "Width", {
|
|
72
|
+
/**
|
|
73
|
+
* Returns the width of a face of the texture or 0 if not available
|
|
74
|
+
*/
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
76
|
+
get: function () {
|
|
77
|
+
return this.source && this.source[0] && this.source[0][0] ? this.source[0][0].width : 0;
|
|
78
|
+
},
|
|
79
|
+
enumerable: false,
|
|
80
|
+
configurable: true
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(TextureCube.prototype, "Height", {
|
|
83
|
+
/**
|
|
84
|
+
* Returns the height of a face of the texture or 0 if not available
|
|
85
|
+
*/
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
87
|
+
get: function () {
|
|
88
|
+
return this.source && this.source[0] && this.source[0][0] ? this.source[0][0].height : 0;
|
|
89
|
+
},
|
|
90
|
+
enumerable: false,
|
|
91
|
+
configurable: true
|
|
92
|
+
});
|
|
93
|
+
return TextureCube;
|
|
94
|
+
}());
|
|
95
|
+
export { TextureCube };
|
|
96
|
+
/**
|
|
97
|
+
* A static class providing methods to aid working with Bablyon textures.
|
|
98
|
+
*/
|
|
99
|
+
var TextureUtils = /** @class */ (function () {
|
|
100
|
+
function TextureUtils() {
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns a BabylonCubeTexture instance from a Spectre texture cube, subject to sampling parameters.
|
|
104
|
+
* If such a texture has already been requested in the past, this texture will be returned, otherwise a new one will be created.
|
|
105
|
+
* The advantage of this is to enable working with texture objects without the need to initialize on the GPU until desired.
|
|
106
|
+
* @param scene A Babylon Scene instance
|
|
107
|
+
* @param textureCube A Spectre TextureCube object
|
|
108
|
+
* @param automaticMipmaps Pass true to enable automatic mipmap generation where possible (requires power of images)
|
|
109
|
+
* @param environment Specifies that the texture will be used as an environment
|
|
110
|
+
* @param singleLod Specifies that the texture will be a singleLod (for environment)
|
|
111
|
+
* @returns Babylon cube texture
|
|
112
|
+
*/
|
|
113
|
+
TextureUtils.GetBabylonCubeTexture = function (scene, textureCube, automaticMipmaps, environment, singleLod) {
|
|
114
|
+
var _a;
|
|
115
|
+
if (environment === void 0) { environment = false; }
|
|
116
|
+
if (singleLod === void 0) { singleLod = false; }
|
|
117
|
+
if (!textureCube) {
|
|
118
|
+
throw new Error("no texture cube provided");
|
|
119
|
+
}
|
|
120
|
+
var parameters;
|
|
121
|
+
if (environment) {
|
|
122
|
+
parameters = singleLod ? TextureUtils._EnvironmentSingleMipSampling : TextureUtils._EnvironmentSampling;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
parameters = {
|
|
126
|
+
magFilter: 9728 /* TextureMagFilter.NEAREST */,
|
|
127
|
+
minFilter: 9728 /* TextureMinFilter.NEAREST */,
|
|
128
|
+
wrapS: 33071 /* TextureWrapMode.CLAMP_TO_EDGE */,
|
|
129
|
+
wrapT: 33071 /* TextureWrapMode.CLAMP_TO_EDGE */,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
var key = TextureUtils.BabylonTextureKeyPrefix + parameters.magFilter + "" + parameters.minFilter + "" + parameters.wrapS + "" + parameters.wrapT;
|
|
133
|
+
var babylonTexture = textureCube[key];
|
|
134
|
+
if (!babylonTexture) {
|
|
135
|
+
//initialize babylon texture
|
|
136
|
+
babylonTexture = new CubeTexture("", scene);
|
|
137
|
+
if (environment) {
|
|
138
|
+
babylonTexture.lodGenerationOffset = TextureUtils.EnvironmentLODOffset;
|
|
139
|
+
babylonTexture.lodGenerationScale = TextureUtils.EnvironmentLODScale;
|
|
140
|
+
}
|
|
141
|
+
babylonTexture.gammaSpace = false;
|
|
142
|
+
var internalTexture_1 = new InternalTexture(scene.getEngine(), 8 /* InternalTextureSource.CubeRaw */);
|
|
143
|
+
var glTexture_1 = (_a = internalTexture_1._hardwareTexture) === null || _a === void 0 ? void 0 : _a.underlyingResource;
|
|
144
|
+
//babylon properties
|
|
145
|
+
internalTexture_1.isCube = true;
|
|
146
|
+
internalTexture_1.generateMipMaps = false;
|
|
147
|
+
babylonTexture._texture = internalTexture_1;
|
|
148
|
+
TextureUtils.ApplySamplingParameters(babylonTexture, parameters);
|
|
149
|
+
var maxMipLevel_1 = automaticMipmaps ? 0 : textureCube.source.length - 1;
|
|
150
|
+
var texturesUploaded_1 = 0;
|
|
151
|
+
var textureComplete_1 = function () {
|
|
152
|
+
return texturesUploaded_1 === (maxMipLevel_1 + 1) * 6;
|
|
153
|
+
};
|
|
154
|
+
var uploadFace_1 = function (i, level, face) {
|
|
155
|
+
if (!glTexture_1) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (i === 0 && level === 0) {
|
|
159
|
+
internalTexture_1.width = face.width;
|
|
160
|
+
internalTexture_1.height = face.height;
|
|
161
|
+
}
|
|
162
|
+
var gl = scene.getEngine()._gl;
|
|
163
|
+
gl.bindTexture(gl.TEXTURE_CUBE_MAP, glTexture_1);
|
|
164
|
+
scene.getEngine()._unpackFlipY(false);
|
|
165
|
+
if (face instanceof HTMLElement || face instanceof ImageData) {
|
|
166
|
+
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level, textureCube.internalFormat, textureCube.internalFormat, textureCube.type, face);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
var textureData = face;
|
|
170
|
+
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level, textureCube.internalFormat, textureData.width, textureData.height, 0, textureData.format, textureCube.type, textureData.data);
|
|
171
|
+
}
|
|
172
|
+
texturesUploaded_1++;
|
|
173
|
+
if (textureComplete_1()) {
|
|
174
|
+
//generate mipmaps
|
|
175
|
+
if (automaticMipmaps) {
|
|
176
|
+
var w = face.width;
|
|
177
|
+
var h = face.height;
|
|
178
|
+
var isPot = (w !== 0 && w & (w - 1)) === 0 && (h !== 0 && h & (h - 1)) === 0;
|
|
179
|
+
if (isPot) {
|
|
180
|
+
gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Upload Separate lods in case there is no support for texture lod.
|
|
184
|
+
if (environment && !scene.getEngine().getCaps().textureLOD && !singleLod) {
|
|
185
|
+
var mipSlices = 3;
|
|
186
|
+
for (var i_1 = 0; i_1 < mipSlices; i_1++) {
|
|
187
|
+
var lodKey = TextureUtils.BabylonTextureKeyPrefix + "lod" + i_1;
|
|
188
|
+
var lod = textureCube[lodKey];
|
|
189
|
+
//initialize lod texture if it doesn't already exist
|
|
190
|
+
if (lod == null && textureCube.Width) {
|
|
191
|
+
//compute LOD from even spacing in smoothness (matching shader calculation)
|
|
192
|
+
var smoothness = i_1 / (mipSlices - 1);
|
|
193
|
+
var roughness = 1 - smoothness;
|
|
194
|
+
var kMinimumVariance = 0.0005;
|
|
195
|
+
var alphaG = roughness * roughness + kMinimumVariance;
|
|
196
|
+
var microsurfaceAverageSlopeTexels = alphaG * textureCube.Width;
|
|
197
|
+
var environmentSpecularLOD = TextureUtils.EnvironmentLODScale * Math.log2(microsurfaceAverageSlopeTexels) + TextureUtils.EnvironmentLODOffset;
|
|
198
|
+
var maxLODIndex = textureCube.source.length - 1;
|
|
199
|
+
var mipmapIndex = Math.min(Math.max(Math.round(environmentSpecularLOD), 0), maxLODIndex);
|
|
200
|
+
lod = TextureUtils.GetBabylonCubeTexture(scene, new TextureCube(6408 /* PixelFormat.RGBA */, 5121 /* PixelType.UNSIGNED_BYTE */, [textureCube.source[mipmapIndex]]), false, true, true);
|
|
201
|
+
if (i_1 === 0) {
|
|
202
|
+
internalTexture_1._lodTextureLow = lod;
|
|
203
|
+
}
|
|
204
|
+
else if (i_1 === 1) {
|
|
205
|
+
internalTexture_1._lodTextureMid = lod;
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
internalTexture_1._lodTextureHigh = lod;
|
|
209
|
+
}
|
|
210
|
+
textureCube[lodKey] = lod;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
internalTexture_1.isReady = true;
|
|
215
|
+
}
|
|
216
|
+
gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
|
|
217
|
+
scene.getEngine().resetTextureCache();
|
|
218
|
+
};
|
|
219
|
+
var _loop_1 = function (i) {
|
|
220
|
+
var faces = textureCube.source[i];
|
|
221
|
+
var _loop_2 = function (j) {
|
|
222
|
+
var face = faces[j];
|
|
223
|
+
if (face instanceof HTMLImageElement && !face.complete) {
|
|
224
|
+
face.addEventListener("load", function () {
|
|
225
|
+
uploadFace_1(j, i, face);
|
|
226
|
+
}, false);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
uploadFace_1(j, i, face);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
for (var j = 0; j < faces.length; j++) {
|
|
233
|
+
_loop_2(j);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
for (var i = 0; i <= maxMipLevel_1; i++) {
|
|
237
|
+
_loop_1(i);
|
|
238
|
+
}
|
|
239
|
+
scene.getEngine().resetTextureCache();
|
|
240
|
+
babylonTexture.isReady = function () {
|
|
241
|
+
return textureComplete_1();
|
|
242
|
+
};
|
|
243
|
+
textureCube[key] = babylonTexture;
|
|
244
|
+
}
|
|
245
|
+
return babylonTexture;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Applies Spectre SamplingParameters to a Babylon texture by directly setting texture parameters on the internal WebGLTexture as well as setting Babylon fields
|
|
249
|
+
* @param babylonTexture Babylon texture to apply texture to (requires the Babylon texture has an initialize _texture field)
|
|
250
|
+
* @param parameters Spectre SamplingParameters to apply
|
|
251
|
+
*/
|
|
252
|
+
TextureUtils.ApplySamplingParameters = function (babylonTexture, parameters) {
|
|
253
|
+
var _a;
|
|
254
|
+
var scene = babylonTexture.getScene();
|
|
255
|
+
if (!scene) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
var gl = scene.getEngine()._gl;
|
|
259
|
+
var target = babylonTexture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
|
|
260
|
+
var internalTexture = babylonTexture._texture;
|
|
261
|
+
if (!internalTexture) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
var glTexture = (_a = internalTexture._hardwareTexture) === null || _a === void 0 ? void 0 : _a.underlyingResource;
|
|
265
|
+
gl.bindTexture(target, glTexture);
|
|
266
|
+
if (parameters.magFilter != null) {
|
|
267
|
+
gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, parameters.magFilter);
|
|
268
|
+
}
|
|
269
|
+
if (parameters.minFilter != null) {
|
|
270
|
+
gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, parameters.minFilter);
|
|
271
|
+
}
|
|
272
|
+
if (parameters.wrapS != null) {
|
|
273
|
+
gl.texParameteri(target, gl.TEXTURE_WRAP_S, parameters.wrapS);
|
|
274
|
+
}
|
|
275
|
+
if (parameters.wrapT != null) {
|
|
276
|
+
gl.texParameteri(target, gl.TEXTURE_WRAP_T, parameters.wrapT);
|
|
277
|
+
}
|
|
278
|
+
//set babylon wrap modes from sampling parameter
|
|
279
|
+
switch (parameters.wrapS) {
|
|
280
|
+
case 10497 /* TextureWrapMode.REPEAT */:
|
|
281
|
+
babylonTexture.wrapU = Texture.WRAP_ADDRESSMODE;
|
|
282
|
+
break;
|
|
283
|
+
case 33071 /* TextureWrapMode.CLAMP_TO_EDGE */:
|
|
284
|
+
babylonTexture.wrapU = Texture.CLAMP_ADDRESSMODE;
|
|
285
|
+
break;
|
|
286
|
+
case 33648 /* TextureWrapMode.MIRRORED_REPEAT */:
|
|
287
|
+
babylonTexture.wrapU = Texture.MIRROR_ADDRESSMODE;
|
|
288
|
+
break;
|
|
289
|
+
default:
|
|
290
|
+
babylonTexture.wrapU = Texture.CLAMP_ADDRESSMODE;
|
|
291
|
+
}
|
|
292
|
+
switch (parameters.wrapT) {
|
|
293
|
+
case 10497 /* TextureWrapMode.REPEAT */:
|
|
294
|
+
babylonTexture.wrapV = Texture.WRAP_ADDRESSMODE;
|
|
295
|
+
break;
|
|
296
|
+
case 33071 /* TextureWrapMode.CLAMP_TO_EDGE */:
|
|
297
|
+
babylonTexture.wrapV = Texture.CLAMP_ADDRESSMODE;
|
|
298
|
+
break;
|
|
299
|
+
case 33648 /* TextureWrapMode.MIRRORED_REPEAT */:
|
|
300
|
+
babylonTexture.wrapV = Texture.MIRROR_ADDRESSMODE;
|
|
301
|
+
break;
|
|
302
|
+
default:
|
|
303
|
+
babylonTexture.wrapV = Texture.CLAMP_ADDRESSMODE;
|
|
304
|
+
}
|
|
305
|
+
if (parameters.maxAnisotropy != null && parameters.maxAnisotropy > 1) {
|
|
306
|
+
var anisotropicExt = gl.getExtension("EXT_texture_filter_anisotropic");
|
|
307
|
+
if (anisotropicExt) {
|
|
308
|
+
var maxAnisotropicSamples = gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
|
|
309
|
+
var maxAnisotropy = Math.min(parameters.maxAnisotropy, maxAnisotropicSamples);
|
|
310
|
+
gl.texParameterf(target, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy);
|
|
311
|
+
babylonTexture.anisotropicFilteringLevel = maxAnisotropy;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
gl.bindTexture(target, null);
|
|
315
|
+
scene.getEngine().resetTextureCache();
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* A prefix used when storing a babylon texture object reference on a Spectre texture object
|
|
319
|
+
*/
|
|
320
|
+
TextureUtils.BabylonTextureKeyPrefix = "__babylonTexture_";
|
|
321
|
+
/**
|
|
322
|
+
* Controls anisotropic filtering for deserialized textures.
|
|
323
|
+
*/
|
|
324
|
+
TextureUtils.MaxAnisotropy = 4;
|
|
325
|
+
TextureUtils._EnvironmentSampling = {
|
|
326
|
+
magFilter: 9729 /* TextureMagFilter.LINEAR */,
|
|
327
|
+
minFilter: 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */,
|
|
328
|
+
wrapS: 33071 /* TextureWrapMode.CLAMP_TO_EDGE */,
|
|
329
|
+
wrapT: 33071 /* TextureWrapMode.CLAMP_TO_EDGE */,
|
|
330
|
+
maxAnisotropy: 1,
|
|
331
|
+
};
|
|
332
|
+
TextureUtils._EnvironmentSingleMipSampling = {
|
|
333
|
+
magFilter: 9729 /* TextureMagFilter.LINEAR */,
|
|
334
|
+
minFilter: 9729 /* TextureMinFilter.LINEAR */,
|
|
335
|
+
wrapS: 33071 /* TextureWrapMode.CLAMP_TO_EDGE */,
|
|
336
|
+
wrapT: 33071 /* TextureWrapMode.CLAMP_TO_EDGE */,
|
|
337
|
+
maxAnisotropy: 1,
|
|
338
|
+
};
|
|
339
|
+
//from "/Internal/Lighting.EnvironmentFilterScale" in Engine/*/Configuration.cpp
|
|
340
|
+
/**
|
|
341
|
+
* Environment preprocessing dedicated value (Internal Use or Advanced only).
|
|
342
|
+
*/
|
|
343
|
+
TextureUtils.EnvironmentLODScale = 0.8;
|
|
344
|
+
/**
|
|
345
|
+
* Environment preprocessing dedicated value (Internal Use or Advanced only)..
|
|
346
|
+
*/
|
|
347
|
+
TextureUtils.EnvironmentLODOffset = 1.0;
|
|
348
|
+
return TextureUtils;
|
|
349
|
+
}());
|
|
350
|
+
export { TextureUtils };
|
|
351
|
+
//# sourceMappingURL=texture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture.js","sourceRoot":"","sources":["../../../../tools/viewer/src/labs/texture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,0DAA4C;AAClE,OAAO,EAAE,eAAe,EAAyB,8DAAgD;AAEjG,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAG1D;;GAEG;AACH,MAAM,CAAN,IAAkB,WAOjB;AAPD,WAAkB,WAAW;IACzB,sEAAwB,CAAA;IACxB,kDAAc,CAAA;IACd,8CAAY,CAAA;IACZ,gDAAa,CAAA;IACb,0DAAkB,CAAA;IAClB,sEAAwB,CAAA;AAC5B,CAAC,EAPiB,WAAW,KAAX,WAAW,QAO5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAkB,SAKjB;AALD,WAAkB,SAAS;IACvB,8DAAsB,CAAA;IACtB,iFAA+B,CAAA;IAC/B,iFAA+B,CAAA;IAC/B,6EAA6B,CAAA;AACjC,CAAC,EALiB,SAAS,KAAT,SAAS,QAK1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAkB,gBAGjB;AAHD,WAAkB,gBAAgB;IAC9B,gEAAgB,CAAA;IAChB,8DAAe,CAAA;AACnB,CAAC,EAHiB,gBAAgB,KAAhB,gBAAgB,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GAAG,CAAC,UAAU,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;gBAChF,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;gBACnF,cAAc,CAAC,yBAAyB,GAAG,aAAa,CAAC;YAC7D,CAAC;QACL,CAAC;QAED,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC;IAC1C,CAAC;IA1QD;;OAEG;IACW,oCAAuB,GAAG,mBAAmB,CAAC;IAE5D;;OAEG;IACW,0BAAa,GAAG,CAAC,CAAC;IAoQjB,iCAAoB,GAAuB;QACtD,SAAS,oCAAyB;QAClC,SAAS,kDAAuC;QAChD,KAAK,2CAA+B;QACpC,KAAK,2CAA+B;QACpC,aAAa,EAAE,CAAC;KACnB,CAAC;IAEa,0CAA6B,GAAuB;QAC/D,SAAS,oCAAyB;QAClC,SAAS,oCAAyB;QAClC,KAAK,2CAA+B;QACpC,KAAK,2CAA+B;QACpC,aAAa,EAAE,CAAC;KACnB,CAAC;IAEF,gFAAgF;IAChF;;OAEG;IACW,gCAAmB,GAAG,GAAG,CAAC;IACxC;;OAEG;IACW,iCAAoB,GAAG,GAAG,CAAC;IAC7C,mBAAC;CAAA,AAtSD,IAsSC;SAtSY,YAAY","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport { CubeTexture } from \"core/Materials/Textures/cubeTexture\";\r\nimport { InternalTexture, InternalTextureSource } from \"core/Materials/Textures/internalTexture\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Engine } from \"core/Engines/engine\";\r\n\r\n/**\r\n * WebGL Pixel Formats\r\n */\r\nexport const enum PixelFormat {\r\n DEPTH_COMPONENT = 0x1902,\r\n ALPHA = 0x1906,\r\n RGB = 0x1907,\r\n RGBA = 0x1908,\r\n LUMINANCE = 0x1909,\r\n LUMINANCE_ALPHA = 0x190a,\r\n}\r\n\r\n/**\r\n * WebGL Pixel Types\r\n */\r\nexport const enum PixelType {\r\n UNSIGNED_BYTE = 0x1401,\r\n UNSIGNED_SHORT_4_4_4_4 = 0x8033,\r\n UNSIGNED_SHORT_5_5_5_1 = 0x8034,\r\n UNSIGNED_SHORT_5_6_5 = 0x8363,\r\n}\r\n\r\n/**\r\n * WebGL Texture Magnification Filter\r\n */\r\nexport const enum TextureMagFilter {\r\n NEAREST = 0x2600,\r\n LINEAR = 0x2601,\r\n}\r\n\r\n/**\r\n * WebGL Texture Minification Filter\r\n */\r\nexport const enum TextureMinFilter {\r\n NEAREST = 0x2600,\r\n LINEAR = 0x2601,\r\n NEAREST_MIPMAP_NEAREST = 0x2700,\r\n LINEAR_MIPMAP_NEAREST = 0x2701,\r\n NEAREST_MIPMAP_LINEAR = 0x2702,\r\n LINEAR_MIPMAP_LINEAR = 0x2703,\r\n}\r\n\r\n/**\r\n * WebGL Texture Wrap Modes\r\n */\r\nexport const enum TextureWrapMode {\r\n REPEAT = 0x2901,\r\n CLAMP_TO_EDGE = 0x812f,\r\n MIRRORED_REPEAT = 0x8370,\r\n}\r\n\r\n/**\r\n * Raw texture data and descriptor sufficient for WebGL texture upload\r\n */\r\nexport interface TextureData {\r\n /**\r\n * Width of image\r\n */\r\n width: number;\r\n /**\r\n * Height of image\r\n */\r\n height: number;\r\n /**\r\n * Format of pixels in data\r\n */\r\n format: PixelFormat;\r\n /**\r\n * Row byte alignment of pixels in data\r\n */\r\n alignment: number;\r\n /**\r\n * Pixel data\r\n */\r\n data: ArrayBufferView;\r\n}\r\n\r\n/**\r\n * Wraps sampling parameters for a WebGL texture\r\n */\r\nexport interface SamplingParameters {\r\n /**\r\n * Magnification mode when upsampling from a WebGL texture\r\n */\r\n magFilter?: TextureMagFilter;\r\n /**\r\n * Minification mode when upsampling from a WebGL texture\r\n */\r\n minFilter?: TextureMinFilter;\r\n /**\r\n * X axis wrapping mode when sampling out of a WebGL texture bounds\r\n */\r\n wrapS?: TextureWrapMode;\r\n /**\r\n * Y axis wrapping mode when sampling out of a WebGL texture bounds\r\n */\r\n wrapT?: TextureWrapMode;\r\n /**\r\n * Anisotropic filtering samples\r\n */\r\n maxAnisotropy?: number;\r\n}\r\n\r\n/**\r\n * Represents a valid WebGL texture source for use in texImage2D\r\n */\r\nexport type TextureSource = TextureData | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;\r\n\r\n/**\r\n * A generic set of texture mipmaps (where index 0 has the largest dimension)\r\n */\r\nexport type Mipmaps<T> = Array<T>;\r\n\r\n/**\r\n * A set of 6 cubemap arranged in the order [+x, -x, +y, -y, +z, -z]\r\n */\r\nexport type Faces<T> = Array<T>;\r\n\r\n/**\r\n * A set of texture mipmaps specifically for 2D textures in WebGL (where index 0 has the largest dimension)\r\n */\r\nexport type Mipmaps2D = Mipmaps<TextureSource>;\r\n\r\n/**\r\n * A set of texture mipmaps specifically for cubemap textures in WebGL (where index 0 has the largest dimension)\r\n */\r\nexport type MipmapsCube = Mipmaps<Faces<TextureSource>>;\r\n\r\n/**\r\n * A minimal WebGL cubemap descriptor\r\n */\r\nexport class TextureCube {\r\n /**\r\n * Returns the width of a face of the texture or 0 if not available\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public get Width(): number {\r\n return this.source && this.source[0] && this.source[0][0] ? this.source[0][0].width : 0;\r\n }\r\n\r\n /**\r\n * Returns the height of a face of the texture or 0 if not available\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public get Height(): number {\r\n return this.source && this.source[0] && this.source[0][0] ? this.source[0][0].height : 0;\r\n }\r\n\r\n /**\r\n * constructor\r\n * @param internalFormat WebGL pixel format for the texture on the GPU\r\n * @param type WebGL pixel type of the supplied data and texture on the GPU\r\n * @param source An array containing mipmap levels of faces, where each mipmap level is an array of faces and each face is a TextureSource object\r\n */\r\n constructor(\r\n public internalFormat: PixelFormat,\r\n public type: PixelType,\r\n public source: MipmapsCube = []\r\n ) {}\r\n}\r\n\r\n/**\r\n * A static class providing methods to aid working with Bablyon textures.\r\n */\r\nexport class TextureUtils {\r\n /**\r\n * A prefix used when storing a babylon texture object reference on a Spectre texture object\r\n */\r\n public static BabylonTextureKeyPrefix = \"__babylonTexture_\";\r\n\r\n /**\r\n * Controls anisotropic filtering for deserialized textures.\r\n */\r\n public static MaxAnisotropy = 4;\r\n\r\n /**\r\n * Returns a BabylonCubeTexture instance from a Spectre texture cube, subject to sampling parameters.\r\n * If such a texture has already been requested in the past, this texture will be returned, otherwise a new one will be created.\r\n * The advantage of this is to enable working with texture objects without the need to initialize on the GPU until desired.\r\n * @param scene A Babylon Scene instance\r\n * @param textureCube A Spectre TextureCube object\r\n * @param automaticMipmaps Pass true to enable automatic mipmap generation where possible (requires power of images)\r\n * @param environment Specifies that the texture will be used as an environment\r\n * @param singleLod Specifies that the texture will be a singleLod (for environment)\r\n * @returns Babylon cube texture\r\n */\r\n public static GetBabylonCubeTexture(scene: Scene, textureCube: TextureCube, automaticMipmaps: boolean, environment = false, singleLod = false): CubeTexture {\r\n if (!textureCube) {\r\n throw new Error(\"no texture cube provided\");\r\n }\r\n\r\n let parameters: SamplingParameters;\r\n if (environment) {\r\n parameters = singleLod ? TextureUtils._EnvironmentSingleMipSampling : TextureUtils._EnvironmentSampling;\r\n } else {\r\n parameters = {\r\n magFilter: TextureMagFilter.NEAREST,\r\n minFilter: TextureMinFilter.NEAREST,\r\n wrapS: TextureWrapMode.CLAMP_TO_EDGE,\r\n wrapT: TextureWrapMode.CLAMP_TO_EDGE,\r\n };\r\n }\r\n\r\n const key = TextureUtils.BabylonTextureKeyPrefix + parameters.magFilter + \"\" + parameters.minFilter + \"\" + parameters.wrapS + \"\" + parameters.wrapT;\r\n\r\n let babylonTexture: CubeTexture = (<any>textureCube)[key];\r\n\r\n if (!babylonTexture) {\r\n //initialize babylon texture\r\n babylonTexture = new CubeTexture(\"\", scene);\r\n if (environment) {\r\n babylonTexture.lodGenerationOffset = TextureUtils.EnvironmentLODOffset;\r\n babylonTexture.lodGenerationScale = TextureUtils.EnvironmentLODScale;\r\n }\r\n\r\n babylonTexture.gammaSpace = false;\r\n\r\n const internalTexture = new InternalTexture(scene.getEngine(), InternalTextureSource.CubeRaw);\r\n const glTexture = internalTexture._hardwareTexture?.underlyingResource;\r\n //babylon properties\r\n internalTexture.isCube = true;\r\n internalTexture.generateMipMaps = false;\r\n\r\n babylonTexture._texture = internalTexture;\r\n\r\n TextureUtils.ApplySamplingParameters(babylonTexture, parameters);\r\n\r\n const maxMipLevel = automaticMipmaps ? 0 : textureCube.source.length - 1;\r\n let texturesUploaded = 0;\r\n\r\n const textureComplete = function () {\r\n return texturesUploaded === (maxMipLevel + 1) * 6;\r\n };\r\n\r\n const uploadFace = function (i: number, level: number, face: TextureSource) {\r\n if (!glTexture) {\r\n return;\r\n }\r\n\r\n if (i === 0 && level === 0) {\r\n internalTexture.width = face.width;\r\n internalTexture.height = face.height;\r\n }\r\n\r\n const gl = (<any>scene.getEngine())._gl;\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, glTexture);\r\n (scene.getEngine() as Engine)._unpackFlipY(false);\r\n if (face instanceof HTMLElement || face instanceof ImageData) {\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level, textureCube.internalFormat, textureCube.internalFormat, textureCube.type, <any>face);\r\n } else {\r\n const textureData = <TextureData>face;\r\n gl.texImage2D(\r\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + i,\r\n level,\r\n textureCube.internalFormat,\r\n textureData.width,\r\n textureData.height,\r\n 0,\r\n textureData.format,\r\n textureCube.type,\r\n textureData.data\r\n );\r\n }\r\n\r\n texturesUploaded++;\r\n\r\n if (textureComplete()) {\r\n //generate mipmaps\r\n if (automaticMipmaps) {\r\n const w = face.width;\r\n const h = face.height;\r\n const isPot = (w !== 0 && w & (w - 1)) === 0 && (h !== 0 && h & (h - 1)) === 0;\r\n if (isPot) {\r\n gl.generateMipmap(gl.TEXTURE_CUBE_MAP);\r\n }\r\n }\r\n\r\n // Upload Separate lods in case there is no support for texture lod.\r\n if (environment && !scene.getEngine().getCaps().textureLOD && !singleLod) {\r\n const mipSlices = 3;\r\n for (let i = 0; i < mipSlices; i++) {\r\n const lodKey = TextureUtils.BabylonTextureKeyPrefix + \"lod\" + i;\r\n let lod: CubeTexture = (<any>textureCube)[lodKey];\r\n\r\n //initialize lod texture if it doesn't already exist\r\n if (lod == null && textureCube.Width) {\r\n //compute LOD from even spacing in smoothness (matching shader calculation)\r\n const smoothness = i / (mipSlices - 1);\r\n const roughness = 1 - smoothness;\r\n const kMinimumVariance = 0.0005;\r\n const alphaG = roughness * roughness + kMinimumVariance;\r\n const microsurfaceAverageSlopeTexels = alphaG * textureCube.Width;\r\n\r\n const environmentSpecularLOD = TextureUtils.EnvironmentLODScale * Math.log2(microsurfaceAverageSlopeTexels) + TextureUtils.EnvironmentLODOffset;\r\n\r\n const maxLODIndex = textureCube.source.length - 1;\r\n const mipmapIndex = Math.min(Math.max(Math.round(environmentSpecularLOD), 0), maxLODIndex);\r\n\r\n lod = TextureUtils.GetBabylonCubeTexture(\r\n scene,\r\n new TextureCube(PixelFormat.RGBA, PixelType.UNSIGNED_BYTE, [textureCube.source[mipmapIndex]]),\r\n false,\r\n true,\r\n true\r\n );\r\n\r\n if (i === 0) {\r\n internalTexture._lodTextureLow = lod;\r\n } else if (i === 1) {\r\n internalTexture._lodTextureMid = lod;\r\n } else {\r\n internalTexture._lodTextureHigh = lod;\r\n }\r\n\r\n (<any>textureCube)[lodKey] = lod;\r\n }\r\n }\r\n }\r\n\r\n internalTexture.isReady = true;\r\n }\r\n\r\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\r\n scene.getEngine().resetTextureCache();\r\n };\r\n\r\n for (let i = 0; i <= maxMipLevel; i++) {\r\n const faces = textureCube.source[i];\r\n for (let j = 0; j < faces.length; j++) {\r\n const face = faces[j];\r\n if (face instanceof HTMLImageElement && !face.complete) {\r\n face.addEventListener(\r\n \"load\",\r\n () => {\r\n uploadFace(j, i, face);\r\n },\r\n false\r\n );\r\n } else {\r\n uploadFace(j, i, face);\r\n }\r\n }\r\n }\r\n\r\n scene.getEngine().resetTextureCache();\r\n\r\n babylonTexture.isReady = () => {\r\n return textureComplete();\r\n };\r\n\r\n (<any>textureCube)[key] = babylonTexture;\r\n }\r\n\r\n return babylonTexture;\r\n }\r\n\r\n /**\r\n * Applies Spectre SamplingParameters to a Babylon texture by directly setting texture parameters on the internal WebGLTexture as well as setting Babylon fields\r\n * @param babylonTexture Babylon texture to apply texture to (requires the Babylon texture has an initialize _texture field)\r\n * @param parameters Spectre SamplingParameters to apply\r\n */\r\n public static ApplySamplingParameters(babylonTexture: BaseTexture, parameters: SamplingParameters) {\r\n const scene = babylonTexture.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n const gl = (<any>scene.getEngine())._gl;\r\n\r\n const target = babylonTexture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;\r\n\r\n const internalTexture = babylonTexture._texture;\r\n if (!internalTexture) {\r\n return;\r\n }\r\n const glTexture = internalTexture._hardwareTexture?.underlyingResource;\r\n gl.bindTexture(target, glTexture);\r\n\r\n if (parameters.magFilter != null) {\r\n gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, parameters.magFilter);\r\n }\r\n if (parameters.minFilter != null) {\r\n gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, parameters.minFilter);\r\n }\r\n if (parameters.wrapS != null) {\r\n gl.texParameteri(target, gl.TEXTURE_WRAP_S, parameters.wrapS);\r\n }\r\n if (parameters.wrapT != null) {\r\n gl.texParameteri(target, gl.TEXTURE_WRAP_T, parameters.wrapT);\r\n }\r\n\r\n //set babylon wrap modes from sampling parameter\r\n switch (parameters.wrapS) {\r\n case TextureWrapMode.REPEAT:\r\n babylonTexture.wrapU = Texture.WRAP_ADDRESSMODE;\r\n break;\r\n case TextureWrapMode.CLAMP_TO_EDGE:\r\n babylonTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n break;\r\n case TextureWrapMode.MIRRORED_REPEAT:\r\n babylonTexture.wrapU = Texture.MIRROR_ADDRESSMODE;\r\n break;\r\n default:\r\n babylonTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n switch (parameters.wrapT) {\r\n case TextureWrapMode.REPEAT:\r\n babylonTexture.wrapV = Texture.WRAP_ADDRESSMODE;\r\n break;\r\n case TextureWrapMode.CLAMP_TO_EDGE:\r\n babylonTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n break;\r\n case TextureWrapMode.MIRRORED_REPEAT:\r\n babylonTexture.wrapV = Texture.MIRROR_ADDRESSMODE;\r\n break;\r\n default:\r\n babylonTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n if (parameters.maxAnisotropy != null && parameters.maxAnisotropy > 1) {\r\n const anisotropicExt = gl.getExtension(\"EXT_texture_filter_anisotropic\");\r\n if (anisotropicExt) {\r\n const maxAnisotropicSamples = gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\r\n const maxAnisotropy = Math.min(parameters.maxAnisotropy, maxAnisotropicSamples);\r\n gl.texParameterf(target, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy);\r\n babylonTexture.anisotropicFilteringLevel = maxAnisotropy;\r\n }\r\n }\r\n\r\n gl.bindTexture(target, null);\r\n scene.getEngine().resetTextureCache();\r\n }\r\n\r\n private static _EnvironmentSampling: SamplingParameters = {\r\n magFilter: TextureMagFilter.LINEAR,\r\n minFilter: TextureMinFilter.LINEAR_MIPMAP_LINEAR,\r\n wrapS: TextureWrapMode.CLAMP_TO_EDGE,\r\n wrapT: TextureWrapMode.CLAMP_TO_EDGE,\r\n maxAnisotropy: 1,\r\n };\r\n\r\n private static _EnvironmentSingleMipSampling: SamplingParameters = {\r\n magFilter: TextureMagFilter.LINEAR,\r\n minFilter: TextureMinFilter.LINEAR,\r\n wrapS: TextureWrapMode.CLAMP_TO_EDGE,\r\n wrapT: TextureWrapMode.CLAMP_TO_EDGE,\r\n maxAnisotropy: 1,\r\n };\r\n\r\n //from \"/Internal/Lighting.EnvironmentFilterScale\" in Engine/*/Configuration.cpp\r\n /**\r\n * Environment preprocessing dedicated value (Internal Use or Advanced only).\r\n */\r\n public static EnvironmentLODScale = 0.8;\r\n /**\r\n * Environment preprocessing dedicated value (Internal Use or Advanced only)..\r\n */\r\n public static EnvironmentLODOffset = 1.0;\r\n}\r\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PBREnvironment } from "./environmentSerializer";
|
|
2
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
|
3
|
+
import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
|
4
|
+
import type { ShadowLight } from "@babylonjs/core/Lights/shadowLight.js";
|
|
5
|
+
/**
|
|
6
|
+
* The ViewerLabs class will hold functions that are not (!) backwards compatible.
|
|
7
|
+
* The APIs in all labs-related classes and configuration might change.
|
|
8
|
+
* Once stable, lab features will be moved to the publis API and configuration object.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ViewerLabs {
|
|
11
|
+
private _scene;
|
|
12
|
+
constructor(_scene: Scene);
|
|
13
|
+
assetsRootURL: string;
|
|
14
|
+
environment: PBREnvironment;
|
|
15
|
+
/**
|
|
16
|
+
* Loads an environment map from a given URL
|
|
17
|
+
* @param url URL of environment map
|
|
18
|
+
* @param onSuccess Callback fired after environment successfully applied to the scene
|
|
19
|
+
* @param onProgress Callback fired at progress events while loading the environment map
|
|
20
|
+
* @param onError Callback fired when the load fails
|
|
21
|
+
*/
|
|
22
|
+
loadEnvironment(url: string, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
|
|
23
|
+
/**
|
|
24
|
+
* Loads an environment map from a given URL
|
|
25
|
+
* @param buffer ArrayBuffer containing environment map
|
|
26
|
+
* @param onSuccess Callback fired after environment successfully applied to the scene
|
|
27
|
+
* @param onProgress Callback fired at progress events while loading the environment map
|
|
28
|
+
* @param onError Callback fired when the load fails
|
|
29
|
+
*/
|
|
30
|
+
loadEnvironment(buffer: ArrayBuffer, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
|
|
31
|
+
/**
|
|
32
|
+
* Sets the environment to an already loaded environment
|
|
33
|
+
* @param env PBREnvironment instance
|
|
34
|
+
* @param onSuccess Callback fired after environment successfully applied to the scene
|
|
35
|
+
* @param onProgress Callback fired at progress events while loading the environment map
|
|
36
|
+
* @param onError Callback fired when the load fails
|
|
37
|
+
*/
|
|
38
|
+
loadEnvironment(env: PBREnvironment, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
|
|
39
|
+
/**
|
|
40
|
+
* Applies an `EnvironmentMapConfiguration` to the scene
|
|
41
|
+
* @param rotationY
|
|
42
|
+
*/
|
|
43
|
+
applyEnvironmentMapConfiguration(rotationY?: number): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get an environment asset url by using the configuration if the path is not absolute.
|
|
46
|
+
* @param url Asset url
|
|
47
|
+
* @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
|
|
48
|
+
*/
|
|
49
|
+
getAssetUrl(url: string): string;
|
|
50
|
+
rotateShadowLight(shadowLight: ShadowLight, amount: number, point?: Vector3, axis?: Vector3, target?: Vector3): void;
|
|
51
|
+
}
|