@babylonjs/viewer 7.25.2-alpha → 7.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration/configuration.d.ts +107 -0
- package/configuration/configuration.js +16 -0
- package/configuration/configuration.js.map +1 -0
- package/configuration/configurationCompatibility.d.ts +8 -0
- package/configuration/configurationCompatibility.js +66 -0
- package/configuration/configurationCompatibility.js.map +1 -0
- package/configuration/configurationContainer.d.ts +10 -0
- package/configuration/configurationContainer.js +10 -0
- package/configuration/configurationContainer.js.map +1 -0
- package/configuration/globals.d.ts +6 -0
- package/configuration/globals.js +18 -0
- package/configuration/globals.js.map +1 -0
- package/configuration/index.d.ts +2 -0
- package/configuration/index.js +4 -0
- package/configuration/index.js.map +1 -0
- package/configuration/interfaces/cameraConfiguration.d.ts +31 -0
- package/configuration/interfaces/cameraConfiguration.js +2 -0
- package/configuration/interfaces/cameraConfiguration.js.map +1 -0
- package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -0
- package/configuration/interfaces/colorGradingConfiguration.js +2 -0
- package/configuration/interfaces/colorGradingConfiguration.js.map +1 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +2 -0
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +1 -0
- package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -0
- package/configuration/interfaces/environmentMapConfiguration.js +2 -0
- package/configuration/interfaces/environmentMapConfiguration.js.map +1 -0
- package/configuration/interfaces/groundConfiguration.d.ts +24 -0
- package/configuration/interfaces/groundConfiguration.js +2 -0
- package/configuration/interfaces/groundConfiguration.js.map +1 -0
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +45 -0
- package/configuration/interfaces/imageProcessingConfiguration.js +2 -0
- package/configuration/interfaces/imageProcessingConfiguration.js.map +1 -0
- package/configuration/interfaces/index.d.ts +15 -0
- package/configuration/interfaces/index.js +16 -0
- package/configuration/interfaces/index.js.map +1 -0
- package/configuration/interfaces/lightConfiguration.d.ts +60 -0
- package/configuration/interfaces/lightConfiguration.js +2 -0
- package/configuration/interfaces/lightConfiguration.js.map +1 -0
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -0
- package/configuration/interfaces/modelAnimationConfiguration.js +2 -0
- package/configuration/interfaces/modelAnimationConfiguration.js.map +1 -0
- package/configuration/interfaces/modelConfiguration.d.ts +65 -0
- package/configuration/interfaces/modelConfiguration.js +2 -0
- package/configuration/interfaces/modelConfiguration.js.map +1 -0
- package/configuration/interfaces/observersConfiguration.d.ts +5 -0
- package/configuration/interfaces/observersConfiguration.js +2 -0
- package/configuration/interfaces/observersConfiguration.js.map +1 -0
- package/configuration/interfaces/sceneConfiguration.d.ts +48 -0
- package/configuration/interfaces/sceneConfiguration.js +2 -0
- package/configuration/interfaces/sceneConfiguration.js.map +1 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.js +2 -0
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +1 -0
- package/configuration/interfaces/skyboxConfiguration.d.ts +21 -0
- package/configuration/interfaces/skyboxConfiguration.js +2 -0
- package/configuration/interfaces/skyboxConfiguration.js.map +1 -0
- package/configuration/interfaces/templateConfiguration.d.ts +67 -0
- package/configuration/interfaces/templateConfiguration.js +2 -0
- package/configuration/interfaces/templateConfiguration.js.map +1 -0
- package/configuration/interfaces/vrConfiguration.d.ts +16 -0
- package/configuration/interfaces/vrConfiguration.js +2 -0
- package/configuration/interfaces/vrConfiguration.js.map +1 -0
- package/configuration/loader.d.ts +4 -0
- package/configuration/loader.js +17 -0
- package/configuration/loader.js.map +1 -0
- package/configuration/mappers.d.ts +43 -0
- package/configuration/mappers.js +192 -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 +350 -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 +199 -0
- package/loader/modelLoader.js.map +1 -0
- package/loader/plugins/applyMaterialConfig.d.ts +12 -0
- package/loader/plugins/applyMaterialConfig.js +16 -0
- package/loader/plugins/applyMaterialConfig.js.map +1 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.js +16 -0
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +1 -0
- package/loader/plugins/index.d.ts +19 -0
- package/loader/plugins/index.js +44 -0
- package/loader/plugins/index.js.map +1 -0
- package/loader/plugins/loaderPlugin.d.ts +24 -0
- package/loader/plugins/loaderPlugin.js +2 -0
- package/loader/plugins/loaderPlugin.js.map +1 -0
- package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -0
- package/loader/plugins/msftLodLoaderPlugin.js +21 -0
- package/loader/plugins/msftLodLoaderPlugin.js.map +1 -0
- package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -0
- package/loader/plugins/telemetryLoaderPlugin.js +36 -0
- package/loader/plugins/telemetryLoaderPlugin.js.map +1 -0
- package/managers/observablesManager.d.ts +66 -0
- package/managers/observablesManager.js +35 -0
- package/managers/observablesManager.js.map +1 -0
- package/managers/sceneManager.d.ts +245 -0
- package/managers/sceneManager.js +1375 -0
- package/managers/sceneManager.js.map +1 -0
- package/managers/telemetryManager.d.ts +78 -0
- package/managers/telemetryManager.js +117 -0
- package/managers/telemetryManager.js.map +1 -0
- package/model/modelAnimation.d.ts +215 -0
- package/model/modelAnimation.js +237 -0
- package/model/modelAnimation.js.map +1 -0
- package/model/viewerModel.d.ts +233 -0
- package/model/viewerModel.js +673 -0
- package/model/viewerModel.js.map +1 -0
- package/optimizer/custom/extended.d.ts +13 -0
- package/optimizer/custom/extended.js +101 -0
- package/optimizer/custom/extended.js.map +1 -0
- package/optimizer/custom/index.d.ts +9 -0
- package/optimizer/custom/index.js +26 -0
- package/optimizer/custom/index.js.map +1 -0
- package/package.json +27 -17
- package/readme.md +21 -35
- 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 +21 -0
- package/templating/plugins/hdButtonPlugin.js.map +1 -0
- package/templating/plugins/printButton.d.ts +9 -0
- package/templating/plugins/printButton.js +40 -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 +675 -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/dist/babylon-viewer.esm.js +0 -2
- package/dist/babylon-viewer.esm.js.map +0 -1
- package/dist/babylon-viewer.esm.min.js +0 -2
- package/dist/babylon-viewer.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-BH3hZg5O.esm.min.js +0 -2
- package/dist/chunks/EXT_lights_image_based-BH3hZg5O.esm.min.js.map +0 -1
- package/dist/chunks/EXT_lights_image_based-DzfllwXH.esm.js +0 -170
- package/dist/chunks/EXT_lights_image_based-DzfllwXH.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-C9OEhnvW.esm.js +0 -86
- package/dist/chunks/EXT_mesh_gpu_instancing-C9OEhnvW.esm.js.map +0 -1
- package/dist/chunks/EXT_mesh_gpu_instancing-CXIBSaqJ.esm.min.js +0 -2
- package/dist/chunks/EXT_mesh_gpu_instancing-CXIBSaqJ.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-FHhysyRP.esm.min.js +0 -2
- package/dist/chunks/EXT_meshopt_compression-FHhysyRP.esm.min.js.map +0 -1
- package/dist/chunks/EXT_meshopt_compression-MDnzeuix.esm.js +0 -134
- package/dist/chunks/EXT_meshopt_compression-MDnzeuix.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-DYg5PN0r.esm.js +0 -44
- package/dist/chunks/EXT_texture_avif-DYg5PN0r.esm.js.map +0 -1
- package/dist/chunks/EXT_texture_avif-aYOG80m1.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_avif-aYOG80m1.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-C4SoS8oM.esm.min.js +0 -2
- package/dist/chunks/EXT_texture_webp-C4SoS8oM.esm.min.js.map +0 -1
- package/dist/chunks/EXT_texture_webp-CFXwdFPL.esm.js +0 -43
- package/dist/chunks/EXT_texture_webp-CFXwdFPL.esm.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-0irOjN40.esm.min.js +0 -2
- package/dist/chunks/ExtrasAsMetadata-0irOjN40.esm.min.js.map +0 -1
- package/dist/chunks/ExtrasAsMetadata-CMMGMmGq.esm.js +0 -64
- package/dist/chunks/ExtrasAsMetadata-CMMGMmGq.esm.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-BP1GTrPy.esm.js +0 -343
- package/dist/chunks/KHR_animation_pointer-BP1GTrPy.esm.js.map +0 -1
- package/dist/chunks/KHR_animation_pointer-DYUHlqMb.esm.min.js +0 -2
- package/dist/chunks/KHR_animation_pointer-DYUHlqMb.esm.min.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-1__XqV2v.esm.js +0 -610
- package/dist/chunks/KHR_draco_mesh_compression-1__XqV2v.esm.js.map +0 -1
- package/dist/chunks/KHR_draco_mesh_compression-DugkDX1-.esm.min.js +0 -2
- package/dist/chunks/KHR_draco_mesh_compression-DugkDX1-.esm.min.js.map +0 -1
- package/dist/chunks/KHR_interactivity-CG9wdbbE.esm.js +0 -4033
- package/dist/chunks/KHR_interactivity-CG9wdbbE.esm.js.map +0 -1
- package/dist/chunks/KHR_interactivity-DTEAfXZw.esm.min.js +0 -2
- package/dist/chunks/KHR_interactivity-DTEAfXZw.esm.min.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-BJoC3s-k.esm.js +0 -1253
- package/dist/chunks/KHR_lights_punctual-BJoC3s-k.esm.js.map +0 -1
- package/dist/chunks/KHR_lights_punctual-CJ8IXFIN.esm.min.js +0 -2
- package/dist/chunks/KHR_lights_punctual-CJ8IXFIN.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-D-JkJqtx.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_anisotropy-D-JkJqtx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_anisotropy-vQUJOfyf.esm.js +0 -64
- package/dist/chunks/KHR_materials_anisotropy-vQUJOfyf.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-DGkjpld9.esm.js +0 -96
- package/dist/chunks/KHR_materials_clearcoat-DGkjpld9.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_clearcoat-D_sScrmJ.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_clearcoat-D_sScrmJ.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-B-AVMVdy.esm.js +0 -97
- package/dist/chunks/KHR_materials_diffuse_transmission-B-AVMVdy.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_diffuse_transmission-D89RzboR.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_diffuse_transmission-D89RzboR.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-B8b6MXDS.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_dispersion-B8b6MXDS.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_dispersion-Biijd7CZ.esm.js +0 -62
- package/dist/chunks/KHR_materials_dispersion-Biijd7CZ.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-CphmP7Mx.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_emissive_strength-CphmP7Mx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_emissive_strength-HYht21Ls.esm.js +0 -55
- package/dist/chunks/KHR_materials_emissive_strength-HYht21Ls.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-CMHiVWXF.esm.js +0 -64
- package/dist/chunks/KHR_materials_ior-CMHiVWXF.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_ior-Dtd5Uruf.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_ior-Dtd5Uruf.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-BPYqwadf.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_iridescence-BPYqwadf.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_iridescence-uiK5wAia.esm.js +0 -72
- package/dist/chunks/KHR_materials_iridescence-uiK5wAia.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-At-foveb.esm.js +0 -81
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-At-foveb.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D-0vzv_p.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D-0vzv_p.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-D9QlTIrL.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_sheen-D9QlTIrL.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_sheen-D_dNVJOm.esm.js +0 -85
- package/dist/chunks/KHR_materials_sheen-D_dNVJOm.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-BoPxT-Mo.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_specular-BoPxT-Mo.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_specular-DQxjj2Cx.esm.js +0 -75
- package/dist/chunks/KHR_materials_specular-DQxjj2Cx.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-BFM7Cmhe.esm.js +0 -307
- package/dist/chunks/KHR_materials_transmission-BFM7Cmhe.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_transmission-Cmv46WbD.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_transmission-Cmv46WbD.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-5NSHSTuh.esm.js +0 -74
- package/dist/chunks/KHR_materials_unlit-5NSHSTuh.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_unlit-D0eVH4Om.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_unlit-D0eVH4Om.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-DV9kQ9N0.esm.js +0 -238
- package/dist/chunks/KHR_materials_variants-DV9kQ9N0.esm.js.map +0 -1
- package/dist/chunks/KHR_materials_variants-q_OSyG78.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_variants-q_OSyG78.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-B-2guGwk.esm.min.js +0 -2
- package/dist/chunks/KHR_materials_volume-B-2guGwk.esm.min.js.map +0 -1
- package/dist/chunks/KHR_materials_volume-ByNJMyHb.esm.js +0 -87
- package/dist/chunks/KHR_materials_volume-ByNJMyHb.esm.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-B-dDY2nG.esm.min.js +0 -2
- package/dist/chunks/KHR_mesh_quantization-B-dDY2nG.esm.min.js.map +0 -1
- package/dist/chunks/KHR_mesh_quantization-CtRIMI9n.esm.js +0 -26
- package/dist/chunks/KHR_mesh_quantization-CtRIMI9n.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-Bpv_M6W8.esm.js +0 -43
- package/dist/chunks/KHR_texture_basisu-Bpv_M6W8.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_basisu-CDZ_8ojt.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_basisu-CDZ_8ojt.esm.min.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-DR04vBMi.esm.js +0 -63
- package/dist/chunks/KHR_texture_transform-DR04vBMi.esm.js.map +0 -1
- package/dist/chunks/KHR_texture_transform-Dxlw1ALx.esm.min.js +0 -2
- package/dist/chunks/KHR_texture_transform-Dxlw1ALx.esm.min.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-BE7tnUAA.esm.js +0 -51
- package/dist/chunks/KHR_xmp_json_ld-BE7tnUAA.esm.js.map +0 -1
- package/dist/chunks/KHR_xmp_json_ld-Cba_e7FN.esm.min.js +0 -2
- package/dist/chunks/KHR_xmp_json_ld-Cba_e7FN.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-C7N149TS.esm.min.js +0 -2
- package/dist/chunks/MSFT_audio_emitter-C7N149TS.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_audio_emitter-Dli0UATE.esm.js +0 -2236
- package/dist/chunks/MSFT_audio_emitter-Dli0UATE.esm.js.map +0 -1
- package/dist/chunks/MSFT_lod-B_XcOQr8.esm.min.js +0 -2
- package/dist/chunks/MSFT_lod-B_XcOQr8.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_lod-Ce-KRZp9.esm.js +0 -337
- package/dist/chunks/MSFT_lod-Ce-KRZp9.esm.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-C1iLB8-L.esm.min.js +0 -2
- package/dist/chunks/MSFT_minecraftMesh-C1iLB8-L.esm.min.js.map +0 -1
- package/dist/chunks/MSFT_minecraftMesh-D7vFOPNh.esm.js +0 -46
- package/dist/chunks/MSFT_minecraftMesh-D7vFOPNh.esm.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-DCJApvhI.esm.js +0 -47
- package/dist/chunks/MSFT_sRGBFactors-DCJApvhI.esm.js.map +0 -1
- package/dist/chunks/MSFT_sRGBFactors-IRTTNK8h.esm.min.js +0 -2
- package/dist/chunks/MSFT_sRGBFactors-IRTTNK8h.esm.min.js.map +0 -1
- package/dist/chunks/assetContainer-9BV4w6Ec.esm.js +0 -1598
- package/dist/chunks/assetContainer-9BV4w6Ec.esm.js.map +0 -1
- package/dist/chunks/assetContainer-Cu6LKJHz.esm.min.js +0 -2
- package/dist/chunks/assetContainer-Cu6LKJHz.esm.min.js.map +0 -1
- package/dist/chunks/audioEngine-Bh-HZCai.esm.min.js +0 -2
- package/dist/chunks/audioEngine-Bh-HZCai.esm.min.js.map +0 -1
- package/dist/chunks/audioEngine-pydGAEd8.esm.js +0 -305
- package/dist/chunks/audioEngine-pydGAEd8.esm.js.map +0 -1
- package/dist/chunks/basisTextureLoader-BD8_wqQL.esm.min.js +0 -2
- package/dist/chunks/basisTextureLoader-BD8_wqQL.esm.min.js.map +0 -1
- package/dist/chunks/basisTextureLoader-JmRg1Sfn.esm.js +0 -600
- package/dist/chunks/basisTextureLoader-JmRg1Sfn.esm.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-Bpjp8qSf.esm.js +0 -87
- package/dist/chunks/ddsTextureLoader-Bpjp8qSf.esm.js.map +0 -1
- package/dist/chunks/ddsTextureLoader-CEyJTB3O.esm.min.js +0 -2
- package/dist/chunks/ddsTextureLoader-CEyJTB3O.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-B11bdnrB.esm.min.js +0 -2
- package/dist/chunks/default.fragment-B11bdnrB.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-Bawtijue.esm.min.js +0 -2
- package/dist/chunks/default.fragment-Bawtijue.esm.min.js.map +0 -1
- package/dist/chunks/default.fragment-D3k4gvNV.esm.js +0 -456
- package/dist/chunks/default.fragment-D3k4gvNV.esm.js.map +0 -1
- package/dist/chunks/default.fragment-DL3qA9UG.esm.js +0 -515
- package/dist/chunks/default.fragment-DL3qA9UG.esm.js.map +0 -1
- package/dist/chunks/default.vertex-B7OOfc9A.esm.js +0 -178
- package/dist/chunks/default.vertex-B7OOfc9A.esm.js.map +0 -1
- package/dist/chunks/default.vertex-BKC2A0e0.esm.js +0 -199
- package/dist/chunks/default.vertex-BKC2A0e0.esm.js.map +0 -1
- package/dist/chunks/default.vertex-BRncvhAx.esm.min.js +0 -2
- package/dist/chunks/default.vertex-BRncvhAx.esm.min.js.map +0 -1
- package/dist/chunks/default.vertex-sJaJV_6d.esm.min.js +0 -2
- package/dist/chunks/default.vertex-sJaJV_6d.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-C1JdSocs.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-C1JdSocs.esm.min.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-Cszg1EQW.esm.js +0 -13
- package/dist/chunks/defaultUboDeclaration-Cszg1EQW.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-DB7zHENU.esm.js +0 -15
- package/dist/chunks/defaultUboDeclaration-DB7zHENU.esm.js.map +0 -1
- package/dist/chunks/defaultUboDeclaration-XHlan1gc.esm.min.js +0 -2
- package/dist/chunks/defaultUboDeclaration-XHlan1gc.esm.min.js.map +0 -1
- package/dist/chunks/engine-DZrewcWP.esm.js +0 -1613
- package/dist/chunks/engine-DZrewcWP.esm.js.map +0 -1
- package/dist/chunks/engine-sFOTJhn4.esm.min.js +0 -2
- package/dist/chunks/engine-sFOTJhn4.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-DLAJXIl8.esm.min.js +0 -2
- package/dist/chunks/envTextureLoader-DLAJXIl8.esm.min.js.map +0 -1
- package/dist/chunks/envTextureLoader-DpLIoFjS.esm.js +0 -63
- package/dist/chunks/envTextureLoader-DpLIoFjS.esm.js.map +0 -1
- package/dist/chunks/environmentTextureTools-CiyJLBbf.esm.min.js +0 -2
- package/dist/chunks/environmentTextureTools-CiyJLBbf.esm.min.js.map +0 -1
- package/dist/chunks/environmentTextureTools-bPqq81in.esm.js +0 -381
- package/dist/chunks/environmentTextureTools-bPqq81in.esm.js.map +0 -1
- package/dist/chunks/exrTextureLoader-DJ7PbPlF.esm.min.js +0 -2
- package/dist/chunks/exrTextureLoader-DJ7PbPlF.esm.min.js.map +0 -1
- package/dist/chunks/exrTextureLoader-DYsBnFky.esm.js +0 -1682
- package/dist/chunks/exrTextureLoader-DYsBnFky.esm.js.map +0 -1
- package/dist/chunks/fogFragment-BLvD2fqs.esm.min.js +0 -2
- package/dist/chunks/fogFragment-BLvD2fqs.esm.min.js.map +0 -1
- package/dist/chunks/fogFragment-b0NlRwYe.esm.js +0 -102
- package/dist/chunks/fogFragment-b0NlRwYe.esm.js.map +0 -1
- package/dist/chunks/glTFLoader-BikrhFtn.esm.js +0 -7552
- package/dist/chunks/glTFLoader-BikrhFtn.esm.js.map +0 -1
- package/dist/chunks/glTFLoader-mZPFBYSM.esm.min.js +0 -2
- package/dist/chunks/glTFLoader-mZPFBYSM.esm.min.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-BdwTR5Nl.esm.js +0 -77
- package/dist/chunks/glTFLoaderAnimation-BdwTR5Nl.esm.js.map +0 -1
- package/dist/chunks/glTFLoaderAnimation-CiKBDKnk.esm.min.js +0 -2
- package/dist/chunks/glTFLoaderAnimation-CiKBDKnk.esm.min.js.map +0 -1
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +0 -2
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +0 -1
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +0 -67
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-C12V8Ng1.esm.js +0 -35
- package/dist/chunks/harmonicsFunctions-C12V8Ng1.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-CRoab7mv.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-CRoab7mv.esm.min.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-CZi4YSE7.esm.js +0 -34
- package/dist/chunks/harmonicsFunctions-CZi4YSE7.esm.js.map +0 -1
- package/dist/chunks/harmonicsFunctions-GFzLo9xW.esm.min.js +0 -2
- package/dist/chunks/harmonicsFunctions-GFzLo9xW.esm.min.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-CsWJNnG5.esm.js +0 -252
- package/dist/chunks/hdrTextureLoader-CsWJNnG5.esm.js.map +0 -1
- package/dist/chunks/hdrTextureLoader-Cwi3SM4o.esm.min.js +0 -2
- package/dist/chunks/hdrTextureLoader-Cwi3SM4o.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-21b9-yGo.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-21b9-yGo.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-COVDWwPu.esm.js +0 -80
- package/dist/chunks/helperFunctions-COVDWwPu.esm.js.map +0 -1
- package/dist/chunks/helperFunctions-CQzJ5T38.esm.min.js +0 -2
- package/dist/chunks/helperFunctions-CQzJ5T38.esm.min.js.map +0 -1
- package/dist/chunks/helperFunctions-CUKI67ax.esm.js +0 -108
- package/dist/chunks/helperFunctions-CUKI67ax.esm.js.map +0 -1
- package/dist/chunks/index-5EaMDaGg.esm.js +0 -79820
- package/dist/chunks/index-5EaMDaGg.esm.js.map +0 -1
- package/dist/chunks/index-RwQCgcf4.esm.min.js +0 -57
- package/dist/chunks/index-RwQCgcf4.esm.min.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-34pzZN2D.esm.js +0 -814
- package/dist/chunks/ktxTextureLoader-34pzZN2D.esm.js.map +0 -1
- package/dist/chunks/ktxTextureLoader-Dj2b7tTw.esm.min.js +0 -2
- package/dist/chunks/ktxTextureLoader-Dj2b7tTw.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-BTOfKIR5.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-BTOfKIR5.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-Boz5U8vN.esm.min.js +0 -2
- package/dist/chunks/logDepthDeclaration-Boz5U8vN.esm.min.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-Dc0_n0rX.esm.js +0 -42
- package/dist/chunks/logDepthDeclaration-Dc0_n0rX.esm.js.map +0 -1
- package/dist/chunks/logDepthDeclaration-cImBekwl.esm.js +0 -35
- package/dist/chunks/logDepthDeclaration-cImBekwl.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-ABvK0V0R.esm.js +0 -77
- package/dist/chunks/logDepthVertex-ABvK0V0R.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-BA4bq6Km.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-BA4bq6Km.esm.min.js.map +0 -1
- package/dist/chunks/logDepthVertex-C7FgfYJH.esm.js +0 -605
- package/dist/chunks/logDepthVertex-C7FgfYJH.esm.js.map +0 -1
- package/dist/chunks/logDepthVertex-Da8gAKX-.esm.min.js +0 -2
- package/dist/chunks/logDepthVertex-Da8gAKX-.esm.min.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-B-9VKUsa.esm.js +0 -11
- package/dist/chunks/mainUVVaryingDeclaration-B-9VKUsa.esm.js.map +0 -1
- package/dist/chunks/mainUVVaryingDeclaration-CNcp6TRG.esm.min.js +0 -2
- package/dist/chunks/mainUVVaryingDeclaration-CNcp6TRG.esm.min.js.map +0 -1
- package/dist/chunks/objFileLoader-3iAEdRPX.esm.js +0 -1280
- package/dist/chunks/objFileLoader-3iAEdRPX.esm.js.map +0 -1
- package/dist/chunks/objFileLoader-Cr90DdHJ.esm.min.js +0 -2
- package/dist/chunks/objFileLoader-Cr90DdHJ.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-BxefW3dP.esm.min.js +0 -2
- package/dist/chunks/oitFragment-BxefW3dP.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-DNM4M_TM.esm.js +0 -1166
- package/dist/chunks/oitFragment-DNM4M_TM.esm.js.map +0 -1
- package/dist/chunks/oitFragment-QOO-2oNY.esm.min.js +0 -2
- package/dist/chunks/oitFragment-QOO-2oNY.esm.min.js.map +0 -1
- package/dist/chunks/oitFragment-c8QTGncf.esm.js +0 -1210
- package/dist/chunks/oitFragment-c8QTGncf.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-54wWMjH0.esm.js +0 -15
- package/dist/chunks/pass.fragment-54wWMjH0.esm.js.map +0 -1
- package/dist/chunks/pass.fragment-C2zJ2wfh.esm.min.js +0 -2
- package/dist/chunks/pass.fragment-C2zJ2wfh.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-B2LdxiLY.esm.js +0 -3163
- package/dist/chunks/pbr.fragment-B2LdxiLY.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-BdB3ttR4.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-BdB3ttR4.esm.min.js.map +0 -1
- package/dist/chunks/pbr.fragment-BweiXotT.esm.js +0 -3219
- package/dist/chunks/pbr.fragment-BweiXotT.esm.js.map +0 -1
- package/dist/chunks/pbr.fragment-DO84e7Qh.esm.min.js +0 -2
- package/dist/chunks/pbr.fragment-DO84e7Qh.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-BXRa8Hxv.esm.js +0 -335
- package/dist/chunks/pbr.vertex-BXRa8Hxv.esm.js.map +0 -1
- package/dist/chunks/pbr.vertex-CF2Ccw8q.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-CF2Ccw8q.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-Dp1NB2h0.esm.min.js +0 -2
- package/dist/chunks/pbr.vertex-Dp1NB2h0.esm.min.js.map +0 -1
- package/dist/chunks/pbr.vertex-ou_Fcm2v.esm.js +0 -208
- package/dist/chunks/pbr.vertex-ou_Fcm2v.esm.js.map +0 -1
- package/dist/chunks/postprocess.vertex-C12ptRTz.esm.js +0 -20
- package/dist/chunks/postprocess.vertex-C12ptRTz.esm.js.map +0 -1
- package/dist/chunks/postprocess.vertex-D9PCzQ_C.esm.min.js +0 -2
- package/dist/chunks/postprocess.vertex-D9PCzQ_C.esm.min.js.map +0 -1
- package/dist/chunks/rawTexture-BTLHgkBf.esm.js +0 -562
- package/dist/chunks/rawTexture-BTLHgkBf.esm.js.map +0 -1
- package/dist/chunks/rawTexture-Cb8Vzv3y.esm.min.js +0 -2
- package/dist/chunks/rawTexture-Cb8Vzv3y.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-4VUd_LZa.esm.js +0 -17
- package/dist/chunks/rgbdDecode.fragment-4VUd_LZa.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-B97s0YHK.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-B97s0YHK.esm.min.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-CgqRZDLm.esm.js +0 -17
- package/dist/chunks/rgbdDecode.fragment-CgqRZDLm.esm.js.map +0 -1
- package/dist/chunks/rgbdDecode.fragment-DSa_xyAA.esm.min.js +0 -2
- package/dist/chunks/rgbdDecode.fragment-DSa_xyAA.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-C3-vIdKY.esm.js +0 -17
- package/dist/chunks/rgbdEncode.fragment-C3-vIdKY.esm.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-CZ7DFmJC.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-CZ7DFmJC.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-CnIc0eyH.esm.min.js +0 -2
- package/dist/chunks/rgbdEncode.fragment-CnIc0eyH.esm.min.js.map +0 -1
- package/dist/chunks/rgbdEncode.fragment-DA8KkHQU.esm.js +0 -17
- package/dist/chunks/rgbdEncode.fragment-DA8KkHQU.esm.js.map +0 -1
- package/dist/chunks/splatFileLoader-BiXQ9pqp.esm.min.js +0 -2
- package/dist/chunks/splatFileLoader-BiXQ9pqp.esm.min.js.map +0 -1
- package/dist/chunks/splatFileLoader-D17axd4l.esm.js +0 -3179
- package/dist/chunks/splatFileLoader-D17axd4l.esm.js.map +0 -1
- package/dist/chunks/standardMaterial-CYafMW8c.esm.js +0 -1809
- package/dist/chunks/standardMaterial-CYafMW8c.esm.js.map +0 -1
- package/dist/chunks/standardMaterial-xLALVwqX.esm.min.js +0 -2
- package/dist/chunks/standardMaterial-xLALVwqX.esm.min.js.map +0 -1
- package/dist/chunks/stlFileLoader-BIeNnvqG.esm.js +0 -237
- package/dist/chunks/stlFileLoader-BIeNnvqG.esm.js.map +0 -1
- package/dist/chunks/stlFileLoader-CqtYJIkJ.esm.min.js +0 -2
- package/dist/chunks/stlFileLoader-CqtYJIkJ.esm.min.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-CDefV-xQ.esm.min.js +0 -2
- package/dist/chunks/tgaTextureLoader-CDefV-xQ.esm.min.js.map +0 -1
- package/dist/chunks/tgaTextureLoader-CerR7twj.esm.js +0 -349
- package/dist/chunks/tgaTextureLoader-CerR7twj.esm.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-InKoMs06.esm.js +0 -314
- package/dist/chunks/thinInstanceMesh-InKoMs06.esm.js.map +0 -1
- package/dist/chunks/thinInstanceMesh-XV_b72vY.esm.min.js +0 -2
- package/dist/chunks/thinInstanceMesh-XV_b72vY.esm.min.js.map +0 -1
- package/dist/chunks/vertexColorMixing-Dm0jnWj1.esm.js +0 -528
- package/dist/chunks/vertexColorMixing-Dm0jnWj1.esm.js.map +0 -1
- package/dist/chunks/vertexColorMixing-N0v0Ism3.esm.min.js +0 -2
- package/dist/chunks/vertexColorMixing-N0v0Ism3.esm.min.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 -275
- package/lib/index.js +0 -942
- package/lib/index.js.map +0 -1
|
@@ -1,562 +0,0 @@
|
|
|
1
|
-
import { T as ThinEngine, C as Constants, c as InternalTexture, L as Logger, b1 as IsExponentOfTwo, f as Texture } from './index-5EaMDaGg.esm.js';
|
|
2
|
-
|
|
3
|
-
ThinEngine.prototype.updateRawTexture = function (texture, data, format, invertY, compression = null, type = Constants.TEXTURETYPE_UNSIGNED_INT, useSRGBBuffer = false) {
|
|
4
|
-
if (!texture) {
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
// Babylon's internalSizedFomat but gl's texImage2D internalFormat
|
|
8
|
-
const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);
|
|
9
|
-
// Babylon's internalFormat but gl's texImage2D format
|
|
10
|
-
const internalFormat = this._getInternalFormat(format);
|
|
11
|
-
const textureType = this._getWebGLTextureType(type);
|
|
12
|
-
this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
|
|
13
|
-
this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
|
|
14
|
-
if (!this._doNotHandleContextLost) {
|
|
15
|
-
texture._bufferView = data;
|
|
16
|
-
texture.format = format;
|
|
17
|
-
texture.type = type;
|
|
18
|
-
texture.invertY = invertY;
|
|
19
|
-
texture._compression = compression;
|
|
20
|
-
}
|
|
21
|
-
if (texture.width % 4 !== 0) {
|
|
22
|
-
this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);
|
|
23
|
-
}
|
|
24
|
-
if (compression && data) {
|
|
25
|
-
this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, 0, data);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data);
|
|
29
|
-
}
|
|
30
|
-
if (texture.generateMipMaps) {
|
|
31
|
-
this._gl.generateMipmap(this._gl.TEXTURE_2D);
|
|
32
|
-
}
|
|
33
|
-
this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
|
|
34
|
-
// this.resetTextureCache();
|
|
35
|
-
texture.isReady = true;
|
|
36
|
-
};
|
|
37
|
-
ThinEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = Constants.TEXTURETYPE_UNSIGNED_INT,
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
|
-
creationFlags = 0, useSRGBBuffer = false) {
|
|
40
|
-
const texture = new InternalTexture(this, 3 /* InternalTextureSource.Raw */);
|
|
41
|
-
texture.baseWidth = width;
|
|
42
|
-
texture.baseHeight = height;
|
|
43
|
-
texture.width = width;
|
|
44
|
-
texture.height = height;
|
|
45
|
-
texture.format = format;
|
|
46
|
-
texture.generateMipMaps = generateMipMaps;
|
|
47
|
-
texture.samplingMode = samplingMode;
|
|
48
|
-
texture.invertY = invertY;
|
|
49
|
-
texture._compression = compression;
|
|
50
|
-
texture.type = type;
|
|
51
|
-
texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);
|
|
52
|
-
if (!this._doNotHandleContextLost) {
|
|
53
|
-
texture._bufferView = data;
|
|
54
|
-
}
|
|
55
|
-
this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);
|
|
56
|
-
this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
|
|
57
|
-
// Filters
|
|
58
|
-
const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
|
|
59
|
-
this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag);
|
|
60
|
-
this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min);
|
|
61
|
-
if (generateMipMaps) {
|
|
62
|
-
this._gl.generateMipmap(this._gl.TEXTURE_2D);
|
|
63
|
-
}
|
|
64
|
-
this._bindTextureDirectly(this._gl.TEXTURE_2D, null);
|
|
65
|
-
this._internalTexturesCache.push(texture);
|
|
66
|
-
return texture;
|
|
67
|
-
};
|
|
68
|
-
ThinEngine.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) {
|
|
69
|
-
const gl = this._gl;
|
|
70
|
-
const texture = new InternalTexture(this, 8 /* InternalTextureSource.CubeRaw */);
|
|
71
|
-
texture.isCube = true;
|
|
72
|
-
texture.format = format;
|
|
73
|
-
texture.type = type;
|
|
74
|
-
if (!this._doNotHandleContextLost) {
|
|
75
|
-
texture._bufferViewArray = data;
|
|
76
|
-
}
|
|
77
|
-
const textureType = this._getWebGLTextureType(type);
|
|
78
|
-
let internalFormat = this._getInternalFormat(format);
|
|
79
|
-
if (internalFormat === gl.RGB) {
|
|
80
|
-
internalFormat = gl.RGBA;
|
|
81
|
-
}
|
|
82
|
-
// Mipmap generation needs a sized internal format that is both color-renderable and texture-filterable
|
|
83
|
-
if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) {
|
|
84
|
-
generateMipMaps = false;
|
|
85
|
-
samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;
|
|
86
|
-
Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
|
|
87
|
-
}
|
|
88
|
-
else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) {
|
|
89
|
-
generateMipMaps = false;
|
|
90
|
-
samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;
|
|
91
|
-
Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
|
|
92
|
-
}
|
|
93
|
-
else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) {
|
|
94
|
-
generateMipMaps = false;
|
|
95
|
-
Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.");
|
|
96
|
-
}
|
|
97
|
-
else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) {
|
|
98
|
-
generateMipMaps = false;
|
|
99
|
-
Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.");
|
|
100
|
-
}
|
|
101
|
-
const width = size;
|
|
102
|
-
const height = width;
|
|
103
|
-
texture.width = width;
|
|
104
|
-
texture.height = height;
|
|
105
|
-
texture.invertY = invertY;
|
|
106
|
-
texture._compression = compression;
|
|
107
|
-
// Double check on POT to generate Mips.
|
|
108
|
-
const isPot = !this.needPOTTextures || (IsExponentOfTwo(texture.width) && IsExponentOfTwo(texture.height));
|
|
109
|
-
if (!isPot) {
|
|
110
|
-
generateMipMaps = false;
|
|
111
|
-
}
|
|
112
|
-
// Upload data if needed. The texture won't be ready until then.
|
|
113
|
-
if (data) {
|
|
114
|
-
this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
|
|
118
|
-
const level = 0;
|
|
119
|
-
this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
|
|
120
|
-
for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
|
|
121
|
-
if (compression) {
|
|
122
|
-
gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, undefined);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, null);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
|
|
129
|
-
}
|
|
130
|
-
this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);
|
|
131
|
-
// Filters
|
|
132
|
-
if (data && generateMipMaps) {
|
|
133
|
-
this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);
|
|
134
|
-
}
|
|
135
|
-
const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
|
|
136
|
-
gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag);
|
|
137
|
-
gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min);
|
|
138
|
-
gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
139
|
-
gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
140
|
-
this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
|
|
141
|
-
texture.generateMipMaps = generateMipMaps;
|
|
142
|
-
texture.samplingMode = samplingMode;
|
|
143
|
-
texture.isReady = true;
|
|
144
|
-
return texture;
|
|
145
|
-
};
|
|
146
|
-
ThinEngine.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression = null, level = 0) {
|
|
147
|
-
texture._bufferViewArray = data;
|
|
148
|
-
texture.format = format;
|
|
149
|
-
texture.type = type;
|
|
150
|
-
texture.invertY = invertY;
|
|
151
|
-
texture._compression = compression;
|
|
152
|
-
const gl = this._gl;
|
|
153
|
-
const textureType = this._getWebGLTextureType(type);
|
|
154
|
-
let internalFormat = this._getInternalFormat(format);
|
|
155
|
-
const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
|
|
156
|
-
let needConversion = false;
|
|
157
|
-
if (internalFormat === gl.RGB) {
|
|
158
|
-
internalFormat = gl.RGBA;
|
|
159
|
-
needConversion = true;
|
|
160
|
-
}
|
|
161
|
-
this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
|
|
162
|
-
this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
|
|
163
|
-
if (texture.width % 4 !== 0) {
|
|
164
|
-
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
|
|
165
|
-
}
|
|
166
|
-
// Data are known to be in +X +Y +Z -X -Y -Z
|
|
167
|
-
for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
|
|
168
|
-
let faceData = data[faceIndex];
|
|
169
|
-
if (compression) {
|
|
170
|
-
gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, this.getCaps().s3tc[compression], texture.width, texture.height, 0, faceData);
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
if (needConversion) {
|
|
174
|
-
faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);
|
|
175
|
-
}
|
|
176
|
-
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
const isPot = !this.needPOTTextures || (IsExponentOfTwo(texture.width) && IsExponentOfTwo(texture.height));
|
|
180
|
-
if (isPot && texture.generateMipMaps && level === 0) {
|
|
181
|
-
this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);
|
|
182
|
-
}
|
|
183
|
-
this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);
|
|
184
|
-
// this.resetTextureCache();
|
|
185
|
-
texture.isReady = true;
|
|
186
|
-
};
|
|
187
|
-
ThinEngine.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, invertY = false) {
|
|
188
|
-
const gl = this._gl;
|
|
189
|
-
const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);
|
|
190
|
-
scene?.addPendingData(texture);
|
|
191
|
-
texture.url = url;
|
|
192
|
-
texture.isReady = false;
|
|
193
|
-
this._internalTexturesCache.push(texture);
|
|
194
|
-
const onerror = (request, exception) => {
|
|
195
|
-
scene?.removePendingData(texture);
|
|
196
|
-
if (onError && request) {
|
|
197
|
-
onError(request.status + " " + request.statusText, exception);
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
const internalCallback = (data) => {
|
|
201
|
-
const width = texture.width;
|
|
202
|
-
const faceDataArrays = callback(data);
|
|
203
|
-
if (!faceDataArrays) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
if (mipmapGenerator) {
|
|
207
|
-
const textureType = this._getWebGLTextureType(type);
|
|
208
|
-
let internalFormat = this._getInternalFormat(format);
|
|
209
|
-
const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
|
|
210
|
-
let needConversion = false;
|
|
211
|
-
if (internalFormat === gl.RGB) {
|
|
212
|
-
internalFormat = gl.RGBA;
|
|
213
|
-
needConversion = true;
|
|
214
|
-
}
|
|
215
|
-
this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);
|
|
216
|
-
this._unpackFlipY(false);
|
|
217
|
-
const mipData = mipmapGenerator(faceDataArrays);
|
|
218
|
-
for (let level = 0; level < mipData.length; level++) {
|
|
219
|
-
const mipSize = width >> level;
|
|
220
|
-
for (let faceIndex = 0; faceIndex < 6; faceIndex++) {
|
|
221
|
-
let mipFaceData = mipData[level][faceIndex];
|
|
222
|
-
if (needConversion) {
|
|
223
|
-
mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);
|
|
224
|
-
}
|
|
225
|
-
gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);
|
|
232
|
-
}
|
|
233
|
-
texture.isReady = true;
|
|
234
|
-
// this.resetTextureCache();
|
|
235
|
-
scene?.removePendingData(texture);
|
|
236
|
-
texture.onLoadedObservable.notifyObservers(texture);
|
|
237
|
-
texture.onLoadedObservable.clear();
|
|
238
|
-
if (onLoad) {
|
|
239
|
-
onLoad();
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
this._loadFile(url, (data) => {
|
|
243
|
-
internalCallback(data);
|
|
244
|
-
}, undefined, scene?.offlineProvider, true, onerror);
|
|
245
|
-
return texture;
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* @internal
|
|
249
|
-
*/
|
|
250
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
251
|
-
function _convertRGBtoRGBATextureData(rgbData, width, height, textureType) {
|
|
252
|
-
// Create new RGBA data container.
|
|
253
|
-
let rgbaData;
|
|
254
|
-
let val1 = 1;
|
|
255
|
-
if (textureType === Constants.TEXTURETYPE_FLOAT) {
|
|
256
|
-
rgbaData = new Float32Array(width * height * 4);
|
|
257
|
-
}
|
|
258
|
-
else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {
|
|
259
|
-
rgbaData = new Uint16Array(width * height * 4);
|
|
260
|
-
val1 = 15360; // 15360 is the encoding of 1 in half float
|
|
261
|
-
}
|
|
262
|
-
else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {
|
|
263
|
-
rgbaData = new Uint32Array(width * height * 4);
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
rgbaData = new Uint8Array(width * height * 4);
|
|
267
|
-
}
|
|
268
|
-
// Convert each pixel.
|
|
269
|
-
for (let x = 0; x < width; x++) {
|
|
270
|
-
for (let y = 0; y < height; y++) {
|
|
271
|
-
const index = (y * width + x) * 3;
|
|
272
|
-
const newIndex = (y * width + x) * 4;
|
|
273
|
-
// Map Old Value to new value.
|
|
274
|
-
rgbaData[newIndex + 0] = rgbData[index + 0];
|
|
275
|
-
rgbaData[newIndex + 1] = rgbData[index + 1];
|
|
276
|
-
rgbaData[newIndex + 2] = rgbData[index + 2];
|
|
277
|
-
// Add fully opaque alpha channel.
|
|
278
|
-
rgbaData[newIndex + 3] = val1;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return rgbaData;
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Create a function for createRawTexture3D/createRawTexture2DArray
|
|
285
|
-
* @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY
|
|
286
|
-
* @internal
|
|
287
|
-
*/
|
|
288
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
289
|
-
function _makeCreateRawTextureFunction(is3D) {
|
|
290
|
-
return function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = Constants.TEXTURETYPE_UNSIGNED_INT) {
|
|
291
|
-
const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;
|
|
292
|
-
const source = is3D ? 10 /* InternalTextureSource.Raw3D */ : 11 /* InternalTextureSource.Raw2DArray */;
|
|
293
|
-
const texture = new InternalTexture(this, source);
|
|
294
|
-
texture.baseWidth = width;
|
|
295
|
-
texture.baseHeight = height;
|
|
296
|
-
texture.baseDepth = depth;
|
|
297
|
-
texture.width = width;
|
|
298
|
-
texture.height = height;
|
|
299
|
-
texture.depth = depth;
|
|
300
|
-
texture.format = format;
|
|
301
|
-
texture.type = textureType;
|
|
302
|
-
texture.generateMipMaps = generateMipMaps;
|
|
303
|
-
texture.samplingMode = samplingMode;
|
|
304
|
-
if (is3D) {
|
|
305
|
-
texture.is3D = true;
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
texture.is2DArray = true;
|
|
309
|
-
}
|
|
310
|
-
if (!this._doNotHandleContextLost) {
|
|
311
|
-
texture._bufferView = data;
|
|
312
|
-
}
|
|
313
|
-
if (is3D) {
|
|
314
|
-
this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);
|
|
318
|
-
}
|
|
319
|
-
this._bindTextureDirectly(target, texture, true);
|
|
320
|
-
// Filters
|
|
321
|
-
const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
|
|
322
|
-
this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag);
|
|
323
|
-
this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min);
|
|
324
|
-
if (generateMipMaps) {
|
|
325
|
-
this._gl.generateMipmap(target);
|
|
326
|
-
}
|
|
327
|
-
this._bindTextureDirectly(target, null);
|
|
328
|
-
this._internalTexturesCache.push(texture);
|
|
329
|
-
return texture;
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
ThinEngine.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(false);
|
|
333
|
-
ThinEngine.prototype.createRawTexture3D = _makeCreateRawTextureFunction(true);
|
|
334
|
-
/**
|
|
335
|
-
* Create a function for updateRawTexture3D/updateRawTexture2DArray
|
|
336
|
-
* @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY
|
|
337
|
-
* @internal
|
|
338
|
-
*/
|
|
339
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
340
|
-
function _makeUpdateRawTextureFunction(is3D) {
|
|
341
|
-
return function (texture, data, format, invertY, compression = null, textureType = Constants.TEXTURETYPE_UNSIGNED_INT) {
|
|
342
|
-
const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;
|
|
343
|
-
const internalType = this._getWebGLTextureType(textureType);
|
|
344
|
-
const internalFormat = this._getInternalFormat(format);
|
|
345
|
-
const internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
|
|
346
|
-
this._bindTextureDirectly(target, texture, true);
|
|
347
|
-
this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);
|
|
348
|
-
if (!this._doNotHandleContextLost) {
|
|
349
|
-
texture._bufferView = data;
|
|
350
|
-
texture.format = format;
|
|
351
|
-
texture.invertY = invertY;
|
|
352
|
-
texture._compression = compression;
|
|
353
|
-
}
|
|
354
|
-
if (texture.width % 4 !== 0) {
|
|
355
|
-
this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);
|
|
356
|
-
}
|
|
357
|
-
if (compression && data) {
|
|
358
|
-
this._gl.compressedTexImage3D(target, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
|
|
362
|
-
}
|
|
363
|
-
if (texture.generateMipMaps) {
|
|
364
|
-
this._gl.generateMipmap(target);
|
|
365
|
-
}
|
|
366
|
-
this._bindTextureDirectly(target, null);
|
|
367
|
-
// this.resetTextureCache();
|
|
368
|
-
texture.isReady = true;
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
ThinEngine.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(false);
|
|
372
|
-
ThinEngine.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(true);
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Raw texture can help creating a texture directly from an array of data.
|
|
376
|
-
* This can be super useful if you either get the data from an uncompressed source or
|
|
377
|
-
* if you wish to create your texture pixel by pixel.
|
|
378
|
-
*/
|
|
379
|
-
class RawTexture extends Texture {
|
|
380
|
-
/**
|
|
381
|
-
* Instantiates a new RawTexture.
|
|
382
|
-
* Raw texture can help creating a texture directly from an array of data.
|
|
383
|
-
* This can be super useful if you either get the data from an uncompressed source or
|
|
384
|
-
* if you wish to create your texture pixel by pixel.
|
|
385
|
-
* @param data define the array of data to use to create the texture (null to create an empty texture)
|
|
386
|
-
* @param width define the width of the texture
|
|
387
|
-
* @param height define the height of the texture
|
|
388
|
-
* @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
|
|
389
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
390
|
-
* @param generateMipMaps define whether mip maps should be generated or not
|
|
391
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
392
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
393
|
-
* @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
|
|
394
|
-
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
395
|
-
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
396
|
-
*/
|
|
397
|
-
constructor(data, width, height,
|
|
398
|
-
/**
|
|
399
|
-
* Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
|
|
400
|
-
*/
|
|
401
|
-
format, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_UNSIGNED_INT, creationFlags, useSRGBBuffer) {
|
|
402
|
-
super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);
|
|
403
|
-
this.format = format;
|
|
404
|
-
if (!this._engine) {
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {
|
|
408
|
-
samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;
|
|
409
|
-
}
|
|
410
|
-
if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {
|
|
411
|
-
samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;
|
|
412
|
-
}
|
|
413
|
-
this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);
|
|
414
|
-
this.wrapU = Texture.CLAMP_ADDRESSMODE;
|
|
415
|
-
this.wrapV = Texture.CLAMP_ADDRESSMODE;
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Updates the texture underlying data.
|
|
419
|
-
* @param data Define the new data of the texture
|
|
420
|
-
*/
|
|
421
|
-
update(data) {
|
|
422
|
-
this._getEngine().updateRawTexture(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type, this._texture._useSRGBBuffer);
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Clones the texture.
|
|
426
|
-
* @returns the cloned texture
|
|
427
|
-
*/
|
|
428
|
-
clone() {
|
|
429
|
-
if (!this._texture) {
|
|
430
|
-
return super.clone();
|
|
431
|
-
}
|
|
432
|
-
const rawTexture = new RawTexture(null, this.getSize().width, this.getSize().height, this.format, this.getScene(), this._texture.generateMipMaps, this._invertY, this.samplingMode, this._texture.type, this._texture._creationFlags, this._useSRGBBuffer);
|
|
433
|
-
rawTexture._texture = this._texture;
|
|
434
|
-
this._texture.incrementReferences();
|
|
435
|
-
return rawTexture;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Creates a luminance texture from some data.
|
|
439
|
-
* @param data Define the texture data
|
|
440
|
-
* @param width Define the width of the texture
|
|
441
|
-
* @param height Define the height of the texture
|
|
442
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
443
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
444
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
445
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
446
|
-
* @returns the luminance texture
|
|
447
|
-
*/
|
|
448
|
-
static CreateLuminanceTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE) {
|
|
449
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Creates a luminance alpha texture from some data.
|
|
453
|
-
* @param data Define the texture data
|
|
454
|
-
* @param width Define the width of the texture
|
|
455
|
-
* @param height Define the height of the texture
|
|
456
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
457
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
458
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
459
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
460
|
-
* @returns the luminance alpha texture
|
|
461
|
-
*/
|
|
462
|
-
static CreateLuminanceAlphaTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE) {
|
|
463
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Creates an alpha texture from some data.
|
|
467
|
-
* @param data Define the texture data
|
|
468
|
-
* @param width Define the width of the texture
|
|
469
|
-
* @param height Define the height of the texture
|
|
470
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
471
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
472
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
473
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
474
|
-
* @returns the alpha texture
|
|
475
|
-
*/
|
|
476
|
-
static CreateAlphaTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE) {
|
|
477
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Creates a RGB texture from some data.
|
|
481
|
-
* @param data Define the texture data
|
|
482
|
-
* @param width Define the width of the texture
|
|
483
|
-
* @param height Define the height of the texture
|
|
484
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
485
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
486
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
487
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
488
|
-
* @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
|
|
489
|
-
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
490
|
-
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
491
|
-
* @returns the RGB alpha texture
|
|
492
|
-
*/
|
|
493
|
-
static CreateRGBTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_UNSIGNED_INT, creationFlags = 0, useSRGBBuffer = false) {
|
|
494
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Creates a RGBA texture from some data.
|
|
498
|
-
* @param data Define the texture data
|
|
499
|
-
* @param width Define the width of the texture
|
|
500
|
-
* @param height Define the height of the texture
|
|
501
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
502
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
503
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
504
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
505
|
-
* @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
|
|
506
|
-
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
507
|
-
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
508
|
-
* @returns the RGBA texture
|
|
509
|
-
*/
|
|
510
|
-
static CreateRGBATexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_UNSIGNED_INT, creationFlags = 0, useSRGBBuffer = false) {
|
|
511
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* Creates a RGBA storage texture from some data.
|
|
515
|
-
* @param data Define the texture data
|
|
516
|
-
* @param width Define the width of the texture
|
|
517
|
-
* @param height Define the height of the texture
|
|
518
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
519
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
520
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
521
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
522
|
-
* @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
|
|
523
|
-
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
524
|
-
* @returns the RGBA texture
|
|
525
|
-
*/
|
|
526
|
-
static CreateRGBAStorageTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_UNSIGNED_INT, useSRGBBuffer = false) {
|
|
527
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE, useSRGBBuffer);
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Creates a R texture from some data.
|
|
531
|
-
* @param data Define the texture data
|
|
532
|
-
* @param width Define the width of the texture
|
|
533
|
-
* @param height Define the height of the texture
|
|
534
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
535
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
536
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
537
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
538
|
-
* @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
|
|
539
|
-
* @returns the R texture
|
|
540
|
-
*/
|
|
541
|
-
static CreateRTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_FLOAT) {
|
|
542
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* Creates a R storage texture from some data.
|
|
546
|
-
* @param data Define the texture data
|
|
547
|
-
* @param width Define the width of the texture
|
|
548
|
-
* @param height Define the height of the texture
|
|
549
|
-
* @param sceneOrEngine defines the scene or engine the texture will belong to
|
|
550
|
-
* @param generateMipMaps Define whether or not to create mip maps for the texture
|
|
551
|
-
* @param invertY define if the data should be flipped on Y when uploaded to the GPU
|
|
552
|
-
* @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
|
|
553
|
-
* @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
|
|
554
|
-
* @returns the R texture
|
|
555
|
-
*/
|
|
556
|
-
static CreateRStorageTexture(data, width, height, sceneOrEngine, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, type = Constants.TEXTURETYPE_FLOAT) {
|
|
557
|
-
return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
export { RawTexture as R };
|
|
562
|
-
//# sourceMappingURL=rawTexture-BTLHgkBf.esm.js.map
|