@babylonjs/viewer 7.36.0-alpha → 7.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration/configuration.d.ts +107 -0
- package/configuration/configuration.js +16 -0
- package/configuration/configuration.js.map +1 -0
- package/configuration/configurationCompatibility.d.ts +8 -0
- package/configuration/configurationCompatibility.js +66 -0
- package/configuration/configurationCompatibility.js.map +1 -0
- package/configuration/configurationContainer.d.ts +10 -0
- package/configuration/configurationContainer.js +10 -0
- package/configuration/configurationContainer.js.map +1 -0
- package/configuration/globals.d.ts +6 -0
- package/configuration/globals.js +18 -0
- package/configuration/globals.js.map +1 -0
- package/configuration/index.d.ts +2 -0
- package/configuration/index.js +4 -0
- package/configuration/index.js.map +1 -0
- package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
- package/configuration/interfaces/cameraConfiguration.js +2 -0
- package/configuration/interfaces/cameraConfiguration.js.map +1 -0
- package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
- package/configuration/interfaces/colorGradingConfiguration.js +2 -0
- package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
- package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
- package/configuration/interfaces/environmentMapConfiguration.js +2 -0
- package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
- package/configuration/interfaces/groundConfiguration.d.ts +24 -0
- package/configuration/interfaces/groundConfiguration.js +2 -0
- package/configuration/interfaces/groundConfiguration.js.map +1 -0
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
- package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
- package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
- package/configuration/interfaces/index.d.ts +15 -0
- package/configuration/interfaces/index.js +16 -0
- package/configuration/interfaces/index.js.map +1 -0
- package/configuration/interfaces/lightConfiguration.d.ts +60 -0
- package/configuration/interfaces/lightConfiguration.js +2 -0
- package/configuration/interfaces/lightConfiguration.js.map +1 -0
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
- package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
- package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
- package/configuration/interfaces/modelConfiguration.d.ts +65 -0
- package/configuration/interfaces/modelConfiguration.js +2 -0
- package/configuration/interfaces/modelConfiguration.js.map +1 -0
- package/configuration/interfaces/observersConfiguration.d.ts +5 -0
- package/configuration/interfaces/observersConfiguration.js +2 -0
- package/configuration/interfaces/observersConfiguration.js.map +1 -0
- package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
- package/configuration/interfaces/sceneConfiguration.js +2 -0
- package/configuration/interfaces/sceneConfiguration.js.map +1 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
- package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
- package/configuration/interfaces/skyboxConfiguration.js +2 -0
- package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
- package/configuration/interfaces/templateConfiguration.d.ts +67 -0
- package/configuration/interfaces/templateConfiguration.js +2 -0
- package/configuration/interfaces/templateConfiguration.js.map +1 -0
- package/configuration/interfaces/vrConfiguration.d.ts +16 -0
- package/configuration/interfaces/vrConfiguration.js +2 -0
- package/configuration/interfaces/vrConfiguration.js.map +1 -0
- package/configuration/loader.d.ts +4 -0
- package/configuration/loader.js +17 -0
- package/configuration/loader.js.map +1 -0
- package/configuration/mappers.d.ts +43 -0
- package/configuration/mappers.js +193 -0
- package/configuration/mappers.js.map +1 -0
- package/configuration/renderOnlyLoader.d.ts +33 -0
- package/configuration/renderOnlyLoader.js +162 -0
- package/configuration/renderOnlyLoader.js.map +1 -0
- package/configuration/types/default.d.ts +6 -0
- package/configuration/types/default.js +121 -0
- package/configuration/types/default.js.map +1 -0
- package/configuration/types/environmentMap.d.ts +5 -0
- package/configuration/types/environmentMap.js +14 -0
- package/configuration/types/environmentMap.js.map +1 -0
- package/configuration/types/extended.d.ts +6 -0
- package/configuration/types/extended.js +317 -0
- package/configuration/types/extended.js.map +1 -0
- package/configuration/types/index.d.ts +14 -0
- package/configuration/types/index.js +51 -0
- package/configuration/types/index.js.map +1 -0
- package/configuration/types/minimal.d.ts +6 -0
- package/configuration/types/minimal.js +43 -0
- package/configuration/types/minimal.js.map +1 -0
- package/configuration/types/renderOnlyDefault.d.ts +30 -0
- package/configuration/types/renderOnlyDefault.js +31 -0
- package/configuration/types/renderOnlyDefault.js.map +1 -0
- package/configuration/types/shadowLight.d.ts +9 -0
- package/configuration/types/shadowLight.js +64 -0
- package/configuration/types/shadowLight.js.map +1 -0
- package/helper/index.d.ts +29 -0
- package/helper/index.js +66 -0
- package/helper/index.js.map +1 -0
- package/index.d.ts +30 -0
- package/index.js +46 -0
- package/index.js.map +1 -0
- package/initializer.d.ts +11 -0
- package/initializer.js +35 -0
- package/initializer.js.map +1 -0
- package/interfaces.d.ts +5 -0
- package/interfaces.js +7 -0
- package/interfaces.js.map +1 -0
- package/labs/environmentSerializer.d.ts +126 -0
- package/labs/environmentSerializer.js +191 -0
- package/labs/environmentSerializer.js.map +1 -0
- package/labs/texture.d.ts +183 -0
- package/labs/texture.js +351 -0
- package/labs/texture.js.map +1 -0
- package/labs/viewerLabs.d.ts +51 -0
- package/labs/viewerLabs.js +134 -0
- package/labs/viewerLabs.js.map +1 -0
- package/loader/modelLoader.d.ts +56 -0
- package/loader/modelLoader.js +202 -0
- package/loader/modelLoader.js.map +1 -0
- package/loader/plugins/applyMaterialConfig.d.ts +12 -0
- package/loader/plugins/applyMaterialConfig.js +16 -0
- package/loader/plugins/applyMaterialConfig.js.map +1 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
- package/loader/plugins/index.d.ts +19 -0
- package/loader/plugins/index.js +44 -0
- package/loader/plugins/index.js.map +1 -0
- package/loader/plugins/loaderPlugin.d.ts +24 -0
- package/loader/plugins/loaderPlugin.js +2 -0
- package/loader/plugins/loaderPlugin.js.map +1 -0
- package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
- package/loader/plugins/msftLodLoaderPlugin.js +21 -0
- package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
- package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
- package/loader/plugins/telemetryLoaderPlugin.js +36 -0
- package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
- package/managers/observablesManager.d.ts +66 -0
- package/managers/observablesManager.js +35 -0
- package/managers/observablesManager.js.map +1 -0
- package/managers/sceneManager.d.ts +245 -0
- package/managers/sceneManager.js +1375 -0
- package/managers/sceneManager.js.map +1 -0
- package/managers/telemetryManager.d.ts +78 -0
- package/managers/telemetryManager.js +117 -0
- package/managers/telemetryManager.js.map +1 -0
- package/model/modelAnimation.d.ts +215 -0
- package/model/modelAnimation.js +237 -0
- package/model/modelAnimation.js.map +1 -0
- package/model/viewerModel.d.ts +233 -0
- package/model/viewerModel.js +673 -0
- package/model/viewerModel.js.map +1 -0
- package/optimizer/custom/extended.d.ts +13 -0
- package/optimizer/custom/extended.js +101 -0
- package/optimizer/custom/extended.js.map +1 -0
- package/optimizer/custom/index.d.ts +9 -0
- package/optimizer/custom/index.js +26 -0
- package/optimizer/custom/index.js.map +1 -0
- package/package.json +27 -18
- package/readme.md +21 -145
- 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_image_based-C-0rlXT1.esm.js +0 -171
- package/dist/chunks/EXT_lights_image_based-C-0rlXT1.esm.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-Dj8Ni3d2.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_image_based-Dj8Ni3d2.esm.min.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-B1CyJu24.esm.js +0 -86
- package/dist/chunks/EXT_mesh_gpu_instancing-B1CyJu24.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-C8G_7QGm.esm.min.js +0 -2
- package/dist/chunks/EXT_mesh_gpu_instancing-C8G_7QGm.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-BWmdyggL.esm.js +0 -134
- package/dist/chunks/EXT_meshopt_compression-BWmdyggL.esm.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-JpCGOf0s.esm.min.js +0 -2
- package/dist/chunks/EXT_meshopt_compression-JpCGOf0s.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-BnIzEc8i.esm.js +0 -44
- package/dist/chunks/EXT_texture_avif-BnIzEc8i.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-DPh64CjM.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_avif-DPh64CjM.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-CFO4xL5G.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_webp-CFO4xL5G.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-HqfTVHCZ.esm.js +0 -43
- package/dist/chunks/EXT_texture_webp-HqfTVHCZ.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-D97FCDjt.esm.js +0 -64
- package/dist/chunks/ExtrasAsMetadata-D97FCDjt.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-DdDksSpx.esm.min.js +0 -2
- package/dist/chunks/ExtrasAsMetadata-DdDksSpx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-BnDSBRgr.esm.js +0 -343
- package/dist/chunks/KHR_animation_pointer-BnDSBRgr.esm.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-CMxD_86V.esm.min.js +0 -2
- package/dist/chunks/KHR_animation_pointer-CMxD_86V.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-BMkcU19_.esm.min.js +0 -2
- package/dist/chunks/KHR_draco_mesh_compression-BMkcU19_.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-UAhzd3VK.esm.js +0 -617
- package/dist/chunks/KHR_draco_mesh_compression-UAhzd3VK.esm.js.map +0 -1
- package/dist/chunks/KHR_interactivity-BpeQ8Qyu.esm.min.js +0 -2
- package/dist/chunks/KHR_interactivity-BpeQ8Qyu.esm.min.js.map +0 -1
- package/dist/chunks/KHR_interactivity-DXk_MDm7.esm.js +0 -4033
- package/dist/chunks/KHR_interactivity-DXk_MDm7.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-BPa3ZY-J.esm.js +0 -1253
- package/dist/chunks/KHR_lights_punctual-BPa3ZY-J.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-D-OD_BpZ.esm.min.js +0 -2
- package/dist/chunks/KHR_lights_punctual-D-OD_BpZ.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-BgE9FbOB.esm.js +0 -65
- package/dist/chunks/KHR_materials_anisotropy-BgE9FbOB.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-DIPUTTRC.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_anisotropy-DIPUTTRC.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-BGx2Shdx.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_clearcoat-BGx2Shdx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-Bn5CfrnP.esm.js +0 -96
- package/dist/chunks/KHR_materials_clearcoat-Bn5CfrnP.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-DPNdPWGd.esm.js +0 -97
- package/dist/chunks/KHR_materials_diffuse_transmission-DPNdPWGd.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-izEv0SNd.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_diffuse_transmission-izEv0SNd.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-Bq7K1HEQ.esm.js +0 -62
- package/dist/chunks/KHR_materials_dispersion-Bq7K1HEQ.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-DBWPH2hJ.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_dispersion-DBWPH2hJ.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-6UcflbjA.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_emissive_strength-6UcflbjA.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-CjYGiLcM.esm.js +0 -55
- package/dist/chunks/KHR_materials_emissive_strength-CjYGiLcM.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-BAHeVsuR.esm.js +0 -64
- package/dist/chunks/KHR_materials_ior-BAHeVsuR.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-CIju_urb.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_ior-CIju_urb.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-9pWJBDfo.esm.js +0 -72
- package/dist/chunks/KHR_materials_iridescence-9pWJBDfo.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-BsLlyCTa.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_iridescence-BsLlyCTa.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D8cATbuT.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D8cATbuT.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-OsmoCB7F.esm.js +0 -81
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-OsmoCB7F.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-BO1HQtbx.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_sheen-BO1HQtbx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-Dg8CsPJs.esm.js +0 -85
- package/dist/chunks/KHR_materials_sheen-Dg8CsPJs.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-CTzLPv_Y.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_specular-CTzLPv_Y.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-yqxYY23C.esm.js +0 -75
- package/dist/chunks/KHR_materials_specular-yqxYY23C.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-Cw-bawr9.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_transmission-Cw-bawr9.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-Drj_fyXz.esm.js +0 -307
- package/dist/chunks/KHR_materials_transmission-Drj_fyXz.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-CTHSnSN1.esm.js +0 -74
- package/dist/chunks/KHR_materials_unlit-CTHSnSN1.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-DW3Q3hX2.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_unlit-DW3Q3hX2.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-9HpnP8WG.esm.js +0 -238
- package/dist/chunks/KHR_materials_variants-9HpnP8WG.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-DrT2UCZI.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_variants-DrT2UCZI.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-BTAz8V1X.esm.js +0 -87
- package/dist/chunks/KHR_materials_volume-BTAz8V1X.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-RWsAj4F0.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_volume-RWsAj4F0.esm.min.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-D9jnG818.esm.js +0 -26
- package/dist/chunks/KHR_mesh_quantization-D9jnG818.esm.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-aISRxDNK.esm.min.js +0 -2
- package/dist/chunks/KHR_mesh_quantization-aISRxDNK.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-BkNPNj5W.esm.min.js +0 -2
- package/dist/chunks/KHR_node_visibility-BkNPNj5W.esm.min.js.map +0 -1
- package/dist/chunks/KHR_node_visibility-DC-3D7A5.esm.js +0 -46
- package/dist/chunks/KHR_node_visibility-DC-3D7A5.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-B89JJbVs.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_basisu-B89JJbVs.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-D7ujO9Rh.esm.js +0 -43
- package/dist/chunks/KHR_texture_basisu-D7ujO9Rh.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-ClHuzCMo.esm.js +0 -63
- package/dist/chunks/KHR_texture_transform-ClHuzCMo.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-wJ7lDLeD.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_transform-wJ7lDLeD.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-BD6LnsUs.esm.min.js +0 -2
- package/dist/chunks/KHR_xmp_json_ld-BD6LnsUs.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-CGzvQSvZ.esm.js +0 -51
- package/dist/chunks/KHR_xmp_json_ld-CGzvQSvZ.esm.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-BwAwNx3E.esm.js +0 -2207
- package/dist/chunks/MSFT_audio_emitter-BwAwNx3E.esm.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-CgEIerLr.esm.min.js +0 -2
- package/dist/chunks/MSFT_audio_emitter-CgEIerLr.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_lod-D3GfTrFY.esm.min.js +0 -2
- package/dist/chunks/MSFT_lod-D3GfTrFY.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_lod-IQnE7Mms.esm.js +0 -337
- package/dist/chunks/MSFT_lod-IQnE7Mms.esm.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-DTVxMcRf.esm.js +0 -46
- package/dist/chunks/MSFT_minecraftMesh-DTVxMcRf.esm.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-MdQ3Mfp_.esm.min.js +0 -2
- package/dist/chunks/MSFT_minecraftMesh-MdQ3Mfp_.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-Bi_jHmjQ.esm.js +0 -47
- package/dist/chunks/MSFT_sRGBFactors-Bi_jHmjQ.esm.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-CeKsISP1.esm.min.js +0 -2
- package/dist/chunks/MSFT_sRGBFactors-CeKsISP1.esm.min.js.map +0 -1
- package/dist/chunks/animationGroup-BEk4nnn0.esm.js +0 -2482
- package/dist/chunks/animationGroup-BEk4nnn0.esm.js.map +0 -1
- package/dist/chunks/animationGroup-DVkE7Jrp.esm.min.js +0 -2
- package/dist/chunks/animationGroup-DVkE7Jrp.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-811yrzpt.esm.min.js +0 -2
- package/dist/chunks/assetContainer-811yrzpt.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-Ch1I3rtz.esm.js +0 -1720
- package/dist/chunks/assetContainer-Ch1I3rtz.esm.js.map +0 -1
- package/dist/chunks/audioEngine-D7yvul_r.esm.js +0 -305
- package/dist/chunks/audioEngine-D7yvul_r.esm.js.map +0 -1
- package/dist/chunks/audioEngine-k_PWuCZZ.esm.min.js +0 -2
- package/dist/chunks/audioEngine-k_PWuCZZ.esm.min.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-BmbcHNy2.esm.js +0 -114
- package/dist/chunks/bakedVertexAnimation-BmbcHNy2.esm.js.map +0 -1
- package/dist/chunks/bakedVertexAnimation-BxxWsZd7.esm.min.js +0 -2
- package/dist/chunks/bakedVertexAnimation-BxxWsZd7.esm.min.js.map +0 -1
- package/dist/chunks/basisTextureLoader-CDOgoy6w.esm.min.js +0 -2
- package/dist/chunks/basisTextureLoader-CDOgoy6w.esm.min.js.map +0 -1
- package/dist/chunks/basisTextureLoader-D-3r2N4B.esm.js +0 -600
- package/dist/chunks/basisTextureLoader-D-3r2N4B.esm.js.map +0 -1
- package/dist/chunks/dds-CuDk7jqp.esm.js +0 -540
- package/dist/chunks/dds-CuDk7jqp.esm.js.map +0 -1
- package/dist/chunks/dds-DotY7dzZ.esm.min.js +0 -2
- package/dist/chunks/dds-DotY7dzZ.esm.min.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-CEvKdiZN.esm.min.js +0 -2
- package/dist/chunks/ddsTextureLoader-CEvKdiZN.esm.min.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-DUU2aCSx.esm.js +0 -88
- package/dist/chunks/ddsTextureLoader-DUU2aCSx.esm.js.map +0 -1
- package/dist/chunks/decalFragment-DorRSt43.esm.min.js +0 -2
- package/dist/chunks/decalFragment-DorRSt43.esm.min.js.map +0 -1
- package/dist/chunks/decalFragment-usYEbFd1.esm.js +0 -18
- package/dist/chunks/decalFragment-usYEbFd1.esm.js.map +0 -1
- package/dist/chunks/default.fragment-B65JKmK4.esm.js +0 -433
- package/dist/chunks/default.fragment-B65JKmK4.esm.js.map +0 -1
- package/dist/chunks/default.fragment-DMzaV-1D.esm.min.js +0 -2
- package/dist/chunks/default.fragment-DMzaV-1D.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-DX272W_1.esm.js +0 -497
- package/dist/chunks/default.fragment-DX272W_1.esm.js.map +0 -1
- package/dist/chunks/default.fragment-cFVjQ581.esm.min.js +0 -2
- package/dist/chunks/default.fragment-cFVjQ581.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-ChbO_NCo.esm.js +0 -201
- package/dist/chunks/default.vertex-ChbO_NCo.esm.js.map +0 -1
- package/dist/chunks/default.vertex-CkX_3SHr.esm.min.js +0 -2
- package/dist/chunks/default.vertex-CkX_3SHr.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-F26iVD0U.esm.js +0 -181
- package/dist/chunks/default.vertex-F26iVD0U.esm.js.map +0 -1
- package/dist/chunks/default.vertex-Fvu87y_k.esm.min.js +0 -2
- package/dist/chunks/default.vertex-Fvu87y_k.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-BwkC1FU3.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-BwkC1FU3.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-DF-55m45.esm.js +0 -15
- package/dist/chunks/defaultUboDeclaration-DF-55m45.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-O2A-FLl7.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-O2A-FLl7.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-zED0FOi4.esm.js +0 -13
- package/dist/chunks/defaultUboDeclaration-zED0FOi4.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-BwNX1ze6.esm.js +0 -200
- package/dist/chunks/dumpTools-BwNX1ze6.esm.js.map +0 -1
- package/dist/chunks/dumpTools-C8tIU8Vg.esm.min.js +0 -2
- package/dist/chunks/dumpTools-C8tIU8Vg.esm.min.js.map +0 -1
- package/dist/chunks/engine-B5sg74E3.esm.min.js +0 -2
- package/dist/chunks/engine-B5sg74E3.esm.min.js.map +0 -1
- package/dist/chunks/engine-CP65EHPg.esm.js +0 -2204
- package/dist/chunks/engine-CP65EHPg.esm.js.map +0 -1
- package/dist/chunks/engine.common-BBoGnUNC.esm.js +0 -1162
- package/dist/chunks/engine.common-BBoGnUNC.esm.js.map +0 -1
- package/dist/chunks/engine.common-BkbsTiHo.esm.min.js +0 -2
- package/dist/chunks/engine.common-BkbsTiHo.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-B70arAfI.esm.js +0 -64
- package/dist/chunks/envTextureLoader-B70arAfI.esm.js.map +0 -1
- package/dist/chunks/envTextureLoader-DHhqK6FO.esm.min.js +0 -2
- package/dist/chunks/envTextureLoader-DHhqK6FO.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-CGf47VK6.esm.min.js +0 -2
- package/dist/chunks/environmentTextureTools-CGf47VK6.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-DdP3pU1V.esm.js +0 -382
- package/dist/chunks/environmentTextureTools-DdP3pU1V.esm.js.map +0 -1
- package/dist/chunks/exrTextureLoader-DHHr9kIC.esm.min.js +0 -2
- package/dist/chunks/exrTextureLoader-DHHr9kIC.esm.min.js.map +0 -1
- package/dist/chunks/exrTextureLoader-DUNRHpVI.esm.js +0 -1682
- package/dist/chunks/exrTextureLoader-DUNRHpVI.esm.js.map +0 -1
- package/dist/chunks/fogFragment-4XIiPNqC.esm.js +0 -102
- package/dist/chunks/fogFragment-4XIiPNqC.esm.js.map +0 -1
- package/dist/chunks/fogFragment-BH3nRhkR.esm.min.js +0 -2
- package/dist/chunks/fogFragment-BH3nRhkR.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-C86N7vRk.esm.min.js +0 -2
- package/dist/chunks/fogFragment-C86N7vRk.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-yxsCDlJx.esm.js +0 -101
- package/dist/chunks/fogFragment-yxsCDlJx.esm.js.map +0 -1
- package/dist/chunks/fresnelFunction-Bmm-eSsR.esm.js +0 -12
- package/dist/chunks/fresnelFunction-Bmm-eSsR.esm.js.map +0 -1
- package/dist/chunks/fresnelFunction-C6cm-reF.esm.min.js +0 -2
- package/dist/chunks/fresnelFunction-C6cm-reF.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoader-8YeGkftV.esm.js +0 -7606
- package/dist/chunks/glTFLoader-8YeGkftV.esm.js.map +0 -1
- package/dist/chunks/glTFLoader-DwAY5NAM.esm.min.js +0 -2
- package/dist/chunks/glTFLoader-DwAY5NAM.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-BQZg3uE2.esm.js +0 -77
- package/dist/chunks/glTFLoaderAnimation-BQZg3uE2.esm.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-CRdyA_ho.esm.min.js +0 -2
- package/dist/chunks/glTFLoaderAnimation-CRdyA_ho.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-BDWc7ugP.esm.js +0 -34
- package/dist/chunks/harmonicsFunctions-BDWc7ugP.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-D1m1tCiL.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-D1m1tCiL.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-DY83TD5F.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-DY83TD5F.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-RB1caKsW.esm.js +0 -35
- package/dist/chunks/harmonicsFunctions-RB1caKsW.esm.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-BA2YCEkF.esm.min.js +0 -2
- package/dist/chunks/hdrTextureLoader-BA2YCEkF.esm.min.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-BGoJncnK.esm.js +0 -252
- package/dist/chunks/hdrTextureLoader-BGoJncnK.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-B66YuDfO.esm.js +0 -80
- package/dist/chunks/helperFunctions-B66YuDfO.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-Bkbn03Eq.esm.js +0 -108
- package/dist/chunks/helperFunctions-Bkbn03Eq.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-DpJHAvub.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-DpJHAvub.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-Q_6RS1S2.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-Q_6RS1S2.esm.min.js.map +0 -1
- package/dist/chunks/index-B0XiE1FO.esm.js +0 -74245
- package/dist/chunks/index-B0XiE1FO.esm.js.map +0 -1
- package/dist/chunks/index-CMQ6hCSC.esm.min.js +0 -57
- package/dist/chunks/index-CMQ6hCSC.esm.min.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-BUiE1iIn.esm.min.js +0 -2
- package/dist/chunks/ktxTextureLoader-BUiE1iIn.esm.min.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-C2AIdCgA.esm.js +0 -814
- package/dist/chunks/ktxTextureLoader-C2AIdCgA.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-B5YDWGct.esm.js +0 -35
- package/dist/chunks/logDepthDeclaration-B5YDWGct.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-D6gM7_OR.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-D6gM7_OR.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-D7JeZYJs.esm.js +0 -11
- package/dist/chunks/logDepthDeclaration-D7JeZYJs.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-DcJYXBc-.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-DcJYXBc-.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-B--nEH5h.esm.js +0 -77
- package/dist/chunks/logDepthVertex-B--nEH5h.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-Bo9jtAiU.esm.js +0 -77
- package/dist/chunks/logDepthVertex-Bo9jtAiU.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-BuwnrjGN.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-BuwnrjGN.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-C7D6zwqe.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-C7D6zwqe.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-Bu2PCs0u.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-Bu2PCs0u.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CQtdE5nF.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-CQtdE5nF.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CkZTmKth.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-CkZTmKth.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-DjByoT5m.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-DjByoT5m.esm.min.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-CNRdvK6C.esm.js +0 -24
- package/dist/chunks/meshUboDeclaration-CNRdvK6C.esm.js.map +0 -1
- package/dist/chunks/meshUboDeclaration-CfdypbbP.esm.min.js +0 -2
- package/dist/chunks/meshUboDeclaration-CfdypbbP.esm.min.js.map +0 -1
- package/dist/chunks/objFileLoader-CTIziUgW.esm.js +0 -1338
- package/dist/chunks/objFileLoader-CTIziUgW.esm.js.map +0 -1
- package/dist/chunks/objFileLoader-Dti6yw2W.esm.min.js +0 -2
- package/dist/chunks/objFileLoader-Dti6yw2W.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-B31nZLKF.esm.min.js +0 -2
- package/dist/chunks/oitFragment-B31nZLKF.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-BaR7MXfg.esm.js +0 -1210
- package/dist/chunks/oitFragment-BaR7MXfg.esm.js.map +0 -1
- package/dist/chunks/oitFragment-DTo1Zewh.esm.min.js +0 -2
- package/dist/chunks/oitFragment-DTo1Zewh.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-Dlmtl4rw.esm.js +0 -1051
- package/dist/chunks/oitFragment-Dlmtl4rw.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-CEtxUJdg.esm.js +0 -15
- package/dist/chunks/pass.fragment-CEtxUJdg.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-C_F6Emgn.esm.js +0 -15
- package/dist/chunks/pass.fragment-C_F6Emgn.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-D6J2ZaiP.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-D6J2ZaiP.esm.min.js.map +0 -1
- package/dist/chunks/pass.fragment-Dq1Ebjt-.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-Dq1Ebjt-.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-7pZbGH4j.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-7pZbGH4j.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-Bjyf9L5u.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-Bjyf9L5u.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-D96q_d7U.esm.js +0 -3218
- package/dist/chunks/pbr.fragment-D96q_d7U.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-DwiLmRps.esm.js +0 -3165
- package/dist/chunks/pbr.fragment-DwiLmRps.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-CaKC7ZQw.esm.js +0 -214
- package/dist/chunks/pbr.vertex-CaKC7ZQw.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-D6L1V4oA.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-D6L1V4oA.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-NQJFxwsz.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-NQJFxwsz.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-zl-bgV9W.esm.js +0 -338
- package/dist/chunks/pbr.vertex-zl-bgV9W.esm.js.map +0 -1
- package/dist/chunks/postprocess.vertex-BGTUGDnQ.esm.min.js +0 -2
- package/dist/chunks/postprocess.vertex-BGTUGDnQ.esm.min.js.map +0 -1
- package/dist/chunks/postprocess.vertex-C-zpaK3h.esm.js +0 -20
- package/dist/chunks/postprocess.vertex-C-zpaK3h.esm.js.map +0 -1
- package/dist/chunks/rawTexture-BbbDtwVR.esm.min.js +0 -2
- package/dist/chunks/rawTexture-BbbDtwVR.esm.min.js.map +0 -1
- package/dist/chunks/rawTexture-C5rmF9gb.esm.js +0 -191
- package/dist/chunks/rawTexture-C5rmF9gb.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-CakmvodV.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-CakmvodV.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-CvYKqu39.esm.js +0 -17
- package/dist/chunks/rgbdDecode.fragment-CvYKqu39.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-DFkxPpRA.esm.js +0 -17
- package/dist/chunks/rgbdDecode.fragment-DFkxPpRA.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-YdIHAz7H.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-YdIHAz7H.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-C0fTyPK2.esm.js +0 -17
- package/dist/chunks/rgbdEncode.fragment-C0fTyPK2.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-CH0DT_u7.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-CH0DT_u7.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-DFMrcC9e.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-DFMrcC9e.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-xiVfo40O.esm.js +0 -17
- package/dist/chunks/rgbdEncode.fragment-xiVfo40O.esm.js.map +0 -1
- package/dist/chunks/splatFileLoader-BxCBgUIf.esm.js +0 -3947
- package/dist/chunks/splatFileLoader-BxCBgUIf.esm.js.map +0 -1
- package/dist/chunks/splatFileLoader-zwiLbtie.esm.min.js +0 -2
- package/dist/chunks/splatFileLoader-zwiLbtie.esm.min.js.map +0 -1
- package/dist/chunks/standardMaterial-CzgWV2aN.esm.js +0 -1805
- package/dist/chunks/standardMaterial-CzgWV2aN.esm.js.map +0 -1
- package/dist/chunks/standardMaterial-DjwIHmDD.esm.min.js +0 -2
- package/dist/chunks/standardMaterial-DjwIHmDD.esm.min.js.map +0 -1
- package/dist/chunks/stlFileLoader-BZ9DHTQ6.esm.js +0 -238
- package/dist/chunks/stlFileLoader-BZ9DHTQ6.esm.js.map +0 -1
- package/dist/chunks/stlFileLoader-Dc-CVC8a.esm.min.js +0 -2
- package/dist/chunks/stlFileLoader-Dc-CVC8a.esm.min.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-DYjWiRyu.esm.js +0 -349
- package/dist/chunks/tgaTextureLoader-DYjWiRyu.esm.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-x7GxoHtb.esm.min.js +0 -2
- package/dist/chunks/tgaTextureLoader-x7GxoHtb.esm.min.js.map +0 -1
- package/dist/chunks/thinEngine-5Pa6QbP6.esm.min.js +0 -2
- package/dist/chunks/thinEngine-5Pa6QbP6.esm.min.js.map +0 -1
- package/dist/chunks/thinEngine-B0O1HeNw.esm.js +0 -3812
- package/dist/chunks/thinEngine-B0O1HeNw.esm.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-BU_q_IZy.esm.min.js +0 -2
- package/dist/chunks/thinInstanceMesh-BU_q_IZy.esm.min.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-GmIu2FgY.esm.js +0 -314
- package/dist/chunks/thinInstanceMesh-GmIu2FgY.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-BI7UZNV0.esm.js +0 -522
- package/dist/chunks/vertexColorMixing-BI7UZNV0.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-CDHo-Mfr.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-CDHo-Mfr.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-D0neNeA0.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-D0neNeA0.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-DwnB7bJ5.esm.js +0 -412
- package/dist/chunks/vertexColorMixing-DwnB7bJ5.esm.js.map +0 -1
- package/dist/chunks/webgpuEngine-Bp2hPOvC.esm.min.js +0 -2
- package/dist/chunks/webgpuEngine-Bp2hPOvC.esm.min.js.map +0 -1
- package/dist/chunks/webgpuEngine-D3OXJ2yl.esm.js +0 -11502
- package/dist/chunks/webgpuEngine-D3OXJ2yl.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/docs/ViewerDefault.jpg +0 -0
- package/docs/ViewerParts.jpg +0 -0
- package/docs/ViewerSlots.jpg +0 -0
- package/docs/ViewerStyled.jpg +0 -0
- package/lib/index.d.ts +0 -534
- package/lib/index.js +0 -1939
- package/lib/index.js.map +0 -1
|
@@ -1,1253 +0,0 @@
|
|
|
1
|
-
import { am as __decorate, aW as serializeAsVector3, aq as serialize, aX as Light, a4 as Matrix, v as Vector3, aY as Axis, a6 as TmpVectors, aZ as Node, R as RegisterClass, t as Texture, an as serializeAsTexture, s as Color3, aP as unregisterGLTFExtension, aQ as registerGLTFExtension } from './index-B0XiE1FO.esm.js';
|
|
2
|
-
import { A as ArrayItem, G as GLTFLoader } from './glTFLoader-8YeGkftV.esm.js';
|
|
3
|
-
import './rawTexture-C5rmF9gb.esm.js';
|
|
4
|
-
import './assetContainer-Ch1I3rtz.esm.js';
|
|
5
|
-
import './glTFLoaderAnimation-BQZg3uE2.esm.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Base implementation IShadowLight
|
|
9
|
-
* It groups all the common behaviour in order to reduce duplication and better follow the DRY pattern.
|
|
10
|
-
*/
|
|
11
|
-
class ShadowLight extends Light {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this._needProjectionMatrixCompute = true;
|
|
15
|
-
this._viewMatrix = Matrix.Identity();
|
|
16
|
-
this._projectionMatrix = Matrix.Identity();
|
|
17
|
-
}
|
|
18
|
-
_setPosition(value) {
|
|
19
|
-
this._position = value;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Sets the position the shadow will be casted from. Also use as the light position for both
|
|
23
|
-
* point and spot lights.
|
|
24
|
-
*/
|
|
25
|
-
get position() {
|
|
26
|
-
return this._position;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Sets the position the shadow will be casted from. Also use as the light position for both
|
|
30
|
-
* point and spot lights.
|
|
31
|
-
*/
|
|
32
|
-
set position(value) {
|
|
33
|
-
this._setPosition(value);
|
|
34
|
-
}
|
|
35
|
-
_setDirection(value) {
|
|
36
|
-
this._direction = value;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* In 2d mode (needCube being false), gets the direction used to cast the shadow.
|
|
40
|
-
* Also use as the light direction on spot and directional lights.
|
|
41
|
-
*/
|
|
42
|
-
get direction() {
|
|
43
|
-
return this._direction;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* In 2d mode (needCube being false), sets the direction used to cast the shadow.
|
|
47
|
-
* Also use as the light direction on spot and directional lights.
|
|
48
|
-
*/
|
|
49
|
-
set direction(value) {
|
|
50
|
-
this._setDirection(value);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Gets the shadow projection clipping minimum z value.
|
|
54
|
-
*/
|
|
55
|
-
get shadowMinZ() {
|
|
56
|
-
return this._shadowMinZ;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Sets the shadow projection clipping minimum z value.
|
|
60
|
-
*/
|
|
61
|
-
set shadowMinZ(value) {
|
|
62
|
-
this._shadowMinZ = value;
|
|
63
|
-
this.forceProjectionMatrixCompute();
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Sets the shadow projection clipping maximum z value.
|
|
67
|
-
*/
|
|
68
|
-
get shadowMaxZ() {
|
|
69
|
-
return this._shadowMaxZ;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Gets the shadow projection clipping maximum z value.
|
|
73
|
-
*/
|
|
74
|
-
set shadowMaxZ(value) {
|
|
75
|
-
this._shadowMaxZ = value;
|
|
76
|
-
this.forceProjectionMatrixCompute();
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Computes the transformed information (transformedPosition and transformedDirection in World space) of the current light
|
|
80
|
-
* @returns true if the information has been computed, false if it does not need to (no parenting)
|
|
81
|
-
*/
|
|
82
|
-
computeTransformedInformation() {
|
|
83
|
-
if (this.parent && this.parent.getWorldMatrix) {
|
|
84
|
-
if (!this.transformedPosition) {
|
|
85
|
-
this.transformedPosition = Vector3.Zero();
|
|
86
|
-
}
|
|
87
|
-
Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition);
|
|
88
|
-
// In case the direction is present.
|
|
89
|
-
if (this.direction) {
|
|
90
|
-
if (!this.transformedDirection) {
|
|
91
|
-
this.transformedDirection = Vector3.Zero();
|
|
92
|
-
}
|
|
93
|
-
Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection);
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Return the depth scale used for the shadow map.
|
|
101
|
-
* @returns the depth scale.
|
|
102
|
-
*/
|
|
103
|
-
getDepthScale() {
|
|
104
|
-
return 50.0;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed.
|
|
108
|
-
* @param faceIndex The index of the face we are computed the direction to generate shadow
|
|
109
|
-
* @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
|
|
110
|
-
*/
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
112
|
-
getShadowDirection(faceIndex) {
|
|
113
|
-
return this.transformedDirection ? this.transformedDirection : this.direction;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* If computeTransformedInformation has been called, returns the ShadowLight absolute position in the world. Otherwise, returns the local position.
|
|
117
|
-
* @returns the position vector in world space
|
|
118
|
-
*/
|
|
119
|
-
getAbsolutePosition() {
|
|
120
|
-
return this.transformedPosition ? this.transformedPosition : this.position;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Sets the ShadowLight direction toward the passed target.
|
|
124
|
-
* @param target The point to target in local space
|
|
125
|
-
* @returns the updated ShadowLight direction
|
|
126
|
-
*/
|
|
127
|
-
setDirectionToTarget(target) {
|
|
128
|
-
this.direction = Vector3.Normalize(target.subtract(this.position));
|
|
129
|
-
return this.direction;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Returns the light rotation in euler definition.
|
|
133
|
-
* @returns the x y z rotation in local space.
|
|
134
|
-
*/
|
|
135
|
-
getRotation() {
|
|
136
|
-
this.direction.normalize();
|
|
137
|
-
const xaxis = Vector3.Cross(this.direction, Axis.Y);
|
|
138
|
-
const yaxis = Vector3.Cross(xaxis, this.direction);
|
|
139
|
-
return Vector3.RotationFromAxis(xaxis, yaxis, this.direction);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Returns whether or not the shadow generation require a cube texture or a 2d texture.
|
|
143
|
-
* @returns true if a cube texture needs to be use
|
|
144
|
-
*/
|
|
145
|
-
needCube() {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Detects if the projection matrix requires to be recomputed this frame.
|
|
150
|
-
* @returns true if it requires to be recomputed otherwise, false.
|
|
151
|
-
*/
|
|
152
|
-
needProjectionMatrixCompute() {
|
|
153
|
-
return this._needProjectionMatrixCompute;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.
|
|
157
|
-
*/
|
|
158
|
-
forceProjectionMatrixCompute() {
|
|
159
|
-
this._needProjectionMatrixCompute = true;
|
|
160
|
-
}
|
|
161
|
-
/** @internal */
|
|
162
|
-
_initCache() {
|
|
163
|
-
super._initCache();
|
|
164
|
-
this._cache.position = Vector3.Zero();
|
|
165
|
-
}
|
|
166
|
-
/** @internal */
|
|
167
|
-
_isSynchronized() {
|
|
168
|
-
if (!this._cache.position.equals(this.position)) {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Computes the world matrix of the node
|
|
175
|
-
* @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
|
|
176
|
-
* @returns the world matrix
|
|
177
|
-
*/
|
|
178
|
-
computeWorldMatrix(force) {
|
|
179
|
-
if (!force && this.isSynchronized()) {
|
|
180
|
-
this._currentRenderId = this.getScene().getRenderId();
|
|
181
|
-
return this._worldMatrix;
|
|
182
|
-
}
|
|
183
|
-
this._updateCache();
|
|
184
|
-
this._cache.position.copyFrom(this.position);
|
|
185
|
-
if (!this._worldMatrix) {
|
|
186
|
-
this._worldMatrix = Matrix.Identity();
|
|
187
|
-
}
|
|
188
|
-
Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix);
|
|
189
|
-
if (this.parent && this.parent.getWorldMatrix) {
|
|
190
|
-
this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix);
|
|
191
|
-
this._markSyncedWithParent();
|
|
192
|
-
}
|
|
193
|
-
// Cache the determinant
|
|
194
|
-
this._worldMatrixDeterminantIsDirty = true;
|
|
195
|
-
return this._worldMatrix;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Gets the minZ used for shadow according to both the scene and the light.
|
|
199
|
-
* @param activeCamera The camera we are returning the min for
|
|
200
|
-
* @returns the depth min z
|
|
201
|
-
*/
|
|
202
|
-
getDepthMinZ(activeCamera) {
|
|
203
|
-
return this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Gets the maxZ used for shadow according to both the scene and the light.
|
|
207
|
-
* @param activeCamera The camera we are returning the max for
|
|
208
|
-
* @returns the depth max z
|
|
209
|
-
*/
|
|
210
|
-
getDepthMaxZ(activeCamera) {
|
|
211
|
-
return this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Sets the shadow projection matrix in parameter to the generated projection matrix.
|
|
215
|
-
* @param matrix The matrix to updated with the projection information
|
|
216
|
-
* @param viewMatrix The transform matrix of the light
|
|
217
|
-
* @param renderList The list of mesh to render in the map
|
|
218
|
-
* @returns The current light
|
|
219
|
-
*/
|
|
220
|
-
setShadowProjectionMatrix(matrix, viewMatrix, renderList) {
|
|
221
|
-
if (this.customProjectionMatrixBuilder) {
|
|
222
|
-
this.customProjectionMatrixBuilder(viewMatrix, renderList, matrix);
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
this._setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList);
|
|
226
|
-
}
|
|
227
|
-
return this;
|
|
228
|
-
}
|
|
229
|
-
/** @internal */
|
|
230
|
-
_syncParentEnabledState() {
|
|
231
|
-
super._syncParentEnabledState();
|
|
232
|
-
if (!this.parent || !this.parent.getWorldMatrix) {
|
|
233
|
-
this.transformedPosition = null;
|
|
234
|
-
this.transformedDirection = null;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Returns the view matrix.
|
|
239
|
-
* @param faceIndex The index of the face for which we want to extract the view matrix. Only used for point light types.
|
|
240
|
-
* @returns The view matrix. Can be null, if a view matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
|
|
241
|
-
*/
|
|
242
|
-
getViewMatrix(faceIndex) {
|
|
243
|
-
const lightDirection = TmpVectors.Vector3[0];
|
|
244
|
-
let lightPosition = this.position;
|
|
245
|
-
if (this.computeTransformedInformation()) {
|
|
246
|
-
lightPosition = this.transformedPosition;
|
|
247
|
-
}
|
|
248
|
-
Vector3.NormalizeToRef(this.getShadowDirection(faceIndex), lightDirection);
|
|
249
|
-
if (Math.abs(Vector3.Dot(lightDirection, Vector3.Up())) === 1.0) {
|
|
250
|
-
lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light
|
|
251
|
-
}
|
|
252
|
-
const lightTarget = TmpVectors.Vector3[1];
|
|
253
|
-
lightPosition.addToRef(lightDirection, lightTarget);
|
|
254
|
-
Matrix.LookAtLHToRef(lightPosition, lightTarget, Vector3.Up(), this._viewMatrix);
|
|
255
|
-
return this._viewMatrix;
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Returns the projection matrix.
|
|
259
|
-
* Note that viewMatrix and renderList are optional and are only used by lights that calculate the projection matrix from a list of meshes (e.g. directional lights with automatic extents calculation).
|
|
260
|
-
* @param viewMatrix The view transform matrix of the light (optional).
|
|
261
|
-
* @param renderList The list of meshes to take into account when calculating the projection matrix (optional).
|
|
262
|
-
* @returns The projection matrix. Can be null, if a projection matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
|
|
263
|
-
*/
|
|
264
|
-
getProjectionMatrix(viewMatrix, renderList) {
|
|
265
|
-
this.setShadowProjectionMatrix(this._projectionMatrix, viewMatrix ?? this._viewMatrix, renderList ?? []);
|
|
266
|
-
return this._projectionMatrix;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
__decorate([
|
|
270
|
-
serializeAsVector3()
|
|
271
|
-
], ShadowLight.prototype, "position", null);
|
|
272
|
-
__decorate([
|
|
273
|
-
serializeAsVector3()
|
|
274
|
-
], ShadowLight.prototype, "direction", null);
|
|
275
|
-
__decorate([
|
|
276
|
-
serialize()
|
|
277
|
-
], ShadowLight.prototype, "shadowMinZ", null);
|
|
278
|
-
__decorate([
|
|
279
|
-
serialize()
|
|
280
|
-
], ShadowLight.prototype, "shadowMaxZ", null);
|
|
281
|
-
|
|
282
|
-
Node.AddNodeConstructor("Light_Type_1", (name, scene) => {
|
|
283
|
-
return () => new DirectionalLight(name, Vector3.Zero(), scene);
|
|
284
|
-
});
|
|
285
|
-
/**
|
|
286
|
-
* A directional light is defined by a direction (what a surprise!).
|
|
287
|
-
* The light is emitted from everywhere in the specified direction, and has an infinite range.
|
|
288
|
-
* An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.
|
|
289
|
-
* Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
290
|
-
*/
|
|
291
|
-
class DirectionalLight extends ShadowLight {
|
|
292
|
-
/**
|
|
293
|
-
* Fix frustum size for the shadow generation. This is disabled if the value is 0.
|
|
294
|
-
*/
|
|
295
|
-
get shadowFrustumSize() {
|
|
296
|
-
return this._shadowFrustumSize;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Specifies a fix frustum size for the shadow generation.
|
|
300
|
-
*/
|
|
301
|
-
set shadowFrustumSize(value) {
|
|
302
|
-
this._shadowFrustumSize = value;
|
|
303
|
-
this.forceProjectionMatrixCompute();
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Gets the shadow projection scale against the optimal computed one.
|
|
307
|
-
* 0.1 by default which means that the projection window is increase by 10% from the optimal size.
|
|
308
|
-
* This does not impact in fixed frustum size (shadowFrustumSize being set)
|
|
309
|
-
*/
|
|
310
|
-
get shadowOrthoScale() {
|
|
311
|
-
return this._shadowOrthoScale;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Sets the shadow projection scale against the optimal computed one.
|
|
315
|
-
* 0.1 by default which means that the projection window is increase by 10% from the optimal size.
|
|
316
|
-
* This does not impact in fixed frustum size (shadowFrustumSize being set)
|
|
317
|
-
*/
|
|
318
|
-
set shadowOrthoScale(value) {
|
|
319
|
-
this._shadowOrthoScale = value;
|
|
320
|
-
this.forceProjectionMatrixCompute();
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Gets or sets the orthoLeft property used to build the light frustum
|
|
324
|
-
*/
|
|
325
|
-
get orthoLeft() {
|
|
326
|
-
return this._orthoLeft;
|
|
327
|
-
}
|
|
328
|
-
set orthoLeft(left) {
|
|
329
|
-
this._orthoLeft = left;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Gets or sets the orthoRight property used to build the light frustum
|
|
333
|
-
*/
|
|
334
|
-
get orthoRight() {
|
|
335
|
-
return this._orthoRight;
|
|
336
|
-
}
|
|
337
|
-
set orthoRight(right) {
|
|
338
|
-
this._orthoRight = right;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Gets or sets the orthoTop property used to build the light frustum
|
|
342
|
-
*/
|
|
343
|
-
get orthoTop() {
|
|
344
|
-
return this._orthoTop;
|
|
345
|
-
}
|
|
346
|
-
set orthoTop(top) {
|
|
347
|
-
this._orthoTop = top;
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Gets or sets the orthoBottom property used to build the light frustum
|
|
351
|
-
*/
|
|
352
|
-
get orthoBottom() {
|
|
353
|
-
return this._orthoBottom;
|
|
354
|
-
}
|
|
355
|
-
set orthoBottom(bottom) {
|
|
356
|
-
this._orthoBottom = bottom;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
|
|
360
|
-
* The directional light is emitted from everywhere in the given direction.
|
|
361
|
-
* It can cast shadows.
|
|
362
|
-
* Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
363
|
-
* @param name The friendly name of the light
|
|
364
|
-
* @param direction The direction of the light
|
|
365
|
-
* @param scene The scene the light belongs to
|
|
366
|
-
*/
|
|
367
|
-
constructor(name, direction, scene) {
|
|
368
|
-
super(name, scene);
|
|
369
|
-
this._shadowFrustumSize = 0;
|
|
370
|
-
this._shadowOrthoScale = 0.1;
|
|
371
|
-
/**
|
|
372
|
-
* Automatically compute the projection matrix to best fit (including all the casters)
|
|
373
|
-
* on each frame.
|
|
374
|
-
*/
|
|
375
|
-
this.autoUpdateExtends = true;
|
|
376
|
-
/**
|
|
377
|
-
* Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters)
|
|
378
|
-
* on each frame. autoUpdateExtends must be set to true for this to work
|
|
379
|
-
*/
|
|
380
|
-
this.autoCalcShadowZBounds = false;
|
|
381
|
-
// Cache
|
|
382
|
-
this._orthoLeft = Number.MAX_VALUE;
|
|
383
|
-
this._orthoRight = Number.MIN_VALUE;
|
|
384
|
-
this._orthoTop = Number.MIN_VALUE;
|
|
385
|
-
this._orthoBottom = Number.MAX_VALUE;
|
|
386
|
-
this.position = direction.scale(-1.0);
|
|
387
|
-
this.direction = direction;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Returns the string "DirectionalLight".
|
|
391
|
-
* @returns The class name
|
|
392
|
-
*/
|
|
393
|
-
getClassName() {
|
|
394
|
-
return "DirectionalLight";
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Returns the integer 1.
|
|
398
|
-
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
399
|
-
*/
|
|
400
|
-
getTypeID() {
|
|
401
|
-
return Light.LIGHTTYPEID_DIRECTIONALLIGHT;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
405
|
-
* Returns the DirectionalLight Shadow projection matrix.
|
|
406
|
-
* @param matrix
|
|
407
|
-
* @param viewMatrix
|
|
408
|
-
* @param renderList
|
|
409
|
-
*/
|
|
410
|
-
_setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
|
|
411
|
-
if (this.shadowFrustumSize > 0) {
|
|
412
|
-
this._setDefaultFixedFrustumShadowProjectionMatrix(matrix);
|
|
413
|
-
}
|
|
414
|
-
else {
|
|
415
|
-
this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
420
|
-
* Returns the DirectionalLight Shadow projection matrix.
|
|
421
|
-
* @param matrix
|
|
422
|
-
*/
|
|
423
|
-
_setDefaultFixedFrustumShadowProjectionMatrix(matrix) {
|
|
424
|
-
const activeCamera = this.getScene().activeCamera;
|
|
425
|
-
if (!activeCamera) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
Matrix.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ, this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
432
|
-
* Returns the DirectionalLight Shadow projection matrix.
|
|
433
|
-
* @param matrix
|
|
434
|
-
* @param viewMatrix
|
|
435
|
-
* @param renderList
|
|
436
|
-
*/
|
|
437
|
-
_setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList) {
|
|
438
|
-
const activeCamera = this.getScene().activeCamera;
|
|
439
|
-
if (!activeCamera) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
// Check extends
|
|
443
|
-
if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {
|
|
444
|
-
const tempVector3 = Vector3.Zero();
|
|
445
|
-
this._orthoLeft = Number.MAX_VALUE;
|
|
446
|
-
this._orthoRight = -Number.MAX_VALUE;
|
|
447
|
-
this._orthoTop = -Number.MAX_VALUE;
|
|
448
|
-
this._orthoBottom = Number.MAX_VALUE;
|
|
449
|
-
let shadowMinZ = Number.MAX_VALUE;
|
|
450
|
-
let shadowMaxZ = -Number.MAX_VALUE;
|
|
451
|
-
for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {
|
|
452
|
-
const mesh = renderList[meshIndex];
|
|
453
|
-
if (!mesh) {
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
const boundingInfo = mesh.getBoundingInfo();
|
|
457
|
-
const boundingBox = boundingInfo.boundingBox;
|
|
458
|
-
for (let index = 0; index < boundingBox.vectorsWorld.length; index++) {
|
|
459
|
-
Vector3.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3);
|
|
460
|
-
if (tempVector3.x < this._orthoLeft) {
|
|
461
|
-
this._orthoLeft = tempVector3.x;
|
|
462
|
-
}
|
|
463
|
-
if (tempVector3.y < this._orthoBottom) {
|
|
464
|
-
this._orthoBottom = tempVector3.y;
|
|
465
|
-
}
|
|
466
|
-
if (tempVector3.x > this._orthoRight) {
|
|
467
|
-
this._orthoRight = tempVector3.x;
|
|
468
|
-
}
|
|
469
|
-
if (tempVector3.y > this._orthoTop) {
|
|
470
|
-
this._orthoTop = tempVector3.y;
|
|
471
|
-
}
|
|
472
|
-
if (this.autoCalcShadowZBounds) {
|
|
473
|
-
if (tempVector3.z < shadowMinZ) {
|
|
474
|
-
shadowMinZ = tempVector3.z;
|
|
475
|
-
}
|
|
476
|
-
if (tempVector3.z > shadowMaxZ) {
|
|
477
|
-
shadowMaxZ = tempVector3.z;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (this.autoCalcShadowZBounds) {
|
|
483
|
-
this._shadowMinZ = shadowMinZ;
|
|
484
|
-
this._shadowMaxZ = shadowMaxZ;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
const xOffset = this._orthoRight - this._orthoLeft;
|
|
488
|
-
const yOffset = this._orthoTop - this._orthoBottom;
|
|
489
|
-
const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
|
|
490
|
-
const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
|
|
491
|
-
const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
|
|
492
|
-
Matrix.OrthoOffCenterLHToRef(this._orthoLeft - xOffset * this.shadowOrthoScale, this._orthoRight + xOffset * this.shadowOrthoScale, this._orthoBottom - yOffset * this.shadowOrthoScale, this._orthoTop + yOffset * this.shadowOrthoScale, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);
|
|
493
|
-
}
|
|
494
|
-
_buildUniformLayout() {
|
|
495
|
-
this._uniformBuffer.addUniform("vLightData", 4);
|
|
496
|
-
this._uniformBuffer.addUniform("vLightDiffuse", 4);
|
|
497
|
-
this._uniformBuffer.addUniform("vLightSpecular", 4);
|
|
498
|
-
this._uniformBuffer.addUniform("shadowsInfo", 3);
|
|
499
|
-
this._uniformBuffer.addUniform("depthValues", 2);
|
|
500
|
-
this._uniformBuffer.create();
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
|
|
504
|
-
* @param effect The effect to update
|
|
505
|
-
* @param lightIndex The index of the light in the effect to update
|
|
506
|
-
* @returns The directional light
|
|
507
|
-
*/
|
|
508
|
-
transferToEffect(effect, lightIndex) {
|
|
509
|
-
if (this.computeTransformedInformation()) {
|
|
510
|
-
this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex);
|
|
511
|
-
return this;
|
|
512
|
-
}
|
|
513
|
-
this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex);
|
|
514
|
-
return this;
|
|
515
|
-
}
|
|
516
|
-
transferToNodeMaterialEffect(effect, lightDataUniformName) {
|
|
517
|
-
if (this.computeTransformedInformation()) {
|
|
518
|
-
effect.setFloat3(lightDataUniformName, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z);
|
|
519
|
-
return this;
|
|
520
|
-
}
|
|
521
|
-
effect.setFloat3(lightDataUniformName, this.direction.x, this.direction.y, this.direction.z);
|
|
522
|
-
return this;
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Gets the minZ used for shadow according to both the scene and the light.
|
|
526
|
-
*
|
|
527
|
-
* Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
|
|
528
|
-
* -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
|
|
529
|
-
* (when not using reverse depth buffer / NDC half Z range)
|
|
530
|
-
* @param activeCamera The camera we are returning the min for
|
|
531
|
-
* @returns the depth min z
|
|
532
|
-
*/
|
|
533
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
534
|
-
getDepthMinZ(activeCamera) {
|
|
535
|
-
const engine = this._scene.getEngine();
|
|
536
|
-
return !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Gets the maxZ used for shadow according to both the scene and the light.
|
|
540
|
-
*
|
|
541
|
-
* Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
|
|
542
|
-
* -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
|
|
543
|
-
* (when not using reverse depth buffer / NDC half Z range)
|
|
544
|
-
* @param activeCamera The camera we are returning the max for
|
|
545
|
-
* @returns the depth max z
|
|
546
|
-
*/
|
|
547
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
548
|
-
getDepthMaxZ(activeCamera) {
|
|
549
|
-
const engine = this._scene.getEngine();
|
|
550
|
-
return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* Prepares the list of defines specific to the light type.
|
|
554
|
-
* @param defines the list of defines
|
|
555
|
-
* @param lightIndex defines the index of the light for the effect
|
|
556
|
-
*/
|
|
557
|
-
prepareLightSpecificDefines(defines, lightIndex) {
|
|
558
|
-
defines["DIRLIGHT" + lightIndex] = true;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
__decorate([
|
|
562
|
-
serialize()
|
|
563
|
-
], DirectionalLight.prototype, "shadowFrustumSize", null);
|
|
564
|
-
__decorate([
|
|
565
|
-
serialize()
|
|
566
|
-
], DirectionalLight.prototype, "shadowOrthoScale", null);
|
|
567
|
-
__decorate([
|
|
568
|
-
serialize()
|
|
569
|
-
], DirectionalLight.prototype, "autoUpdateExtends", void 0);
|
|
570
|
-
__decorate([
|
|
571
|
-
serialize()
|
|
572
|
-
], DirectionalLight.prototype, "autoCalcShadowZBounds", void 0);
|
|
573
|
-
__decorate([
|
|
574
|
-
serialize("orthoLeft")
|
|
575
|
-
], DirectionalLight.prototype, "_orthoLeft", void 0);
|
|
576
|
-
__decorate([
|
|
577
|
-
serialize("orthoRight")
|
|
578
|
-
], DirectionalLight.prototype, "_orthoRight", void 0);
|
|
579
|
-
__decorate([
|
|
580
|
-
serialize("orthoTop")
|
|
581
|
-
], DirectionalLight.prototype, "_orthoTop", void 0);
|
|
582
|
-
__decorate([
|
|
583
|
-
serialize("orthoBottom")
|
|
584
|
-
], DirectionalLight.prototype, "_orthoBottom", void 0);
|
|
585
|
-
// Register Class Name
|
|
586
|
-
RegisterClass("BABYLON.DirectionalLight", DirectionalLight);
|
|
587
|
-
|
|
588
|
-
Node.AddNodeConstructor("Light_Type_0", (name, scene) => {
|
|
589
|
-
return () => new PointLight(name, Vector3.Zero(), scene);
|
|
590
|
-
});
|
|
591
|
-
/**
|
|
592
|
-
* A point light is a light defined by an unique point in world space.
|
|
593
|
-
* The light is emitted in every direction from this point.
|
|
594
|
-
* A good example of a point light is a standard light bulb.
|
|
595
|
-
* Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
596
|
-
*/
|
|
597
|
-
class PointLight extends ShadowLight {
|
|
598
|
-
/**
|
|
599
|
-
* Getter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
|
|
600
|
-
* This specifies what angle the shadow will use to be created.
|
|
601
|
-
*
|
|
602
|
-
* It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
|
|
603
|
-
*/
|
|
604
|
-
get shadowAngle() {
|
|
605
|
-
return this._shadowAngle;
|
|
606
|
-
}
|
|
607
|
-
/**
|
|
608
|
-
* Setter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
|
|
609
|
-
* This specifies what angle the shadow will use to be created.
|
|
610
|
-
*
|
|
611
|
-
* It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
|
|
612
|
-
*/
|
|
613
|
-
set shadowAngle(value) {
|
|
614
|
-
this._shadowAngle = value;
|
|
615
|
-
this.forceProjectionMatrixCompute();
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* Gets the direction if it has been set.
|
|
619
|
-
* In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
|
|
620
|
-
*/
|
|
621
|
-
get direction() {
|
|
622
|
-
return this._direction;
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
|
|
626
|
-
*/
|
|
627
|
-
set direction(value) {
|
|
628
|
-
const previousNeedCube = this.needCube();
|
|
629
|
-
this._direction = value;
|
|
630
|
-
if (this.needCube() !== previousNeedCube && this._shadowGenerators) {
|
|
631
|
-
const iterator = this._shadowGenerators.values();
|
|
632
|
-
for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
|
|
633
|
-
const shadowGenerator = key.value;
|
|
634
|
-
shadowGenerator.recreateShadowMap();
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* Creates a PointLight object from the passed name and position (Vector3) and adds it in the scene.
|
|
640
|
-
* A PointLight emits the light in every direction.
|
|
641
|
-
* It can cast shadows.
|
|
642
|
-
* If the scene camera is already defined and you want to set your PointLight at the camera position, just set it :
|
|
643
|
-
* ```javascript
|
|
644
|
-
* var pointLight = new PointLight("pl", camera.position, scene);
|
|
645
|
-
* ```
|
|
646
|
-
* Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
647
|
-
* @param name The light friendly name
|
|
648
|
-
* @param position The position of the point light in the scene
|
|
649
|
-
* @param scene The scene the lights belongs to
|
|
650
|
-
*/
|
|
651
|
-
constructor(name, position, scene) {
|
|
652
|
-
super(name, scene);
|
|
653
|
-
this._shadowAngle = Math.PI / 2;
|
|
654
|
-
this.position = position;
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Returns the string "PointLight"
|
|
658
|
-
* @returns the class name
|
|
659
|
-
*/
|
|
660
|
-
getClassName() {
|
|
661
|
-
return "PointLight";
|
|
662
|
-
}
|
|
663
|
-
/**
|
|
664
|
-
* Returns the integer 0.
|
|
665
|
-
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
666
|
-
*/
|
|
667
|
-
getTypeID() {
|
|
668
|
-
return Light.LIGHTTYPEID_POINTLIGHT;
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* Specifies whether or not the shadowmap should be a cube texture.
|
|
672
|
-
* @returns true if the shadowmap needs to be a cube texture.
|
|
673
|
-
*/
|
|
674
|
-
needCube() {
|
|
675
|
-
return !this.direction;
|
|
676
|
-
}
|
|
677
|
-
/**
|
|
678
|
-
* Returns a new Vector3 aligned with the PointLight cube system according to the passed cube face index (integer).
|
|
679
|
-
* @param faceIndex The index of the face we are computed the direction to generate shadow
|
|
680
|
-
* @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
|
|
681
|
-
*/
|
|
682
|
-
getShadowDirection(faceIndex) {
|
|
683
|
-
if (this.direction) {
|
|
684
|
-
return super.getShadowDirection(faceIndex);
|
|
685
|
-
}
|
|
686
|
-
else {
|
|
687
|
-
switch (faceIndex) {
|
|
688
|
-
case 0:
|
|
689
|
-
return new Vector3(1.0, 0.0, 0.0);
|
|
690
|
-
case 1:
|
|
691
|
-
return new Vector3(-1.0, 0.0, 0.0);
|
|
692
|
-
case 2:
|
|
693
|
-
return new Vector3(0.0, -1.0, 0.0);
|
|
694
|
-
case 3:
|
|
695
|
-
return new Vector3(0.0, 1.0, 0.0);
|
|
696
|
-
case 4:
|
|
697
|
-
return new Vector3(0.0, 0.0, 1.0);
|
|
698
|
-
case 5:
|
|
699
|
-
return new Vector3(0.0, 0.0, -1.0);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
return Vector3.Zero();
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings :
|
|
706
|
-
* - fov = PI / 2
|
|
707
|
-
* - aspect ratio : 1.0
|
|
708
|
-
* - z-near and far equal to the active camera minZ and maxZ.
|
|
709
|
-
* Returns the PointLight.
|
|
710
|
-
* @param matrix
|
|
711
|
-
* @param viewMatrix
|
|
712
|
-
* @param renderList
|
|
713
|
-
*/
|
|
714
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
715
|
-
_setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
|
|
716
|
-
const activeCamera = this.getScene().activeCamera;
|
|
717
|
-
if (!activeCamera) {
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
|
|
721
|
-
const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
|
|
722
|
-
const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
|
|
723
|
-
Matrix.PerspectiveFovLHToRef(this.shadowAngle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);
|
|
724
|
-
}
|
|
725
|
-
_buildUniformLayout() {
|
|
726
|
-
this._uniformBuffer.addUniform("vLightData", 4);
|
|
727
|
-
this._uniformBuffer.addUniform("vLightDiffuse", 4);
|
|
728
|
-
this._uniformBuffer.addUniform("vLightSpecular", 4);
|
|
729
|
-
this._uniformBuffer.addUniform("vLightFalloff", 4);
|
|
730
|
-
this._uniformBuffer.addUniform("shadowsInfo", 3);
|
|
731
|
-
this._uniformBuffer.addUniform("depthValues", 2);
|
|
732
|
-
this._uniformBuffer.create();
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).
|
|
736
|
-
* @param effect The effect to update
|
|
737
|
-
* @param lightIndex The index of the light in the effect to update
|
|
738
|
-
* @returns The point light
|
|
739
|
-
*/
|
|
740
|
-
transferToEffect(effect, lightIndex) {
|
|
741
|
-
if (this.computeTransformedInformation()) {
|
|
742
|
-
this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0.0, lightIndex);
|
|
743
|
-
}
|
|
744
|
-
else {
|
|
745
|
-
this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, lightIndex);
|
|
746
|
-
}
|
|
747
|
-
this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, lightIndex);
|
|
748
|
-
return this;
|
|
749
|
-
}
|
|
750
|
-
transferToNodeMaterialEffect(effect, lightDataUniformName) {
|
|
751
|
-
if (this.computeTransformedInformation()) {
|
|
752
|
-
effect.setFloat3(lightDataUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z);
|
|
753
|
-
}
|
|
754
|
-
else {
|
|
755
|
-
effect.setFloat3(lightDataUniformName, this.position.x, this.position.y, this.position.z);
|
|
756
|
-
}
|
|
757
|
-
return this;
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* Prepares the list of defines specific to the light type.
|
|
761
|
-
* @param defines the list of defines
|
|
762
|
-
* @param lightIndex defines the index of the light for the effect
|
|
763
|
-
*/
|
|
764
|
-
prepareLightSpecificDefines(defines, lightIndex) {
|
|
765
|
-
defines["POINTLIGHT" + lightIndex] = true;
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
__decorate([
|
|
769
|
-
serialize()
|
|
770
|
-
], PointLight.prototype, "shadowAngle", null);
|
|
771
|
-
// Register Class Name
|
|
772
|
-
RegisterClass("BABYLON.PointLight", PointLight);
|
|
773
|
-
|
|
774
|
-
Node.AddNodeConstructor("Light_Type_2", (name, scene) => {
|
|
775
|
-
return () => new SpotLight(name, Vector3.Zero(), Vector3.Zero(), 0, 0, scene);
|
|
776
|
-
});
|
|
777
|
-
/**
|
|
778
|
-
* A spot light is defined by a position, a direction, an angle, and an exponent.
|
|
779
|
-
* These values define a cone of light starting from the position, emitting toward the direction.
|
|
780
|
-
* The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,
|
|
781
|
-
* and the exponent defines the speed of the decay of the light with distance (reach).
|
|
782
|
-
* Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
783
|
-
*/
|
|
784
|
-
class SpotLight extends ShadowLight {
|
|
785
|
-
/**
|
|
786
|
-
* Gets the cone angle of the spot light in Radians.
|
|
787
|
-
*/
|
|
788
|
-
get angle() {
|
|
789
|
-
return this._angle;
|
|
790
|
-
}
|
|
791
|
-
/**
|
|
792
|
-
* Sets the cone angle of the spot light in Radians.
|
|
793
|
-
*/
|
|
794
|
-
set angle(value) {
|
|
795
|
-
this._angle = value;
|
|
796
|
-
this._cosHalfAngle = Math.cos(value * 0.5);
|
|
797
|
-
this._projectionTextureProjectionLightDirty = true;
|
|
798
|
-
this.forceProjectionMatrixCompute();
|
|
799
|
-
this._computeAngleValues();
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* Only used in gltf falloff mode, this defines the angle where
|
|
803
|
-
* the directional falloff will start before cutting at angle which could be seen
|
|
804
|
-
* as outer angle.
|
|
805
|
-
*/
|
|
806
|
-
get innerAngle() {
|
|
807
|
-
return this._innerAngle;
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* Only used in gltf falloff mode, this defines the angle where
|
|
811
|
-
* the directional falloff will start before cutting at angle which could be seen
|
|
812
|
-
* as outer angle.
|
|
813
|
-
*/
|
|
814
|
-
set innerAngle(value) {
|
|
815
|
-
this._innerAngle = value;
|
|
816
|
-
this._computeAngleValues();
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Allows scaling the angle of the light for shadow generation only.
|
|
820
|
-
*/
|
|
821
|
-
get shadowAngleScale() {
|
|
822
|
-
return this._shadowAngleScale;
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Allows scaling the angle of the light for shadow generation only.
|
|
826
|
-
*/
|
|
827
|
-
set shadowAngleScale(value) {
|
|
828
|
-
this._shadowAngleScale = value;
|
|
829
|
-
this.forceProjectionMatrixCompute();
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* Allows reading the projection texture
|
|
833
|
-
*/
|
|
834
|
-
get projectionTextureMatrix() {
|
|
835
|
-
return this._projectionTextureMatrix;
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Gets the near clip of the Spotlight for texture projection.
|
|
839
|
-
*/
|
|
840
|
-
get projectionTextureLightNear() {
|
|
841
|
-
return this._projectionTextureLightNear;
|
|
842
|
-
}
|
|
843
|
-
/**
|
|
844
|
-
* Sets the near clip of the Spotlight for texture projection.
|
|
845
|
-
*/
|
|
846
|
-
set projectionTextureLightNear(value) {
|
|
847
|
-
this._projectionTextureLightNear = value;
|
|
848
|
-
this._projectionTextureProjectionLightDirty = true;
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Gets the far clip of the Spotlight for texture projection.
|
|
852
|
-
*/
|
|
853
|
-
get projectionTextureLightFar() {
|
|
854
|
-
return this._projectionTextureLightFar;
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* Sets the far clip of the Spotlight for texture projection.
|
|
858
|
-
*/
|
|
859
|
-
set projectionTextureLightFar(value) {
|
|
860
|
-
this._projectionTextureLightFar = value;
|
|
861
|
-
this._projectionTextureProjectionLightDirty = true;
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* Gets the Up vector of the Spotlight for texture projection.
|
|
865
|
-
*/
|
|
866
|
-
get projectionTextureUpDirection() {
|
|
867
|
-
return this._projectionTextureUpDirection;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Sets the Up vector of the Spotlight for texture projection.
|
|
871
|
-
*/
|
|
872
|
-
set projectionTextureUpDirection(value) {
|
|
873
|
-
this._projectionTextureUpDirection = value;
|
|
874
|
-
this._projectionTextureProjectionLightDirty = true;
|
|
875
|
-
}
|
|
876
|
-
/**
|
|
877
|
-
* Gets the projection texture of the light.
|
|
878
|
-
*/
|
|
879
|
-
get projectionTexture() {
|
|
880
|
-
return this._projectionTexture;
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Sets the projection texture of the light.
|
|
884
|
-
*/
|
|
885
|
-
set projectionTexture(value) {
|
|
886
|
-
if (this._projectionTexture === value) {
|
|
887
|
-
return;
|
|
888
|
-
}
|
|
889
|
-
this._projectionTexture = value;
|
|
890
|
-
this._projectionTextureDirty = true;
|
|
891
|
-
if (this._projectionTexture && !this._projectionTexture.isReady()) {
|
|
892
|
-
if (SpotLight._IsProceduralTexture(this._projectionTexture)) {
|
|
893
|
-
this._projectionTexture.getEffect().executeWhenCompiled(() => {
|
|
894
|
-
this._markMeshesAsLightDirty();
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
else if (SpotLight._IsTexture(this._projectionTexture)) {
|
|
898
|
-
this._projectionTexture.onLoadObservable.addOnce(() => {
|
|
899
|
-
this._markMeshesAsLightDirty();
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
static _IsProceduralTexture(texture) {
|
|
905
|
-
return texture.onGeneratedObservable !== undefined;
|
|
906
|
-
}
|
|
907
|
-
static _IsTexture(texture) {
|
|
908
|
-
return texture.onLoadObservable !== undefined;
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
* Gets or sets the light projection matrix as used by the projection texture
|
|
912
|
-
*/
|
|
913
|
-
get projectionTextureProjectionLightMatrix() {
|
|
914
|
-
return this._projectionTextureProjectionLightMatrix;
|
|
915
|
-
}
|
|
916
|
-
set projectionTextureProjectionLightMatrix(projection) {
|
|
917
|
-
this._projectionTextureProjectionLightMatrix = projection;
|
|
918
|
-
this._projectionTextureProjectionLightDirty = false;
|
|
919
|
-
this._projectionTextureDirty = true;
|
|
920
|
-
}
|
|
921
|
-
/**
|
|
922
|
-
* Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.
|
|
923
|
-
* It can cast shadows.
|
|
924
|
-
* Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
925
|
-
* @param name The light friendly name
|
|
926
|
-
* @param position The position of the spot light in the scene
|
|
927
|
-
* @param direction The direction of the light in the scene
|
|
928
|
-
* @param angle The cone angle of the light in Radians
|
|
929
|
-
* @param exponent The light decay speed with the distance from the emission spot
|
|
930
|
-
* @param scene The scene the lights belongs to
|
|
931
|
-
*/
|
|
932
|
-
constructor(name, position, direction, angle, exponent, scene) {
|
|
933
|
-
super(name, scene);
|
|
934
|
-
this._innerAngle = 0;
|
|
935
|
-
this._projectionTextureMatrix = Matrix.Zero();
|
|
936
|
-
this._projectionTextureLightNear = 1e-6;
|
|
937
|
-
this._projectionTextureLightFar = 1000.0;
|
|
938
|
-
this._projectionTextureUpDirection = Vector3.Up();
|
|
939
|
-
this._projectionTextureViewLightDirty = true;
|
|
940
|
-
this._projectionTextureProjectionLightDirty = true;
|
|
941
|
-
this._projectionTextureDirty = true;
|
|
942
|
-
this._projectionTextureViewTargetVector = Vector3.Zero();
|
|
943
|
-
this._projectionTextureViewLightMatrix = Matrix.Zero();
|
|
944
|
-
this._projectionTextureProjectionLightMatrix = Matrix.Zero();
|
|
945
|
-
this._projectionTextureScalingMatrix = Matrix.FromValues(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
|
|
946
|
-
this.position = position;
|
|
947
|
-
this.direction = direction;
|
|
948
|
-
this.angle = angle;
|
|
949
|
-
this.exponent = exponent;
|
|
950
|
-
}
|
|
951
|
-
/**
|
|
952
|
-
* Returns the string "SpotLight".
|
|
953
|
-
* @returns the class name
|
|
954
|
-
*/
|
|
955
|
-
getClassName() {
|
|
956
|
-
return "SpotLight";
|
|
957
|
-
}
|
|
958
|
-
/**
|
|
959
|
-
* Returns the integer 2.
|
|
960
|
-
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
961
|
-
*/
|
|
962
|
-
getTypeID() {
|
|
963
|
-
return Light.LIGHTTYPEID_SPOTLIGHT;
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* Overrides the direction setter to recompute the projection texture view light Matrix.
|
|
967
|
-
* @param value
|
|
968
|
-
*/
|
|
969
|
-
_setDirection(value) {
|
|
970
|
-
super._setDirection(value);
|
|
971
|
-
this._projectionTextureViewLightDirty = true;
|
|
972
|
-
}
|
|
973
|
-
/**
|
|
974
|
-
* Overrides the position setter to recompute the projection texture view light Matrix.
|
|
975
|
-
* @param value
|
|
976
|
-
*/
|
|
977
|
-
_setPosition(value) {
|
|
978
|
-
super._setPosition(value);
|
|
979
|
-
this._projectionTextureViewLightDirty = true;
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
|
|
983
|
-
* Returns the SpotLight.
|
|
984
|
-
* @param matrix
|
|
985
|
-
* @param viewMatrix
|
|
986
|
-
* @param renderList
|
|
987
|
-
*/
|
|
988
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
989
|
-
_setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
|
|
990
|
-
const activeCamera = this.getScene().activeCamera;
|
|
991
|
-
if (!activeCamera) {
|
|
992
|
-
return;
|
|
993
|
-
}
|
|
994
|
-
this._shadowAngleScale = this._shadowAngleScale || 1;
|
|
995
|
-
const angle = this._shadowAngleScale * this._angle;
|
|
996
|
-
const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
|
|
997
|
-
const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
|
|
998
|
-
const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
|
|
999
|
-
Matrix.PerspectiveFovLHToRef(angle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);
|
|
1000
|
-
}
|
|
1001
|
-
_computeProjectionTextureViewLightMatrix() {
|
|
1002
|
-
this._projectionTextureViewLightDirty = false;
|
|
1003
|
-
this._projectionTextureDirty = true;
|
|
1004
|
-
this.getAbsolutePosition().addToRef(this.getShadowDirection(), this._projectionTextureViewTargetVector);
|
|
1005
|
-
Matrix.LookAtLHToRef(this.getAbsolutePosition(), this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);
|
|
1006
|
-
}
|
|
1007
|
-
_computeProjectionTextureProjectionLightMatrix() {
|
|
1008
|
-
this._projectionTextureProjectionLightDirty = false;
|
|
1009
|
-
this._projectionTextureDirty = true;
|
|
1010
|
-
const lightFar = this.projectionTextureLightFar;
|
|
1011
|
-
const lightNear = this.projectionTextureLightNear;
|
|
1012
|
-
const P = lightFar / (lightFar - lightNear);
|
|
1013
|
-
const Q = -P * lightNear;
|
|
1014
|
-
const S = 1.0 / Math.tan(this._angle / 2.0);
|
|
1015
|
-
const A = 1.0;
|
|
1016
|
-
Matrix.FromValuesToRef(S / A, 0.0, 0.0, 0.0, 0.0, S, 0.0, 0.0, 0.0, 0.0, P, 1.0, 0.0, 0.0, Q, 0.0, this._projectionTextureProjectionLightMatrix);
|
|
1017
|
-
}
|
|
1018
|
-
/**
|
|
1019
|
-
* Main function for light texture projection matrix computing.
|
|
1020
|
-
*/
|
|
1021
|
-
_computeProjectionTextureMatrix() {
|
|
1022
|
-
this._projectionTextureDirty = false;
|
|
1023
|
-
this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix);
|
|
1024
|
-
if (this._projectionTexture instanceof Texture) {
|
|
1025
|
-
const u = this._projectionTexture.uScale / 2.0;
|
|
1026
|
-
const v = this._projectionTexture.vScale / 2.0;
|
|
1027
|
-
Matrix.FromValuesToRef(u, 0.0, 0.0, 0.0, 0.0, v, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0, this._projectionTextureScalingMatrix);
|
|
1028
|
-
}
|
|
1029
|
-
this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);
|
|
1030
|
-
}
|
|
1031
|
-
_buildUniformLayout() {
|
|
1032
|
-
this._uniformBuffer.addUniform("vLightData", 4);
|
|
1033
|
-
this._uniformBuffer.addUniform("vLightDiffuse", 4);
|
|
1034
|
-
this._uniformBuffer.addUniform("vLightSpecular", 4);
|
|
1035
|
-
this._uniformBuffer.addUniform("vLightDirection", 3);
|
|
1036
|
-
this._uniformBuffer.addUniform("vLightFalloff", 4);
|
|
1037
|
-
this._uniformBuffer.addUniform("shadowsInfo", 3);
|
|
1038
|
-
this._uniformBuffer.addUniform("depthValues", 2);
|
|
1039
|
-
this._uniformBuffer.create();
|
|
1040
|
-
}
|
|
1041
|
-
_computeAngleValues() {
|
|
1042
|
-
this._lightAngleScale = 1.0 / Math.max(0.001, Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle);
|
|
1043
|
-
this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* Sets the passed Effect "effect" with the Light textures.
|
|
1047
|
-
* @param effect The effect to update
|
|
1048
|
-
* @param lightIndex The index of the light in the effect to update
|
|
1049
|
-
* @returns The light
|
|
1050
|
-
*/
|
|
1051
|
-
transferTexturesToEffect(effect, lightIndex) {
|
|
1052
|
-
if (this.projectionTexture && this.projectionTexture.isReady()) {
|
|
1053
|
-
if (this._projectionTextureViewLightDirty) {
|
|
1054
|
-
this._computeProjectionTextureViewLightMatrix();
|
|
1055
|
-
}
|
|
1056
|
-
if (this._projectionTextureProjectionLightDirty) {
|
|
1057
|
-
this._computeProjectionTextureProjectionLightMatrix();
|
|
1058
|
-
}
|
|
1059
|
-
if (this._projectionTextureDirty) {
|
|
1060
|
-
this._computeProjectionTextureMatrix();
|
|
1061
|
-
}
|
|
1062
|
-
effect.setMatrix("textureProjectionMatrix" + lightIndex, this._projectionTextureMatrix);
|
|
1063
|
-
effect.setTexture("projectionLightTexture" + lightIndex, this.projectionTexture);
|
|
1064
|
-
}
|
|
1065
|
-
return this;
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* Sets the passed Effect object with the SpotLight transformed position (or position if not parented) and normalized direction.
|
|
1069
|
-
* @param effect The effect to update
|
|
1070
|
-
* @param lightIndex The index of the light in the effect to update
|
|
1071
|
-
* @returns The spot light
|
|
1072
|
-
*/
|
|
1073
|
-
transferToEffect(effect, lightIndex) {
|
|
1074
|
-
let normalizeDirection;
|
|
1075
|
-
if (this.computeTransformedInformation()) {
|
|
1076
|
-
this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex);
|
|
1077
|
-
normalizeDirection = Vector3.Normalize(this.transformedDirection);
|
|
1078
|
-
}
|
|
1079
|
-
else {
|
|
1080
|
-
this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex);
|
|
1081
|
-
normalizeDirection = Vector3.Normalize(this.direction);
|
|
1082
|
-
}
|
|
1083
|
-
this._uniformBuffer.updateFloat4("vLightDirection", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex);
|
|
1084
|
-
this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex);
|
|
1085
|
-
return this;
|
|
1086
|
-
}
|
|
1087
|
-
transferToNodeMaterialEffect(effect, lightDataUniformName) {
|
|
1088
|
-
let normalizeDirection;
|
|
1089
|
-
if (this.computeTransformedInformation()) {
|
|
1090
|
-
normalizeDirection = Vector3.Normalize(this.transformedDirection);
|
|
1091
|
-
}
|
|
1092
|
-
else {
|
|
1093
|
-
normalizeDirection = Vector3.Normalize(this.direction);
|
|
1094
|
-
}
|
|
1095
|
-
if (this.getScene().useRightHandedSystem) {
|
|
1096
|
-
effect.setFloat3(lightDataUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z);
|
|
1097
|
-
}
|
|
1098
|
-
else {
|
|
1099
|
-
effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);
|
|
1100
|
-
}
|
|
1101
|
-
return this;
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* Disposes the light and the associated resources.
|
|
1105
|
-
*/
|
|
1106
|
-
dispose() {
|
|
1107
|
-
super.dispose();
|
|
1108
|
-
if (this._projectionTexture) {
|
|
1109
|
-
this._projectionTexture.dispose();
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
/**
|
|
1113
|
-
* Gets the minZ used for shadow according to both the scene and the light.
|
|
1114
|
-
* @param activeCamera The camera we are returning the min for
|
|
1115
|
-
* @returns the depth min z
|
|
1116
|
-
*/
|
|
1117
|
-
getDepthMinZ(activeCamera) {
|
|
1118
|
-
const engine = this._scene.getEngine();
|
|
1119
|
-
const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
|
|
1120
|
-
return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? minZ : this._scene.getEngine().isNDCHalfZRange ? 0 : minZ;
|
|
1121
|
-
}
|
|
1122
|
-
/**
|
|
1123
|
-
* Gets the maxZ used for shadow according to both the scene and the light.
|
|
1124
|
-
* @param activeCamera The camera we are returning the max for
|
|
1125
|
-
* @returns the depth max z
|
|
1126
|
-
*/
|
|
1127
|
-
getDepthMaxZ(activeCamera) {
|
|
1128
|
-
const engine = this._scene.getEngine();
|
|
1129
|
-
const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
|
|
1130
|
-
return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : maxZ;
|
|
1131
|
-
}
|
|
1132
|
-
/**
|
|
1133
|
-
* Prepares the list of defines specific to the light type.
|
|
1134
|
-
* @param defines the list of defines
|
|
1135
|
-
* @param lightIndex defines the index of the light for the effect
|
|
1136
|
-
*/
|
|
1137
|
-
prepareLightSpecificDefines(defines, lightIndex) {
|
|
1138
|
-
defines["SPOTLIGHT" + lightIndex] = true;
|
|
1139
|
-
defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = this.projectionTexture && this.projectionTexture.isReady() ? true : false;
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
__decorate([
|
|
1143
|
-
serialize()
|
|
1144
|
-
], SpotLight.prototype, "angle", null);
|
|
1145
|
-
__decorate([
|
|
1146
|
-
serialize()
|
|
1147
|
-
], SpotLight.prototype, "innerAngle", null);
|
|
1148
|
-
__decorate([
|
|
1149
|
-
serialize()
|
|
1150
|
-
], SpotLight.prototype, "shadowAngleScale", null);
|
|
1151
|
-
__decorate([
|
|
1152
|
-
serialize()
|
|
1153
|
-
], SpotLight.prototype, "exponent", void 0);
|
|
1154
|
-
__decorate([
|
|
1155
|
-
serialize()
|
|
1156
|
-
], SpotLight.prototype, "projectionTextureLightNear", null);
|
|
1157
|
-
__decorate([
|
|
1158
|
-
serialize()
|
|
1159
|
-
], SpotLight.prototype, "projectionTextureLightFar", null);
|
|
1160
|
-
__decorate([
|
|
1161
|
-
serialize()
|
|
1162
|
-
], SpotLight.prototype, "projectionTextureUpDirection", null);
|
|
1163
|
-
__decorate([
|
|
1164
|
-
serializeAsTexture("projectedLightTexture")
|
|
1165
|
-
], SpotLight.prototype, "_projectionTexture", void 0);
|
|
1166
|
-
// Register Class Name
|
|
1167
|
-
RegisterClass("BABYLON.SpotLight", SpotLight);
|
|
1168
|
-
|
|
1169
|
-
const NAME = "KHR_lights_punctual";
|
|
1170
|
-
/**
|
|
1171
|
-
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual/README.md)
|
|
1172
|
-
*/
|
|
1173
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1174
|
-
class KHR_lights {
|
|
1175
|
-
/**
|
|
1176
|
-
* @internal
|
|
1177
|
-
*/
|
|
1178
|
-
constructor(loader) {
|
|
1179
|
-
/**
|
|
1180
|
-
* The name of this extension.
|
|
1181
|
-
*/
|
|
1182
|
-
this.name = NAME;
|
|
1183
|
-
this._loader = loader;
|
|
1184
|
-
this.enabled = this._loader.isExtensionUsed(NAME);
|
|
1185
|
-
}
|
|
1186
|
-
/** @internal */
|
|
1187
|
-
dispose() {
|
|
1188
|
-
this._loader = null;
|
|
1189
|
-
delete this._lights;
|
|
1190
|
-
}
|
|
1191
|
-
/** @internal */
|
|
1192
|
-
onLoading() {
|
|
1193
|
-
const extensions = this._loader.gltf.extensions;
|
|
1194
|
-
if (extensions && extensions[this.name]) {
|
|
1195
|
-
const extension = extensions[this.name];
|
|
1196
|
-
this._lights = extension.lights;
|
|
1197
|
-
ArrayItem.Assign(this._lights);
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
/**
|
|
1201
|
-
* @internal
|
|
1202
|
-
*/
|
|
1203
|
-
loadNodeAsync(context, node, assign) {
|
|
1204
|
-
return GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => {
|
|
1205
|
-
this._loader._allMaterialsDirtyRequired = true;
|
|
1206
|
-
return this._loader.loadNodeAsync(context, node, (babylonMesh) => {
|
|
1207
|
-
let babylonLight;
|
|
1208
|
-
const light = ArrayItem.Get(extensionContext, this._lights, extension.light);
|
|
1209
|
-
const name = light.name || babylonMesh.name;
|
|
1210
|
-
this._loader.babylonScene._blockEntityCollection = !!this._loader._assetContainer;
|
|
1211
|
-
switch (light.type) {
|
|
1212
|
-
case "directional" /* KHRLightsPunctual_LightType.DIRECTIONAL */: {
|
|
1213
|
-
const babylonDirectionalLight = new DirectionalLight(name, Vector3.Backward(), this._loader.babylonScene);
|
|
1214
|
-
babylonDirectionalLight.position.setAll(0);
|
|
1215
|
-
babylonLight = babylonDirectionalLight;
|
|
1216
|
-
break;
|
|
1217
|
-
}
|
|
1218
|
-
case "point" /* KHRLightsPunctual_LightType.POINT */: {
|
|
1219
|
-
babylonLight = new PointLight(name, Vector3.Zero(), this._loader.babylonScene);
|
|
1220
|
-
break;
|
|
1221
|
-
}
|
|
1222
|
-
case "spot" /* KHRLightsPunctual_LightType.SPOT */: {
|
|
1223
|
-
const babylonSpotLight = new SpotLight(name, Vector3.Zero(), Vector3.Backward(), 0, 1, this._loader.babylonScene);
|
|
1224
|
-
babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;
|
|
1225
|
-
babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;
|
|
1226
|
-
babylonLight = babylonSpotLight;
|
|
1227
|
-
break;
|
|
1228
|
-
}
|
|
1229
|
-
default: {
|
|
1230
|
-
this._loader.babylonScene._blockEntityCollection = false;
|
|
1231
|
-
throw new Error(`${extensionContext}: Invalid light type (${light.type})`);
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
babylonLight._parentContainer = this._loader._assetContainer;
|
|
1235
|
-
this._loader.babylonScene._blockEntityCollection = false;
|
|
1236
|
-
light._babylonLight = babylonLight;
|
|
1237
|
-
babylonLight.falloffType = Light.FALLOFF_GLTF;
|
|
1238
|
-
babylonLight.diffuse = light.color ? Color3.FromArray(light.color) : Color3.White();
|
|
1239
|
-
babylonLight.intensity = light.intensity == undefined ? 1 : light.intensity;
|
|
1240
|
-
babylonLight.range = light.range == undefined ? Number.MAX_VALUE : light.range;
|
|
1241
|
-
babylonLight.parent = babylonMesh;
|
|
1242
|
-
this._loader._babylonLights.push(babylonLight);
|
|
1243
|
-
GLTFLoader.AddPointerMetadata(babylonLight, extensionContext);
|
|
1244
|
-
assign(babylonMesh);
|
|
1245
|
-
});
|
|
1246
|
-
});
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
unregisterGLTFExtension(NAME);
|
|
1250
|
-
registerGLTFExtension(NAME, true, (loader) => new KHR_lights(loader));
|
|
1251
|
-
|
|
1252
|
-
export { KHR_lights };
|
|
1253
|
-
//# sourceMappingURL=KHR_lights_punctual-BPa3ZY-J.esm.js.map
|