@babylonjs/viewer 7.40.0 → 7.40.1-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-gxFyrTPG.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_ies-gxFyrTPG.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-pE68tmBj.esm.js +84 -0
- package/dist/chunks/EXT_lights_ies-pE68tmBj.esm.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-B8Oal0Ur.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_image_based-B8Oal0Ur.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-CmP_ZGlF.esm.js +171 -0
- package/dist/chunks/EXT_lights_image_based-CmP_ZGlF.esm.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-DSFpOud_.esm.min.js +2 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-DSFpOud_.esm.min.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-DksAVeyV.esm.js +86 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-DksAVeyV.esm.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-CNUItnkN.esm.min.js +2 -0
- package/dist/chunks/EXT_meshopt_compression-CNUItnkN.esm.min.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-CeM-AELC.esm.js +134 -0
- package/dist/chunks/EXT_meshopt_compression-CeM-AELC.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-BWOJV_Yf.esm.js +44 -0
- package/dist/chunks/EXT_texture_avif-BWOJV_Yf.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-CSTfqZHT.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_avif-CSTfqZHT.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-4Pxv5jC9.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_webp-4Pxv5jC9.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-C9og1YZL.esm.js +43 -0
- package/dist/chunks/EXT_texture_webp-C9og1YZL.esm.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-BmFy6ZgN.esm.js +64 -0
- package/dist/chunks/ExtrasAsMetadata-BmFy6ZgN.esm.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-BwYwFtj7.esm.min.js +2 -0
- package/dist/chunks/ExtrasAsMetadata-BwYwFtj7.esm.min.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-BM2iOlKg.esm.js +352 -0
- package/dist/chunks/KHR_animation_pointer-BM2iOlKg.esm.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-C7FvhqL3.esm.min.js +2 -0
- package/dist/chunks/KHR_animation_pointer-C7FvhqL3.esm.min.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-BocaEHGh.esm.js +617 -0
- package/dist/chunks/KHR_draco_mesh_compression-BocaEHGh.esm.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-CjRCmIUz.esm.min.js +2 -0
- package/dist/chunks/KHR_draco_mesh_compression-CjRCmIUz.esm.min.js.map +1 -0
- package/dist/chunks/KHR_interactivity-C_ndoQHo.esm.min.js +2 -0
- package/dist/chunks/KHR_interactivity-C_ndoQHo.esm.min.js.map +1 -0
- package/dist/chunks/KHR_interactivity-ClHXW_8S.esm.js +4033 -0
- package/dist/chunks/KHR_interactivity-ClHXW_8S.esm.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-D0u7ZFj4.esm.js +581 -0
- package/dist/chunks/KHR_lights_punctual-D0u7ZFj4.esm.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-Z509RdIo.esm.min.js +2 -0
- package/dist/chunks/KHR_lights_punctual-Z509RdIo.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-Dz4vBqG3.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_anisotropy-Dz4vBqG3.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-VuLS4v3P.esm.js +65 -0
- package/dist/chunks/KHR_materials_anisotropy-VuLS4v3P.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-DM7vCrC3.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_clearcoat-DM7vCrC3.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-Dt0nQ5Ky.esm.js +96 -0
- package/dist/chunks/KHR_materials_clearcoat-Dt0nQ5Ky.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-1Pa4ScwD.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-1Pa4ScwD.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-DIUHVeOQ.esm.js +97 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-DIUHVeOQ.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-CMpGZsUw.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_dispersion-CMpGZsUw.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-CeSj8nUI.esm.js +62 -0
- package/dist/chunks/KHR_materials_dispersion-CeSj8nUI.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-CQQX31qK.esm.js +55 -0
- package/dist/chunks/KHR_materials_emissive_strength-CQQX31qK.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-DH4A4kIp.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_emissive_strength-DH4A4kIp.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-BTU1gw-j.esm.js +64 -0
- package/dist/chunks/KHR_materials_ior-BTU1gw-j.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-DyzPdK6b.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_ior-DyzPdK6b.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-8ZgbULX5.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_iridescence-8ZgbULX5.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-D2HCEadq.esm.js +72 -0
- package/dist/chunks/KHR_materials_iridescence-D2HCEadq.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C4K79VpA.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C4K79VpA.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DtJVJ-gl.esm.js +81 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DtJVJ-gl.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-CT4KjW_v.esm.js +85 -0
- package/dist/chunks/KHR_materials_sheen-CT4KjW_v.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-DQt5abo-.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_sheen-DQt5abo-.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-CCvL1awH.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_specular-CCvL1awH.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-CgLKBQCa.esm.js +75 -0
- package/dist/chunks/KHR_materials_specular-CgLKBQCa.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-B64oDwox.esm.js +307 -0
- package/dist/chunks/KHR_materials_transmission-B64oDwox.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-C6yPYKde.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_transmission-C6yPYKde.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-BGPDq328.esm.js +74 -0
- package/dist/chunks/KHR_materials_unlit-BGPDq328.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-Sz3qCEGr.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_unlit-Sz3qCEGr.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-Cqw7xft3.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_variants-Cqw7xft3.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-D7rYTNoB.esm.js +262 -0
- package/dist/chunks/KHR_materials_variants-D7rYTNoB.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-BBsNt0LM.esm.js +87 -0
- package/dist/chunks/KHR_materials_volume-BBsNt0LM.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-DfWO7kG_.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_volume-DfWO7kG_.esm.min.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-BiDGkiGh.esm.min.js +2 -0
- package/dist/chunks/KHR_mesh_quantization-BiDGkiGh.esm.min.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-fE1qitjF.esm.js +26 -0
- package/dist/chunks/KHR_mesh_quantization-fE1qitjF.esm.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-DaOK-Y48.esm.min.js +2 -0
- package/dist/chunks/KHR_node_hoverability-DaOK-Y48.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-glogCdHq.esm.js +39 -0
- package/dist/chunks/KHR_node_hoverability-glogCdHq.esm.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-BCVXn2la.esm.min.js +2 -0
- package/dist/chunks/KHR_node_visibility-BCVXn2la.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-CCfVtnan.esm.js +46 -0
- package/dist/chunks/KHR_node_visibility-CCfVtnan.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-_cpZJuOo.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_basisu-_cpZJuOo.esm.min.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-nhRrTq0b.esm.js +43 -0
- package/dist/chunks/KHR_texture_basisu-nhRrTq0b.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-AgI_J0Ru.esm.js +63 -0
- package/dist/chunks/KHR_texture_transform-AgI_J0Ru.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-CgcA7bhJ.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_transform-CgcA7bhJ.esm.min.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-C37VZwlU.esm.min.js +2 -0
- package/dist/chunks/KHR_xmp_json_ld-C37VZwlU.esm.min.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-Cm4z6qFH.esm.js +51 -0
- package/dist/chunks/KHR_xmp_json_ld-Cm4z6qFH.esm.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-4EFTMS8D.esm.js +2207 -0
- package/dist/chunks/MSFT_audio_emitter-4EFTMS8D.esm.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-Czn1DAbD.esm.min.js +2 -0
- package/dist/chunks/MSFT_audio_emitter-Czn1DAbD.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_lod-Bn4FnO5A.esm.js +337 -0
- package/dist/chunks/MSFT_lod-Bn4FnO5A.esm.js.map +1 -0
- package/dist/chunks/MSFT_lod-DDB-SKXR.esm.min.js +2 -0
- package/dist/chunks/MSFT_lod-DDB-SKXR.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-APRwcxWb.esm.min.js +2 -0
- package/dist/chunks/MSFT_minecraftMesh-APRwcxWb.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-DPvby_FZ.esm.js +46 -0
- package/dist/chunks/MSFT_minecraftMesh-DPvby_FZ.esm.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-D33sXFGi.esm.js +47 -0
- package/dist/chunks/MSFT_sRGBFactors-D33sXFGi.esm.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-OsUqZSue.esm.min.js +2 -0
- package/dist/chunks/MSFT_sRGBFactors-OsUqZSue.esm.min.js.map +1 -0
- package/dist/chunks/animationGroup-BR3zskS8.esm.js +2482 -0
- package/dist/chunks/animationGroup-BR3zskS8.esm.js.map +1 -0
- package/dist/chunks/animationGroup-ChIp5GuO.esm.min.js +2 -0
- package/dist/chunks/animationGroup-ChIp5GuO.esm.min.js.map +1 -0
- package/dist/chunks/assetContainer-DLSDgjTx.esm.min.js +2 -0
- package/dist/chunks/assetContainer-DLSDgjTx.esm.min.js.map +1 -0
- package/dist/chunks/assetContainer-cm8rvay3.esm.js +1720 -0
- package/dist/chunks/assetContainer-cm8rvay3.esm.js.map +1 -0
- package/dist/chunks/audioEngine-Cx5dB73O.esm.js +305 -0
- package/dist/chunks/audioEngine-Cx5dB73O.esm.js.map +1 -0
- package/dist/chunks/audioEngine-hKZ2m0jY.esm.min.js +2 -0
- package/dist/chunks/audioEngine-hKZ2m0jY.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-BCUFE4CP.esm.min.js +2 -0
- package/dist/chunks/bakedVertexAnimation-BCUFE4CP.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-ByPKjjzz.esm.js +114 -0
- package/dist/chunks/bakedVertexAnimation-ByPKjjzz.esm.js.map +1 -0
- package/dist/chunks/basisTextureLoader-BIqCbGFg.esm.min.js +2 -0
- package/dist/chunks/basisTextureLoader-BIqCbGFg.esm.min.js.map +1 -0
- package/dist/chunks/basisTextureLoader-CT8X4ynA.esm.js +600 -0
- package/dist/chunks/basisTextureLoader-CT8X4ynA.esm.js.map +1 -0
- package/dist/chunks/dds-BDOPTCsA.esm.min.js +2 -0
- package/dist/chunks/dds-BDOPTCsA.esm.min.js.map +1 -0
- package/dist/chunks/dds-BYrGO6eI.esm.js +540 -0
- package/dist/chunks/dds-BYrGO6eI.esm.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-BbrffKmM.esm.min.js +2 -0
- package/dist/chunks/ddsTextureLoader-BbrffKmM.esm.min.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-C36kkIBH.esm.js +88 -0
- package/dist/chunks/ddsTextureLoader-C36kkIBH.esm.js.map +1 -0
- package/dist/chunks/decalFragment-07cq9QvS.esm.min.js +2 -0
- package/dist/chunks/decalFragment-07cq9QvS.esm.min.js.map +1 -0
- package/dist/chunks/decalFragment-B16Nfnl3.esm.js +18 -0
- package/dist/chunks/decalFragment-B16Nfnl3.esm.js.map +1 -0
- package/dist/chunks/default.fragment-BkjbMxBE.esm.min.js +2 -0
- package/dist/chunks/default.fragment-BkjbMxBE.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-C-8jVS2k.esm.min.js +2 -0
- package/dist/chunks/default.fragment-C-8jVS2k.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-C3Pectqi.esm.js +515 -0
- package/dist/chunks/default.fragment-C3Pectqi.esm.js.map +1 -0
- package/dist/chunks/default.fragment-D3LhG5le.esm.js +446 -0
- package/dist/chunks/default.fragment-D3LhG5le.esm.js.map +1 -0
- package/dist/chunks/default.vertex-CPx_2Z0S.esm.js +181 -0
- package/dist/chunks/default.vertex-CPx_2Z0S.esm.js.map +1 -0
- package/dist/chunks/default.vertex-CVMUuXku.esm.js +202 -0
- package/dist/chunks/default.vertex-CVMUuXku.esm.js.map +1 -0
- package/dist/chunks/default.vertex-CbVQZVXB.esm.min.js +2 -0
- package/dist/chunks/default.vertex-CbVQZVXB.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-S3Wv9p0Q.esm.min.js +2 -0
- package/dist/chunks/default.vertex-S3Wv9p0Q.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-BdxOUPT0.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-BdxOUPT0.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-CUaZKOKG.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-CUaZKOKG.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-DdcmVbYg.esm.js +15 -0
- package/dist/chunks/defaultUboDeclaration-DdcmVbYg.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-rLhenj1H.esm.js +13 -0
- package/dist/chunks/defaultUboDeclaration-rLhenj1H.esm.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-CPmY0U7D.esm.js +200 -0
- package/dist/chunks/dumpTools-CPmY0U7D.esm.js.map +1 -0
- package/dist/chunks/dumpTools-DVDwJ2sz.esm.min.js +2 -0
- package/dist/chunks/dumpTools-DVDwJ2sz.esm.min.js.map +1 -0
- package/dist/chunks/engine-BqSrdURz.esm.min.js +2 -0
- package/dist/chunks/engine-BqSrdURz.esm.min.js.map +1 -0
- package/dist/chunks/engine-D_GgT2Nf.esm.js +2216 -0
- package/dist/chunks/engine-D_GgT2Nf.esm.js.map +1 -0
- package/dist/chunks/engine.common-CN1Lug5p.esm.js +1162 -0
- package/dist/chunks/engine.common-CN1Lug5p.esm.js.map +1 -0
- package/dist/chunks/engine.common-DgiXKhLy.esm.min.js +2 -0
- package/dist/chunks/engine.common-DgiXKhLy.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-BORNR9vu.esm.min.js +2 -0
- package/dist/chunks/envTextureLoader-BORNR9vu.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-DHwsXTfw.esm.js +64 -0
- package/dist/chunks/envTextureLoader-DHwsXTfw.esm.js.map +1 -0
- package/dist/chunks/environmentTextureTools-B2vnsFq-.esm.js +382 -0
- package/dist/chunks/environmentTextureTools-B2vnsFq-.esm.js.map +1 -0
- package/dist/chunks/environmentTextureTools-BYQHZH-c.esm.min.js +2 -0
- package/dist/chunks/environmentTextureTools-BYQHZH-c.esm.min.js.map +1 -0
- package/dist/chunks/exrTextureLoader-B8FQohBr.esm.js +1683 -0
- package/dist/chunks/exrTextureLoader-B8FQohBr.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-D8xP0GLQ.esm.min.js +2 -0
- package/dist/chunks/exrTextureLoader-D8xP0GLQ.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-5YT33bDn.esm.js +102 -0
- package/dist/chunks/fogFragment-5YT33bDn.esm.js.map +1 -0
- package/dist/chunks/fogFragment-BOBZ2KwN.esm.min.js +2 -0
- package/dist/chunks/fogFragment-BOBZ2KwN.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-CLENZGuB.esm.js +101 -0
- package/dist/chunks/fogFragment-CLENZGuB.esm.js.map +1 -0
- package/dist/chunks/fogFragment-D9dudohA.esm.min.js +2 -0
- package/dist/chunks/fogFragment-D9dudohA.esm.min.js.map +1 -0
- package/dist/chunks/fresnelFunction-BkO99b6C.esm.js +12 -0
- package/dist/chunks/fresnelFunction-BkO99b6C.esm.js.map +1 -0
- package/dist/chunks/fresnelFunction-CqiLsMCu.esm.min.js +2 -0
- package/dist/chunks/fresnelFunction-CqiLsMCu.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoader-CkL-dxBD.esm.min.js +2 -0
- package/dist/chunks/glTFLoader-CkL-dxBD.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoader-IEHRfiUn.esm.js +7586 -0
- package/dist/chunks/glTFLoader-IEHRfiUn.esm.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-CV32Nmqb.esm.js +77 -0
- package/dist/chunks/glTFLoaderAnimation-CV32Nmqb.esm.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-Cq2ziV9o.esm.min.js +2 -0
- package/dist/chunks/glTFLoaderAnimation-Cq2ziV9o.esm.min.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-B5QCEZvF.esm.js +34 -0
- package/dist/chunks/harmonicsFunctions-B5QCEZvF.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-BxLCgoIQ.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-BxLCgoIQ.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-Daxnf8NE.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-Daxnf8NE.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-UzG0C-sm.esm.js +35 -0
- package/dist/chunks/harmonicsFunctions-UzG0C-sm.esm.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-BpVjKGyb.esm.min.js +2 -0
- package/dist/chunks/hdrTextureLoader-BpVjKGyb.esm.min.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-DgW8CxRF.esm.js +253 -0
- package/dist/chunks/hdrTextureLoader-DgW8CxRF.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-BFgvMG5S.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-BFgvMG5S.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-BatAhE6u.esm.js +108 -0
- package/dist/chunks/helperFunctions-BatAhE6u.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-qECwmiwu.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-qECwmiwu.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-vbA-oTJx.esm.js +80 -0
- package/dist/chunks/helperFunctions-vbA-oTJx.esm.js.map +1 -0
- package/dist/chunks/iesTextureLoader-Ccd5pvbh.esm.min.js +2 -0
- package/dist/chunks/iesTextureLoader-Ccd5pvbh.esm.min.js.map +1 -0
- package/dist/chunks/iesTextureLoader-nMYnOfhm.esm.js +189 -0
- package/dist/chunks/iesTextureLoader-nMYnOfhm.esm.js.map +1 -0
- package/dist/chunks/index-BHIM4QBr.esm.min.js +57 -0
- package/dist/chunks/index-BHIM4QBr.esm.min.js.map +1 -0
- package/dist/chunks/index-CtkZLm9J.esm.js +74717 -0
- package/dist/chunks/index-CtkZLm9J.esm.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-CkkvHzY3.esm.js +814 -0
- package/dist/chunks/ktxTextureLoader-CkkvHzY3.esm.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-CwGlHia2.esm.min.js +2 -0
- package/dist/chunks/ktxTextureLoader-CwGlHia2.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-BiUSPlzz.esm.js +35 -0
- package/dist/chunks/logDepthDeclaration-BiUSPlzz.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-Bq2fzMbS.esm.js +11 -0
- package/dist/chunks/logDepthDeclaration-Bq2fzMbS.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-C8DJP16D.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-C8DJP16D.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-DJpvEdPG.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-DJpvEdPG.esm.min.js.map +1 -0
- package/dist/chunks/logDepthVertex-C00_obGd.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-C00_obGd.esm.min.js.map +1 -0
- package/dist/chunks/logDepthVertex-CYIGBMYd.esm.js +77 -0
- package/dist/chunks/logDepthVertex-CYIGBMYd.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-CxT8FVOf.esm.js +81 -0
- package/dist/chunks/logDepthVertex-CxT8FVOf.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-SyM_Fu5K.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-SyM_Fu5K.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-BaIG4IFB.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-BaIG4IFB.esm.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-CQzOmEIM.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-CQzOmEIM.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-D100Qvmm.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-D100Qvmm.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-OSD7irdC.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-OSD7irdC.esm.js.map +1 -0
- package/dist/chunks/meshUboDeclaration--wzKOTOT.esm.min.js +2 -0
- package/dist/chunks/meshUboDeclaration--wzKOTOT.esm.min.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-DIi9ZPDc.esm.js +26 -0
- package/dist/chunks/meshUboDeclaration-DIi9ZPDc.esm.js.map +1 -0
- package/dist/chunks/objFileLoader-Cda8pwUd.esm.js +1338 -0
- package/dist/chunks/objFileLoader-Cda8pwUd.esm.js.map +1 -0
- package/dist/chunks/objFileLoader-kzI-pZ8o.esm.min.js +2 -0
- package/dist/chunks/objFileLoader-kzI-pZ8o.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-4cP4dKVP.esm.min.js +2 -0
- package/dist/chunks/oitFragment-4cP4dKVP.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-Bz1w36ia.esm.js +1078 -0
- package/dist/chunks/oitFragment-Bz1w36ia.esm.js.map +1 -0
- package/dist/chunks/oitFragment-DUkW-kmb.esm.min.js +2 -0
- package/dist/chunks/oitFragment-DUkW-kmb.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-DiuTTpNa.esm.js +1240 -0
- package/dist/chunks/oitFragment-DiuTTpNa.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-B8l5NRgR.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-B8l5NRgR.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-BF4UEoT8.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-BF4UEoT8.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-CD3_26yo.esm.js +15 -0
- package/dist/chunks/pass.fragment-CD3_26yo.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-DfeELUEn.esm.js +15 -0
- package/dist/chunks/pass.fragment-DfeELUEn.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-BDylAp64.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-BDylAp64.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-C1qko419.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-C1qko419.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-EBVxSAEQ.esm.js +3232 -0
- package/dist/chunks/pbr.fragment-EBVxSAEQ.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-lt62m8b7.esm.js +3273 -0
- package/dist/chunks/pbr.fragment-lt62m8b7.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-CGRL_eY2.esm.js +339 -0
- package/dist/chunks/pbr.vertex-CGRL_eY2.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-CHv4zeYj.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-CHv4zeYj.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-Dk4h9ywZ.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-Dk4h9ywZ.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-DopP5mYu.esm.js +214 -0
- package/dist/chunks/pbr.vertex-DopP5mYu.esm.js.map +1 -0
- package/dist/chunks/postprocess.vertex-Bt30-Flh.esm.min.js +2 -0
- package/dist/chunks/postprocess.vertex-Bt30-Flh.esm.min.js.map +1 -0
- package/dist/chunks/postprocess.vertex-pLUOpXIY.esm.js +20 -0
- package/dist/chunks/postprocess.vertex-pLUOpXIY.esm.js.map +1 -0
- package/dist/chunks/rawTexture-78KJgWfq.esm.js +191 -0
- package/dist/chunks/rawTexture-78KJgWfq.esm.js.map +1 -0
- package/dist/chunks/rawTexture-CCCnj14W.esm.min.js +2 -0
- package/dist/chunks/rawTexture-CCCnj14W.esm.min.js.map +1 -0
- package/dist/chunks/ray-CfhmGTmj.esm.js +946 -0
- package/dist/chunks/ray-CfhmGTmj.esm.js.map +1 -0
- package/dist/chunks/ray-Du89cGmz.esm.min.js +2 -0
- package/dist/chunks/ray-Du89cGmz.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-BHAQKD_5.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-BHAQKD_5.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-CV6q4aIi.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-CV6q4aIi.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-DEu4F_6T.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-DEu4F_6T.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-DiJfgZKv.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-DiJfgZKv.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-CR30N0Mr.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-CR30N0Mr.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-CUE3DGC8.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-CUE3DGC8.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-DdFs5QJM.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-DdFs5QJM.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-omm81hdD.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-omm81hdD.esm.min.js.map +1 -0
- package/dist/chunks/splatFileLoader-BnaOhITn.esm.js +3379 -0
- package/dist/chunks/splatFileLoader-BnaOhITn.esm.js.map +1 -0
- package/dist/chunks/splatFileLoader-CuMIDOsR.esm.min.js +2 -0
- package/dist/chunks/splatFileLoader-CuMIDOsR.esm.min.js.map +1 -0
- package/dist/chunks/spotLight-Ca0-j1Op.esm.js +701 -0
- package/dist/chunks/spotLight-Ca0-j1Op.esm.js.map +1 -0
- package/dist/chunks/spotLight-DXuSbTaJ.esm.min.js +2 -0
- package/dist/chunks/spotLight-DXuSbTaJ.esm.min.js.map +1 -0
- package/dist/chunks/standardMaterial-DKyaZtcm.esm.js +1805 -0
- package/dist/chunks/standardMaterial-DKyaZtcm.esm.js.map +1 -0
- package/dist/chunks/standardMaterial-h3ccobBt.esm.min.js +2 -0
- package/dist/chunks/standardMaterial-h3ccobBt.esm.min.js.map +1 -0
- package/dist/chunks/stlFileLoader-CDv97liE.esm.js +238 -0
- package/dist/chunks/stlFileLoader-CDv97liE.esm.js.map +1 -0
- package/dist/chunks/stlFileLoader-e2ImyWaM.esm.min.js +2 -0
- package/dist/chunks/stlFileLoader-e2ImyWaM.esm.min.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-DJaEph-Q.esm.js +349 -0
- package/dist/chunks/tgaTextureLoader-DJaEph-Q.esm.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-slv-QvZW.esm.min.js +2 -0
- package/dist/chunks/tgaTextureLoader-slv-QvZW.esm.min.js.map +1 -0
- package/dist/chunks/thinEngine-Ue9ZAvRK.esm.js +3848 -0
- package/dist/chunks/thinEngine-Ue9ZAvRK.esm.js.map +1 -0
- package/dist/chunks/thinEngine-pihAbdON.esm.min.js +2 -0
- package/dist/chunks/thinEngine-pihAbdON.esm.min.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-BgfKoejL.esm.min.js +2 -0
- package/dist/chunks/thinInstanceMesh-BgfKoejL.esm.min.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-V41szD4h.esm.js +314 -0
- package/dist/chunks/thinInstanceMesh-V41szD4h.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-CZsK7mYP.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-CZsK7mYP.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-DKVusFas.esm.js +522 -0
- package/dist/chunks/vertexColorMixing-DKVusFas.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-DeZKI8QK.esm.js +412 -0
- package/dist/chunks/vertexColorMixing-DeZKI8QK.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-axGN1U7X.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-axGN1U7X.esm.min.js.map +1 -0
- package/dist/chunks/webgpuEngine-COis70hT.esm.js +11533 -0
- package/dist/chunks/webgpuEngine-COis70hT.esm.js.map +1 -0
- package/dist/chunks/webgpuEngine-Cx_GlShD.esm.min.js +2 -0
- package/dist/chunks/webgpuEngine-Cx_GlShD.esm.min.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 +559 -0
- package/lib/index.js +2083 -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,1805 @@
|
|
|
1
|
+
import { am as __decorate, an as serializeAsTexture, ao as expandToProperty, ap as serializeAsColor3, aq as serialize, ar as serializeAsFresnelParameters, R as RegisterClass, ak as Scene, z as PushMaterial, s as Color3, as as SmartArray, a4 as Matrix, at as DetailMapConfiguration, au as PrePassConfiguration, av as Material, aw as PrepareDefinesForLights, ax as PrepareDefinesForMultiview, ay as PrepareDefinesForPrePass, az as PrepareDefinesForOIT, aA as MaterialHelperGeometryRendering, C as Constants, aB as PrepareDefinesForMergedUV, t as Texture, J as PrepareDefinesForMisc, K as PrepareDefinesForFrameBoundValues, N as PrepareDefinesForAttributes, aC as HandleFallbacksForShadows, aD as PrepareAttributesForBones, Q as PrepareAttributesForInstances, aE as PrepareAttributesForMorphTargets, aF as PrepareAttributesForBakedVertexAnimation, aG as ImageProcessingConfiguration, W as PrepareUniformsAndSamplersList, X as addClipPlaneUniforms, aH as BindBonesParameters, aI as BindTextureMatrix, Z as bindClipPlane, aJ as BindLights, _ as BindFogParameters, aK as BindMorphTargetParameters, $ as BindLogDepth, a0 as SerializationHelper, aL as MaterialFlags, a1 as MaterialDefines, aM as EffectFallbacks, V as VertexBuffer } from './index-CtkZLm9J.esm.js';
|
|
2
|
+
|
|
3
|
+
const onCreatedEffectParameters = { effect: null, subMesh: null };
|
|
4
|
+
/** @internal */
|
|
5
|
+
class StandardMaterialDefines extends MaterialDefines {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the Standard Material defines.
|
|
8
|
+
* @param externalProperties The external properties
|
|
9
|
+
*/
|
|
10
|
+
constructor(externalProperties) {
|
|
11
|
+
super(externalProperties);
|
|
12
|
+
this.MAINUV1 = false;
|
|
13
|
+
this.MAINUV2 = false;
|
|
14
|
+
this.MAINUV3 = false;
|
|
15
|
+
this.MAINUV4 = false;
|
|
16
|
+
this.MAINUV5 = false;
|
|
17
|
+
this.MAINUV6 = false;
|
|
18
|
+
this.DIFFUSE = false;
|
|
19
|
+
this.DIFFUSEDIRECTUV = 0;
|
|
20
|
+
this.BAKED_VERTEX_ANIMATION_TEXTURE = false;
|
|
21
|
+
this.AMBIENT = false;
|
|
22
|
+
this.AMBIENTDIRECTUV = 0;
|
|
23
|
+
this.OPACITY = false;
|
|
24
|
+
this.OPACITYDIRECTUV = 0;
|
|
25
|
+
this.OPACITYRGB = false;
|
|
26
|
+
this.REFLECTION = false;
|
|
27
|
+
this.EMISSIVE = false;
|
|
28
|
+
this.EMISSIVEDIRECTUV = 0;
|
|
29
|
+
this.SPECULAR = false;
|
|
30
|
+
this.SPECULARDIRECTUV = 0;
|
|
31
|
+
this.BUMP = false;
|
|
32
|
+
this.BUMPDIRECTUV = 0;
|
|
33
|
+
this.PARALLAX = false;
|
|
34
|
+
this.PARALLAX_RHS = false;
|
|
35
|
+
this.PARALLAXOCCLUSION = false;
|
|
36
|
+
this.SPECULAROVERALPHA = false;
|
|
37
|
+
this.CLIPPLANE = false;
|
|
38
|
+
this.CLIPPLANE2 = false;
|
|
39
|
+
this.CLIPPLANE3 = false;
|
|
40
|
+
this.CLIPPLANE4 = false;
|
|
41
|
+
this.CLIPPLANE5 = false;
|
|
42
|
+
this.CLIPPLANE6 = false;
|
|
43
|
+
this.ALPHATEST = false;
|
|
44
|
+
this.DEPTHPREPASS = false;
|
|
45
|
+
this.ALPHAFROMDIFFUSE = false;
|
|
46
|
+
this.POINTSIZE = false;
|
|
47
|
+
this.FOG = false;
|
|
48
|
+
this.SPECULARTERM = false;
|
|
49
|
+
this.DIFFUSEFRESNEL = false;
|
|
50
|
+
this.OPACITYFRESNEL = false;
|
|
51
|
+
this.REFLECTIONFRESNEL = false;
|
|
52
|
+
this.REFRACTIONFRESNEL = false;
|
|
53
|
+
this.EMISSIVEFRESNEL = false;
|
|
54
|
+
this.FRESNEL = false;
|
|
55
|
+
this.NORMAL = false;
|
|
56
|
+
this.TANGENT = false;
|
|
57
|
+
this.UV1 = false;
|
|
58
|
+
this.UV2 = false;
|
|
59
|
+
this.UV3 = false;
|
|
60
|
+
this.UV4 = false;
|
|
61
|
+
this.UV5 = false;
|
|
62
|
+
this.UV6 = false;
|
|
63
|
+
this.VERTEXCOLOR = false;
|
|
64
|
+
this.VERTEXALPHA = false;
|
|
65
|
+
this.NUM_BONE_INFLUENCERS = 0;
|
|
66
|
+
this.BonesPerMesh = 0;
|
|
67
|
+
this.BONETEXTURE = false;
|
|
68
|
+
this.BONES_VELOCITY_ENABLED = false;
|
|
69
|
+
this.INSTANCES = false;
|
|
70
|
+
this.THIN_INSTANCES = false;
|
|
71
|
+
this.INSTANCESCOLOR = false;
|
|
72
|
+
this.GLOSSINESS = false;
|
|
73
|
+
this.ROUGHNESS = false;
|
|
74
|
+
this.EMISSIVEASILLUMINATION = false;
|
|
75
|
+
this.LINKEMISSIVEWITHDIFFUSE = false;
|
|
76
|
+
this.REFLECTIONFRESNELFROMSPECULAR = false;
|
|
77
|
+
this.LIGHTMAP = false;
|
|
78
|
+
this.LIGHTMAPDIRECTUV = 0;
|
|
79
|
+
this.OBJECTSPACE_NORMALMAP = false;
|
|
80
|
+
this.USELIGHTMAPASSHADOWMAP = false;
|
|
81
|
+
this.REFLECTIONMAP_3D = false;
|
|
82
|
+
this.REFLECTIONMAP_SPHERICAL = false;
|
|
83
|
+
this.REFLECTIONMAP_PLANAR = false;
|
|
84
|
+
this.REFLECTIONMAP_CUBIC = false;
|
|
85
|
+
this.USE_LOCAL_REFLECTIONMAP_CUBIC = false;
|
|
86
|
+
this.USE_LOCAL_REFRACTIONMAP_CUBIC = false;
|
|
87
|
+
this.REFLECTIONMAP_PROJECTION = false;
|
|
88
|
+
this.REFLECTIONMAP_SKYBOX = false;
|
|
89
|
+
this.REFLECTIONMAP_EXPLICIT = false;
|
|
90
|
+
this.REFLECTIONMAP_EQUIRECTANGULAR = false;
|
|
91
|
+
this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = false;
|
|
92
|
+
this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = false;
|
|
93
|
+
this.REFLECTIONMAP_OPPOSITEZ = false;
|
|
94
|
+
this.INVERTCUBICMAP = false;
|
|
95
|
+
this.LOGARITHMICDEPTH = false;
|
|
96
|
+
this.REFRACTION = false;
|
|
97
|
+
this.REFRACTIONMAP_3D = false;
|
|
98
|
+
this.REFLECTIONOVERALPHA = false;
|
|
99
|
+
this.TWOSIDEDLIGHTING = false;
|
|
100
|
+
this.SHADOWFLOAT = false;
|
|
101
|
+
this.MORPHTARGETS = false;
|
|
102
|
+
this.MORPHTARGETS_NORMAL = false;
|
|
103
|
+
this.MORPHTARGETS_TANGENT = false;
|
|
104
|
+
this.MORPHTARGETS_UV = false;
|
|
105
|
+
this.NUM_MORPH_INFLUENCERS = 0;
|
|
106
|
+
this.MORPHTARGETS_TEXTURE = false;
|
|
107
|
+
this.NONUNIFORMSCALING = false; // https://playground.babylonjs.com#V6DWIH
|
|
108
|
+
this.PREMULTIPLYALPHA = false; // https://playground.babylonjs.com#LNVJJ7
|
|
109
|
+
this.ALPHATEST_AFTERALLALPHACOMPUTATIONS = false;
|
|
110
|
+
this.ALPHABLEND = true;
|
|
111
|
+
this.PREPASS = false;
|
|
112
|
+
this.PREPASS_COLOR = false;
|
|
113
|
+
this.PREPASS_COLOR_INDEX = -1;
|
|
114
|
+
this.PREPASS_IRRADIANCE = false;
|
|
115
|
+
this.PREPASS_IRRADIANCE_INDEX = -1;
|
|
116
|
+
this.PREPASS_ALBEDO = false;
|
|
117
|
+
this.PREPASS_ALBEDO_INDEX = -1;
|
|
118
|
+
this.PREPASS_ALBEDO_SQRT = false;
|
|
119
|
+
this.PREPASS_ALBEDO_SQRT_INDEX = -1;
|
|
120
|
+
this.PREPASS_DEPTH = false;
|
|
121
|
+
this.PREPASS_DEPTH_INDEX = -1;
|
|
122
|
+
this.PREPASS_SCREENSPACE_DEPTH = false;
|
|
123
|
+
this.PREPASS_SCREENSPACE_DEPTH_INDEX = -1;
|
|
124
|
+
this.PREPASS_NORMAL = false;
|
|
125
|
+
this.PREPASS_NORMAL_INDEX = -1;
|
|
126
|
+
this.PREPASS_NORMAL_WORLDSPACE = false;
|
|
127
|
+
this.PREPASS_WORLD_NORMAL = false;
|
|
128
|
+
this.PREPASS_WORLD_NORMAL_INDEX = -1;
|
|
129
|
+
this.PREPASS_POSITION = false;
|
|
130
|
+
this.PREPASS_POSITION_INDEX = -1;
|
|
131
|
+
this.PREPASS_LOCAL_POSITION = false;
|
|
132
|
+
this.PREPASS_LOCAL_POSITION_INDEX = -1;
|
|
133
|
+
this.PREPASS_VELOCITY = false;
|
|
134
|
+
this.PREPASS_VELOCITY_INDEX = -1;
|
|
135
|
+
this.PREPASS_VELOCITY_LINEAR = false;
|
|
136
|
+
this.PREPASS_VELOCITY_LINEAR_INDEX = -1;
|
|
137
|
+
this.PREPASS_REFLECTIVITY = false;
|
|
138
|
+
this.PREPASS_REFLECTIVITY_INDEX = -1;
|
|
139
|
+
this.SCENE_MRT_COUNT = 0;
|
|
140
|
+
this.RGBDLIGHTMAP = false;
|
|
141
|
+
this.RGBDREFLECTION = false;
|
|
142
|
+
this.RGBDREFRACTION = false;
|
|
143
|
+
this.IMAGEPROCESSING = false;
|
|
144
|
+
this.VIGNETTE = false;
|
|
145
|
+
this.VIGNETTEBLENDMODEMULTIPLY = false;
|
|
146
|
+
this.VIGNETTEBLENDMODEOPAQUE = false;
|
|
147
|
+
this.TONEMAPPING = 0;
|
|
148
|
+
this.CONTRAST = false;
|
|
149
|
+
this.COLORCURVES = false;
|
|
150
|
+
this.COLORGRADING = false;
|
|
151
|
+
this.COLORGRADING3D = false;
|
|
152
|
+
this.SAMPLER3DGREENDEPTH = false;
|
|
153
|
+
this.SAMPLER3DBGRMAP = false;
|
|
154
|
+
this.DITHER = false;
|
|
155
|
+
this.IMAGEPROCESSINGPOSTPROCESS = false;
|
|
156
|
+
this.SKIPFINALCOLORCLAMP = false;
|
|
157
|
+
this.MULTIVIEW = false;
|
|
158
|
+
this.ORDER_INDEPENDENT_TRANSPARENCY = false;
|
|
159
|
+
this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS = false;
|
|
160
|
+
this.CAMERA_ORTHOGRAPHIC = false;
|
|
161
|
+
this.CAMERA_PERSPECTIVE = false;
|
|
162
|
+
/**
|
|
163
|
+
* If the reflection texture on this material is in linear color space
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
this.IS_REFLECTION_LINEAR = false;
|
|
167
|
+
/**
|
|
168
|
+
* If the refraction texture on this material is in linear color space
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
this.IS_REFRACTION_LINEAR = false;
|
|
172
|
+
this.EXPOSURE = false;
|
|
173
|
+
this.DECAL_AFTER_DETAIL = false;
|
|
174
|
+
this.rebuild();
|
|
175
|
+
}
|
|
176
|
+
setReflectionMode(modeToEnable) {
|
|
177
|
+
const modes = [
|
|
178
|
+
"REFLECTIONMAP_CUBIC",
|
|
179
|
+
"REFLECTIONMAP_EXPLICIT",
|
|
180
|
+
"REFLECTIONMAP_PLANAR",
|
|
181
|
+
"REFLECTIONMAP_PROJECTION",
|
|
182
|
+
"REFLECTIONMAP_PROJECTION",
|
|
183
|
+
"REFLECTIONMAP_SKYBOX",
|
|
184
|
+
"REFLECTIONMAP_SPHERICAL",
|
|
185
|
+
"REFLECTIONMAP_EQUIRECTANGULAR",
|
|
186
|
+
"REFLECTIONMAP_EQUIRECTANGULAR_FIXED",
|
|
187
|
+
"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED",
|
|
188
|
+
];
|
|
189
|
+
for (const mode of modes) {
|
|
190
|
+
this[mode] = mode === modeToEnable;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* This is the default material used in Babylon. It is the best trade off between quality
|
|
196
|
+
* and performances.
|
|
197
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
|
|
198
|
+
*/
|
|
199
|
+
class StandardMaterial extends PushMaterial {
|
|
200
|
+
/**
|
|
201
|
+
* Gets the image processing configuration used either in this material.
|
|
202
|
+
*/
|
|
203
|
+
get imageProcessingConfiguration() {
|
|
204
|
+
return this._imageProcessingConfiguration;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Sets the Default image processing configuration used either in the this material.
|
|
208
|
+
*
|
|
209
|
+
* If sets to null, the scene one is in use.
|
|
210
|
+
*/
|
|
211
|
+
set imageProcessingConfiguration(value) {
|
|
212
|
+
this._attachImageProcessingConfiguration(value);
|
|
213
|
+
// Ensure the effect will be rebuilt.
|
|
214
|
+
this._markAllSubMeshesAsTexturesDirty();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Attaches a new image processing configuration to the Standard Material.
|
|
218
|
+
* @param configuration
|
|
219
|
+
*/
|
|
220
|
+
_attachImageProcessingConfiguration(configuration) {
|
|
221
|
+
if (configuration === this._imageProcessingConfiguration) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
// Detaches observer
|
|
225
|
+
if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
|
|
226
|
+
this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
|
|
227
|
+
}
|
|
228
|
+
// Pick the scene configuration if needed
|
|
229
|
+
if (!configuration) {
|
|
230
|
+
this._imageProcessingConfiguration = this.getScene().imageProcessingConfiguration;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
this._imageProcessingConfiguration = configuration;
|
|
234
|
+
}
|
|
235
|
+
// Attaches observer
|
|
236
|
+
if (this._imageProcessingConfiguration) {
|
|
237
|
+
this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {
|
|
238
|
+
this._markAllSubMeshesAsImageProcessingDirty();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Can this material render to prepass
|
|
244
|
+
*/
|
|
245
|
+
get isPrePassCapable() {
|
|
246
|
+
return !this.disableDepthWrite;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Gets whether the color curves effect is enabled.
|
|
250
|
+
*/
|
|
251
|
+
get cameraColorCurvesEnabled() {
|
|
252
|
+
return this.imageProcessingConfiguration.colorCurvesEnabled;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Sets whether the color curves effect is enabled.
|
|
256
|
+
*/
|
|
257
|
+
set cameraColorCurvesEnabled(value) {
|
|
258
|
+
this.imageProcessingConfiguration.colorCurvesEnabled = value;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Gets whether the color grading effect is enabled.
|
|
262
|
+
*/
|
|
263
|
+
get cameraColorGradingEnabled() {
|
|
264
|
+
return this.imageProcessingConfiguration.colorGradingEnabled;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Gets whether the color grading effect is enabled.
|
|
268
|
+
*/
|
|
269
|
+
set cameraColorGradingEnabled(value) {
|
|
270
|
+
this.imageProcessingConfiguration.colorGradingEnabled = value;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Gets whether tonemapping is enabled or not.
|
|
274
|
+
*/
|
|
275
|
+
get cameraToneMappingEnabled() {
|
|
276
|
+
return this._imageProcessingConfiguration.toneMappingEnabled;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Sets whether tonemapping is enabled or not
|
|
280
|
+
*/
|
|
281
|
+
set cameraToneMappingEnabled(value) {
|
|
282
|
+
this._imageProcessingConfiguration.toneMappingEnabled = value;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* The camera exposure used on this material.
|
|
286
|
+
* This property is here and not in the camera to allow controlling exposure without full screen post process.
|
|
287
|
+
* This corresponds to a photographic exposure.
|
|
288
|
+
*/
|
|
289
|
+
get cameraExposure() {
|
|
290
|
+
return this._imageProcessingConfiguration.exposure;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The camera exposure used on this material.
|
|
294
|
+
* This property is here and not in the camera to allow controlling exposure without full screen post process.
|
|
295
|
+
* This corresponds to a photographic exposure.
|
|
296
|
+
*/
|
|
297
|
+
set cameraExposure(value) {
|
|
298
|
+
this._imageProcessingConfiguration.exposure = value;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Gets The camera contrast used on this material.
|
|
302
|
+
*/
|
|
303
|
+
get cameraContrast() {
|
|
304
|
+
return this._imageProcessingConfiguration.contrast;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Sets The camera contrast used on this material.
|
|
308
|
+
*/
|
|
309
|
+
set cameraContrast(value) {
|
|
310
|
+
this._imageProcessingConfiguration.contrast = value;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Gets the Color Grading 2D Lookup Texture.
|
|
314
|
+
*/
|
|
315
|
+
get cameraColorGradingTexture() {
|
|
316
|
+
return this._imageProcessingConfiguration.colorGradingTexture;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Sets the Color Grading 2D Lookup Texture.
|
|
320
|
+
*/
|
|
321
|
+
set cameraColorGradingTexture(value) {
|
|
322
|
+
this._imageProcessingConfiguration.colorGradingTexture = value;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
|
|
326
|
+
* They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
|
|
327
|
+
* These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
|
|
328
|
+
* corresponding to low luminance, medium luminance, and high luminance areas respectively.
|
|
329
|
+
*/
|
|
330
|
+
get cameraColorCurves() {
|
|
331
|
+
return this._imageProcessingConfiguration.colorCurves;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
|
|
335
|
+
* They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
|
|
336
|
+
* These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
|
|
337
|
+
* corresponding to low luminance, medium luminance, and high luminance areas respectively.
|
|
338
|
+
*/
|
|
339
|
+
set cameraColorCurves(value) {
|
|
340
|
+
this._imageProcessingConfiguration.colorCurves = value;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Can this material render to several textures at once
|
|
344
|
+
*/
|
|
345
|
+
get canRenderToMRT() {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Instantiates a new standard material.
|
|
350
|
+
* This is the default material used in Babylon. It is the best trade off between quality
|
|
351
|
+
* and performances.
|
|
352
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
|
|
353
|
+
* @param name Define the name of the material in the scene
|
|
354
|
+
* @param scene Define the scene the material belong to
|
|
355
|
+
* @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false
|
|
356
|
+
*/
|
|
357
|
+
constructor(name, scene, forceGLSL = false) {
|
|
358
|
+
super(name, scene, undefined, forceGLSL || StandardMaterial.ForceGLSL);
|
|
359
|
+
this._diffuseTexture = null;
|
|
360
|
+
this._ambientTexture = null;
|
|
361
|
+
this._opacityTexture = null;
|
|
362
|
+
this._reflectionTexture = null;
|
|
363
|
+
this._emissiveTexture = null;
|
|
364
|
+
this._specularTexture = null;
|
|
365
|
+
this._bumpTexture = null;
|
|
366
|
+
this._lightmapTexture = null;
|
|
367
|
+
this._refractionTexture = null;
|
|
368
|
+
/**
|
|
369
|
+
* The color of the material lit by the environmental background lighting.
|
|
370
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#ambient-color-example
|
|
371
|
+
*/
|
|
372
|
+
this.ambientColor = new Color3(0, 0, 0);
|
|
373
|
+
/**
|
|
374
|
+
* The basic color of the material as viewed under a light.
|
|
375
|
+
*/
|
|
376
|
+
this.diffuseColor = new Color3(1, 1, 1);
|
|
377
|
+
/**
|
|
378
|
+
* Define how the color and intensity of the highlight given by the light in the material.
|
|
379
|
+
*/
|
|
380
|
+
this.specularColor = new Color3(1, 1, 1);
|
|
381
|
+
/**
|
|
382
|
+
* Define the color of the material as if self lit.
|
|
383
|
+
* This will be mixed in the final result even in the absence of light.
|
|
384
|
+
*/
|
|
385
|
+
this.emissiveColor = new Color3(0, 0, 0);
|
|
386
|
+
/**
|
|
387
|
+
* Defines how sharp are the highlights in the material.
|
|
388
|
+
* The bigger the value the sharper giving a more glossy feeling to the result.
|
|
389
|
+
* Reversely, the smaller the value the blurrier giving a more rough feeling to the result.
|
|
390
|
+
*/
|
|
391
|
+
this.specularPower = 64;
|
|
392
|
+
this._useAlphaFromDiffuseTexture = false;
|
|
393
|
+
this._useEmissiveAsIllumination = false;
|
|
394
|
+
this._linkEmissiveWithDiffuse = false;
|
|
395
|
+
this._useSpecularOverAlpha = false;
|
|
396
|
+
this._useReflectionOverAlpha = false;
|
|
397
|
+
this._disableLighting = false;
|
|
398
|
+
this._useObjectSpaceNormalMap = false;
|
|
399
|
+
this._useParallax = false;
|
|
400
|
+
this._useParallaxOcclusion = false;
|
|
401
|
+
/**
|
|
402
|
+
* Apply a scaling factor that determine which "depth" the height map should reprensent. A value between 0.05 and 0.1 is reasonnable in Parallax, you can reach 0.2 using Parallax Occlusion.
|
|
403
|
+
*/
|
|
404
|
+
this.parallaxScaleBias = 0.05;
|
|
405
|
+
this._roughness = 0;
|
|
406
|
+
/**
|
|
407
|
+
* In case of refraction, define the value of the index of refraction.
|
|
408
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
|
|
409
|
+
*/
|
|
410
|
+
this.indexOfRefraction = 0.98;
|
|
411
|
+
/**
|
|
412
|
+
* Invert the refraction texture alongside the y axis.
|
|
413
|
+
* It can be useful with procedural textures or probe for instance.
|
|
414
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
|
|
415
|
+
*/
|
|
416
|
+
this.invertRefractionY = true;
|
|
417
|
+
/**
|
|
418
|
+
* Defines the alpha limits in alpha test mode.
|
|
419
|
+
*/
|
|
420
|
+
this.alphaCutOff = 0.4;
|
|
421
|
+
this._useLightmapAsShadowmap = false;
|
|
422
|
+
this._useReflectionFresnelFromSpecular = false;
|
|
423
|
+
this._useGlossinessFromSpecularMapAlpha = false;
|
|
424
|
+
this._maxSimultaneousLights = 4;
|
|
425
|
+
this._invertNormalMapX = false;
|
|
426
|
+
this._invertNormalMapY = false;
|
|
427
|
+
this._twoSidedLighting = false;
|
|
428
|
+
this._applyDecalMapAfterDetailMap = false;
|
|
429
|
+
this._shadersLoaded = false;
|
|
430
|
+
this._renderTargets = new SmartArray(16);
|
|
431
|
+
this._worldViewProjectionMatrix = Matrix.Zero();
|
|
432
|
+
this._globalAmbientColor = new Color3(0, 0, 0);
|
|
433
|
+
this._cacheHasRenderTargetTextures = false;
|
|
434
|
+
this.detailMap = new DetailMapConfiguration(this);
|
|
435
|
+
// Setup the default processing configuration to the scene.
|
|
436
|
+
this._attachImageProcessingConfiguration(null);
|
|
437
|
+
this.prePassConfiguration = new PrePassConfiguration();
|
|
438
|
+
this.getRenderTargetTextures = () => {
|
|
439
|
+
this._renderTargets.reset();
|
|
440
|
+
if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
|
|
441
|
+
this._renderTargets.push(this._reflectionTexture);
|
|
442
|
+
}
|
|
443
|
+
if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
|
|
444
|
+
this._renderTargets.push(this._refractionTexture);
|
|
445
|
+
}
|
|
446
|
+
this._eventInfo.renderTargets = this._renderTargets;
|
|
447
|
+
this._callbackPluginEventFillRenderTargetTextures(this._eventInfo);
|
|
448
|
+
return this._renderTargets;
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Gets a boolean indicating that current material needs to register RTT
|
|
453
|
+
*/
|
|
454
|
+
get hasRenderTargetTextures() {
|
|
455
|
+
if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
|
|
459
|
+
return true;
|
|
460
|
+
}
|
|
461
|
+
return this._cacheHasRenderTargetTextures;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Gets the current class name of the material e.g. "StandardMaterial"
|
|
465
|
+
* Mainly use in serialization.
|
|
466
|
+
* @returns the class name
|
|
467
|
+
*/
|
|
468
|
+
getClassName() {
|
|
469
|
+
return "StandardMaterial";
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Specifies if the material will require alpha blending
|
|
473
|
+
* @returns a boolean specifying if alpha blending is needed
|
|
474
|
+
*/
|
|
475
|
+
needAlphaBlending() {
|
|
476
|
+
if (this._disableAlphaBlending) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
return (this.alpha < 1.0 ||
|
|
480
|
+
this._opacityTexture != null ||
|
|
481
|
+
this._shouldUseAlphaFromDiffuseTexture() ||
|
|
482
|
+
(this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled));
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Specifies if this material should be rendered in alpha test mode
|
|
486
|
+
* @returns a boolean specifying if an alpha test is needed.
|
|
487
|
+
*/
|
|
488
|
+
needAlphaTesting() {
|
|
489
|
+
if (this._forceAlphaTest) {
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
return this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === Material.MATERIAL_ALPHATEST);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* @returns whether or not the alpha value of the diffuse texture should be used for alpha blending.
|
|
496
|
+
*/
|
|
497
|
+
_shouldUseAlphaFromDiffuseTexture() {
|
|
498
|
+
return this._diffuseTexture != null && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture && this._transparencyMode !== Material.MATERIAL_OPAQUE;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* @returns whether or not there is a usable alpha channel for transparency.
|
|
502
|
+
*/
|
|
503
|
+
_hasAlphaChannel() {
|
|
504
|
+
return (this._diffuseTexture != null && this._diffuseTexture.hasAlpha) || this._opacityTexture != null;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Get the texture used for alpha test purpose.
|
|
508
|
+
* @returns the diffuse texture in case of the standard material.
|
|
509
|
+
*/
|
|
510
|
+
getAlphaTestTexture() {
|
|
511
|
+
return this._diffuseTexture;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Get if the submesh is ready to be used and all its information available.
|
|
515
|
+
* Child classes can use it to update shaders
|
|
516
|
+
* @param mesh defines the mesh to check
|
|
517
|
+
* @param subMesh defines which submesh to check
|
|
518
|
+
* @param useInstances specifies that instances should be used
|
|
519
|
+
* @returns a boolean indicating that the submesh is ready or not
|
|
520
|
+
*/
|
|
521
|
+
isReadyForSubMesh(mesh, subMesh, useInstances = false) {
|
|
522
|
+
if (!this._uniformBufferLayoutBuilt) {
|
|
523
|
+
this.buildUniformLayout();
|
|
524
|
+
}
|
|
525
|
+
const drawWrapper = subMesh._drawWrapper;
|
|
526
|
+
if (drawWrapper.effect && this.isFrozen) {
|
|
527
|
+
if (drawWrapper._wasPreviouslyReady && drawWrapper._wasPreviouslyUsingInstances === useInstances) {
|
|
528
|
+
return true;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (!subMesh.materialDefines) {
|
|
532
|
+
this._callbackPluginEventGeneric(4 /* MaterialPluginEvent.GetDefineNames */, this._eventInfo);
|
|
533
|
+
subMesh.materialDefines = new StandardMaterialDefines(this._eventInfo.defineNames);
|
|
534
|
+
}
|
|
535
|
+
const scene = this.getScene();
|
|
536
|
+
const defines = subMesh.materialDefines;
|
|
537
|
+
if (this._isReadyForSubMesh(subMesh)) {
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
const engine = scene.getEngine();
|
|
541
|
+
// Lights
|
|
542
|
+
defines._needNormals = PrepareDefinesForLights(scene, mesh, defines, true, this._maxSimultaneousLights, this._disableLighting);
|
|
543
|
+
// Multiview
|
|
544
|
+
PrepareDefinesForMultiview(scene, defines);
|
|
545
|
+
// PrePass
|
|
546
|
+
const oit = this.needAlphaBlendingForMesh(mesh) && this.getScene().useOrderIndependentTransparency;
|
|
547
|
+
PrepareDefinesForPrePass(scene, defines, this.canRenderToMRT && !oit);
|
|
548
|
+
// Order independant transparency
|
|
549
|
+
PrepareDefinesForOIT(scene, defines, oit);
|
|
550
|
+
MaterialHelperGeometryRendering.PrepareDefines(engine.currentRenderPassId, mesh, defines);
|
|
551
|
+
// Textures
|
|
552
|
+
if (defines._areTexturesDirty) {
|
|
553
|
+
this._eventInfo.hasRenderTargetTextures = false;
|
|
554
|
+
this._callbackPluginEventHasRenderTargetTextures(this._eventInfo);
|
|
555
|
+
this._cacheHasRenderTargetTextures = this._eventInfo.hasRenderTargetTextures;
|
|
556
|
+
defines._needUVs = false;
|
|
557
|
+
for (let i = 1; i <= Constants.MAX_SUPPORTED_UV_SETS; ++i) {
|
|
558
|
+
defines["MAINUV" + i] = false;
|
|
559
|
+
}
|
|
560
|
+
if (scene.texturesEnabled) {
|
|
561
|
+
defines.DIFFUSEDIRECTUV = 0;
|
|
562
|
+
defines.BUMPDIRECTUV = 0;
|
|
563
|
+
defines.AMBIENTDIRECTUV = 0;
|
|
564
|
+
defines.OPACITYDIRECTUV = 0;
|
|
565
|
+
defines.EMISSIVEDIRECTUV = 0;
|
|
566
|
+
defines.SPECULARDIRECTUV = 0;
|
|
567
|
+
defines.LIGHTMAPDIRECTUV = 0;
|
|
568
|
+
if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
|
|
569
|
+
if (!this._diffuseTexture.isReadyOrNotBlocking()) {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
PrepareDefinesForMergedUV(this._diffuseTexture, defines, "DIFFUSE");
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
defines.DIFFUSE = false;
|
|
578
|
+
}
|
|
579
|
+
if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
|
|
580
|
+
if (!this._ambientTexture.isReadyOrNotBlocking()) {
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
PrepareDefinesForMergedUV(this._ambientTexture, defines, "AMBIENT");
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
defines.AMBIENT = false;
|
|
589
|
+
}
|
|
590
|
+
if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {
|
|
591
|
+
if (!this._opacityTexture.isReadyOrNotBlocking()) {
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
PrepareDefinesForMergedUV(this._opacityTexture, defines, "OPACITY");
|
|
596
|
+
defines.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
defines.OPACITY = false;
|
|
601
|
+
}
|
|
602
|
+
if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
|
|
603
|
+
if (!this._reflectionTexture.isReadyOrNotBlocking()) {
|
|
604
|
+
return false;
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
defines._needNormals = true;
|
|
608
|
+
defines.REFLECTION = true;
|
|
609
|
+
defines.ROUGHNESS = this._roughness > 0;
|
|
610
|
+
defines.REFLECTIONOVERALPHA = this._useReflectionOverAlpha;
|
|
611
|
+
defines.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === Texture.INVCUBIC_MODE;
|
|
612
|
+
defines.REFLECTIONMAP_3D = this._reflectionTexture.isCube;
|
|
613
|
+
defines.REFLECTIONMAP_OPPOSITEZ =
|
|
614
|
+
defines.REFLECTIONMAP_3D && this.getScene().useRightHandedSystem ? !this._reflectionTexture.invertZ : this._reflectionTexture.invertZ;
|
|
615
|
+
defines.RGBDREFLECTION = this._reflectionTexture.isRGBD;
|
|
616
|
+
switch (this._reflectionTexture.coordinatesMode) {
|
|
617
|
+
case Texture.EXPLICIT_MODE:
|
|
618
|
+
defines.setReflectionMode("REFLECTIONMAP_EXPLICIT");
|
|
619
|
+
break;
|
|
620
|
+
case Texture.PLANAR_MODE:
|
|
621
|
+
defines.setReflectionMode("REFLECTIONMAP_PLANAR");
|
|
622
|
+
break;
|
|
623
|
+
case Texture.PROJECTION_MODE:
|
|
624
|
+
defines.setReflectionMode("REFLECTIONMAP_PROJECTION");
|
|
625
|
+
break;
|
|
626
|
+
case Texture.SKYBOX_MODE:
|
|
627
|
+
defines.setReflectionMode("REFLECTIONMAP_SKYBOX");
|
|
628
|
+
break;
|
|
629
|
+
case Texture.SPHERICAL_MODE:
|
|
630
|
+
defines.setReflectionMode("REFLECTIONMAP_SPHERICAL");
|
|
631
|
+
break;
|
|
632
|
+
case Texture.EQUIRECTANGULAR_MODE:
|
|
633
|
+
defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");
|
|
634
|
+
break;
|
|
635
|
+
case Texture.FIXED_EQUIRECTANGULAR_MODE:
|
|
636
|
+
defines.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");
|
|
637
|
+
break;
|
|
638
|
+
case Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:
|
|
639
|
+
defines.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");
|
|
640
|
+
break;
|
|
641
|
+
case Texture.CUBIC_MODE:
|
|
642
|
+
case Texture.INVCUBIC_MODE:
|
|
643
|
+
default:
|
|
644
|
+
defines.setReflectionMode("REFLECTIONMAP_CUBIC");
|
|
645
|
+
break;
|
|
646
|
+
}
|
|
647
|
+
defines.USE_LOCAL_REFLECTIONMAP_CUBIC = this._reflectionTexture.boundingBoxSize ? true : false;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
defines.REFLECTION = false;
|
|
652
|
+
defines.REFLECTIONMAP_OPPOSITEZ = false;
|
|
653
|
+
}
|
|
654
|
+
if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
|
|
655
|
+
if (!this._emissiveTexture.isReadyOrNotBlocking()) {
|
|
656
|
+
return false;
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
PrepareDefinesForMergedUV(this._emissiveTexture, defines, "EMISSIVE");
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
defines.EMISSIVE = false;
|
|
664
|
+
}
|
|
665
|
+
if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {
|
|
666
|
+
if (!this._lightmapTexture.isReadyOrNotBlocking()) {
|
|
667
|
+
return false;
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
PrepareDefinesForMergedUV(this._lightmapTexture, defines, "LIGHTMAP");
|
|
671
|
+
defines.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap;
|
|
672
|
+
defines.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
defines.LIGHTMAP = false;
|
|
677
|
+
}
|
|
678
|
+
if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {
|
|
679
|
+
if (!this._specularTexture.isReadyOrNotBlocking()) {
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
else {
|
|
683
|
+
PrepareDefinesForMergedUV(this._specularTexture, defines, "SPECULAR");
|
|
684
|
+
defines.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
defines.SPECULAR = false;
|
|
689
|
+
}
|
|
690
|
+
if (scene.getEngine().getCaps().standardDerivatives && this._bumpTexture && StandardMaterial.BumpTextureEnabled) {
|
|
691
|
+
// Bump texture can not be not blocking.
|
|
692
|
+
if (!this._bumpTexture.isReady()) {
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
PrepareDefinesForMergedUV(this._bumpTexture, defines, "BUMP");
|
|
697
|
+
defines.PARALLAX = this._useParallax;
|
|
698
|
+
defines.PARALLAX_RHS = scene.useRightHandedSystem;
|
|
699
|
+
defines.PARALLAXOCCLUSION = this._useParallaxOcclusion;
|
|
700
|
+
}
|
|
701
|
+
defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
defines.BUMP = false;
|
|
705
|
+
defines.PARALLAX = false;
|
|
706
|
+
defines.PARALLAX_RHS = false;
|
|
707
|
+
defines.PARALLAXOCCLUSION = false;
|
|
708
|
+
}
|
|
709
|
+
if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
|
|
710
|
+
if (!this._refractionTexture.isReadyOrNotBlocking()) {
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
defines._needUVs = true;
|
|
715
|
+
defines.REFRACTION = true;
|
|
716
|
+
defines.REFRACTIONMAP_3D = this._refractionTexture.isCube;
|
|
717
|
+
defines.RGBDREFRACTION = this._refractionTexture.isRGBD;
|
|
718
|
+
defines.USE_LOCAL_REFRACTIONMAP_CUBIC = this._refractionTexture.boundingBoxSize ? true : false;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
else {
|
|
722
|
+
defines.REFRACTION = false;
|
|
723
|
+
}
|
|
724
|
+
defines.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting;
|
|
725
|
+
}
|
|
726
|
+
else {
|
|
727
|
+
defines.DIFFUSE = false;
|
|
728
|
+
defines.AMBIENT = false;
|
|
729
|
+
defines.OPACITY = false;
|
|
730
|
+
defines.REFLECTION = false;
|
|
731
|
+
defines.EMISSIVE = false;
|
|
732
|
+
defines.LIGHTMAP = false;
|
|
733
|
+
defines.BUMP = false;
|
|
734
|
+
defines.REFRACTION = false;
|
|
735
|
+
}
|
|
736
|
+
defines.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture();
|
|
737
|
+
defines.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination;
|
|
738
|
+
defines.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse;
|
|
739
|
+
defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
|
|
740
|
+
defines.PREMULTIPLYALPHA = this.alphaMode === Constants.ALPHA_PREMULTIPLIED || this.alphaMode === Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;
|
|
741
|
+
defines.ALPHATEST_AFTERALLALPHACOMPUTATIONS = this.transparencyMode !== null;
|
|
742
|
+
defines.ALPHABLEND = this.transparencyMode === null || this.needAlphaBlendingForMesh(mesh); // check on null for backward compatibility
|
|
743
|
+
}
|
|
744
|
+
this._eventInfo.isReadyForSubMesh = true;
|
|
745
|
+
this._eventInfo.defines = defines;
|
|
746
|
+
this._eventInfo.subMesh = subMesh;
|
|
747
|
+
this._callbackPluginEventIsReadyForSubMesh(this._eventInfo);
|
|
748
|
+
if (!this._eventInfo.isReadyForSubMesh) {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {
|
|
752
|
+
if (!this._imageProcessingConfiguration.isReady()) {
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
755
|
+
this._imageProcessingConfiguration.prepareDefines(defines);
|
|
756
|
+
defines.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace;
|
|
757
|
+
defines.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;
|
|
758
|
+
}
|
|
759
|
+
if (defines._areFresnelDirty) {
|
|
760
|
+
if (StandardMaterial.FresnelEnabled) {
|
|
761
|
+
// Fresnel
|
|
762
|
+
if (this._diffuseFresnelParameters ||
|
|
763
|
+
this._opacityFresnelParameters ||
|
|
764
|
+
this._emissiveFresnelParameters ||
|
|
765
|
+
this._refractionFresnelParameters ||
|
|
766
|
+
this._reflectionFresnelParameters) {
|
|
767
|
+
defines.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled;
|
|
768
|
+
defines.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled;
|
|
769
|
+
defines.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled;
|
|
770
|
+
defines.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular;
|
|
771
|
+
defines.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled;
|
|
772
|
+
defines.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled;
|
|
773
|
+
defines._needNormals = true;
|
|
774
|
+
defines.FRESNEL = true;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
else {
|
|
778
|
+
defines.FRESNEL = false;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
// Misc.
|
|
782
|
+
PrepareDefinesForMisc(mesh, scene, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh) || this._forceAlphaTest, defines, this._applyDecalMapAfterDetailMap);
|
|
783
|
+
// Values that need to be evaluated on every frame
|
|
784
|
+
PrepareDefinesForFrameBoundValues(scene, engine, this, defines, useInstances, null, subMesh.getRenderingMesh().hasThinInstances);
|
|
785
|
+
// External config
|
|
786
|
+
this._eventInfo.defines = defines;
|
|
787
|
+
this._eventInfo.mesh = mesh;
|
|
788
|
+
this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo);
|
|
789
|
+
// Attribs
|
|
790
|
+
PrepareDefinesForAttributes(mesh, defines, true, true, true);
|
|
791
|
+
// External config
|
|
792
|
+
this._callbackPluginEventPrepareDefines(this._eventInfo);
|
|
793
|
+
// Get correct effect
|
|
794
|
+
let forceWasNotReadyPreviously = false;
|
|
795
|
+
if (defines.isDirty) {
|
|
796
|
+
const lightDisposed = defines._areLightsDisposed;
|
|
797
|
+
defines.markAsProcessed();
|
|
798
|
+
// Fallbacks
|
|
799
|
+
const fallbacks = new EffectFallbacks();
|
|
800
|
+
if (defines.REFLECTION) {
|
|
801
|
+
fallbacks.addFallback(0, "REFLECTION");
|
|
802
|
+
}
|
|
803
|
+
if (defines.SPECULAR) {
|
|
804
|
+
fallbacks.addFallback(0, "SPECULAR");
|
|
805
|
+
}
|
|
806
|
+
if (defines.BUMP) {
|
|
807
|
+
fallbacks.addFallback(0, "BUMP");
|
|
808
|
+
}
|
|
809
|
+
if (defines.PARALLAX) {
|
|
810
|
+
fallbacks.addFallback(1, "PARALLAX");
|
|
811
|
+
}
|
|
812
|
+
if (defines.PARALLAX_RHS) {
|
|
813
|
+
fallbacks.addFallback(1, "PARALLAX_RHS");
|
|
814
|
+
}
|
|
815
|
+
if (defines.PARALLAXOCCLUSION) {
|
|
816
|
+
fallbacks.addFallback(0, "PARALLAXOCCLUSION");
|
|
817
|
+
}
|
|
818
|
+
if (defines.SPECULAROVERALPHA) {
|
|
819
|
+
fallbacks.addFallback(0, "SPECULAROVERALPHA");
|
|
820
|
+
}
|
|
821
|
+
if (defines.FOG) {
|
|
822
|
+
fallbacks.addFallback(1, "FOG");
|
|
823
|
+
}
|
|
824
|
+
if (defines.POINTSIZE) {
|
|
825
|
+
fallbacks.addFallback(0, "POINTSIZE");
|
|
826
|
+
}
|
|
827
|
+
if (defines.LOGARITHMICDEPTH) {
|
|
828
|
+
fallbacks.addFallback(0, "LOGARITHMICDEPTH");
|
|
829
|
+
}
|
|
830
|
+
HandleFallbacksForShadows(defines, fallbacks, this._maxSimultaneousLights);
|
|
831
|
+
if (defines.SPECULARTERM) {
|
|
832
|
+
fallbacks.addFallback(0, "SPECULARTERM");
|
|
833
|
+
}
|
|
834
|
+
if (defines.DIFFUSEFRESNEL) {
|
|
835
|
+
fallbacks.addFallback(1, "DIFFUSEFRESNEL");
|
|
836
|
+
}
|
|
837
|
+
if (defines.OPACITYFRESNEL) {
|
|
838
|
+
fallbacks.addFallback(2, "OPACITYFRESNEL");
|
|
839
|
+
}
|
|
840
|
+
if (defines.REFLECTIONFRESNEL) {
|
|
841
|
+
fallbacks.addFallback(3, "REFLECTIONFRESNEL");
|
|
842
|
+
}
|
|
843
|
+
if (defines.EMISSIVEFRESNEL) {
|
|
844
|
+
fallbacks.addFallback(4, "EMISSIVEFRESNEL");
|
|
845
|
+
}
|
|
846
|
+
if (defines.FRESNEL) {
|
|
847
|
+
fallbacks.addFallback(4, "FRESNEL");
|
|
848
|
+
}
|
|
849
|
+
if (defines.MULTIVIEW) {
|
|
850
|
+
fallbacks.addFallback(0, "MULTIVIEW");
|
|
851
|
+
}
|
|
852
|
+
//Attributes
|
|
853
|
+
const attribs = [VertexBuffer.PositionKind];
|
|
854
|
+
if (defines.NORMAL) {
|
|
855
|
+
attribs.push(VertexBuffer.NormalKind);
|
|
856
|
+
}
|
|
857
|
+
if (defines.TANGENT) {
|
|
858
|
+
attribs.push(VertexBuffer.TangentKind);
|
|
859
|
+
}
|
|
860
|
+
for (let i = 1; i <= Constants.MAX_SUPPORTED_UV_SETS; ++i) {
|
|
861
|
+
if (defines["UV" + i]) {
|
|
862
|
+
attribs.push(`uv${i === 1 ? "" : i}`);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
if (defines.VERTEXCOLOR) {
|
|
866
|
+
attribs.push(VertexBuffer.ColorKind);
|
|
867
|
+
}
|
|
868
|
+
PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
|
|
869
|
+
PrepareAttributesForInstances(attribs, defines);
|
|
870
|
+
PrepareAttributesForMorphTargets(attribs, mesh, defines);
|
|
871
|
+
PrepareAttributesForBakedVertexAnimation(attribs, mesh, defines);
|
|
872
|
+
let shaderName = "default";
|
|
873
|
+
const uniforms = [
|
|
874
|
+
"world",
|
|
875
|
+
"view",
|
|
876
|
+
"viewProjection",
|
|
877
|
+
"vEyePosition",
|
|
878
|
+
"vLightsType",
|
|
879
|
+
"vAmbientColor",
|
|
880
|
+
"vDiffuseColor",
|
|
881
|
+
"vSpecularColor",
|
|
882
|
+
"vEmissiveColor",
|
|
883
|
+
"visibility",
|
|
884
|
+
"vFogInfos",
|
|
885
|
+
"vFogColor",
|
|
886
|
+
"pointSize",
|
|
887
|
+
"vDiffuseInfos",
|
|
888
|
+
"vAmbientInfos",
|
|
889
|
+
"vOpacityInfos",
|
|
890
|
+
"vReflectionInfos",
|
|
891
|
+
"vEmissiveInfos",
|
|
892
|
+
"vSpecularInfos",
|
|
893
|
+
"vBumpInfos",
|
|
894
|
+
"vLightmapInfos",
|
|
895
|
+
"vRefractionInfos",
|
|
896
|
+
"mBones",
|
|
897
|
+
"diffuseMatrix",
|
|
898
|
+
"ambientMatrix",
|
|
899
|
+
"opacityMatrix",
|
|
900
|
+
"reflectionMatrix",
|
|
901
|
+
"emissiveMatrix",
|
|
902
|
+
"specularMatrix",
|
|
903
|
+
"bumpMatrix",
|
|
904
|
+
"normalMatrix",
|
|
905
|
+
"lightmapMatrix",
|
|
906
|
+
"refractionMatrix",
|
|
907
|
+
"diffuseLeftColor",
|
|
908
|
+
"diffuseRightColor",
|
|
909
|
+
"opacityParts",
|
|
910
|
+
"reflectionLeftColor",
|
|
911
|
+
"reflectionRightColor",
|
|
912
|
+
"emissiveLeftColor",
|
|
913
|
+
"emissiveRightColor",
|
|
914
|
+
"refractionLeftColor",
|
|
915
|
+
"refractionRightColor",
|
|
916
|
+
"vReflectionPosition",
|
|
917
|
+
"vReflectionSize",
|
|
918
|
+
"vRefractionPosition",
|
|
919
|
+
"vRefractionSize",
|
|
920
|
+
"logarithmicDepthConstant",
|
|
921
|
+
"vTangentSpaceParams",
|
|
922
|
+
"alphaCutOff",
|
|
923
|
+
"boneTextureWidth",
|
|
924
|
+
"morphTargetTextureInfo",
|
|
925
|
+
"morphTargetTextureIndices",
|
|
926
|
+
];
|
|
927
|
+
const samplers = [
|
|
928
|
+
"diffuseSampler",
|
|
929
|
+
"ambientSampler",
|
|
930
|
+
"opacitySampler",
|
|
931
|
+
"reflectionCubeSampler",
|
|
932
|
+
"reflection2DSampler",
|
|
933
|
+
"emissiveSampler",
|
|
934
|
+
"specularSampler",
|
|
935
|
+
"bumpSampler",
|
|
936
|
+
"lightmapSampler",
|
|
937
|
+
"refractionCubeSampler",
|
|
938
|
+
"refraction2DSampler",
|
|
939
|
+
"boneSampler",
|
|
940
|
+
"morphTargets",
|
|
941
|
+
"oitDepthSampler",
|
|
942
|
+
"oitFrontColorSampler",
|
|
943
|
+
];
|
|
944
|
+
const uniformBuffers = ["Material", "Scene", "Mesh"];
|
|
945
|
+
const indexParameters = { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: defines.NUM_MORPH_INFLUENCERS };
|
|
946
|
+
this._eventInfo.fallbacks = fallbacks;
|
|
947
|
+
this._eventInfo.fallbackRank = 0;
|
|
948
|
+
this._eventInfo.defines = defines;
|
|
949
|
+
this._eventInfo.uniforms = uniforms;
|
|
950
|
+
this._eventInfo.attributes = attribs;
|
|
951
|
+
this._eventInfo.samplers = samplers;
|
|
952
|
+
this._eventInfo.uniformBuffersNames = uniformBuffers;
|
|
953
|
+
this._eventInfo.customCode = undefined;
|
|
954
|
+
this._eventInfo.mesh = mesh;
|
|
955
|
+
this._eventInfo.indexParameters = indexParameters;
|
|
956
|
+
this._callbackPluginEventGeneric(128 /* MaterialPluginEvent.PrepareEffect */, this._eventInfo);
|
|
957
|
+
MaterialHelperGeometryRendering.AddUniformsAndSamplers(uniforms, samplers);
|
|
958
|
+
PrePassConfiguration.AddUniforms(uniforms);
|
|
959
|
+
if (ImageProcessingConfiguration) {
|
|
960
|
+
ImageProcessingConfiguration.PrepareUniforms(uniforms, defines);
|
|
961
|
+
ImageProcessingConfiguration.PrepareSamplers(samplers, defines);
|
|
962
|
+
}
|
|
963
|
+
PrepareUniformsAndSamplersList({
|
|
964
|
+
uniformsNames: uniforms,
|
|
965
|
+
uniformBuffersNames: uniformBuffers,
|
|
966
|
+
samplers: samplers,
|
|
967
|
+
defines: defines,
|
|
968
|
+
maxSimultaneousLights: this._maxSimultaneousLights,
|
|
969
|
+
});
|
|
970
|
+
addClipPlaneUniforms(uniforms);
|
|
971
|
+
const csnrOptions = {};
|
|
972
|
+
if (this.customShaderNameResolve) {
|
|
973
|
+
shaderName = this.customShaderNameResolve(shaderName, uniforms, uniformBuffers, samplers, defines, attribs, csnrOptions);
|
|
974
|
+
}
|
|
975
|
+
const join = defines.toString();
|
|
976
|
+
const previousEffect = subMesh.effect;
|
|
977
|
+
let effect = scene.getEngine().createEffect(shaderName, {
|
|
978
|
+
attributes: attribs,
|
|
979
|
+
uniformsNames: uniforms,
|
|
980
|
+
uniformBuffersNames: uniformBuffers,
|
|
981
|
+
samplers: samplers,
|
|
982
|
+
defines: join,
|
|
983
|
+
fallbacks: fallbacks,
|
|
984
|
+
onCompiled: this.onCompiled,
|
|
985
|
+
onError: this.onError,
|
|
986
|
+
indexParameters,
|
|
987
|
+
processFinalCode: csnrOptions.processFinalCode,
|
|
988
|
+
processCodeAfterIncludes: this._eventInfo.customCode,
|
|
989
|
+
multiTarget: defines.PREPASS,
|
|
990
|
+
shaderLanguage: this._shaderLanguage,
|
|
991
|
+
extraInitializationsAsync: this._shadersLoaded
|
|
992
|
+
? undefined
|
|
993
|
+
: async () => {
|
|
994
|
+
if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
|
|
995
|
+
await Promise.all([import('./default.vertex-CPx_2Z0S.esm.js'), import('./default.fragment-D3LhG5le.esm.js')]);
|
|
996
|
+
}
|
|
997
|
+
else {
|
|
998
|
+
await Promise.all([import('./default.vertex-CVMUuXku.esm.js'), import('./default.fragment-C3Pectqi.esm.js')]);
|
|
999
|
+
}
|
|
1000
|
+
this._shadersLoaded = true;
|
|
1001
|
+
},
|
|
1002
|
+
}, engine);
|
|
1003
|
+
this._eventInfo.customCode = undefined;
|
|
1004
|
+
if (effect) {
|
|
1005
|
+
if (this._onEffectCreatedObservable) {
|
|
1006
|
+
onCreatedEffectParameters.effect = effect;
|
|
1007
|
+
onCreatedEffectParameters.subMesh = subMesh;
|
|
1008
|
+
this._onEffectCreatedObservable.notifyObservers(onCreatedEffectParameters);
|
|
1009
|
+
}
|
|
1010
|
+
// Use previous effect while new one is compiling
|
|
1011
|
+
if (this.allowShaderHotSwapping && previousEffect && !effect.isReady()) {
|
|
1012
|
+
effect = previousEffect;
|
|
1013
|
+
defines.markAsUnprocessed();
|
|
1014
|
+
forceWasNotReadyPreviously = this.isFrozen;
|
|
1015
|
+
if (lightDisposed) {
|
|
1016
|
+
// re register in case it takes more than one frame.
|
|
1017
|
+
defines._areLightsDisposed = true;
|
|
1018
|
+
return false;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
scene.resetCachedMaterial();
|
|
1023
|
+
subMesh.setEffect(effect, defines, this._materialContext);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
if (!subMesh.effect || !subMesh.effect.isReady()) {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
defines._renderId = scene.getRenderId();
|
|
1031
|
+
drawWrapper._wasPreviouslyReady = forceWasNotReadyPreviously ? false : true;
|
|
1032
|
+
drawWrapper._wasPreviouslyUsingInstances = useInstances;
|
|
1033
|
+
this._checkScenePerformancePriority();
|
|
1034
|
+
return true;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Builds the material UBO layouts.
|
|
1038
|
+
* Used internally during the effect preparation.
|
|
1039
|
+
*/
|
|
1040
|
+
buildUniformLayout() {
|
|
1041
|
+
// Order is important !
|
|
1042
|
+
const ubo = this._uniformBuffer;
|
|
1043
|
+
ubo.addUniform("diffuseLeftColor", 4);
|
|
1044
|
+
ubo.addUniform("diffuseRightColor", 4);
|
|
1045
|
+
ubo.addUniform("opacityParts", 4);
|
|
1046
|
+
ubo.addUniform("reflectionLeftColor", 4);
|
|
1047
|
+
ubo.addUniform("reflectionRightColor", 4);
|
|
1048
|
+
ubo.addUniform("refractionLeftColor", 4);
|
|
1049
|
+
ubo.addUniform("refractionRightColor", 4);
|
|
1050
|
+
ubo.addUniform("emissiveLeftColor", 4);
|
|
1051
|
+
ubo.addUniform("emissiveRightColor", 4);
|
|
1052
|
+
ubo.addUniform("vDiffuseInfos", 2);
|
|
1053
|
+
ubo.addUniform("vAmbientInfos", 2);
|
|
1054
|
+
ubo.addUniform("vOpacityInfos", 2);
|
|
1055
|
+
ubo.addUniform("vReflectionInfos", 2);
|
|
1056
|
+
ubo.addUniform("vReflectionPosition", 3);
|
|
1057
|
+
ubo.addUniform("vReflectionSize", 3);
|
|
1058
|
+
ubo.addUniform("vEmissiveInfos", 2);
|
|
1059
|
+
ubo.addUniform("vLightmapInfos", 2);
|
|
1060
|
+
ubo.addUniform("vSpecularInfos", 2);
|
|
1061
|
+
ubo.addUniform("vBumpInfos", 3);
|
|
1062
|
+
ubo.addUniform("diffuseMatrix", 16);
|
|
1063
|
+
ubo.addUniform("ambientMatrix", 16);
|
|
1064
|
+
ubo.addUniform("opacityMatrix", 16);
|
|
1065
|
+
ubo.addUniform("reflectionMatrix", 16);
|
|
1066
|
+
ubo.addUniform("emissiveMatrix", 16);
|
|
1067
|
+
ubo.addUniform("lightmapMatrix", 16);
|
|
1068
|
+
ubo.addUniform("specularMatrix", 16);
|
|
1069
|
+
ubo.addUniform("bumpMatrix", 16);
|
|
1070
|
+
ubo.addUniform("vTangentSpaceParams", 2);
|
|
1071
|
+
ubo.addUniform("pointSize", 1);
|
|
1072
|
+
ubo.addUniform("alphaCutOff", 1);
|
|
1073
|
+
ubo.addUniform("refractionMatrix", 16);
|
|
1074
|
+
ubo.addUniform("vRefractionInfos", 4);
|
|
1075
|
+
ubo.addUniform("vRefractionPosition", 3);
|
|
1076
|
+
ubo.addUniform("vRefractionSize", 3);
|
|
1077
|
+
ubo.addUniform("vSpecularColor", 4);
|
|
1078
|
+
ubo.addUniform("vEmissiveColor", 3);
|
|
1079
|
+
ubo.addUniform("vDiffuseColor", 4);
|
|
1080
|
+
ubo.addUniform("vAmbientColor", 3);
|
|
1081
|
+
super.buildUniformLayout();
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Binds the submesh to this material by preparing the effect and shader to draw
|
|
1085
|
+
* @param world defines the world transformation matrix
|
|
1086
|
+
* @param mesh defines the mesh containing the submesh
|
|
1087
|
+
* @param subMesh defines the submesh to bind the material to
|
|
1088
|
+
*/
|
|
1089
|
+
bindForSubMesh(world, mesh, subMesh) {
|
|
1090
|
+
const scene = this.getScene();
|
|
1091
|
+
const defines = subMesh.materialDefines;
|
|
1092
|
+
if (!defines) {
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
const effect = subMesh.effect;
|
|
1096
|
+
if (!effect) {
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
this._activeEffect = effect;
|
|
1100
|
+
// Matrices Mesh.
|
|
1101
|
+
mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
|
|
1102
|
+
mesh.transferToEffect(world);
|
|
1103
|
+
// Binding unconditionally
|
|
1104
|
+
this._uniformBuffer.bindToEffect(effect, "Material");
|
|
1105
|
+
this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
|
|
1106
|
+
MaterialHelperGeometryRendering.Bind(scene.getEngine().currentRenderPassId, this._activeEffect, mesh, world);
|
|
1107
|
+
this._eventInfo.subMesh = subMesh;
|
|
1108
|
+
this._callbackPluginEventHardBindForSubMesh(this._eventInfo);
|
|
1109
|
+
// Normal Matrix
|
|
1110
|
+
if (defines.OBJECTSPACE_NORMALMAP) {
|
|
1111
|
+
world.toNormalMatrix(this._normalMatrix);
|
|
1112
|
+
this.bindOnlyNormalMatrix(this._normalMatrix);
|
|
1113
|
+
}
|
|
1114
|
+
const mustRebind = this._mustRebind(scene, effect, subMesh, mesh.visibility);
|
|
1115
|
+
// Bones
|
|
1116
|
+
BindBonesParameters(mesh, effect);
|
|
1117
|
+
const ubo = this._uniformBuffer;
|
|
1118
|
+
if (mustRebind) {
|
|
1119
|
+
this.bindViewProjection(effect);
|
|
1120
|
+
if (!ubo.useUbo || !this.isFrozen || !ubo.isSync || subMesh._drawWrapper._forceRebindOnNextCall) {
|
|
1121
|
+
if (StandardMaterial.FresnelEnabled && defines.FRESNEL) {
|
|
1122
|
+
// Fresnel
|
|
1123
|
+
if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) {
|
|
1124
|
+
ubo.updateColor4("diffuseLeftColor", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power);
|
|
1125
|
+
ubo.updateColor4("diffuseRightColor", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias);
|
|
1126
|
+
}
|
|
1127
|
+
if (this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled) {
|
|
1128
|
+
ubo.updateColor4("opacityParts", new Color3(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power);
|
|
1129
|
+
}
|
|
1130
|
+
if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
|
|
1131
|
+
ubo.updateColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power);
|
|
1132
|
+
ubo.updateColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias);
|
|
1133
|
+
}
|
|
1134
|
+
if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) {
|
|
1135
|
+
ubo.updateColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power);
|
|
1136
|
+
ubo.updateColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias);
|
|
1137
|
+
}
|
|
1138
|
+
if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
|
|
1139
|
+
ubo.updateColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power);
|
|
1140
|
+
ubo.updateColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
// Textures
|
|
1144
|
+
if (scene.texturesEnabled) {
|
|
1145
|
+
if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
|
|
1146
|
+
ubo.updateFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
|
|
1147
|
+
BindTextureMatrix(this._diffuseTexture, ubo, "diffuse");
|
|
1148
|
+
}
|
|
1149
|
+
if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
|
|
1150
|
+
ubo.updateFloat2("vAmbientInfos", this._ambientTexture.coordinatesIndex, this._ambientTexture.level);
|
|
1151
|
+
BindTextureMatrix(this._ambientTexture, ubo, "ambient");
|
|
1152
|
+
}
|
|
1153
|
+
if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {
|
|
1154
|
+
ubo.updateFloat2("vOpacityInfos", this._opacityTexture.coordinatesIndex, this._opacityTexture.level);
|
|
1155
|
+
BindTextureMatrix(this._opacityTexture, ubo, "opacity");
|
|
1156
|
+
}
|
|
1157
|
+
if (this._hasAlphaChannel()) {
|
|
1158
|
+
ubo.updateFloat("alphaCutOff", this.alphaCutOff);
|
|
1159
|
+
}
|
|
1160
|
+
if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
|
|
1161
|
+
ubo.updateFloat2("vReflectionInfos", this._reflectionTexture.level, this.roughness);
|
|
1162
|
+
ubo.updateMatrix("reflectionMatrix", this._reflectionTexture.getReflectionTextureMatrix());
|
|
1163
|
+
if (this._reflectionTexture.boundingBoxSize) {
|
|
1164
|
+
const cubeTexture = this._reflectionTexture;
|
|
1165
|
+
ubo.updateVector3("vReflectionPosition", cubeTexture.boundingBoxPosition);
|
|
1166
|
+
ubo.updateVector3("vReflectionSize", cubeTexture.boundingBoxSize);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
|
|
1170
|
+
ubo.updateFloat2("vEmissiveInfos", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level);
|
|
1171
|
+
BindTextureMatrix(this._emissiveTexture, ubo, "emissive");
|
|
1172
|
+
}
|
|
1173
|
+
if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {
|
|
1174
|
+
ubo.updateFloat2("vLightmapInfos", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level);
|
|
1175
|
+
BindTextureMatrix(this._lightmapTexture, ubo, "lightmap");
|
|
1176
|
+
}
|
|
1177
|
+
if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {
|
|
1178
|
+
ubo.updateFloat2("vSpecularInfos", this._specularTexture.coordinatesIndex, this._specularTexture.level);
|
|
1179
|
+
BindTextureMatrix(this._specularTexture, ubo, "specular");
|
|
1180
|
+
}
|
|
1181
|
+
if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) {
|
|
1182
|
+
ubo.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level, this.parallaxScaleBias);
|
|
1183
|
+
BindTextureMatrix(this._bumpTexture, ubo, "bump");
|
|
1184
|
+
if (scene._mirroredCameraPosition) {
|
|
1185
|
+
ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
|
|
1186
|
+
}
|
|
1187
|
+
else {
|
|
1188
|
+
ubo.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
|
|
1192
|
+
let depth = 1.0;
|
|
1193
|
+
if (!this._refractionTexture.isCube) {
|
|
1194
|
+
ubo.updateMatrix("refractionMatrix", this._refractionTexture.getReflectionTextureMatrix());
|
|
1195
|
+
if (this._refractionTexture.depth) {
|
|
1196
|
+
depth = this._refractionTexture.depth;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
ubo.updateFloat4("vRefractionInfos", this._refractionTexture.level, this.indexOfRefraction, depth, this.invertRefractionY ? -1 : 1);
|
|
1200
|
+
if (this._refractionTexture.boundingBoxSize) {
|
|
1201
|
+
const cubeTexture = this._refractionTexture;
|
|
1202
|
+
ubo.updateVector3("vRefractionPosition", cubeTexture.boundingBoxPosition);
|
|
1203
|
+
ubo.updateVector3("vRefractionSize", cubeTexture.boundingBoxSize);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
// Point size
|
|
1208
|
+
if (this.pointsCloud) {
|
|
1209
|
+
ubo.updateFloat("pointSize", this.pointSize);
|
|
1210
|
+
}
|
|
1211
|
+
ubo.updateColor4("vSpecularColor", this.specularColor, this.specularPower);
|
|
1212
|
+
ubo.updateColor3("vEmissiveColor", StandardMaterial.EmissiveTextureEnabled ? this.emissiveColor : Color3.BlackReadOnly);
|
|
1213
|
+
ubo.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha);
|
|
1214
|
+
scene.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor);
|
|
1215
|
+
ubo.updateColor3("vAmbientColor", this._globalAmbientColor);
|
|
1216
|
+
}
|
|
1217
|
+
// Textures
|
|
1218
|
+
if (scene.texturesEnabled) {
|
|
1219
|
+
if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
|
|
1220
|
+
effect.setTexture("diffuseSampler", this._diffuseTexture);
|
|
1221
|
+
}
|
|
1222
|
+
if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
|
|
1223
|
+
effect.setTexture("ambientSampler", this._ambientTexture);
|
|
1224
|
+
}
|
|
1225
|
+
if (this._opacityTexture && StandardMaterial.OpacityTextureEnabled) {
|
|
1226
|
+
effect.setTexture("opacitySampler", this._opacityTexture);
|
|
1227
|
+
}
|
|
1228
|
+
if (this._reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
|
|
1229
|
+
if (this._reflectionTexture.isCube) {
|
|
1230
|
+
effect.setTexture("reflectionCubeSampler", this._reflectionTexture);
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
effect.setTexture("reflection2DSampler", this._reflectionTexture);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
if (this._emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
|
|
1237
|
+
effect.setTexture("emissiveSampler", this._emissiveTexture);
|
|
1238
|
+
}
|
|
1239
|
+
if (this._lightmapTexture && StandardMaterial.LightmapTextureEnabled) {
|
|
1240
|
+
effect.setTexture("lightmapSampler", this._lightmapTexture);
|
|
1241
|
+
}
|
|
1242
|
+
if (this._specularTexture && StandardMaterial.SpecularTextureEnabled) {
|
|
1243
|
+
effect.setTexture("specularSampler", this._specularTexture);
|
|
1244
|
+
}
|
|
1245
|
+
if (this._bumpTexture && scene.getEngine().getCaps().standardDerivatives && StandardMaterial.BumpTextureEnabled) {
|
|
1246
|
+
effect.setTexture("bumpSampler", this._bumpTexture);
|
|
1247
|
+
}
|
|
1248
|
+
if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
|
|
1249
|
+
if (this._refractionTexture.isCube) {
|
|
1250
|
+
effect.setTexture("refractionCubeSampler", this._refractionTexture);
|
|
1251
|
+
}
|
|
1252
|
+
else {
|
|
1253
|
+
effect.setTexture("refraction2DSampler", this._refractionTexture);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
// OIT with depth peeling
|
|
1258
|
+
if (this.getScene().useOrderIndependentTransparency && this.needAlphaBlendingForMesh(mesh)) {
|
|
1259
|
+
this.getScene().depthPeelingRenderer.bind(effect);
|
|
1260
|
+
}
|
|
1261
|
+
this._eventInfo.subMesh = subMesh;
|
|
1262
|
+
this._callbackPluginEventBindForSubMesh(this._eventInfo);
|
|
1263
|
+
// Clip plane
|
|
1264
|
+
bindClipPlane(effect, this, scene);
|
|
1265
|
+
// Colors
|
|
1266
|
+
this.bindEyePosition(effect);
|
|
1267
|
+
}
|
|
1268
|
+
else if (scene.getEngine()._features.needToAlwaysBindUniformBuffers) {
|
|
1269
|
+
this._needToBindSceneUbo = true;
|
|
1270
|
+
}
|
|
1271
|
+
if (mustRebind || !this.isFrozen) {
|
|
1272
|
+
// Lights
|
|
1273
|
+
if (scene.lightsEnabled && !this._disableLighting) {
|
|
1274
|
+
BindLights(scene, mesh, effect, defines, this._maxSimultaneousLights);
|
|
1275
|
+
}
|
|
1276
|
+
// View
|
|
1277
|
+
if ((scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) ||
|
|
1278
|
+
this._reflectionTexture ||
|
|
1279
|
+
this._refractionTexture ||
|
|
1280
|
+
mesh.receiveShadows ||
|
|
1281
|
+
defines.PREPASS) {
|
|
1282
|
+
this.bindView(effect);
|
|
1283
|
+
}
|
|
1284
|
+
// Fog
|
|
1285
|
+
BindFogParameters(scene, mesh, effect);
|
|
1286
|
+
// Morph targets
|
|
1287
|
+
if (defines.NUM_MORPH_INFLUENCERS) {
|
|
1288
|
+
BindMorphTargetParameters(mesh, effect);
|
|
1289
|
+
}
|
|
1290
|
+
if (defines.BAKED_VERTEX_ANIMATION_TEXTURE) {
|
|
1291
|
+
mesh.bakedVertexAnimationManager?.bind(effect, defines.INSTANCES);
|
|
1292
|
+
}
|
|
1293
|
+
// Log. depth
|
|
1294
|
+
if (this.useLogarithmicDepth) {
|
|
1295
|
+
BindLogDepth(defines, effect, scene);
|
|
1296
|
+
}
|
|
1297
|
+
// image processing
|
|
1298
|
+
if (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess) {
|
|
1299
|
+
this._imageProcessingConfiguration.bind(this._activeEffect);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
this._afterBind(mesh, this._activeEffect, subMesh);
|
|
1303
|
+
ubo.update();
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Get the list of animatables in the material.
|
|
1307
|
+
* @returns the list of animatables object used in the material
|
|
1308
|
+
*/
|
|
1309
|
+
getAnimatables() {
|
|
1310
|
+
const results = super.getAnimatables();
|
|
1311
|
+
if (this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0) {
|
|
1312
|
+
results.push(this._diffuseTexture);
|
|
1313
|
+
}
|
|
1314
|
+
if (this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0) {
|
|
1315
|
+
results.push(this._ambientTexture);
|
|
1316
|
+
}
|
|
1317
|
+
if (this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0) {
|
|
1318
|
+
results.push(this._opacityTexture);
|
|
1319
|
+
}
|
|
1320
|
+
if (this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0) {
|
|
1321
|
+
results.push(this._reflectionTexture);
|
|
1322
|
+
}
|
|
1323
|
+
if (this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0) {
|
|
1324
|
+
results.push(this._emissiveTexture);
|
|
1325
|
+
}
|
|
1326
|
+
if (this._specularTexture && this._specularTexture.animations && this._specularTexture.animations.length > 0) {
|
|
1327
|
+
results.push(this._specularTexture);
|
|
1328
|
+
}
|
|
1329
|
+
if (this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0) {
|
|
1330
|
+
results.push(this._bumpTexture);
|
|
1331
|
+
}
|
|
1332
|
+
if (this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0) {
|
|
1333
|
+
results.push(this._lightmapTexture);
|
|
1334
|
+
}
|
|
1335
|
+
if (this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0) {
|
|
1336
|
+
results.push(this._refractionTexture);
|
|
1337
|
+
}
|
|
1338
|
+
return results;
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Gets the active textures from the material
|
|
1342
|
+
* @returns an array of textures
|
|
1343
|
+
*/
|
|
1344
|
+
getActiveTextures() {
|
|
1345
|
+
const activeTextures = super.getActiveTextures();
|
|
1346
|
+
if (this._diffuseTexture) {
|
|
1347
|
+
activeTextures.push(this._diffuseTexture);
|
|
1348
|
+
}
|
|
1349
|
+
if (this._ambientTexture) {
|
|
1350
|
+
activeTextures.push(this._ambientTexture);
|
|
1351
|
+
}
|
|
1352
|
+
if (this._opacityTexture) {
|
|
1353
|
+
activeTextures.push(this._opacityTexture);
|
|
1354
|
+
}
|
|
1355
|
+
if (this._reflectionTexture) {
|
|
1356
|
+
activeTextures.push(this._reflectionTexture);
|
|
1357
|
+
}
|
|
1358
|
+
if (this._emissiveTexture) {
|
|
1359
|
+
activeTextures.push(this._emissiveTexture);
|
|
1360
|
+
}
|
|
1361
|
+
if (this._specularTexture) {
|
|
1362
|
+
activeTextures.push(this._specularTexture);
|
|
1363
|
+
}
|
|
1364
|
+
if (this._bumpTexture) {
|
|
1365
|
+
activeTextures.push(this._bumpTexture);
|
|
1366
|
+
}
|
|
1367
|
+
if (this._lightmapTexture) {
|
|
1368
|
+
activeTextures.push(this._lightmapTexture);
|
|
1369
|
+
}
|
|
1370
|
+
if (this._refractionTexture) {
|
|
1371
|
+
activeTextures.push(this._refractionTexture);
|
|
1372
|
+
}
|
|
1373
|
+
return activeTextures;
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Specifies if the material uses a texture
|
|
1377
|
+
* @param texture defines the texture to check against the material
|
|
1378
|
+
* @returns a boolean specifying if the material uses the texture
|
|
1379
|
+
*/
|
|
1380
|
+
hasTexture(texture) {
|
|
1381
|
+
if (super.hasTexture(texture)) {
|
|
1382
|
+
return true;
|
|
1383
|
+
}
|
|
1384
|
+
if (this._diffuseTexture === texture) {
|
|
1385
|
+
return true;
|
|
1386
|
+
}
|
|
1387
|
+
if (this._ambientTexture === texture) {
|
|
1388
|
+
return true;
|
|
1389
|
+
}
|
|
1390
|
+
if (this._opacityTexture === texture) {
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1393
|
+
if (this._reflectionTexture === texture) {
|
|
1394
|
+
return true;
|
|
1395
|
+
}
|
|
1396
|
+
if (this._emissiveTexture === texture) {
|
|
1397
|
+
return true;
|
|
1398
|
+
}
|
|
1399
|
+
if (this._specularTexture === texture) {
|
|
1400
|
+
return true;
|
|
1401
|
+
}
|
|
1402
|
+
if (this._bumpTexture === texture) {
|
|
1403
|
+
return true;
|
|
1404
|
+
}
|
|
1405
|
+
if (this._lightmapTexture === texture) {
|
|
1406
|
+
return true;
|
|
1407
|
+
}
|
|
1408
|
+
if (this._refractionTexture === texture) {
|
|
1409
|
+
return true;
|
|
1410
|
+
}
|
|
1411
|
+
return false;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Disposes the material
|
|
1415
|
+
* @param forceDisposeEffect specifies if effects should be forcefully disposed
|
|
1416
|
+
* @param forceDisposeTextures specifies if textures should be forcefully disposed
|
|
1417
|
+
*/
|
|
1418
|
+
dispose(forceDisposeEffect, forceDisposeTextures) {
|
|
1419
|
+
if (forceDisposeTextures) {
|
|
1420
|
+
this._diffuseTexture?.dispose();
|
|
1421
|
+
this._ambientTexture?.dispose();
|
|
1422
|
+
this._opacityTexture?.dispose();
|
|
1423
|
+
this._reflectionTexture?.dispose();
|
|
1424
|
+
this._emissiveTexture?.dispose();
|
|
1425
|
+
this._specularTexture?.dispose();
|
|
1426
|
+
this._bumpTexture?.dispose();
|
|
1427
|
+
this._lightmapTexture?.dispose();
|
|
1428
|
+
this._refractionTexture?.dispose();
|
|
1429
|
+
}
|
|
1430
|
+
if (this._imageProcessingConfiguration && this._imageProcessingObserver) {
|
|
1431
|
+
this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);
|
|
1432
|
+
}
|
|
1433
|
+
super.dispose(forceDisposeEffect, forceDisposeTextures);
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* Makes a duplicate of the material, and gives it a new name
|
|
1437
|
+
* @param name defines the new name for the duplicated material
|
|
1438
|
+
* @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.
|
|
1439
|
+
* @param rootUrl defines the root URL to use to load textures
|
|
1440
|
+
* @returns the cloned material
|
|
1441
|
+
*/
|
|
1442
|
+
clone(name, cloneTexturesOnlyOnce = true, rootUrl = "") {
|
|
1443
|
+
const result = SerializationHelper.Clone(() => new StandardMaterial(name, this.getScene()), this, { cloneTexturesOnlyOnce });
|
|
1444
|
+
result.name = name;
|
|
1445
|
+
result.id = name;
|
|
1446
|
+
this.stencil.copyTo(result.stencil);
|
|
1447
|
+
this._clonePlugins(result, rootUrl);
|
|
1448
|
+
return result;
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Creates a standard material from parsed material data
|
|
1452
|
+
* @param source defines the JSON representation of the material
|
|
1453
|
+
* @param scene defines the hosting scene
|
|
1454
|
+
* @param rootUrl defines the root URL to use to load textures and relative dependencies
|
|
1455
|
+
* @returns a new standard material
|
|
1456
|
+
*/
|
|
1457
|
+
static Parse(source, scene, rootUrl) {
|
|
1458
|
+
const material = SerializationHelper.Parse(() => new StandardMaterial(source.name, scene), source, scene, rootUrl);
|
|
1459
|
+
if (source.stencil) {
|
|
1460
|
+
material.stencil.parse(source.stencil, scene, rootUrl);
|
|
1461
|
+
}
|
|
1462
|
+
Material._ParsePlugins(source, material, scene, rootUrl);
|
|
1463
|
+
return material;
|
|
1464
|
+
}
|
|
1465
|
+
// Flags used to enable or disable a type of texture for all Standard Materials
|
|
1466
|
+
/**
|
|
1467
|
+
* Are diffuse textures enabled in the application.
|
|
1468
|
+
*/
|
|
1469
|
+
static get DiffuseTextureEnabled() {
|
|
1470
|
+
return MaterialFlags.DiffuseTextureEnabled;
|
|
1471
|
+
}
|
|
1472
|
+
static set DiffuseTextureEnabled(value) {
|
|
1473
|
+
MaterialFlags.DiffuseTextureEnabled = value;
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* Are detail textures enabled in the application.
|
|
1477
|
+
*/
|
|
1478
|
+
static get DetailTextureEnabled() {
|
|
1479
|
+
return MaterialFlags.DetailTextureEnabled;
|
|
1480
|
+
}
|
|
1481
|
+
static set DetailTextureEnabled(value) {
|
|
1482
|
+
MaterialFlags.DetailTextureEnabled = value;
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Are ambient textures enabled in the application.
|
|
1486
|
+
*/
|
|
1487
|
+
static get AmbientTextureEnabled() {
|
|
1488
|
+
return MaterialFlags.AmbientTextureEnabled;
|
|
1489
|
+
}
|
|
1490
|
+
static set AmbientTextureEnabled(value) {
|
|
1491
|
+
MaterialFlags.AmbientTextureEnabled = value;
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Are opacity textures enabled in the application.
|
|
1495
|
+
*/
|
|
1496
|
+
static get OpacityTextureEnabled() {
|
|
1497
|
+
return MaterialFlags.OpacityTextureEnabled;
|
|
1498
|
+
}
|
|
1499
|
+
static set OpacityTextureEnabled(value) {
|
|
1500
|
+
MaterialFlags.OpacityTextureEnabled = value;
|
|
1501
|
+
}
|
|
1502
|
+
/**
|
|
1503
|
+
* Are reflection textures enabled in the application.
|
|
1504
|
+
*/
|
|
1505
|
+
static get ReflectionTextureEnabled() {
|
|
1506
|
+
return MaterialFlags.ReflectionTextureEnabled;
|
|
1507
|
+
}
|
|
1508
|
+
static set ReflectionTextureEnabled(value) {
|
|
1509
|
+
MaterialFlags.ReflectionTextureEnabled = value;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Are emissive textures enabled in the application.
|
|
1513
|
+
*/
|
|
1514
|
+
static get EmissiveTextureEnabled() {
|
|
1515
|
+
return MaterialFlags.EmissiveTextureEnabled;
|
|
1516
|
+
}
|
|
1517
|
+
static set EmissiveTextureEnabled(value) {
|
|
1518
|
+
MaterialFlags.EmissiveTextureEnabled = value;
|
|
1519
|
+
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Are specular textures enabled in the application.
|
|
1522
|
+
*/
|
|
1523
|
+
static get SpecularTextureEnabled() {
|
|
1524
|
+
return MaterialFlags.SpecularTextureEnabled;
|
|
1525
|
+
}
|
|
1526
|
+
static set SpecularTextureEnabled(value) {
|
|
1527
|
+
MaterialFlags.SpecularTextureEnabled = value;
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* Are bump textures enabled in the application.
|
|
1531
|
+
*/
|
|
1532
|
+
static get BumpTextureEnabled() {
|
|
1533
|
+
return MaterialFlags.BumpTextureEnabled;
|
|
1534
|
+
}
|
|
1535
|
+
static set BumpTextureEnabled(value) {
|
|
1536
|
+
MaterialFlags.BumpTextureEnabled = value;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Are lightmap textures enabled in the application.
|
|
1540
|
+
*/
|
|
1541
|
+
static get LightmapTextureEnabled() {
|
|
1542
|
+
return MaterialFlags.LightmapTextureEnabled;
|
|
1543
|
+
}
|
|
1544
|
+
static set LightmapTextureEnabled(value) {
|
|
1545
|
+
MaterialFlags.LightmapTextureEnabled = value;
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* Are refraction textures enabled in the application.
|
|
1549
|
+
*/
|
|
1550
|
+
static get RefractionTextureEnabled() {
|
|
1551
|
+
return MaterialFlags.RefractionTextureEnabled;
|
|
1552
|
+
}
|
|
1553
|
+
static set RefractionTextureEnabled(value) {
|
|
1554
|
+
MaterialFlags.RefractionTextureEnabled = value;
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* Are color grading textures enabled in the application.
|
|
1558
|
+
*/
|
|
1559
|
+
static get ColorGradingTextureEnabled() {
|
|
1560
|
+
return MaterialFlags.ColorGradingTextureEnabled;
|
|
1561
|
+
}
|
|
1562
|
+
static set ColorGradingTextureEnabled(value) {
|
|
1563
|
+
MaterialFlags.ColorGradingTextureEnabled = value;
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Are fresnels enabled in the application.
|
|
1567
|
+
*/
|
|
1568
|
+
static get FresnelEnabled() {
|
|
1569
|
+
return MaterialFlags.FresnelEnabled;
|
|
1570
|
+
}
|
|
1571
|
+
static set FresnelEnabled(value) {
|
|
1572
|
+
MaterialFlags.FresnelEnabled = value;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Force all the standard materials to compile to glsl even on WebGPU engines.
|
|
1577
|
+
* False by default. This is mostly meant for backward compatibility.
|
|
1578
|
+
*/
|
|
1579
|
+
StandardMaterial.ForceGLSL = false;
|
|
1580
|
+
__decorate([
|
|
1581
|
+
serializeAsTexture("diffuseTexture")
|
|
1582
|
+
], StandardMaterial.prototype, "_diffuseTexture", void 0);
|
|
1583
|
+
__decorate([
|
|
1584
|
+
expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")
|
|
1585
|
+
], StandardMaterial.prototype, "diffuseTexture", void 0);
|
|
1586
|
+
__decorate([
|
|
1587
|
+
serializeAsTexture("ambientTexture")
|
|
1588
|
+
], StandardMaterial.prototype, "_ambientTexture", void 0);
|
|
1589
|
+
__decorate([
|
|
1590
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1591
|
+
], StandardMaterial.prototype, "ambientTexture", void 0);
|
|
1592
|
+
__decorate([
|
|
1593
|
+
serializeAsTexture("opacityTexture")
|
|
1594
|
+
], StandardMaterial.prototype, "_opacityTexture", void 0);
|
|
1595
|
+
__decorate([
|
|
1596
|
+
expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")
|
|
1597
|
+
], StandardMaterial.prototype, "opacityTexture", void 0);
|
|
1598
|
+
__decorate([
|
|
1599
|
+
serializeAsTexture("reflectionTexture")
|
|
1600
|
+
], StandardMaterial.prototype, "_reflectionTexture", void 0);
|
|
1601
|
+
__decorate([
|
|
1602
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1603
|
+
], StandardMaterial.prototype, "reflectionTexture", void 0);
|
|
1604
|
+
__decorate([
|
|
1605
|
+
serializeAsTexture("emissiveTexture")
|
|
1606
|
+
], StandardMaterial.prototype, "_emissiveTexture", void 0);
|
|
1607
|
+
__decorate([
|
|
1608
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1609
|
+
], StandardMaterial.prototype, "emissiveTexture", void 0);
|
|
1610
|
+
__decorate([
|
|
1611
|
+
serializeAsTexture("specularTexture")
|
|
1612
|
+
], StandardMaterial.prototype, "_specularTexture", void 0);
|
|
1613
|
+
__decorate([
|
|
1614
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1615
|
+
], StandardMaterial.prototype, "specularTexture", void 0);
|
|
1616
|
+
__decorate([
|
|
1617
|
+
serializeAsTexture("bumpTexture")
|
|
1618
|
+
], StandardMaterial.prototype, "_bumpTexture", void 0);
|
|
1619
|
+
__decorate([
|
|
1620
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1621
|
+
], StandardMaterial.prototype, "bumpTexture", void 0);
|
|
1622
|
+
__decorate([
|
|
1623
|
+
serializeAsTexture("lightmapTexture")
|
|
1624
|
+
], StandardMaterial.prototype, "_lightmapTexture", void 0);
|
|
1625
|
+
__decorate([
|
|
1626
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1627
|
+
], StandardMaterial.prototype, "lightmapTexture", void 0);
|
|
1628
|
+
__decorate([
|
|
1629
|
+
serializeAsTexture("refractionTexture")
|
|
1630
|
+
], StandardMaterial.prototype, "_refractionTexture", void 0);
|
|
1631
|
+
__decorate([
|
|
1632
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1633
|
+
], StandardMaterial.prototype, "refractionTexture", void 0);
|
|
1634
|
+
__decorate([
|
|
1635
|
+
serializeAsColor3("ambient")
|
|
1636
|
+
], StandardMaterial.prototype, "ambientColor", void 0);
|
|
1637
|
+
__decorate([
|
|
1638
|
+
serializeAsColor3("diffuse")
|
|
1639
|
+
], StandardMaterial.prototype, "diffuseColor", void 0);
|
|
1640
|
+
__decorate([
|
|
1641
|
+
serializeAsColor3("specular")
|
|
1642
|
+
], StandardMaterial.prototype, "specularColor", void 0);
|
|
1643
|
+
__decorate([
|
|
1644
|
+
serializeAsColor3("emissive")
|
|
1645
|
+
], StandardMaterial.prototype, "emissiveColor", void 0);
|
|
1646
|
+
__decorate([
|
|
1647
|
+
serialize()
|
|
1648
|
+
], StandardMaterial.prototype, "specularPower", void 0);
|
|
1649
|
+
__decorate([
|
|
1650
|
+
serialize("useAlphaFromDiffuseTexture")
|
|
1651
|
+
], StandardMaterial.prototype, "_useAlphaFromDiffuseTexture", void 0);
|
|
1652
|
+
__decorate([
|
|
1653
|
+
expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")
|
|
1654
|
+
], StandardMaterial.prototype, "useAlphaFromDiffuseTexture", void 0);
|
|
1655
|
+
__decorate([
|
|
1656
|
+
serialize("useEmissiveAsIllumination")
|
|
1657
|
+
], StandardMaterial.prototype, "_useEmissiveAsIllumination", void 0);
|
|
1658
|
+
__decorate([
|
|
1659
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1660
|
+
], StandardMaterial.prototype, "useEmissiveAsIllumination", void 0);
|
|
1661
|
+
__decorate([
|
|
1662
|
+
serialize("linkEmissiveWithDiffuse")
|
|
1663
|
+
], StandardMaterial.prototype, "_linkEmissiveWithDiffuse", void 0);
|
|
1664
|
+
__decorate([
|
|
1665
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1666
|
+
], StandardMaterial.prototype, "linkEmissiveWithDiffuse", void 0);
|
|
1667
|
+
__decorate([
|
|
1668
|
+
serialize("useSpecularOverAlpha")
|
|
1669
|
+
], StandardMaterial.prototype, "_useSpecularOverAlpha", void 0);
|
|
1670
|
+
__decorate([
|
|
1671
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1672
|
+
], StandardMaterial.prototype, "useSpecularOverAlpha", void 0);
|
|
1673
|
+
__decorate([
|
|
1674
|
+
serialize("useReflectionOverAlpha")
|
|
1675
|
+
], StandardMaterial.prototype, "_useReflectionOverAlpha", void 0);
|
|
1676
|
+
__decorate([
|
|
1677
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1678
|
+
], StandardMaterial.prototype, "useReflectionOverAlpha", void 0);
|
|
1679
|
+
__decorate([
|
|
1680
|
+
serialize("disableLighting")
|
|
1681
|
+
], StandardMaterial.prototype, "_disableLighting", void 0);
|
|
1682
|
+
__decorate([
|
|
1683
|
+
expandToProperty("_markAllSubMeshesAsLightsDirty")
|
|
1684
|
+
], StandardMaterial.prototype, "disableLighting", void 0);
|
|
1685
|
+
__decorate([
|
|
1686
|
+
serialize("useObjectSpaceNormalMap")
|
|
1687
|
+
], StandardMaterial.prototype, "_useObjectSpaceNormalMap", void 0);
|
|
1688
|
+
__decorate([
|
|
1689
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1690
|
+
], StandardMaterial.prototype, "useObjectSpaceNormalMap", void 0);
|
|
1691
|
+
__decorate([
|
|
1692
|
+
serialize("useParallax")
|
|
1693
|
+
], StandardMaterial.prototype, "_useParallax", void 0);
|
|
1694
|
+
__decorate([
|
|
1695
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1696
|
+
], StandardMaterial.prototype, "useParallax", void 0);
|
|
1697
|
+
__decorate([
|
|
1698
|
+
serialize("useParallaxOcclusion")
|
|
1699
|
+
], StandardMaterial.prototype, "_useParallaxOcclusion", void 0);
|
|
1700
|
+
__decorate([
|
|
1701
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1702
|
+
], StandardMaterial.prototype, "useParallaxOcclusion", void 0);
|
|
1703
|
+
__decorate([
|
|
1704
|
+
serialize()
|
|
1705
|
+
], StandardMaterial.prototype, "parallaxScaleBias", void 0);
|
|
1706
|
+
__decorate([
|
|
1707
|
+
serialize("roughness")
|
|
1708
|
+
], StandardMaterial.prototype, "_roughness", void 0);
|
|
1709
|
+
__decorate([
|
|
1710
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1711
|
+
], StandardMaterial.prototype, "roughness", void 0);
|
|
1712
|
+
__decorate([
|
|
1713
|
+
serialize()
|
|
1714
|
+
], StandardMaterial.prototype, "indexOfRefraction", void 0);
|
|
1715
|
+
__decorate([
|
|
1716
|
+
serialize()
|
|
1717
|
+
], StandardMaterial.prototype, "invertRefractionY", void 0);
|
|
1718
|
+
__decorate([
|
|
1719
|
+
serialize()
|
|
1720
|
+
], StandardMaterial.prototype, "alphaCutOff", void 0);
|
|
1721
|
+
__decorate([
|
|
1722
|
+
serialize("useLightmapAsShadowmap")
|
|
1723
|
+
], StandardMaterial.prototype, "_useLightmapAsShadowmap", void 0);
|
|
1724
|
+
__decorate([
|
|
1725
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1726
|
+
], StandardMaterial.prototype, "useLightmapAsShadowmap", void 0);
|
|
1727
|
+
__decorate([
|
|
1728
|
+
serializeAsFresnelParameters("diffuseFresnelParameters")
|
|
1729
|
+
], StandardMaterial.prototype, "_diffuseFresnelParameters", void 0);
|
|
1730
|
+
__decorate([
|
|
1731
|
+
expandToProperty("_markAllSubMeshesAsFresnelDirty")
|
|
1732
|
+
], StandardMaterial.prototype, "diffuseFresnelParameters", void 0);
|
|
1733
|
+
__decorate([
|
|
1734
|
+
serializeAsFresnelParameters("opacityFresnelParameters")
|
|
1735
|
+
], StandardMaterial.prototype, "_opacityFresnelParameters", void 0);
|
|
1736
|
+
__decorate([
|
|
1737
|
+
expandToProperty("_markAllSubMeshesAsFresnelAndMiscDirty")
|
|
1738
|
+
], StandardMaterial.prototype, "opacityFresnelParameters", void 0);
|
|
1739
|
+
__decorate([
|
|
1740
|
+
serializeAsFresnelParameters("reflectionFresnelParameters")
|
|
1741
|
+
], StandardMaterial.prototype, "_reflectionFresnelParameters", void 0);
|
|
1742
|
+
__decorate([
|
|
1743
|
+
expandToProperty("_markAllSubMeshesAsFresnelDirty")
|
|
1744
|
+
], StandardMaterial.prototype, "reflectionFresnelParameters", void 0);
|
|
1745
|
+
__decorate([
|
|
1746
|
+
serializeAsFresnelParameters("refractionFresnelParameters")
|
|
1747
|
+
], StandardMaterial.prototype, "_refractionFresnelParameters", void 0);
|
|
1748
|
+
__decorate([
|
|
1749
|
+
expandToProperty("_markAllSubMeshesAsFresnelDirty")
|
|
1750
|
+
], StandardMaterial.prototype, "refractionFresnelParameters", void 0);
|
|
1751
|
+
__decorate([
|
|
1752
|
+
serializeAsFresnelParameters("emissiveFresnelParameters")
|
|
1753
|
+
], StandardMaterial.prototype, "_emissiveFresnelParameters", void 0);
|
|
1754
|
+
__decorate([
|
|
1755
|
+
expandToProperty("_markAllSubMeshesAsFresnelDirty")
|
|
1756
|
+
], StandardMaterial.prototype, "emissiveFresnelParameters", void 0);
|
|
1757
|
+
__decorate([
|
|
1758
|
+
serialize("useReflectionFresnelFromSpecular")
|
|
1759
|
+
], StandardMaterial.prototype, "_useReflectionFresnelFromSpecular", void 0);
|
|
1760
|
+
__decorate([
|
|
1761
|
+
expandToProperty("_markAllSubMeshesAsFresnelDirty")
|
|
1762
|
+
], StandardMaterial.prototype, "useReflectionFresnelFromSpecular", void 0);
|
|
1763
|
+
__decorate([
|
|
1764
|
+
serialize("useGlossinessFromSpecularMapAlpha")
|
|
1765
|
+
], StandardMaterial.prototype, "_useGlossinessFromSpecularMapAlpha", void 0);
|
|
1766
|
+
__decorate([
|
|
1767
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1768
|
+
], StandardMaterial.prototype, "useGlossinessFromSpecularMapAlpha", void 0);
|
|
1769
|
+
__decorate([
|
|
1770
|
+
serialize("maxSimultaneousLights")
|
|
1771
|
+
], StandardMaterial.prototype, "_maxSimultaneousLights", void 0);
|
|
1772
|
+
__decorate([
|
|
1773
|
+
expandToProperty("_markAllSubMeshesAsLightsDirty")
|
|
1774
|
+
], StandardMaterial.prototype, "maxSimultaneousLights", void 0);
|
|
1775
|
+
__decorate([
|
|
1776
|
+
serialize("invertNormalMapX")
|
|
1777
|
+
], StandardMaterial.prototype, "_invertNormalMapX", void 0);
|
|
1778
|
+
__decorate([
|
|
1779
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1780
|
+
], StandardMaterial.prototype, "invertNormalMapX", void 0);
|
|
1781
|
+
__decorate([
|
|
1782
|
+
serialize("invertNormalMapY")
|
|
1783
|
+
], StandardMaterial.prototype, "_invertNormalMapY", void 0);
|
|
1784
|
+
__decorate([
|
|
1785
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1786
|
+
], StandardMaterial.prototype, "invertNormalMapY", void 0);
|
|
1787
|
+
__decorate([
|
|
1788
|
+
serialize("twoSidedLighting")
|
|
1789
|
+
], StandardMaterial.prototype, "_twoSidedLighting", void 0);
|
|
1790
|
+
__decorate([
|
|
1791
|
+
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
1792
|
+
], StandardMaterial.prototype, "twoSidedLighting", void 0);
|
|
1793
|
+
__decorate([
|
|
1794
|
+
serialize("applyDecalMapAfterDetailMap")
|
|
1795
|
+
], StandardMaterial.prototype, "_applyDecalMapAfterDetailMap", void 0);
|
|
1796
|
+
__decorate([
|
|
1797
|
+
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
1798
|
+
], StandardMaterial.prototype, "applyDecalMapAfterDetailMap", void 0);
|
|
1799
|
+
RegisterClass("BABYLON.StandardMaterial", StandardMaterial);
|
|
1800
|
+
Scene.DefaultMaterialFactory = (scene) => {
|
|
1801
|
+
return new StandardMaterial("default material", scene);
|
|
1802
|
+
};
|
|
1803
|
+
|
|
1804
|
+
export { StandardMaterial as S };
|
|
1805
|
+
//# sourceMappingURL=standardMaterial-DKyaZtcm.esm.js.map
|