@babylonjs/viewer 7.41.1 → 7.42.0-alpha
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/assets/photoStudio.env +0 -0
- package/dist/babylon-viewer.esm.js +2 -0
- package/dist/babylon-viewer.esm.js.map +1 -0
- package/dist/babylon-viewer.esm.min.js +2 -0
- package/dist/babylon-viewer.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-BHDD74jk.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_ies-BHDD74jk.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-CJfRNbJm.esm.js +84 -0
- package/dist/chunks/EXT_lights_ies-CJfRNbJm.esm.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-B460Sv95.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_image_based-B460Sv95.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-CQ6UCahL.esm.js +171 -0
- package/dist/chunks/EXT_lights_image_based-CQ6UCahL.esm.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-D77OfiDS.esm.js +86 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-D77OfiDS.esm.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-GMG29Y9J.esm.min.js +2 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-GMG29Y9J.esm.min.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-CniiOX0a.esm.js +134 -0
- package/dist/chunks/EXT_meshopt_compression-CniiOX0a.esm.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-DCcKdizI.esm.min.js +2 -0
- package/dist/chunks/EXT_meshopt_compression-DCcKdizI.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-By7mk6aS.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_avif-By7mk6aS.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-DnaKno7b.esm.js +44 -0
- package/dist/chunks/EXT_texture_avif-DnaKno7b.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-Bm29ukIo.esm.js +43 -0
- package/dist/chunks/EXT_texture_webp-Bm29ukIo.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-DtSWYlAE.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_webp-DtSWYlAE.esm.min.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-BUO8J2zR.esm.js +64 -0
- package/dist/chunks/ExtrasAsMetadata-BUO8J2zR.esm.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-mi3fn9sR.esm.min.js +2 -0
- package/dist/chunks/ExtrasAsMetadata-mi3fn9sR.esm.min.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-COeThtQe.esm.min.js +2 -0
- package/dist/chunks/KHR_animation_pointer-COeThtQe.esm.min.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-DXqgkZGB.esm.js +352 -0
- package/dist/chunks/KHR_animation_pointer-DXqgkZGB.esm.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-Bh9XGNFd.esm.js +610 -0
- package/dist/chunks/KHR_draco_mesh_compression-Bh9XGNFd.esm.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-DyU2KIa2.esm.min.js +2 -0
- package/dist/chunks/KHR_draco_mesh_compression-DyU2KIa2.esm.min.js.map +1 -0
- package/dist/chunks/KHR_interactivity-QP9zFX3U.esm.js +4033 -0
- package/dist/chunks/KHR_interactivity-QP9zFX3U.esm.js.map +1 -0
- package/dist/chunks/KHR_interactivity-_r7e7vwA.esm.min.js +2 -0
- package/dist/chunks/KHR_interactivity-_r7e7vwA.esm.min.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-DWGx9KlE.esm.js +581 -0
- package/dist/chunks/KHR_lights_punctual-DWGx9KlE.esm.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-cz3ulMW0.esm.min.js +2 -0
- package/dist/chunks/KHR_lights_punctual-cz3ulMW0.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-BSvZxEnx.esm.js +65 -0
- package/dist/chunks/KHR_materials_anisotropy-BSvZxEnx.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-CtKPvN_z.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_anisotropy-CtKPvN_z.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-BephgEiM.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_clearcoat-BephgEiM.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-C3QB9HNC.esm.js +96 -0
- package/dist/chunks/KHR_materials_clearcoat-C3QB9HNC.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-CZvfLdyF.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-CZvfLdyF.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-DuM5GD2L.esm.js +97 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-DuM5GD2L.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-0FtkqUmS.esm.js +62 -0
- package/dist/chunks/KHR_materials_dispersion-0FtkqUmS.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-C7mAat5y.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_dispersion-C7mAat5y.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-Bz2y9OnA.esm.js +55 -0
- package/dist/chunks/KHR_materials_emissive_strength-Bz2y9OnA.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-b7ZNj1HF.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_emissive_strength-b7ZNj1HF.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-C5-JiuLs.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_ior-C5-JiuLs.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-D1jjzmsp.esm.js +64 -0
- package/dist/chunks/KHR_materials_ior-D1jjzmsp.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-CChET9-W.esm.js +72 -0
- package/dist/chunks/KHR_materials_iridescence-CChET9-W.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-hATfgETI.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_iridescence-hATfgETI.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-B-HlmeqI.esm.js +81 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-B-HlmeqI.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-_IaUmSJE.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-_IaUmSJE.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-D2QD8uSC.esm.js +85 -0
- package/dist/chunks/KHR_materials_sheen-D2QD8uSC.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-cqxpRyXD.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_sheen-cqxpRyXD.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-DnHIH9RX.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_specular-DnHIH9RX.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-vwRXhXVF.esm.js +75 -0
- package/dist/chunks/KHR_materials_specular-vwRXhXVF.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-D81TRCgt.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_transmission-D81TRCgt.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-nPX6lno-.esm.js +307 -0
- package/dist/chunks/KHR_materials_transmission-nPX6lno-.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-CLSTXPsk.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_unlit-CLSTXPsk.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-pmQPq5qR.esm.js +74 -0
- package/dist/chunks/KHR_materials_unlit-pmQPq5qR.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-C_XVH51a.esm.js +262 -0
- package/dist/chunks/KHR_materials_variants-C_XVH51a.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-Czo1ZM8r.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_variants-Czo1ZM8r.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-BJVGGE1g.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_volume-BJVGGE1g.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-C4EKOzF-.esm.js +87 -0
- package/dist/chunks/KHR_materials_volume-C4EKOzF-.esm.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-CZIcA8DN.esm.min.js +2 -0
- package/dist/chunks/KHR_mesh_quantization-CZIcA8DN.esm.min.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-DG9WNux6.esm.js +26 -0
- package/dist/chunks/KHR_mesh_quantization-DG9WNux6.esm.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-C1YMkQ95.esm.js +39 -0
- package/dist/chunks/KHR_node_hoverability-C1YMkQ95.esm.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-HxHiCdR9.esm.min.js +2 -0
- package/dist/chunks/KHR_node_hoverability-HxHiCdR9.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-C5tc6GOc.esm.js +46 -0
- package/dist/chunks/KHR_node_visibility-C5tc6GOc.esm.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-CSqn8wRd.esm.min.js +2 -0
- package/dist/chunks/KHR_node_visibility-CSqn8wRd.esm.min.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-DA2FE-qb.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_basisu-DA2FE-qb.esm.min.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-KtQL54P-.esm.js +43 -0
- package/dist/chunks/KHR_texture_basisu-KtQL54P-.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-Cb6Q41F3.esm.js +63 -0
- package/dist/chunks/KHR_texture_transform-Cb6Q41F3.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-GdBAq_uW.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_transform-GdBAq_uW.esm.min.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-CD_mkZDv.esm.min.js +2 -0
- package/dist/chunks/KHR_xmp_json_ld-CD_mkZDv.esm.min.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-f1rcQfsd.esm.js +51 -0
- package/dist/chunks/KHR_xmp_json_ld-f1rcQfsd.esm.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-BU83EIcP.esm.min.js +2 -0
- package/dist/chunks/MSFT_audio_emitter-BU83EIcP.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-ClwdeJaR.esm.js +2201 -0
- package/dist/chunks/MSFT_audio_emitter-ClwdeJaR.esm.js.map +1 -0
- package/dist/chunks/MSFT_lod-D3MQWFc3.esm.min.js +2 -0
- package/dist/chunks/MSFT_lod-D3MQWFc3.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_lod-DkM5iXcm.esm.js +337 -0
- package/dist/chunks/MSFT_lod-DkM5iXcm.esm.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-CG9JY5Ic.esm.min.js +2 -0
- package/dist/chunks/MSFT_minecraftMesh-CG9JY5Ic.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-Cyjdx_Y_.esm.js +46 -0
- package/dist/chunks/MSFT_minecraftMesh-Cyjdx_Y_.esm.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-Bm3_fRmt.esm.min.js +2 -0
- package/dist/chunks/MSFT_sRGBFactors-Bm3_fRmt.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-uFdNij-4.esm.js +47 -0
- package/dist/chunks/MSFT_sRGBFactors-uFdNij-4.esm.js.map +1 -0
- package/dist/chunks/animationGroup-CravGs2P.esm.min.js +2 -0
- package/dist/chunks/animationGroup-CravGs2P.esm.min.js.map +1 -0
- package/dist/chunks/animationGroup-DqmFa1Nk.esm.js +2482 -0
- package/dist/chunks/animationGroup-DqmFa1Nk.esm.js.map +1 -0
- package/dist/chunks/assetContainer-0Qu2XIWb.esm.js +1720 -0
- package/dist/chunks/assetContainer-0Qu2XIWb.esm.js.map +1 -0
- package/dist/chunks/assetContainer-CMuD-n3X.esm.min.js +2 -0
- package/dist/chunks/assetContainer-CMuD-n3X.esm.min.js.map +1 -0
- package/dist/chunks/audioEngine--EMyAh-L.esm.js +305 -0
- package/dist/chunks/audioEngine--EMyAh-L.esm.js.map +1 -0
- package/dist/chunks/audioEngine-3doZGQV6.esm.min.js +2 -0
- package/dist/chunks/audioEngine-3doZGQV6.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-DgMI1D24.esm.min.js +2 -0
- package/dist/chunks/bakedVertexAnimation-DgMI1D24.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-gQlUctpB.esm.js +114 -0
- package/dist/chunks/bakedVertexAnimation-gQlUctpB.esm.js.map +1 -0
- package/dist/chunks/basisTextureLoader-B0PY0ILM.esm.js +600 -0
- package/dist/chunks/basisTextureLoader-B0PY0ILM.esm.js.map +1 -0
- package/dist/chunks/basisTextureLoader-ES0mOtqQ.esm.min.js +2 -0
- package/dist/chunks/basisTextureLoader-ES0mOtqQ.esm.min.js.map +1 -0
- package/dist/chunks/dds-DEZD6DKL.esm.min.js +2 -0
- package/dist/chunks/dds-DEZD6DKL.esm.min.js.map +1 -0
- package/dist/chunks/dds-HwVEMga8.esm.js +540 -0
- package/dist/chunks/dds-HwVEMga8.esm.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-3PDKukdG.esm.js +88 -0
- package/dist/chunks/ddsTextureLoader-3PDKukdG.esm.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-C62DqYdE.esm.min.js +2 -0
- package/dist/chunks/ddsTextureLoader-C62DqYdE.esm.min.js.map +1 -0
- package/dist/chunks/decalFragment-B9KsZn_u.esm.min.js +2 -0
- package/dist/chunks/decalFragment-B9KsZn_u.esm.min.js.map +1 -0
- package/dist/chunks/decalFragment-CNA1EQK9.esm.js +18 -0
- package/dist/chunks/decalFragment-CNA1EQK9.esm.js.map +1 -0
- package/dist/chunks/default.fragment-BsajFq2Q.esm.js +446 -0
- package/dist/chunks/default.fragment-BsajFq2Q.esm.js.map +1 -0
- package/dist/chunks/default.fragment-C7O2NjXo.esm.min.js +2 -0
- package/dist/chunks/default.fragment-C7O2NjXo.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-CNef5Xlg.esm.min.js +2 -0
- package/dist/chunks/default.fragment-CNef5Xlg.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-DAO0SBl-.esm.js +515 -0
- package/dist/chunks/default.fragment-DAO0SBl-.esm.js.map +1 -0
- package/dist/chunks/default.vertex-Ban5pFUb.esm.js +211 -0
- package/dist/chunks/default.vertex-Ban5pFUb.esm.js.map +1 -0
- package/dist/chunks/default.vertex-CPjp6YBQ.esm.min.js +2 -0
- package/dist/chunks/default.vertex-CPjp6YBQ.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-CemfGK4Y.esm.min.js +2 -0
- package/dist/chunks/default.vertex-CemfGK4Y.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-QE4cV7Y2.esm.js +190 -0
- package/dist/chunks/default.vertex-QE4cV7Y2.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-B5nIsoCQ.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-B5nIsoCQ.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-B8tY8ajW.esm.js +15 -0
- package/dist/chunks/defaultUboDeclaration-B8tY8ajW.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-D7yr1BRw.esm.js +13 -0
- package/dist/chunks/defaultUboDeclaration-D7yr1BRw.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-Db_EQWlv.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-Db_EQWlv.esm.min.js.map +1 -0
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
- package/dist/chunks/dumpTools-C13JzZr_.esm.min.js +2 -0
- package/dist/chunks/dumpTools-C13JzZr_.esm.min.js.map +1 -0
- package/dist/chunks/dumpTools-D6BRv6Ws.esm.js +200 -0
- package/dist/chunks/dumpTools-D6BRv6Ws.esm.js.map +1 -0
- package/dist/chunks/engine-29lBc-mw.esm.min.js +2 -0
- package/dist/chunks/engine-29lBc-mw.esm.min.js.map +1 -0
- package/dist/chunks/engine-Bk6S663t.esm.js +2213 -0
- package/dist/chunks/engine-Bk6S663t.esm.js.map +1 -0
- package/dist/chunks/engine.common-D_DOB0rT.esm.js +1162 -0
- package/dist/chunks/engine.common-D_DOB0rT.esm.js.map +1 -0
- package/dist/chunks/engine.common-OpqDqcE2.esm.min.js +2 -0
- package/dist/chunks/engine.common-OpqDqcE2.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-DS13pG9w.esm.js +64 -0
- package/dist/chunks/envTextureLoader-DS13pG9w.esm.js.map +1 -0
- package/dist/chunks/envTextureLoader-Dt6q0XDu.esm.min.js +2 -0
- package/dist/chunks/envTextureLoader-Dt6q0XDu.esm.min.js.map +1 -0
- package/dist/chunks/environmentTextureTools-DKN-Hd8c.esm.min.js +2 -0
- package/dist/chunks/environmentTextureTools-DKN-Hd8c.esm.min.js.map +1 -0
- package/dist/chunks/environmentTextureTools-DWkvV21A.esm.js +382 -0
- package/dist/chunks/environmentTextureTools-DWkvV21A.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-6o4jfUaF.esm.js +1683 -0
- package/dist/chunks/exrTextureLoader-6o4jfUaF.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-CXV9O3pZ.esm.min.js +2 -0
- package/dist/chunks/exrTextureLoader-CXV9O3pZ.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-BdOtsPe3.esm.js +102 -0
- package/dist/chunks/fogFragment-BdOtsPe3.esm.js.map +1 -0
- package/dist/chunks/fogFragment-Cv3Bqrrg.esm.js +101 -0
- package/dist/chunks/fogFragment-Cv3Bqrrg.esm.js.map +1 -0
- package/dist/chunks/fogFragment-D91rqvp0.esm.min.js +2 -0
- package/dist/chunks/fogFragment-D91rqvp0.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-qdYpZbGA.esm.min.js +2 -0
- package/dist/chunks/fogFragment-qdYpZbGA.esm.min.js.map +1 -0
- package/dist/chunks/fresnelFunction-DBMK4K-2.esm.min.js +2 -0
- package/dist/chunks/fresnelFunction-DBMK4K-2.esm.min.js.map +1 -0
- package/dist/chunks/fresnelFunction-o5ZOc6C0.esm.js +12 -0
- package/dist/chunks/fresnelFunction-o5ZOc6C0.esm.js.map +1 -0
- package/dist/chunks/glTFLoader-Dj_JCgqJ.esm.min.js +2 -0
- package/dist/chunks/glTFLoader-Dj_JCgqJ.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoader-DnWHbX53.esm.js +7693 -0
- package/dist/chunks/glTFLoader-DnWHbX53.esm.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-A_WVS-lt.esm.min.js +2 -0
- package/dist/chunks/glTFLoaderAnimation-A_WVS-lt.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-C3gHlipY.esm.js +77 -0
- package/dist/chunks/glTFLoaderAnimation-C3gHlipY.esm.js.map +1 -0
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-91QStv6v.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-91QStv6v.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-DBJQNoSA.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-DBJQNoSA.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-DXdlMMN6.esm.js +34 -0
- package/dist/chunks/harmonicsFunctions-DXdlMMN6.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-VtAD6DeX.esm.js +35 -0
- package/dist/chunks/harmonicsFunctions-VtAD6DeX.esm.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-CYtpPSzs.esm.js +253 -0
- package/dist/chunks/hdrTextureLoader-CYtpPSzs.esm.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-CzZ1hV7q.esm.min.js +2 -0
- package/dist/chunks/hdrTextureLoader-CzZ1hV7q.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-Bn3a_gzG.esm.js +110 -0
- package/dist/chunks/helperFunctions-Bn3a_gzG.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-CA_QOVSE.esm.js +83 -0
- package/dist/chunks/helperFunctions-CA_QOVSE.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-mebe29sq.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-mebe29sq.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-wIdfkMdZ.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-wIdfkMdZ.esm.min.js.map +1 -0
- package/dist/chunks/iesTextureLoader-D8_bkaCP.esm.min.js +2 -0
- package/dist/chunks/iesTextureLoader-D8_bkaCP.esm.min.js.map +1 -0
- package/dist/chunks/iesTextureLoader-K1MQUalq.esm.js +189 -0
- package/dist/chunks/iesTextureLoader-K1MQUalq.esm.js.map +1 -0
- package/dist/chunks/index-Bo5F_mGk.esm.min.js +57 -0
- package/dist/chunks/index-Bo5F_mGk.esm.min.js.map +1 -0
- package/dist/chunks/index-Dlf001gP.esm.js +74889 -0
- package/dist/chunks/index-Dlf001gP.esm.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-B6UHYOxL.esm.js +814 -0
- package/dist/chunks/ktxTextureLoader-B6UHYOxL.esm.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-s_dbtiwN.esm.min.js +2 -0
- package/dist/chunks/ktxTextureLoader-s_dbtiwN.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration--xmemf5p.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration--xmemf5p.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-Babs-3_m.esm.js +35 -0
- package/dist/chunks/logDepthDeclaration-Babs-3_m.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-BvoznvSG.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-BvoznvSG.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-_EPT9ybx.esm.js +11 -0
- package/dist/chunks/logDepthDeclaration-_EPT9ybx.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-0vve_qKh.esm.js +77 -0
- package/dist/chunks/logDepthVertex-0vve_qKh.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-BkGmO8_s.esm.js +81 -0
- package/dist/chunks/logDepthVertex-BkGmO8_s.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-CVcNpHQe.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-CVcNpHQe.esm.min.js.map +1 -0
- package/dist/chunks/logDepthVertex-DL8eWalk.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-DL8eWalk.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-9DUO7sPf.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-9DUO7sPf.esm.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-DXZGPs7O.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-DXZGPs7O.esm.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-DaFtbg5X.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-DaFtbg5X.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-lKBcMFcP.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-lKBcMFcP.esm.min.js.map +1 -0
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +119 -0
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +1 -0
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +2 -0
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-BN0BlYEZ.esm.js +26 -0
- package/dist/chunks/meshUboDeclaration-BN0BlYEZ.esm.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-BcQ1P_co.esm.min.js +2 -0
- package/dist/chunks/meshUboDeclaration-BcQ1P_co.esm.min.js.map +1 -0
- package/dist/chunks/objFileLoader-Lx7JtYFA.esm.min.js +2 -0
- package/dist/chunks/objFileLoader-Lx7JtYFA.esm.min.js.map +1 -0
- package/dist/chunks/objFileLoader-_nxEPYB4.esm.js +1338 -0
- package/dist/chunks/objFileLoader-_nxEPYB4.esm.js.map +1 -0
- package/dist/chunks/oitFragment-BPgREULe.esm.js +1240 -0
- package/dist/chunks/oitFragment-BPgREULe.esm.js.map +1 -0
- package/dist/chunks/oitFragment-CKNxTV0T.esm.min.js +2 -0
- package/dist/chunks/oitFragment-CKNxTV0T.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-CT3oWGRL.esm.js +1078 -0
- package/dist/chunks/oitFragment-CT3oWGRL.esm.js.map +1 -0
- package/dist/chunks/oitFragment-CXrV_64a.esm.min.js +2 -0
- package/dist/chunks/oitFragment-CXrV_64a.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-BugqjVKo.esm.js +15 -0
- package/dist/chunks/pass.fragment-BugqjVKo.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-X-KK3tOa.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-X-KK3tOa.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-pJ1J3AeO.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-pJ1J3AeO.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-tk9KCmM-.esm.js +15 -0
- package/dist/chunks/pass.fragment-tk9KCmM-.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-C4BFWzEP.esm.js +3269 -0
- package/dist/chunks/pbr.fragment-C4BFWzEP.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-CTE0zFNb.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-CTE0zFNb.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-DZRIiJzv.esm.js +3222 -0
- package/dist/chunks/pbr.fragment-DZRIiJzv.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-Dk1kkP87.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-Dk1kkP87.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-Ba8BDEep.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-Ba8BDEep.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-DM2WONhK.esm.js +223 -0
- package/dist/chunks/pbr.vertex-DM2WONhK.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-DVghYyb7.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-DVghYyb7.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-DiVjR6Bs.esm.js +348 -0
- package/dist/chunks/pbr.vertex-DiVjR6Bs.esm.js.map +1 -0
- package/dist/chunks/postprocess.vertex-CtVD6qfW.esm.min.js +2 -0
- package/dist/chunks/postprocess.vertex-CtVD6qfW.esm.min.js.map +1 -0
- package/dist/chunks/postprocess.vertex-DntzOpKV.esm.js +20 -0
- package/dist/chunks/postprocess.vertex-DntzOpKV.esm.js.map +1 -0
- package/dist/chunks/rawTexture-BAt5J3G4.esm.min.js +2 -0
- package/dist/chunks/rawTexture-BAt5J3G4.esm.min.js.map +1 -0
- package/dist/chunks/rawTexture-D0O_yrdQ.esm.js +191 -0
- package/dist/chunks/rawTexture-D0O_yrdQ.esm.js.map +1 -0
- package/dist/chunks/ray-Bbt37I0I.esm.js +946 -0
- package/dist/chunks/ray-Bbt37I0I.esm.js.map +1 -0
- package/dist/chunks/ray-OQ0d0a-k.esm.min.js +2 -0
- package/dist/chunks/ray-OQ0d0a-k.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-4HjKGwMm.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-4HjKGwMm.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-CKVGwRZO.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-CKVGwRZO.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-Cn6YVnkB.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-Cn6YVnkB.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-DwcDy8Eo.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-DwcDy8Eo.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-BUluDIqG.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-BUluDIqG.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-CEiZq0Qt.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-CEiZq0Qt.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-CY0yYtEl.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-CY0yYtEl.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-DS4_h_Qc.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-DS4_h_Qc.esm.min.js.map +1 -0
- package/dist/chunks/splatFileLoader-C9ykR2nU.esm.js +3387 -0
- package/dist/chunks/splatFileLoader-C9ykR2nU.esm.js.map +1 -0
- package/dist/chunks/splatFileLoader-fz6lXWf1.esm.min.js +2 -0
- package/dist/chunks/splatFileLoader-fz6lXWf1.esm.min.js.map +1 -0
- package/dist/chunks/spotLight-BJUVKiS1.esm.min.js +2 -0
- package/dist/chunks/spotLight-BJUVKiS1.esm.min.js.map +1 -0
- package/dist/chunks/spotLight-DPadbSE2.esm.js +701 -0
- package/dist/chunks/spotLight-DPadbSE2.esm.js.map +1 -0
- package/dist/chunks/standardMaterial-BFBsF3pv.esm.min.js +2 -0
- package/dist/chunks/standardMaterial-BFBsF3pv.esm.min.js.map +1 -0
- package/dist/chunks/standardMaterial-eJkfs5dX.esm.js +1807 -0
- package/dist/chunks/standardMaterial-eJkfs5dX.esm.js.map +1 -0
- package/dist/chunks/stlFileLoader-D-4wZdg7.esm.js +238 -0
- package/dist/chunks/stlFileLoader-D-4wZdg7.esm.js.map +1 -0
- package/dist/chunks/stlFileLoader-DFdDdaYW.esm.min.js +2 -0
- package/dist/chunks/stlFileLoader-DFdDdaYW.esm.min.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-84Uwk9uE.esm.min.js +2 -0
- package/dist/chunks/tgaTextureLoader-84Uwk9uE.esm.min.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-DDAxGDFK.esm.js +349 -0
- package/dist/chunks/tgaTextureLoader-DDAxGDFK.esm.js.map +1 -0
- package/dist/chunks/thinEngine-CiBi1yBe.esm.min.js +2 -0
- package/dist/chunks/thinEngine-CiBi1yBe.esm.min.js.map +1 -0
- package/dist/chunks/thinEngine-iDkoF96X.esm.js +3848 -0
- package/dist/chunks/thinEngine-iDkoF96X.esm.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-DGBYkFXN.esm.js +314 -0
- package/dist/chunks/thinInstanceMesh-DGBYkFXN.esm.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-MROq1d7v.esm.min.js +2 -0
- package/dist/chunks/thinInstanceMesh-MROq1d7v.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-0VXbzCuF.esm.js +428 -0
- package/dist/chunks/vertexColorMixing-0VXbzCuF.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-B3GD6hE2.esm.js +538 -0
- package/dist/chunks/vertexColorMixing-B3GD6hE2.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-ClVYo-h9.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-ClVYo-h9.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-j0Dix_Wy.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-j0Dix_Wy.esm.min.js.map +1 -0
- package/dist/chunks/webgpuEngine-BLhhEybd.esm.min.js +2 -0
- package/dist/chunks/webgpuEngine-BLhhEybd.esm.min.js.map +1 -0
- package/dist/chunks/webgpuEngine-Cs5fkngY.esm.js +11533 -0
- package/dist/chunks/webgpuEngine-Cs5fkngY.esm.js.map +1 -0
- package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
- package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
- package/lib/index.d.ts +591 -0
- package/lib/index.js +2165 -0
- package/lib/index.js.map +1 -0
- package/package.json +19 -28
- package/readme.md +28 -28
- package/configuration/configuration.d.ts +0 -107
- package/configuration/configuration.js +0 -16
- package/configuration/configuration.js.map +0 -1
- package/configuration/configurationCompatibility.d.ts +0 -8
- package/configuration/configurationCompatibility.js +0 -66
- package/configuration/configurationCompatibility.js.map +0 -1
- package/configuration/configurationContainer.d.ts +0 -10
- package/configuration/configurationContainer.js +0 -10
- package/configuration/configurationContainer.js.map +0 -1
- package/configuration/globals.d.ts +0 -6
- package/configuration/globals.js +0 -18
- package/configuration/globals.js.map +0 -1
- package/configuration/index.d.ts +0 -2
- package/configuration/index.js +0 -4
- package/configuration/index.js.map +0 -1
- package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
- package/configuration/interfaces/cameraConfiguration.js +0 -2
- package/configuration/interfaces/cameraConfiguration.js.map +0 -1
- package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
- package/configuration/interfaces/colorGradingConfiguration.js +0 -2
- package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
- package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
- package/configuration/interfaces/environmentMapConfiguration.js +0 -2
- package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
- package/configuration/interfaces/groundConfiguration.d.ts +0 -24
- package/configuration/interfaces/groundConfiguration.js +0 -2
- package/configuration/interfaces/groundConfiguration.js.map +0 -1
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
- package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
- package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
- package/configuration/interfaces/index.d.ts +0 -15
- package/configuration/interfaces/index.js +0 -16
- package/configuration/interfaces/index.js.map +0 -1
- package/configuration/interfaces/lightConfiguration.d.ts +0 -60
- package/configuration/interfaces/lightConfiguration.js +0 -2
- package/configuration/interfaces/lightConfiguration.js.map +0 -1
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
- package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
- package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
- package/configuration/interfaces/modelConfiguration.d.ts +0 -65
- package/configuration/interfaces/modelConfiguration.js +0 -2
- package/configuration/interfaces/modelConfiguration.js.map +0 -1
- package/configuration/interfaces/observersConfiguration.d.ts +0 -5
- package/configuration/interfaces/observersConfiguration.js +0 -2
- package/configuration/interfaces/observersConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
- package/configuration/interfaces/sceneConfiguration.js +0 -2
- package/configuration/interfaces/sceneConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
- package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
- package/configuration/interfaces/skyboxConfiguration.js +0 -2
- package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
- package/configuration/interfaces/templateConfiguration.d.ts +0 -67
- package/configuration/interfaces/templateConfiguration.js +0 -2
- package/configuration/interfaces/templateConfiguration.js.map +0 -1
- package/configuration/interfaces/vrConfiguration.d.ts +0 -16
- package/configuration/interfaces/vrConfiguration.js +0 -2
- package/configuration/interfaces/vrConfiguration.js.map +0 -1
- package/configuration/loader.d.ts +0 -4
- package/configuration/loader.js +0 -17
- package/configuration/loader.js.map +0 -1
- package/configuration/mappers.d.ts +0 -43
- package/configuration/mappers.js +0 -193
- package/configuration/mappers.js.map +0 -1
- package/configuration/renderOnlyLoader.d.ts +0 -33
- package/configuration/renderOnlyLoader.js +0 -162
- package/configuration/renderOnlyLoader.js.map +0 -1
- package/configuration/types/default.d.ts +0 -6
- package/configuration/types/default.js +0 -121
- package/configuration/types/default.js.map +0 -1
- package/configuration/types/environmentMap.d.ts +0 -5
- package/configuration/types/environmentMap.js +0 -14
- package/configuration/types/environmentMap.js.map +0 -1
- package/configuration/types/extended.d.ts +0 -6
- package/configuration/types/extended.js +0 -317
- package/configuration/types/extended.js.map +0 -1
- package/configuration/types/index.d.ts +0 -14
- package/configuration/types/index.js +0 -51
- package/configuration/types/index.js.map +0 -1
- package/configuration/types/minimal.d.ts +0 -6
- package/configuration/types/minimal.js +0 -43
- package/configuration/types/minimal.js.map +0 -1
- package/configuration/types/renderOnlyDefault.d.ts +0 -30
- package/configuration/types/renderOnlyDefault.js +0 -31
- package/configuration/types/renderOnlyDefault.js.map +0 -1
- package/configuration/types/shadowLight.d.ts +0 -9
- package/configuration/types/shadowLight.js +0 -64
- package/configuration/types/shadowLight.js.map +0 -1
- package/helper/index.d.ts +0 -29
- package/helper/index.js +0 -66
- package/helper/index.js.map +0 -1
- package/index.d.ts +0 -30
- package/index.js +0 -46
- package/index.js.map +0 -1
- package/initializer.d.ts +0 -11
- package/initializer.js +0 -35
- package/initializer.js.map +0 -1
- package/interfaces.d.ts +0 -5
- package/interfaces.js +0 -7
- package/interfaces.js.map +0 -1
- package/labs/environmentSerializer.d.ts +0 -126
- package/labs/environmentSerializer.js +0 -191
- package/labs/environmentSerializer.js.map +0 -1
- package/labs/texture.d.ts +0 -183
- package/labs/texture.js +0 -351
- package/labs/texture.js.map +0 -1
- package/labs/viewerLabs.d.ts +0 -51
- package/labs/viewerLabs.js +0 -134
- package/labs/viewerLabs.js.map +0 -1
- package/loader/modelLoader.d.ts +0 -56
- package/loader/modelLoader.js +0 -202
- package/loader/modelLoader.js.map +0 -1
- package/loader/plugins/applyMaterialConfig.d.ts +0 -12
- package/loader/plugins/applyMaterialConfig.js +0 -16
- package/loader/plugins/applyMaterialConfig.js.map +0 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
- package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
- package/loader/plugins/index.d.ts +0 -19
- package/loader/plugins/index.js +0 -44
- package/loader/plugins/index.js.map +0 -1
- package/loader/plugins/loaderPlugin.d.ts +0 -24
- package/loader/plugins/loaderPlugin.js +0 -2
- package/loader/plugins/loaderPlugin.js.map +0 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
- package/loader/plugins/msftLodLoaderPlugin.js +0 -21
- package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
- package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
- package/loader/plugins/telemetryLoaderPlugin.js +0 -36
- package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
- package/managers/observablesManager.d.ts +0 -66
- package/managers/observablesManager.js +0 -35
- package/managers/observablesManager.js.map +0 -1
- package/managers/sceneManager.d.ts +0 -245
- package/managers/sceneManager.js +0 -1375
- package/managers/sceneManager.js.map +0 -1
- package/managers/telemetryManager.d.ts +0 -78
- package/managers/telemetryManager.js +0 -117
- package/managers/telemetryManager.js.map +0 -1
- package/model/modelAnimation.d.ts +0 -215
- package/model/modelAnimation.js +0 -237
- package/model/modelAnimation.js.map +0 -1
- package/model/viewerModel.d.ts +0 -233
- package/model/viewerModel.js +0 -673
- package/model/viewerModel.js.map +0 -1
- package/optimizer/custom/extended.d.ts +0 -13
- package/optimizer/custom/extended.js +0 -101
- package/optimizer/custom/extended.js.map +0 -1
- package/optimizer/custom/index.d.ts +0 -9
- package/optimizer/custom/index.js +0 -26
- package/optimizer/custom/index.js.map +0 -1
- package/renderOnlyIndex.d.ts +0 -11
- package/renderOnlyIndex.js +0 -18
- package/renderOnlyIndex.js.map +0 -1
- package/templating/eventManager.d.ts +0 -35
- package/templating/eventManager.js +0 -66
- package/templating/eventManager.js.map +0 -1
- package/templating/plugins/hdButtonPlugin.d.ts +0 -9
- package/templating/plugins/hdButtonPlugin.js +0 -22
- package/templating/plugins/hdButtonPlugin.js.map +0 -1
- package/templating/plugins/printButton.d.ts +0 -9
- package/templating/plugins/printButton.js +0 -41
- package/templating/plugins/printButton.js.map +0 -1
- package/templating/templateManager.d.ts +0 -197
- package/templating/templateManager.js +0 -561
- package/templating/templateManager.js.map +0 -1
- package/templating/viewerTemplatePlugin.d.ts +0 -21
- package/templating/viewerTemplatePlugin.js +0 -69
- package/templating/viewerTemplatePlugin.js.map +0 -1
- package/viewer/defaultViewer.d.ts +0 -130
- package/viewer/defaultViewer.js +0 -672
- package/viewer/defaultViewer.js.map +0 -1
- package/viewer/renderOnlyViewer.d.ts +0 -9
- package/viewer/renderOnlyViewer.js +0 -46
- package/viewer/renderOnlyViewer.js.map +0 -1
- package/viewer/viewer.d.ts +0 -258
- package/viewer/viewer.js +0 -783
- package/viewer/viewer.js.map +0 -1
- package/viewer/viewerManager.d.ts +0 -58
- package/viewer/viewerManager.js +0 -91
- package/viewer/viewerManager.js.map +0 -1
- package/viewer/viewerWithTemplate.d.ts +0 -9
- package/viewer/viewerWithTemplate.js +0 -20
- package/viewer/viewerWithTemplate.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_sheen-D2QD8uSC.esm.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_sheen.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_sheen\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_sheen/README.md)\n * [Playground Sample](https://www.babylonjs-playground.com/frame.html#BNIZX6#4)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_sheen {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSheenPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSheenPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n babylonMaterial.sheen.isEnabled = true;\n babylonMaterial.sheen.intensity = 1;\n if (properties.sheenColorFactor != undefined) {\n babylonMaterial.sheen.color = Color3.FromArray(properties.sheenColorFactor);\n }\n else {\n babylonMaterial.sheen.color = Color3.Black();\n }\n if (properties.sheenColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenColorTexture`, properties.sheenColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Color)`;\n babylonMaterial.sheen.texture = texture;\n }));\n }\n if (properties.sheenRoughnessFactor !== undefined) {\n babylonMaterial.sheen.roughness = properties.sheenRoughnessFactor;\n }\n else {\n babylonMaterial.sheen.roughness = 0;\n }\n if (properties.sheenRoughnessTexture) {\n properties.sheenRoughnessTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenRoughnessTexture`, properties.sheenRoughnessTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Roughness)`;\n babylonMaterial.sheen.textureRoughness = texture;\n }));\n }\n babylonMaterial.sheen.albedoScaling = true;\n babylonMaterial.sheen.useRoughnessFromMainTexture = false;\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_sheen(loader));\n//# sourceMappingURL=KHR_materials_sheen.js.map"],"names":[],"mappings":";;;;;;AAIA,MAAM,IAAI,GAAG,qBAAqB;AAClC;AACA;AACA;AACA;AACA;AACO,MAAM,mBAAmB,CAAC;AACjC;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB;AACA;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,GAAG,OAAO;AAChE,aAAa,CAAC,CAAC;AACf;AACA,QAAQ,eAAe,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI;AAClD,QAAQ,eAAe,CAAC,KAAK,CAAC,2BAA2B,GAAG,KAAK;AACjE,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AACpD;AACA;AACA,uBAAuB,CAAC,IAAI,CAAC;AAC7B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a$ as e,s,aQ as n,aR as o}from"./index-Bo5F_mGk.esm.min.js";import{G as r}from"./glTFLoader-Dj_JCgqJ.esm.min.js";import"./rawTexture-BAt5J3G4.esm.min.js";import"./assetContainer-CMuD-n3X.esm.min.js";import"./glTFLoaderAnimation-A_WVS-lt.esm.min.js";const t="KHR_materials_sheen";class a{constructor(e){this.name=t,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,n){return r.LoadExtensionAsync(e,s,this.name,((o,r)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(e,s,n)),t.push(this._loadSheenPropertiesAsync(o,r,n)),Promise.all(t).then((()=>{}))}))}_loadSheenPropertiesAsync(n,o,r){if(!(r instanceof e))throw new Error(`${n}: Material type not supported`);const t=new Array;return r.sheen.isEnabled=!0,r.sheen.intensity=1,null!=o.sheenColorFactor?r.sheen.color=s.FromArray(o.sheenColorFactor):r.sheen.color=s.Black(),o.sheenColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${n}/sheenColorTexture`,o.sheenColorTexture,(e=>{e.name=`${r.name} (Sheen Color)`,r.sheen.texture=e}))),void 0!==o.sheenRoughnessFactor?r.sheen.roughness=o.sheenRoughnessFactor:r.sheen.roughness=0,o.sheenRoughnessTexture&&(o.sheenRoughnessTexture.nonColorData=!0,t.push(this._loader.loadTextureInfoAsync(`${n}/sheenRoughnessTexture`,o.sheenRoughnessTexture,(e=>{e.name=`${r.name} (Sheen Roughness)`,r.sheen.textureRoughness=e})))),r.sheen.albedoScaling=!0,r.sheen.useRoughnessFromMainTexture=!1,Promise.all(t).then((()=>{}))}}n(t),o(t,!0,(e=>new a(e)));export{a as KHR_materials_sheen};
|
|
2
|
+
//# sourceMappingURL=KHR_materials_sheen-cqxpRyXD.esm.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_sheen-cqxpRyXD.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_sheen.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_sheen\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_sheen/README.md)\n * [Playground Sample](https://www.babylonjs-playground.com/frame.html#BNIZX6#4)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_sheen {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSheenPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSheenPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n babylonMaterial.sheen.isEnabled = true;\n babylonMaterial.sheen.intensity = 1;\n if (properties.sheenColorFactor != undefined) {\n babylonMaterial.sheen.color = Color3.FromArray(properties.sheenColorFactor);\n }\n else {\n babylonMaterial.sheen.color = Color3.Black();\n }\n if (properties.sheenColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenColorTexture`, properties.sheenColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Color)`;\n babylonMaterial.sheen.texture = texture;\n }));\n }\n if (properties.sheenRoughnessFactor !== undefined) {\n babylonMaterial.sheen.roughness = properties.sheenRoughnessFactor;\n }\n else {\n babylonMaterial.sheen.roughness = 0;\n }\n if (properties.sheenRoughnessTexture) {\n properties.sheenRoughnessTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/sheenRoughnessTexture`, properties.sheenRoughnessTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Sheen Roughness)`;\n babylonMaterial.sheen.textureRoughness = texture;\n }));\n }\n babylonMaterial.sheen.albedoScaling = true;\n babylonMaterial.sheen.useRoughnessFromMainTexture = false;\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_sheen(loader));\n//# sourceMappingURL=KHR_materials_sheen.js.map"],"names":["NAME","KHR_materials_sheen","constructor","loader","this","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","GLTFLoader","LoadExtensionAsync","extensionContext","extension","promises","Array","push","_loadSheenPropertiesAsync","Promise","all","then","properties","PBRMaterial","Error","sheen","isEnabled","intensity","undefined","sheenColorFactor","color","Color3","FromArray","Black","sheenColorTexture","loadTextureInfoAsync","texture","sheenRoughnessFactor","roughness","sheenRoughnessTexture","nonColorData","textureRoughness","albedoScaling","useRoughnessFromMainTexture","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"gQAIA,MAAMA,EAAO,sBAMN,MAAMC,EAIT,WAAAC,CAAYC,GAIRC,KAAKC,KAAOL,EAIZI,KAAKE,MAAQ,IACbF,KAAKG,QAAUJ,EACfC,KAAKI,QAAUJ,KAAKG,QAAQE,gBAAgBT,EACpD,CAEI,OAAAU,GACIN,KAAKG,QAAU,IACvB,CAII,2BAAAI,CAA4BC,EAASC,EAAUC,GAC3C,OAAOC,EAAWC,mBAAmBJ,EAASC,EAAUT,KAAKC,MAAM,CAACY,EAAkBC,KAClF,MAAMC,EAAW,IAAIC,MAGrB,OAFAD,EAASE,KAAKjB,KAAKG,QAAQI,4BAA4BC,EAASC,EAAUC,IAC1EK,EAASE,KAAKjB,KAAKkB,0BAA0BL,EAAkBC,EAAWJ,IACnES,QAAQC,IAAIL,GAAUM,MAAK,QAAU,GAExD,CACI,yBAAAH,CAA0BV,EAASc,EAAYZ,GAC3C,KAAMA,aAA2Ba,GAC7B,MAAM,IAAIC,MAAM,GAAGhB,kCAEvB,MAAMO,EAAW,IAAIC,MA8BrB,OA7BAN,EAAgBe,MAAMC,WAAY,EAClChB,EAAgBe,MAAME,UAAY,EACCC,MAA/BN,EAAWO,iBACXnB,EAAgBe,MAAMK,MAAQC,EAAOC,UAAUV,EAAWO,kBAG1DnB,EAAgBe,MAAMK,MAAQC,EAAOE,QAErCX,EAAWY,mBACXnB,EAASE,KAAKjB,KAAKG,QAAQgC,qBAAqB,GAAG3B,sBAA6Bc,EAAWY,mBAAoBE,IAC3GA,EAAQnC,KAAO,GAAGS,EAAgBT,qBAClCS,EAAgBe,MAAMW,QAAUA,CAAO,UAGPR,IAApCN,EAAWe,qBACX3B,EAAgBe,MAAMa,UAAYhB,EAAWe,qBAG7C3B,EAAgBe,MAAMa,UAAY,EAElChB,EAAWiB,wBACXjB,EAAWiB,sBAAsBC,cAAe,EAChDzB,EAASE,KAAKjB,KAAKG,QAAQgC,qBAAqB,GAAG3B,0BAAiCc,EAAWiB,uBAAwBH,IACnHA,EAAQnC,KAAO,GAAGS,EAAgBT,yBAClCS,EAAgBe,MAAMgB,iBAAmBL,CAAO,MAGxD1B,EAAgBe,MAAMiB,eAAgB,EACtChC,EAAgBe,MAAMkB,6BAA8B,EAC7CxB,QAAQC,IAAIL,GAAUM,MAAK,QAC1C,EAEAuB,EAAwBhD,GACxBiD,EAAsBjD,GAAM,GAAOG,GAAW,IAAIF,EAAoBE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a$ as e,s as r,aQ as a,aR as s}from"./index-Bo5F_mGk.esm.min.js";import{G as o}from"./glTFLoader-Dj_JCgqJ.esm.min.js";import"./rawTexture-BAt5J3G4.esm.min.js";import"./assetContainer-CMuD-n3X.esm.min.js";import"./glTFLoaderAnimation-A_WVS-lt.esm.min.js";const t="KHR_materials_specular";class l{constructor(e){this.name=t,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,r,a){return o.LoadExtensionAsync(e,r,this.name,((s,o)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(e,r,a)),t.push(this._loadSpecularPropertiesAsync(s,o,a)),Promise.all(t).then((()=>{}))}))}_loadSpecularPropertiesAsync(a,s,o){if(!(o instanceof e))throw new Error(`${a}: Material type not supported`);const t=new Array;return void 0!==s.specularFactor&&(o.metallicF0Factor=s.specularFactor),void 0!==s.specularColorFactor&&(o.metallicReflectanceColor=r.FromArray(s.specularColorFactor)),s.specularTexture&&(s.specularTexture.nonColorData=!0,t.push(this._loader.loadTextureInfoAsync(`${a}/specularTexture`,s.specularTexture,(e=>{e.name=`${o.name} (Specular)`,o.metallicReflectanceTexture=e,o.useOnlyMetallicFromMetallicReflectanceTexture=!0})))),s.specularColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${a}/specularColorTexture`,s.specularColorTexture,(e=>{e.name=`${o.name} (Specular Color)`,o.reflectanceTexture=e}))),Promise.all(t).then((()=>{}))}}a(t),s(t,!0,(e=>new l(e)));export{l as KHR_materials_specular};
|
|
2
|
+
//# sourceMappingURL=KHR_materials_specular-DnHIH9RX.esm.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_specular-DnHIH9RX.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_specular.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_specular\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_specular {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSpecularPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n if (properties.specularFactor !== undefined) {\n babylonMaterial.metallicF0Factor = properties.specularFactor;\n }\n if (properties.specularColorFactor !== undefined) {\n babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor);\n }\n if (properties.specularTexture) {\n properties.specularTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular)`;\n babylonMaterial.metallicReflectanceTexture = texture;\n babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true;\n }));\n }\n if (properties.specularColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular Color)`;\n babylonMaterial.reflectanceTexture = texture;\n }));\n }\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_specular(loader));\n//# sourceMappingURL=KHR_materials_specular.js.map"],"names":["NAME","KHR_materials_specular","constructor","loader","this","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","GLTFLoader","LoadExtensionAsync","extensionContext","extension","promises","Array","push","_loadSpecularPropertiesAsync","Promise","all","then","properties","PBRMaterial","Error","undefined","specularFactor","metallicF0Factor","specularColorFactor","metallicReflectanceColor","Color3","FromArray","specularTexture","nonColorData","loadTextureInfoAsync","texture","metallicReflectanceTexture","useOnlyMetallicFromMetallicReflectanceTexture","specularColorTexture","reflectanceTexture","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"qQAIA,MAAMA,EAAO,yBAKN,MAAMC,EAIT,WAAAC,CAAYC,GAIRC,KAAKC,KAAOL,EAIZI,KAAKE,MAAQ,IACbF,KAAKG,QAAUJ,EACfC,KAAKI,QAAUJ,KAAKG,QAAQE,gBAAgBT,EACpD,CAEI,OAAAU,GACIN,KAAKG,QAAU,IACvB,CAII,2BAAAI,CAA4BC,EAASC,EAAUC,GAC3C,OAAOC,EAAWC,mBAAmBJ,EAASC,EAAUT,KAAKC,MAAM,CAACY,EAAkBC,KAClF,MAAMC,EAAW,IAAIC,MAGrB,OAFAD,EAASE,KAAKjB,KAAKG,QAAQI,4BAA4BC,EAASC,EAAUC,IAC1EK,EAASE,KAAKjB,KAAKkB,6BAA6BL,EAAkBC,EAAWJ,IACtES,QAAQC,IAAIL,GAAUM,MAAK,QAAU,GAExD,CACI,4BAAAH,CAA6BV,EAASc,EAAYZ,GAC9C,KAAMA,aAA2Ba,GAC7B,MAAM,IAAIC,MAAM,GAAGhB,kCAEvB,MAAMO,EAAW,IAAIC,MAqBrB,YApBkCS,IAA9BH,EAAWI,iBACXhB,EAAgBiB,iBAAmBL,EAAWI,qBAEXD,IAAnCH,EAAWM,sBACXlB,EAAgBmB,yBAA2BC,EAAOC,UAAUT,EAAWM,sBAEvEN,EAAWU,kBACXV,EAAWU,gBAAgBC,cAAe,EAC1ClB,EAASE,KAAKjB,KAAKG,QAAQ+B,qBAAqB,GAAG1B,oBAA2Bc,EAAWU,iBAAkBG,IACvGA,EAAQlC,KAAO,GAAGS,EAAgBT,kBAClCS,EAAgB0B,2BAA6BD,EAC7CzB,EAAgB2B,+CAAgD,CAAI,MAGxEf,EAAWgB,sBACXvB,EAASE,KAAKjB,KAAKG,QAAQ+B,qBAAqB,GAAG1B,yBAAgCc,EAAWgB,sBAAuBH,IACjHA,EAAQlC,KAAO,GAAGS,EAAgBT,wBAClCS,EAAgB6B,mBAAqBJ,CAAO,KAG7ChB,QAAQC,IAAIL,GAAUM,MAAK,QAC1C,EAEAmB,EAAwB5C,GACxB6C,EAAsB7C,GAAM,GAAOG,GAAW,IAAIF,EAAuBE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { a$ as PBRMaterial, s as Color3, aQ as unregisterGLTFExtension, aR as registerGLTFExtension } from './index-Dlf001gP.esm.js';
|
|
2
|
+
import { G as GLTFLoader } from './glTFLoader-DnWHbX53.esm.js';
|
|
3
|
+
import './rawTexture-D0O_yrdQ.esm.js';
|
|
4
|
+
import './assetContainer-0Qu2XIWb.esm.js';
|
|
5
|
+
import './glTFLoaderAnimation-C3gHlipY.esm.js';
|
|
6
|
+
|
|
7
|
+
const NAME = "KHR_materials_specular";
|
|
8
|
+
/**
|
|
9
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)
|
|
10
|
+
*/
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
+
class KHR_materials_specular {
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
constructor(loader) {
|
|
17
|
+
/**
|
|
18
|
+
* The name of this extension.
|
|
19
|
+
*/
|
|
20
|
+
this.name = NAME;
|
|
21
|
+
/**
|
|
22
|
+
* Defines a number that determines the order the extensions are applied.
|
|
23
|
+
*/
|
|
24
|
+
this.order = 190;
|
|
25
|
+
this._loader = loader;
|
|
26
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
|
27
|
+
}
|
|
28
|
+
/** @internal */
|
|
29
|
+
dispose() {
|
|
30
|
+
this._loader = null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
loadMaterialPropertiesAsync(context, material, babylonMaterial) {
|
|
36
|
+
return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {
|
|
37
|
+
const promises = new Array();
|
|
38
|
+
promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
|
39
|
+
promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial));
|
|
40
|
+
return Promise.all(promises).then(() => { });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
_loadSpecularPropertiesAsync(context, properties, babylonMaterial) {
|
|
44
|
+
if (!(babylonMaterial instanceof PBRMaterial)) {
|
|
45
|
+
throw new Error(`${context}: Material type not supported`);
|
|
46
|
+
}
|
|
47
|
+
const promises = new Array();
|
|
48
|
+
if (properties.specularFactor !== undefined) {
|
|
49
|
+
babylonMaterial.metallicF0Factor = properties.specularFactor;
|
|
50
|
+
}
|
|
51
|
+
if (properties.specularColorFactor !== undefined) {
|
|
52
|
+
babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor);
|
|
53
|
+
}
|
|
54
|
+
if (properties.specularTexture) {
|
|
55
|
+
properties.specularTexture.nonColorData = true;
|
|
56
|
+
promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {
|
|
57
|
+
texture.name = `${babylonMaterial.name} (Specular)`;
|
|
58
|
+
babylonMaterial.metallicReflectanceTexture = texture;
|
|
59
|
+
babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true;
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
if (properties.specularColorTexture) {
|
|
63
|
+
promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {
|
|
64
|
+
texture.name = `${babylonMaterial.name} (Specular Color)`;
|
|
65
|
+
babylonMaterial.reflectanceTexture = texture;
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
return Promise.all(promises).then(() => { });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
unregisterGLTFExtension(NAME);
|
|
72
|
+
registerGLTFExtension(NAME, true, (loader) => new KHR_materials_specular(loader));
|
|
73
|
+
|
|
74
|
+
export { KHR_materials_specular };
|
|
75
|
+
//# sourceMappingURL=KHR_materials_specular-vwRXhXVF.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_specular-vwRXhXVF.esm.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_specular.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_specular\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_specular {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 190;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadSpecularPropertiesAsync(extensionContext, extension, babylonMaterial));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadSpecularPropertiesAsync(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n if (properties.specularFactor !== undefined) {\n babylonMaterial.metallicF0Factor = properties.specularFactor;\n }\n if (properties.specularColorFactor !== undefined) {\n babylonMaterial.metallicReflectanceColor = Color3.FromArray(properties.specularColorFactor);\n }\n if (properties.specularTexture) {\n properties.specularTexture.nonColorData = true;\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularTexture`, properties.specularTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular)`;\n babylonMaterial.metallicReflectanceTexture = texture;\n babylonMaterial.useOnlyMetallicFromMetallicReflectanceTexture = true;\n }));\n }\n if (properties.specularColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/specularColorTexture`, properties.specularColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Specular Color)`;\n babylonMaterial.reflectanceTexture = texture;\n }));\n }\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_specular(loader));\n//# sourceMappingURL=KHR_materials_specular.js.map"],"names":[],"mappings":";;;;;;AAIA,MAAM,IAAI,GAAG,wBAAwB;AACrC;AACA;AACA;AACA;AACO,MAAM,sBAAsB,CAAC;AACpC;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB;AACA;AACA;AACA,QAAQ,IAAI,CAAC,KAAK,GAAG,GAAG;AACxB,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM;AAC7B,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;AACzD;AACA;AACA,IAAI,OAAO,GAAG;AACd,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI;AAC3B;AACA;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE;AACpE,QAAQ,OAAO,UAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,gBAAgB,EAAE,SAAS,KAAK;AAC5G,YAAY,MAAM,QAAQ,GAAG,IAAI,KAAK,EAAE;AACxC,YAAY,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;AACvG,YAAY,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AAC1G,YAAY,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AACxD,SAAS,CAAC;AACV;AACA,IAAI,4BAA4B,CA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,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC;AACzE,gBAAgB,eAAe,CAAC,kBAAkB,GAAG,OAAO;AAC5D,aAAa,CAAC,CAAC;AACf;AACA,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;AACpD;AACA;AACA,uBAAuB,CAAC,IAAI,CAAC;AAC7B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a$ as e,aQ as s,aR as t,C as r,aV as a,T as n,bC as i}from"./index-Bo5F_mGk.esm.min.js";import{G as o}from"./glTFLoader-Dj_JCgqJ.esm.min.js";import"./rawTexture-BAt5J3G4.esm.min.js";import"./assetContainer-CMuD-n3X.esm.min.js";import"./glTFLoaderAnimation-A_WVS-lt.esm.min.js";class h{static _GetDefaultOptions(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:r.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}constructor(e,s){this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options={...h._GetDefaultOptions(),...e},this._scene=s,this._scene._transmissionHelper=this,this.onErrorObservable=new a,this._scene.onDisposeObservable.addOnce((()=>{this.dispose()})),this._parseScene(),this._setupRenderTargets()}updateOptions(e){if(!Object.keys(e).filter((s=>this._options[s]!==e[s])).length)return;const s={...this._options,...e},t=this._options;this._options=s,s.renderSize===t.renderSize&&s.renderTargetTextureType===t.renderTargetTextureType&&s.generateMipmaps===t.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=s.samples,this._opaqueRenderTarget.lodGenerationScale=s.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=s.lodGenerationOffset):this._setupRenderTargets()}getOpaqueTarget(){return this._opaqueRenderTarget}_shouldRenderAsTransmission(s){return!!s&&!!(s instanceof e&&s.subSurface.isRefractionEnabled)}_addMesh(e){this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),n.SetImmediate((()=>{this._shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=this._opaqueRenderTarget,-1===this._transparentMeshesCache.indexOf(e)&&this._transparentMeshesCache.push(e)):-1===this._opaqueMeshesCache.indexOf(e)&&this._opaqueMeshesCache.push(e)}))}_removeMesh(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];let s=this._transparentMeshesCache.indexOf(e);-1!==s&&this._transparentMeshesCache.splice(s,1),s=this._opaqueMeshesCache.indexOf(e),-1!==s&&this._opaqueMeshesCache.splice(s,1)}_parseScene(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}_onMeshMaterialChanged(s){const t=this._transparentMeshesCache.indexOf(s),r=this._opaqueMeshesCache.indexOf(s);this._shouldRenderAsTransmission(s.material)?(s.material instanceof e&&(s.material.subSurface.refractionTexture=this._opaqueRenderTarget),-1!==r?(this._opaqueMeshesCache.splice(r,1),this._transparentMeshesCache.push(s)):-1===t&&this._transparentMeshesCache.push(s)):-1!==t?(this._transparentMeshesCache.splice(t,1),this._opaqueMeshesCache.push(s)):-1===r&&this._opaqueMeshesCache.push(s)}_isRenderTargetValid(){return null!==this._opaqueRenderTarget?.getInternalTexture()}_setupRenderTargets(){let e,s;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new i("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=this._options.clearColor?.clone()??this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.onBeforeBindObservable.add((t=>{s=this._scene.environmentIntensity,this._scene.environmentIntensity=1,e=this._scene.imageProcessingConfiguration.applyByPostProcess,this._options.clearColor?t.clearColor.copyFrom(this._options.clearColor):this._scene.clearColor.toLinearSpaceToRef(t.clearColor,this._scene.getEngine().useExactSrgbConversions),this._scene.imageProcessingConfiguration._applyByPostProcess=!0})),this._opaqueRenderTarget.onAfterUnbindObservable.add((()=>{this._scene.environmentIntensity=s,this._scene.imageProcessingConfiguration._applyByPostProcess=e})),this._transparentMeshesCache.forEach((e=>{this._shouldRenderAsTransmission(e.material)&&(e.material.refractionTexture=this._opaqueRenderTarget)}))}dispose(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}const p="KHR_materials_transmission";class d{constructor(e){this.name=p,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(p),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,t){return o.LoadExtensionAsync(e,s,this.name,((r,a)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(e,s,t)),n.push(this._loadTransparentPropertiesAsync(r,s,t,a)),Promise.all(n).then((()=>{}))}))}_loadTransparentPropertiesAsync(s,t,r,a){if(!(r instanceof e))throw new Error(`${s}: Material type not supported`);const n=r;if(n.subSurface.isRefractionEnabled=!0,n.subSurface.volumeIndexOfRefraction=1,n.subSurface.useAlbedoToTintRefraction=!0,void 0===a.transmissionFactor)return n.subSurface.refractionIntensity=0,n.subSurface.isRefractionEnabled=!1,Promise.resolve();{n.subSurface.refractionIntensity=a.transmissionFactor;const e=n.getScene();n.subSurface.refractionIntensity&&!e._transmissionHelper?new h({},n.getScene()):n.subSurface.refractionIntensity&&!e._transmissionHelper?._isRenderTargetValid()&&e._transmissionHelper?._setupRenderTargets()}return n.subSurface.minimumThickness=0,n.subSurface.maximumThickness=0,a.transmissionTexture?(a.transmissionTexture.nonColorData=!0,this._loader.loadTextureInfoAsync(`${s}/transmissionTexture`,a.transmissionTexture,void 0).then((e=>{e.name=`${r.name} (Transmission)`,n.subSurface.refractionIntensityTexture=e,n.subSurface.useGltfStyleTextures=!0}))):Promise.resolve()}}s(p),t(p,!0,(e=>new d(e)));export{d as KHR_materials_transmission};
|
|
2
|
+
//# sourceMappingURL=KHR_materials_transmission-D81TRCgt.esm.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_transmission-D81TRCgt.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_transmission.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\nimport { Observable } from \"core/Misc/observable\";\nimport { Constants } from \"core/Engines/constants\";\nimport { Tools } from \"core/Misc/tools\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\n/**\n * A class to handle setting up the rendering of opaque objects to be shown through transmissive objects.\n */\nclass TransmissionHelper {\n /**\n * Creates the default options for the helper.\n * @returns the default options\n */\n static _GetDefaultOptions() {\n return {\n renderSize: 1024,\n samples: 4,\n lodGenerationScale: 1,\n lodGenerationOffset: -4,\n renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT,\n generateMipmaps: true,\n };\n }\n /**\n * constructor\n * @param options Defines the options we want to customize the helper\n * @param scene The scene to add the material to\n */\n constructor(options, scene) {\n this._opaqueRenderTarget = null;\n this._opaqueMeshesCache = [];\n this._transparentMeshesCache = [];\n this._materialObservers = {};\n this._options = {\n ...TransmissionHelper._GetDefaultOptions(),\n ...options,\n };\n this._scene = scene;\n this._scene._transmissionHelper = this;\n this.onErrorObservable = new Observable();\n this._scene.onDisposeObservable.addOnce(() => {\n this.dispose();\n });\n this._parseScene();\n this._setupRenderTargets();\n }\n /**\n * Updates the background according to the new options\n * @param options\n */\n updateOptions(options) {\n // First check if any options are actually being changed. If not, exit.\n const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]);\n if (!newValues.length) {\n return;\n }\n const newOptions = {\n ...this._options,\n ...options,\n };\n const oldOptions = this._options;\n this._options = newOptions;\n // If size changes, recreate everything\n if (newOptions.renderSize !== oldOptions.renderSize ||\n newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType ||\n newOptions.generateMipmaps !== oldOptions.generateMipmaps ||\n !this._opaqueRenderTarget) {\n this._setupRenderTargets();\n }\n else {\n this._opaqueRenderTarget.samples = newOptions.samples;\n this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset;\n }\n }\n /**\n * @returns the opaque render target texture or null if not available.\n */\n getOpaqueTarget() {\n return this._opaqueRenderTarget;\n }\n _shouldRenderAsTransmission(material) {\n if (!material) {\n return false;\n }\n if (material instanceof PBRMaterial && material.subSurface.isRefractionEnabled) {\n return true;\n }\n return false;\n }\n _addMesh(mesh) {\n this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this));\n // we need to defer the processing because _addMesh may be called as part as an instance mesh creation, in which case some\n // internal properties are not setup yet, like _sourceMesh (needed when doing mesh.material below)\n Tools.SetImmediate(() => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n if (this._transparentMeshesCache.indexOf(mesh) === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n }\n else {\n if (this._opaqueMeshesCache.indexOf(mesh) === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n });\n }\n _removeMesh(mesh) {\n mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]);\n delete this._materialObservers[mesh.uniqueId];\n let idx = this._transparentMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._transparentMeshesCache.splice(idx, 1);\n }\n idx = this._opaqueMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._opaqueMeshesCache.splice(idx, 1);\n }\n }\n _parseScene() {\n this._scene.meshes.forEach(this._addMesh.bind(this));\n // Listen for when a mesh is added to the scene and add it to our cache lists.\n this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this));\n // Listen for when a mesh is removed from to the scene and remove it from our cache lists.\n this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));\n }\n // When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.\n _onMeshMaterialChanged(mesh) {\n const transparentIdx = this._transparentMeshesCache.indexOf(mesh);\n const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh);\n // If the material is transparent, make sure that it's added to the transparent list and removed from the opaque list\n const useTransmission = this._shouldRenderAsTransmission(mesh.material);\n if (useTransmission) {\n if (mesh.material instanceof PBRMaterial) {\n mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget;\n }\n if (opaqueIdx !== -1) {\n this._opaqueMeshesCache.splice(opaqueIdx, 1);\n this._transparentMeshesCache.push(mesh);\n }\n else if (transparentIdx === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n // If the material is opaque, make sure that it's added to the opaque list and removed from the transparent list\n }\n else {\n if (transparentIdx !== -1) {\n this._transparentMeshesCache.splice(transparentIdx, 1);\n this._opaqueMeshesCache.push(mesh);\n }\n else if (opaqueIdx === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n }\n /**\n * @internal\n * Check if the opaque render target has not been disposed and can still be used.\n * @returns\n */\n _isRenderTargetValid() {\n return this._opaqueRenderTarget?.getInternalTexture() !== null;\n }\n /**\n * @internal\n * Setup the render targets according to the specified options.\n */\n _setupRenderTargets() {\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n }\n this._opaqueRenderTarget = new RenderTargetTexture(\"opaqueSceneTexture\", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType);\n this._opaqueRenderTarget.ignoreCameraViewport = true;\n this._opaqueRenderTarget.renderList = this._opaqueMeshesCache;\n this._opaqueRenderTarget.clearColor = this._options.clearColor?.clone() ?? this._scene.clearColor.clone();\n this._opaqueRenderTarget.gammaSpace = false;\n this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset;\n this._opaqueRenderTarget.samples = this._options.samples;\n this._opaqueRenderTarget.renderSprites = true;\n this._opaqueRenderTarget.renderParticles = true;\n let sceneImageProcessingapplyByPostProcess;\n let saveSceneEnvIntensity;\n this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => {\n saveSceneEnvIntensity = this._scene.environmentIntensity;\n this._scene.environmentIntensity = 1.0;\n sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;\n if (!this._options.clearColor) {\n this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions);\n }\n else {\n opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor);\n }\n // we do not use the applyByPostProcess setter to avoid flagging all the materials as \"image processing dirty\"!\n this._scene.imageProcessingConfiguration._applyByPostProcess = true;\n });\n this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {\n this._scene.environmentIntensity = saveSceneEnvIntensity;\n this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;\n });\n this._transparentMeshesCache.forEach((mesh) => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n }\n });\n }\n /**\n * Dispose all the elements created by the Helper.\n */\n dispose() {\n this._scene._transmissionHelper = undefined;\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n this._opaqueRenderTarget = null;\n }\n this._transparentMeshesCache = [];\n this._opaqueMeshesCache = [];\n }\n}\nconst NAME = \"KHR_materials_transmission\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_transmission {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 175;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n if (this.enabled) {\n loader.parent.transparencyAsCoverage = true;\n }\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const pbrMaterial = babylonMaterial;\n // Enables \"refraction\" texture which represents transmitted light.\n pbrMaterial.subSurface.isRefractionEnabled = true;\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\n pbrMaterial.subSurface.volumeIndexOfRefraction = 1.0;\n // Albedo colour will tint transmission.\n pbrMaterial.subSurface.useAlbedoToTintRefraction = true;\n if (extension.transmissionFactor !== undefined) {\n pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;\n const scene = pbrMaterial.getScene();\n if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper) {\n new TransmissionHelper({}, pbrMaterial.getScene());\n }\n else if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper?._isRenderTargetValid()) {\n // If the render target is not valid, recreate it.\n scene._transmissionHelper?._setupRenderTargets();\n }\n }\n else {\n pbrMaterial.subSurface.refractionIntensity = 0.0;\n pbrMaterial.subSurface.isRefractionEnabled = false;\n return Promise.resolve();\n }\n pbrMaterial.subSurface.minimumThickness = 0.0;\n pbrMaterial.subSurface.maximumThickness = 0.0;\n if (extension.transmissionTexture) {\n extension.transmissionTexture.nonColorData = true;\n return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then((texture) => {\n texture.name = `${babylonMaterial.name} (Transmission)`;\n pbrMaterial.subSurface.refractionIntensityTexture = texture;\n pbrMaterial.subSurface.useGltfStyleTextures = true;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_transmission(loader));\n//# sourceMappingURL=KHR_materials_transmission.js.map"],"names":["TransmissionHelper","_GetDefaultOptions","renderSize","samples","lodGenerationScale","lodGenerationOffset","renderTargetTextureType","Constants","TEXTURETYPE_HALF_FLOAT","generateMipmaps","constructor","options","scene","this","_opaqueRenderTarget","_opaqueMeshesCache","_transparentMeshesCache","_materialObservers","_options","_scene","_transmissionHelper","onErrorObservable","Observable","onDisposeObservable","addOnce","dispose","_parseScene","_setupRenderTargets","updateOptions","Object","keys","filter","key","length","newOptions","oldOptions","getOpaqueTarget","_shouldRenderAsTransmission","material","PBRMaterial","subSurface","isRefractionEnabled","_addMesh","mesh","uniqueId","onMaterialChangedObservable","add","_onMeshMaterialChanged","bind","Tools","SetImmediate","refractionTexture","indexOf","push","_removeMesh","remove","idx","splice","meshes","forEach","onNewMeshAddedObservable","onMeshRemovedObservable","transparentIdx","opaqueIdx","_isRenderTargetValid","getInternalTexture","sceneImageProcessingapplyByPostProcess","saveSceneEnvIntensity","RenderTargetTexture","undefined","ignoreCameraViewport","renderList","clearColor","clone","gammaSpace","renderSprites","renderParticles","onBeforeBindObservable","opaqueRenderTarget","environmentIntensity","imageProcessingConfiguration","applyByPostProcess","copyFrom","toLinearSpaceToRef","getEngine","useExactSrgbConversions","_applyByPostProcess","onAfterUnbindObservable","NAME","KHR_materials_transmission","loader","name","order","_loader","enabled","isExtensionUsed","parent","transparencyAsCoverage","loadMaterialPropertiesAsync","context","babylonMaterial","GLTFLoader","LoadExtensionAsync","extensionContext","extension","promises","Array","_loadTransparentPropertiesAsync","Promise","all","then","Error","pbrMaterial","volumeIndexOfRefraction","useAlbedoToTintRefraction","transmissionFactor","refractionIntensity","resolve","getScene","minimumThickness","maximumThickness","transmissionTexture","nonColorData","loadTextureInfoAsync","texture","refractionIntensityTexture","useGltfStyleTextures","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"4RAUA,MAAMA,EAKF,yBAAOC,GACH,MAAO,CACHC,WAAY,KACZC,QAAS,EACTC,mBAAoB,EACpBC,qBAAsB,EACtBC,wBAAyBC,EAAUC,uBACnCC,iBAAiB,EAE7B,CAMI,WAAAC,CAAYC,EAASC,GACjBC,KAAKC,oBAAsB,KAC3BD,KAAKE,mBAAqB,GAC1BF,KAAKG,wBAA0B,GAC/BH,KAAKI,mBAAqB,CAAE,EAC5BJ,KAAKK,SAAW,IACTlB,EAAmBC,wBACnBU,GAEPE,KAAKM,OAASP,EACdC,KAAKM,OAAOC,oBAAsBP,KAClCA,KAAKQ,kBAAoB,IAAIC,EAC7BT,KAAKM,OAAOI,oBAAoBC,SAAQ,KACpCX,KAAKY,SAAS,IAElBZ,KAAKa,cACLb,KAAKc,qBACb,CAKI,aAAAC,CAAcjB,GAGV,IADkBkB,OAAOC,KAAKnB,GAASoB,QAAQC,GAAQnB,KAAKK,SAASc,KAASrB,EAAQqB,KACvEC,OACX,OAEJ,MAAMC,EAAa,IACZrB,K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}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { a$ as PBRMaterial, aQ as unregisterGLTFExtension, aR as registerGLTFExtension, C as Constants, aV as Observable, T as Tools, bC as RenderTargetTexture } from './index-Dlf001gP.esm.js';
|
|
2
|
+
import { G as GLTFLoader } from './glTFLoader-DnWHbX53.esm.js';
|
|
3
|
+
import './rawTexture-D0O_yrdQ.esm.js';
|
|
4
|
+
import './assetContainer-0Qu2XIWb.esm.js';
|
|
5
|
+
import './glTFLoaderAnimation-C3gHlipY.esm.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A class to handle setting up the rendering of opaque objects to be shown through transmissive objects.
|
|
9
|
+
*/
|
|
10
|
+
class TransmissionHelper {
|
|
11
|
+
/**
|
|
12
|
+
* Creates the default options for the helper.
|
|
13
|
+
* @returns the default options
|
|
14
|
+
*/
|
|
15
|
+
static _GetDefaultOptions() {
|
|
16
|
+
return {
|
|
17
|
+
renderSize: 1024,
|
|
18
|
+
samples: 4,
|
|
19
|
+
lodGenerationScale: 1,
|
|
20
|
+
lodGenerationOffset: -4,
|
|
21
|
+
renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT,
|
|
22
|
+
generateMipmaps: true,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* constructor
|
|
27
|
+
* @param options Defines the options we want to customize the helper
|
|
28
|
+
* @param scene The scene to add the material to
|
|
29
|
+
*/
|
|
30
|
+
constructor(options, scene) {
|
|
31
|
+
this._opaqueRenderTarget = null;
|
|
32
|
+
this._opaqueMeshesCache = [];
|
|
33
|
+
this._transparentMeshesCache = [];
|
|
34
|
+
this._materialObservers = {};
|
|
35
|
+
this._options = {
|
|
36
|
+
...TransmissionHelper._GetDefaultOptions(),
|
|
37
|
+
...options,
|
|
38
|
+
};
|
|
39
|
+
this._scene = scene;
|
|
40
|
+
this._scene._transmissionHelper = this;
|
|
41
|
+
this.onErrorObservable = new Observable();
|
|
42
|
+
this._scene.onDisposeObservable.addOnce(() => {
|
|
43
|
+
this.dispose();
|
|
44
|
+
});
|
|
45
|
+
this._parseScene();
|
|
46
|
+
this._setupRenderTargets();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Updates the background according to the new options
|
|
50
|
+
* @param options
|
|
51
|
+
*/
|
|
52
|
+
updateOptions(options) {
|
|
53
|
+
// First check if any options are actually being changed. If not, exit.
|
|
54
|
+
const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]);
|
|
55
|
+
if (!newValues.length) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const newOptions = {
|
|
59
|
+
...this._options,
|
|
60
|
+
...options,
|
|
61
|
+
};
|
|
62
|
+
const oldOptions = this._options;
|
|
63
|
+
this._options = newOptions;
|
|
64
|
+
// If size changes, recreate everything
|
|
65
|
+
if (newOptions.renderSize !== oldOptions.renderSize ||
|
|
66
|
+
newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType ||
|
|
67
|
+
newOptions.generateMipmaps !== oldOptions.generateMipmaps ||
|
|
68
|
+
!this._opaqueRenderTarget) {
|
|
69
|
+
this._setupRenderTargets();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this._opaqueRenderTarget.samples = newOptions.samples;
|
|
73
|
+
this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale;
|
|
74
|
+
this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @returns the opaque render target texture or null if not available.
|
|
79
|
+
*/
|
|
80
|
+
getOpaqueTarget() {
|
|
81
|
+
return this._opaqueRenderTarget;
|
|
82
|
+
}
|
|
83
|
+
_shouldRenderAsTransmission(material) {
|
|
84
|
+
if (!material) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (material instanceof PBRMaterial && material.subSurface.isRefractionEnabled) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
_addMesh(mesh) {
|
|
93
|
+
this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this));
|
|
94
|
+
// we need to defer the processing because _addMesh may be called as part as an instance mesh creation, in which case some
|
|
95
|
+
// internal properties are not setup yet, like _sourceMesh (needed when doing mesh.material below)
|
|
96
|
+
Tools.SetImmediate(() => {
|
|
97
|
+
if (this._shouldRenderAsTransmission(mesh.material)) {
|
|
98
|
+
mesh.material.refractionTexture = this._opaqueRenderTarget;
|
|
99
|
+
if (this._transparentMeshesCache.indexOf(mesh) === -1) {
|
|
100
|
+
this._transparentMeshesCache.push(mesh);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
if (this._opaqueMeshesCache.indexOf(mesh) === -1) {
|
|
105
|
+
this._opaqueMeshesCache.push(mesh);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
_removeMesh(mesh) {
|
|
111
|
+
mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]);
|
|
112
|
+
delete this._materialObservers[mesh.uniqueId];
|
|
113
|
+
let idx = this._transparentMeshesCache.indexOf(mesh);
|
|
114
|
+
if (idx !== -1) {
|
|
115
|
+
this._transparentMeshesCache.splice(idx, 1);
|
|
116
|
+
}
|
|
117
|
+
idx = this._opaqueMeshesCache.indexOf(mesh);
|
|
118
|
+
if (idx !== -1) {
|
|
119
|
+
this._opaqueMeshesCache.splice(idx, 1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
_parseScene() {
|
|
123
|
+
this._scene.meshes.forEach(this._addMesh.bind(this));
|
|
124
|
+
// Listen for when a mesh is added to the scene and add it to our cache lists.
|
|
125
|
+
this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this));
|
|
126
|
+
// Listen for when a mesh is removed from to the scene and remove it from our cache lists.
|
|
127
|
+
this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));
|
|
128
|
+
}
|
|
129
|
+
// When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.
|
|
130
|
+
_onMeshMaterialChanged(mesh) {
|
|
131
|
+
const transparentIdx = this._transparentMeshesCache.indexOf(mesh);
|
|
132
|
+
const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh);
|
|
133
|
+
// If the material is transparent, make sure that it's added to the transparent list and removed from the opaque list
|
|
134
|
+
const useTransmission = this._shouldRenderAsTransmission(mesh.material);
|
|
135
|
+
if (useTransmission) {
|
|
136
|
+
if (mesh.material instanceof PBRMaterial) {
|
|
137
|
+
mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget;
|
|
138
|
+
}
|
|
139
|
+
if (opaqueIdx !== -1) {
|
|
140
|
+
this._opaqueMeshesCache.splice(opaqueIdx, 1);
|
|
141
|
+
this._transparentMeshesCache.push(mesh);
|
|
142
|
+
}
|
|
143
|
+
else if (transparentIdx === -1) {
|
|
144
|
+
this._transparentMeshesCache.push(mesh);
|
|
145
|
+
}
|
|
146
|
+
// If the material is opaque, make sure that it's added to the opaque list and removed from the transparent list
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
if (transparentIdx !== -1) {
|
|
150
|
+
this._transparentMeshesCache.splice(transparentIdx, 1);
|
|
151
|
+
this._opaqueMeshesCache.push(mesh);
|
|
152
|
+
}
|
|
153
|
+
else if (opaqueIdx === -1) {
|
|
154
|
+
this._opaqueMeshesCache.push(mesh);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
* Check if the opaque render target has not been disposed and can still be used.
|
|
161
|
+
* @returns
|
|
162
|
+
*/
|
|
163
|
+
_isRenderTargetValid() {
|
|
164
|
+
return this._opaqueRenderTarget?.getInternalTexture() !== null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @internal
|
|
168
|
+
* Setup the render targets according to the specified options.
|
|
169
|
+
*/
|
|
170
|
+
_setupRenderTargets() {
|
|
171
|
+
if (this._opaqueRenderTarget) {
|
|
172
|
+
this._opaqueRenderTarget.dispose();
|
|
173
|
+
}
|
|
174
|
+
this._opaqueRenderTarget = new RenderTargetTexture("opaqueSceneTexture", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType);
|
|
175
|
+
this._opaqueRenderTarget.ignoreCameraViewport = true;
|
|
176
|
+
this._opaqueRenderTarget.renderList = this._opaqueMeshesCache;
|
|
177
|
+
this._opaqueRenderTarget.clearColor = this._options.clearColor?.clone() ?? this._scene.clearColor.clone();
|
|
178
|
+
this._opaqueRenderTarget.gammaSpace = false;
|
|
179
|
+
this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale;
|
|
180
|
+
this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset;
|
|
181
|
+
this._opaqueRenderTarget.samples = this._options.samples;
|
|
182
|
+
this._opaqueRenderTarget.renderSprites = true;
|
|
183
|
+
this._opaqueRenderTarget.renderParticles = true;
|
|
184
|
+
let sceneImageProcessingapplyByPostProcess;
|
|
185
|
+
let saveSceneEnvIntensity;
|
|
186
|
+
this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => {
|
|
187
|
+
saveSceneEnvIntensity = this._scene.environmentIntensity;
|
|
188
|
+
this._scene.environmentIntensity = 1.0;
|
|
189
|
+
sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;
|
|
190
|
+
if (!this._options.clearColor) {
|
|
191
|
+
this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor);
|
|
195
|
+
}
|
|
196
|
+
// we do not use the applyByPostProcess setter to avoid flagging all the materials as "image processing dirty"!
|
|
197
|
+
this._scene.imageProcessingConfiguration._applyByPostProcess = true;
|
|
198
|
+
});
|
|
199
|
+
this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {
|
|
200
|
+
this._scene.environmentIntensity = saveSceneEnvIntensity;
|
|
201
|
+
this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;
|
|
202
|
+
});
|
|
203
|
+
this._transparentMeshesCache.forEach((mesh) => {
|
|
204
|
+
if (this._shouldRenderAsTransmission(mesh.material)) {
|
|
205
|
+
mesh.material.refractionTexture = this._opaqueRenderTarget;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Dispose all the elements created by the Helper.
|
|
211
|
+
*/
|
|
212
|
+
dispose() {
|
|
213
|
+
this._scene._transmissionHelper = undefined;
|
|
214
|
+
if (this._opaqueRenderTarget) {
|
|
215
|
+
this._opaqueRenderTarget.dispose();
|
|
216
|
+
this._opaqueRenderTarget = null;
|
|
217
|
+
}
|
|
218
|
+
this._transparentMeshesCache = [];
|
|
219
|
+
this._opaqueMeshesCache = [];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const NAME = "KHR_materials_transmission";
|
|
223
|
+
/**
|
|
224
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)
|
|
225
|
+
*/
|
|
226
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
227
|
+
class KHR_materials_transmission {
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
constructor(loader) {
|
|
232
|
+
/**
|
|
233
|
+
* The name of this extension.
|
|
234
|
+
*/
|
|
235
|
+
this.name = NAME;
|
|
236
|
+
/**
|
|
237
|
+
* Defines a number that determines the order the extensions are applied.
|
|
238
|
+
*/
|
|
239
|
+
this.order = 175;
|
|
240
|
+
this._loader = loader;
|
|
241
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
|
242
|
+
if (this.enabled) {
|
|
243
|
+
loader.parent.transparencyAsCoverage = true;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** @internal */
|
|
247
|
+
dispose() {
|
|
248
|
+
this._loader = null;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @internal
|
|
252
|
+
*/
|
|
253
|
+
loadMaterialPropertiesAsync(context, material, babylonMaterial) {
|
|
254
|
+
return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {
|
|
255
|
+
const promises = new Array();
|
|
256
|
+
promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
|
257
|
+
promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension));
|
|
258
|
+
return Promise.all(promises).then(() => { });
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
_loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {
|
|
262
|
+
if (!(babylonMaterial instanceof PBRMaterial)) {
|
|
263
|
+
throw new Error(`${context}: Material type not supported`);
|
|
264
|
+
}
|
|
265
|
+
const pbrMaterial = babylonMaterial;
|
|
266
|
+
// Enables "refraction" texture which represents transmitted light.
|
|
267
|
+
pbrMaterial.subSurface.isRefractionEnabled = true;
|
|
268
|
+
// Since this extension models thin-surface transmission only, we must make IOR = 1.0
|
|
269
|
+
pbrMaterial.subSurface.volumeIndexOfRefraction = 1.0;
|
|
270
|
+
// Albedo colour will tint transmission.
|
|
271
|
+
pbrMaterial.subSurface.useAlbedoToTintRefraction = true;
|
|
272
|
+
if (extension.transmissionFactor !== undefined) {
|
|
273
|
+
pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;
|
|
274
|
+
const scene = pbrMaterial.getScene();
|
|
275
|
+
if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper) {
|
|
276
|
+
new TransmissionHelper({}, pbrMaterial.getScene());
|
|
277
|
+
}
|
|
278
|
+
else if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper?._isRenderTargetValid()) {
|
|
279
|
+
// If the render target is not valid, recreate it.
|
|
280
|
+
scene._transmissionHelper?._setupRenderTargets();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
pbrMaterial.subSurface.refractionIntensity = 0.0;
|
|
285
|
+
pbrMaterial.subSurface.isRefractionEnabled = false;
|
|
286
|
+
return Promise.resolve();
|
|
287
|
+
}
|
|
288
|
+
pbrMaterial.subSurface.minimumThickness = 0.0;
|
|
289
|
+
pbrMaterial.subSurface.maximumThickness = 0.0;
|
|
290
|
+
if (extension.transmissionTexture) {
|
|
291
|
+
extension.transmissionTexture.nonColorData = true;
|
|
292
|
+
return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then((texture) => {
|
|
293
|
+
texture.name = `${babylonMaterial.name} (Transmission)`;
|
|
294
|
+
pbrMaterial.subSurface.refractionIntensityTexture = texture;
|
|
295
|
+
pbrMaterial.subSurface.useGltfStyleTextures = true;
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
return Promise.resolve();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
unregisterGLTFExtension(NAME);
|
|
304
|
+
registerGLTFExtension(NAME, true, (loader) => new KHR_materials_transmission(loader));
|
|
305
|
+
|
|
306
|
+
export { KHR_materials_transmission };
|
|
307
|
+
//# sourceMappingURL=KHR_materials_transmission-nPX6lno-.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_transmission-nPX6lno-.esm.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_transmission.js"],"sourcesContent":["import { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\nimport { Observable } from \"core/Misc/observable\";\nimport { Constants } from \"core/Engines/constants\";\nimport { Tools } from \"core/Misc/tools\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\n/**\n * A class to handle setting up the rendering of opaque objects to be shown through transmissive objects.\n */\nclass TransmissionHelper {\n /**\n * Creates the default options for the helper.\n * @returns the default options\n */\n static _GetDefaultOptions() {\n return {\n renderSize: 1024,\n samples: 4,\n lodGenerationScale: 1,\n lodGenerationOffset: -4,\n renderTargetTextureType: Constants.TEXTURETYPE_HALF_FLOAT,\n generateMipmaps: true,\n };\n }\n /**\n * constructor\n * @param options Defines the options we want to customize the helper\n * @param scene The scene to add the material to\n */\n constructor(options, scene) {\n this._opaqueRenderTarget = null;\n this._opaqueMeshesCache = [];\n this._transparentMeshesCache = [];\n this._materialObservers = {};\n this._options = {\n ...TransmissionHelper._GetDefaultOptions(),\n ...options,\n };\n this._scene = scene;\n this._scene._transmissionHelper = this;\n this.onErrorObservable = new Observable();\n this._scene.onDisposeObservable.addOnce(() => {\n this.dispose();\n });\n this._parseScene();\n this._setupRenderTargets();\n }\n /**\n * Updates the background according to the new options\n * @param options\n */\n updateOptions(options) {\n // First check if any options are actually being changed. If not, exit.\n const newValues = Object.keys(options).filter((key) => this._options[key] !== options[key]);\n if (!newValues.length) {\n return;\n }\n const newOptions = {\n ...this._options,\n ...options,\n };\n const oldOptions = this._options;\n this._options = newOptions;\n // If size changes, recreate everything\n if (newOptions.renderSize !== oldOptions.renderSize ||\n newOptions.renderTargetTextureType !== oldOptions.renderTargetTextureType ||\n newOptions.generateMipmaps !== oldOptions.generateMipmaps ||\n !this._opaqueRenderTarget) {\n this._setupRenderTargets();\n }\n else {\n this._opaqueRenderTarget.samples = newOptions.samples;\n this._opaqueRenderTarget.lodGenerationScale = newOptions.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = newOptions.lodGenerationOffset;\n }\n }\n /**\n * @returns the opaque render target texture or null if not available.\n */\n getOpaqueTarget() {\n return this._opaqueRenderTarget;\n }\n _shouldRenderAsTransmission(material) {\n if (!material) {\n return false;\n }\n if (material instanceof PBRMaterial && material.subSurface.isRefractionEnabled) {\n return true;\n }\n return false;\n }\n _addMesh(mesh) {\n this._materialObservers[mesh.uniqueId] = mesh.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this));\n // we need to defer the processing because _addMesh may be called as part as an instance mesh creation, in which case some\n // internal properties are not setup yet, like _sourceMesh (needed when doing mesh.material below)\n Tools.SetImmediate(() => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n if (this._transparentMeshesCache.indexOf(mesh) === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n }\n else {\n if (this._opaqueMeshesCache.indexOf(mesh) === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n });\n }\n _removeMesh(mesh) {\n mesh.onMaterialChangedObservable.remove(this._materialObservers[mesh.uniqueId]);\n delete this._materialObservers[mesh.uniqueId];\n let idx = this._transparentMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._transparentMeshesCache.splice(idx, 1);\n }\n idx = this._opaqueMeshesCache.indexOf(mesh);\n if (idx !== -1) {\n this._opaqueMeshesCache.splice(idx, 1);\n }\n }\n _parseScene() {\n this._scene.meshes.forEach(this._addMesh.bind(this));\n // Listen for when a mesh is added to the scene and add it to our cache lists.\n this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this));\n // Listen for when a mesh is removed from to the scene and remove it from our cache lists.\n this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));\n }\n // When one of the meshes in the scene has its material changed, make sure that it's in the correct cache list.\n _onMeshMaterialChanged(mesh) {\n const transparentIdx = this._transparentMeshesCache.indexOf(mesh);\n const opaqueIdx = this._opaqueMeshesCache.indexOf(mesh);\n // If the material is transparent, make sure that it's added to the transparent list and removed from the opaque list\n const useTransmission = this._shouldRenderAsTransmission(mesh.material);\n if (useTransmission) {\n if (mesh.material instanceof PBRMaterial) {\n mesh.material.subSurface.refractionTexture = this._opaqueRenderTarget;\n }\n if (opaqueIdx !== -1) {\n this._opaqueMeshesCache.splice(opaqueIdx, 1);\n this._transparentMeshesCache.push(mesh);\n }\n else if (transparentIdx === -1) {\n this._transparentMeshesCache.push(mesh);\n }\n // If the material is opaque, make sure that it's added to the opaque list and removed from the transparent list\n }\n else {\n if (transparentIdx !== -1) {\n this._transparentMeshesCache.splice(transparentIdx, 1);\n this._opaqueMeshesCache.push(mesh);\n }\n else if (opaqueIdx === -1) {\n this._opaqueMeshesCache.push(mesh);\n }\n }\n }\n /**\n * @internal\n * Check if the opaque render target has not been disposed and can still be used.\n * @returns\n */\n _isRenderTargetValid() {\n return this._opaqueRenderTarget?.getInternalTexture() !== null;\n }\n /**\n * @internal\n * Setup the render targets according to the specified options.\n */\n _setupRenderTargets() {\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n }\n this._opaqueRenderTarget = new RenderTargetTexture(\"opaqueSceneTexture\", this._options.renderSize, this._scene, this._options.generateMipmaps, undefined, this._options.renderTargetTextureType);\n this._opaqueRenderTarget.ignoreCameraViewport = true;\n this._opaqueRenderTarget.renderList = this._opaqueMeshesCache;\n this._opaqueRenderTarget.clearColor = this._options.clearColor?.clone() ?? this._scene.clearColor.clone();\n this._opaqueRenderTarget.gammaSpace = false;\n this._opaqueRenderTarget.lodGenerationScale = this._options.lodGenerationScale;\n this._opaqueRenderTarget.lodGenerationOffset = this._options.lodGenerationOffset;\n this._opaqueRenderTarget.samples = this._options.samples;\n this._opaqueRenderTarget.renderSprites = true;\n this._opaqueRenderTarget.renderParticles = true;\n let sceneImageProcessingapplyByPostProcess;\n let saveSceneEnvIntensity;\n this._opaqueRenderTarget.onBeforeBindObservable.add((opaqueRenderTarget) => {\n saveSceneEnvIntensity = this._scene.environmentIntensity;\n this._scene.environmentIntensity = 1.0;\n sceneImageProcessingapplyByPostProcess = this._scene.imageProcessingConfiguration.applyByPostProcess;\n if (!this._options.clearColor) {\n this._scene.clearColor.toLinearSpaceToRef(opaqueRenderTarget.clearColor, this._scene.getEngine().useExactSrgbConversions);\n }\n else {\n opaqueRenderTarget.clearColor.copyFrom(this._options.clearColor);\n }\n // we do not use the applyByPostProcess setter to avoid flagging all the materials as \"image processing dirty\"!\n this._scene.imageProcessingConfiguration._applyByPostProcess = true;\n });\n this._opaqueRenderTarget.onAfterUnbindObservable.add(() => {\n this._scene.environmentIntensity = saveSceneEnvIntensity;\n this._scene.imageProcessingConfiguration._applyByPostProcess = sceneImageProcessingapplyByPostProcess;\n });\n this._transparentMeshesCache.forEach((mesh) => {\n if (this._shouldRenderAsTransmission(mesh.material)) {\n mesh.material.refractionTexture = this._opaqueRenderTarget;\n }\n });\n }\n /**\n * Dispose all the elements created by the Helper.\n */\n dispose() {\n this._scene._transmissionHelper = undefined;\n if (this._opaqueRenderTarget) {\n this._opaqueRenderTarget.dispose();\n this._opaqueRenderTarget = null;\n }\n this._transparentMeshesCache = [];\n this._opaqueMeshesCache = [];\n }\n}\nconst NAME = \"KHR_materials_transmission\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_transmission {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 175;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n if (this.enabled) {\n loader.parent.transparencyAsCoverage = true;\n }\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n const promises = new Array();\n promises.push(this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));\n promises.push(this._loadTransparentPropertiesAsync(extensionContext, material, babylonMaterial, extension));\n return Promise.all(promises).then(() => { });\n });\n }\n _loadTransparentPropertiesAsync(context, material, babylonMaterial, extension) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const pbrMaterial = babylonMaterial;\n // Enables \"refraction\" texture which represents transmitted light.\n pbrMaterial.subSurface.isRefractionEnabled = true;\n // Since this extension models thin-surface transmission only, we must make IOR = 1.0\n pbrMaterial.subSurface.volumeIndexOfRefraction = 1.0;\n // Albedo colour will tint transmission.\n pbrMaterial.subSurface.useAlbedoToTintRefraction = true;\n if (extension.transmissionFactor !== undefined) {\n pbrMaterial.subSurface.refractionIntensity = extension.transmissionFactor;\n const scene = pbrMaterial.getScene();\n if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper) {\n new TransmissionHelper({}, pbrMaterial.getScene());\n }\n else if (pbrMaterial.subSurface.refractionIntensity && !scene._transmissionHelper?._isRenderTargetValid()) {\n // If the render target is not valid, recreate it.\n scene._transmissionHelper?._setupRenderTargets();\n }\n }\n else {\n pbrMaterial.subSurface.refractionIntensity = 0.0;\n pbrMaterial.subSurface.isRefractionEnabled = false;\n return Promise.resolve();\n }\n pbrMaterial.subSurface.minimumThickness = 0.0;\n pbrMaterial.subSurface.maximumThickness = 0.0;\n if (extension.transmissionTexture) {\n extension.transmissionTexture.nonColorData = true;\n return this._loader.loadTextureInfoAsync(`${context}/transmissionTexture`, extension.transmissionTexture, undefined).then((texture) => {\n texture.name = `${babylonMaterial.name} (Transmission)`;\n pbrMaterial.subSurface.refractionIntensityTexture = texture;\n pbrMaterial.subSurface.useGltfStyleTextures = true;\n });\n }\n else {\n return Promise.resolve();\n }\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_transmission(loader));\n//# sourceMappingURL=KHR_materials_transmission.js.map"],"names":[],"mappings":";;;;;;AAOA;AACA;AACA;AACA,MAAM,kBAAkB,CAAC;AACzB;AACA;AACA;AACA;AACA,IAAI,OAAO,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AAO,EAAE;AACpC;AACA;AACA;AACA,uBAAuB,CAAC,IAAI,CAAC;AAC7B,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a$ as e,s as o,aQ as r,aR as s}from"./index-Bo5F_mGk.esm.min.js";import{G as a}from"./glTFLoader-Dj_JCgqJ.esm.min.js";import"./rawTexture-BAt5J3G4.esm.min.js";import"./assetContainer-CMuD-n3X.esm.min.js";import"./glTFLoaderAnimation-A_WVS-lt.esm.min.js";const t="KHR_materials_unlit";class i{constructor(e){this.name=t,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,o,r){return a.LoadExtensionAsync(e,o,this.name,(()=>this._loadUnlitPropertiesAsync(e,o,r)))}_loadUnlitPropertiesAsync(r,s,a){if(!(a instanceof e))throw new Error(`${r}: Material type not supported`);const t=new Array;a.unlit=!0;const i=s.pbrMetallicRoughness;return i&&(i.baseColorFactor?(a.albedoColor=o.FromArray(i.baseColorFactor),a.alpha=i.baseColorFactor[3]):a.albedoColor=o.White(),i.baseColorTexture&&t.push(this._loader.loadTextureInfoAsync(`${r}/baseColorTexture`,i.baseColorTexture,(e=>{e.name=`${a.name} (Base Color)`,a.albedoTexture=e})))),s.doubleSided&&(a.backFaceCulling=!1,a.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(r,s,a),Promise.all(t).then((()=>{}))}}r(t),s(t,!0,(e=>new i(e)));export{i as KHR_materials_unlit};
|
|
2
|
+
//# sourceMappingURL=KHR_materials_unlit-CLSTXPsk.esm.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KHR_materials_unlit-CLSTXPsk.esm.min.js","sources":["../../../../../dev/loaders/dist/glTF/2.0/Extensions/KHR_materials_unlit.js"],"sourcesContent":["import { Color3 } from \"core/Maths/math.color\";\nimport { PBRMaterial } from \"core/Materials/PBR/pbrMaterial\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { registerGLTFExtension, unregisterGLTFExtension } from \"../glTFLoaderExtensionRegistry\";\nconst NAME = \"KHR_materials_unlit\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_unlit/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_unlit {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 210;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, () => {\n return this._loadUnlitPropertiesAsync(context, material, babylonMaterial);\n });\n }\n _loadUnlitPropertiesAsync(context, material, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n const promises = new Array();\n babylonMaterial.unlit = true;\n const properties = material.pbrMetallicRoughness;\n if (properties) {\n if (properties.baseColorFactor) {\n babylonMaterial.albedoColor = Color3.FromArray(properties.baseColorFactor);\n babylonMaterial.alpha = properties.baseColorFactor[3];\n }\n else {\n babylonMaterial.albedoColor = Color3.White();\n }\n if (properties.baseColorTexture) {\n promises.push(this._loader.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture) => {\n texture.name = `${babylonMaterial.name} (Base Color)`;\n babylonMaterial.albedoTexture = texture;\n }));\n }\n }\n if (material.doubleSided) {\n babylonMaterial.backFaceCulling = false;\n babylonMaterial.twoSidedLighting = true;\n }\n this._loader.loadMaterialAlphaProperties(context, material, babylonMaterial);\n return Promise.all(promises).then(() => { });\n }\n}\nunregisterGLTFExtension(NAME);\nregisterGLTFExtension(NAME, true, (loader) => new KHR_materials_unlit(loader));\n//# sourceMappingURL=KHR_materials_unlit.js.map"],"names":["NAME","KHR_materials_unlit","constructor","loader","this","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","GLTFLoader","LoadExtensionAsync","_loadUnlitPropertiesAsync","PBRMaterial","Error","promises","Array","unlit","properties","pbrMetallicRoughness","baseColorFactor","albedoColor","Color3","FromArray","alpha","White","baseColorTexture","push","loadTextureInfoAsync","texture","albedoTexture","doubleSided","backFaceCulling","twoSidedLighting","loadMaterialAlphaProperties","Promise","all","then","unregisterGLTFExtension","registerGLTFExtension"],"mappings":"qQAIA,MAAMA,EAAO,sBAKN,MAAMC,EAIT,WAAAC,CAAYC,GAIRC,KAAKC,KAAOL,EAIZI,KAAKE,MAAQ,IACbF,KAAKG,QAAUJ,EACfC,KAAKI,QAAUJ,KAAKG,QAAQE,gBAAgBT,EACpD,CAEI,OAAAU,GACIN,KAAKG,QAAU,IACvB,CAII,2BAAAI,CAA4BC,EAASC,EAAUC,GAC3C,OAAOC,EAAWC,mBAAmBJ,EAASC,EAAUT,KAAKC,MAAM,IACxDD,KAAKa,0BAA0BL,EAASC,EAAUC,IAErE,CACI,yBAAAG,CAA0BL,EAASC,EAAUC,GACzC,KAAMA,aAA2BI,GAC7B,MAAM,IAAIC,MAAM,GAAGP,kCAEvB,MAAMQ,EAAW,IAAIC,MACrBP,EAAgBQ,OAAQ,EACxB,MAAMC,EAAaV,EAASW,qBAqB5B,OApBID,IACIA,EAAWE,iBACXX,EAAgBY,YAAcC,EAAOC,UAAUL,EAAWE,iBAC1DX,EAAgBe,MAAQN,EAAWE,gBAAgB,IAGnDX,EAAgBY,YAAcC,EAAOG,QAErCP,EAAWQ,kBACXX,EAASY,KAAK5B,KAAKG,QAAQ0B,qBAAqB,GAAGrB,qBAA4BW,EAAWQ,kBAAmBG,IACzGA,EAAQ7B,KAAO,GAAGS,EAAgBT,oBAClCS,EAAgBqB,cAAgBD,CAAO,MAI/CrB,EAASuB,cACTtB,EAAgBuB,iBAAkB,EAClCvB,EAAgBwB,kBAAmB,GAEvClC,KAAKG,QAAQgC,4BAA4B3B,EAASC,EAAUC,GACrD0B,QAAQC,IAAIrB,GAAUsB,MAAK,QAC1C,EAEAC,EAAwB3C,GACxB4C,EAAsB5C,GAAM,GAAOG,GAAW,IAAIF,EAAoBE"}
|