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