@babylonjs/viewer 7.40.0 → 7.40.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/assets/photoStudio.env +0 -0
  2. package/dist/babylon-viewer.esm.js +2 -0
  3. package/dist/babylon-viewer.esm.js.map +1 -0
  4. package/dist/babylon-viewer.esm.min.js +2 -0
  5. package/dist/babylon-viewer.esm.min.js.map +1 -0
  6. package/dist/chunks/EXT_lights_ies-gxFyrTPG.esm.min.js +2 -0
  7. package/dist/chunks/EXT_lights_ies-gxFyrTPG.esm.min.js.map +1 -0
  8. package/dist/chunks/EXT_lights_ies-pE68tmBj.esm.js +84 -0
  9. package/dist/chunks/EXT_lights_ies-pE68tmBj.esm.js.map +1 -0
  10. package/dist/chunks/EXT_lights_image_based-B8Oal0Ur.esm.min.js +2 -0
  11. package/dist/chunks/EXT_lights_image_based-B8Oal0Ur.esm.min.js.map +1 -0
  12. package/dist/chunks/EXT_lights_image_based-CmP_ZGlF.esm.js +171 -0
  13. package/dist/chunks/EXT_lights_image_based-CmP_ZGlF.esm.js.map +1 -0
  14. package/dist/chunks/EXT_mesh_gpu_instancing-DSFpOud_.esm.min.js +2 -0
  15. package/dist/chunks/EXT_mesh_gpu_instancing-DSFpOud_.esm.min.js.map +1 -0
  16. package/dist/chunks/EXT_mesh_gpu_instancing-DksAVeyV.esm.js +86 -0
  17. package/dist/chunks/EXT_mesh_gpu_instancing-DksAVeyV.esm.js.map +1 -0
  18. package/dist/chunks/EXT_meshopt_compression-CNUItnkN.esm.min.js +2 -0
  19. package/dist/chunks/EXT_meshopt_compression-CNUItnkN.esm.min.js.map +1 -0
  20. package/dist/chunks/EXT_meshopt_compression-CeM-AELC.esm.js +134 -0
  21. package/dist/chunks/EXT_meshopt_compression-CeM-AELC.esm.js.map +1 -0
  22. package/dist/chunks/EXT_texture_avif-BWOJV_Yf.esm.js +44 -0
  23. package/dist/chunks/EXT_texture_avif-BWOJV_Yf.esm.js.map +1 -0
  24. package/dist/chunks/EXT_texture_avif-CSTfqZHT.esm.min.js +2 -0
  25. package/dist/chunks/EXT_texture_avif-CSTfqZHT.esm.min.js.map +1 -0
  26. package/dist/chunks/EXT_texture_webp-4Pxv5jC9.esm.min.js +2 -0
  27. package/dist/chunks/EXT_texture_webp-4Pxv5jC9.esm.min.js.map +1 -0
  28. package/dist/chunks/EXT_texture_webp-C9og1YZL.esm.js +43 -0
  29. package/dist/chunks/EXT_texture_webp-C9og1YZL.esm.js.map +1 -0
  30. package/dist/chunks/ExtrasAsMetadata-BmFy6ZgN.esm.js +64 -0
  31. package/dist/chunks/ExtrasAsMetadata-BmFy6ZgN.esm.js.map +1 -0
  32. package/dist/chunks/ExtrasAsMetadata-BwYwFtj7.esm.min.js +2 -0
  33. package/dist/chunks/ExtrasAsMetadata-BwYwFtj7.esm.min.js.map +1 -0
  34. package/dist/chunks/KHR_animation_pointer-BM2iOlKg.esm.js +352 -0
  35. package/dist/chunks/KHR_animation_pointer-BM2iOlKg.esm.js.map +1 -0
  36. package/dist/chunks/KHR_animation_pointer-C7FvhqL3.esm.min.js +2 -0
  37. package/dist/chunks/KHR_animation_pointer-C7FvhqL3.esm.min.js.map +1 -0
  38. package/dist/chunks/KHR_draco_mesh_compression-BocaEHGh.esm.js +617 -0
  39. package/dist/chunks/KHR_draco_mesh_compression-BocaEHGh.esm.js.map +1 -0
  40. package/dist/chunks/KHR_draco_mesh_compression-CjRCmIUz.esm.min.js +2 -0
  41. package/dist/chunks/KHR_draco_mesh_compression-CjRCmIUz.esm.min.js.map +1 -0
  42. package/dist/chunks/KHR_interactivity-C_ndoQHo.esm.min.js +2 -0
  43. package/dist/chunks/KHR_interactivity-C_ndoQHo.esm.min.js.map +1 -0
  44. package/dist/chunks/KHR_interactivity-ClHXW_8S.esm.js +4033 -0
  45. package/dist/chunks/KHR_interactivity-ClHXW_8S.esm.js.map +1 -0
  46. package/dist/chunks/KHR_lights_punctual-D0u7ZFj4.esm.js +581 -0
  47. package/dist/chunks/KHR_lights_punctual-D0u7ZFj4.esm.js.map +1 -0
  48. package/dist/chunks/KHR_lights_punctual-Z509RdIo.esm.min.js +2 -0
  49. package/dist/chunks/KHR_lights_punctual-Z509RdIo.esm.min.js.map +1 -0
  50. package/dist/chunks/KHR_materials_anisotropy-Dz4vBqG3.esm.min.js +2 -0
  51. package/dist/chunks/KHR_materials_anisotropy-Dz4vBqG3.esm.min.js.map +1 -0
  52. package/dist/chunks/KHR_materials_anisotropy-VuLS4v3P.esm.js +65 -0
  53. package/dist/chunks/KHR_materials_anisotropy-VuLS4v3P.esm.js.map +1 -0
  54. package/dist/chunks/KHR_materials_clearcoat-DM7vCrC3.esm.min.js +2 -0
  55. package/dist/chunks/KHR_materials_clearcoat-DM7vCrC3.esm.min.js.map +1 -0
  56. package/dist/chunks/KHR_materials_clearcoat-Dt0nQ5Ky.esm.js +96 -0
  57. package/dist/chunks/KHR_materials_clearcoat-Dt0nQ5Ky.esm.js.map +1 -0
  58. package/dist/chunks/KHR_materials_diffuse_transmission-1Pa4ScwD.esm.min.js +2 -0
  59. package/dist/chunks/KHR_materials_diffuse_transmission-1Pa4ScwD.esm.min.js.map +1 -0
  60. package/dist/chunks/KHR_materials_diffuse_transmission-DIUHVeOQ.esm.js +97 -0
  61. package/dist/chunks/KHR_materials_diffuse_transmission-DIUHVeOQ.esm.js.map +1 -0
  62. package/dist/chunks/KHR_materials_dispersion-CMpGZsUw.esm.min.js +2 -0
  63. package/dist/chunks/KHR_materials_dispersion-CMpGZsUw.esm.min.js.map +1 -0
  64. package/dist/chunks/KHR_materials_dispersion-CeSj8nUI.esm.js +62 -0
  65. package/dist/chunks/KHR_materials_dispersion-CeSj8nUI.esm.js.map +1 -0
  66. package/dist/chunks/KHR_materials_emissive_strength-CQQX31qK.esm.js +55 -0
  67. package/dist/chunks/KHR_materials_emissive_strength-CQQX31qK.esm.js.map +1 -0
  68. package/dist/chunks/KHR_materials_emissive_strength-DH4A4kIp.esm.min.js +2 -0
  69. package/dist/chunks/KHR_materials_emissive_strength-DH4A4kIp.esm.min.js.map +1 -0
  70. package/dist/chunks/KHR_materials_ior-BTU1gw-j.esm.js +64 -0
  71. package/dist/chunks/KHR_materials_ior-BTU1gw-j.esm.js.map +1 -0
  72. package/dist/chunks/KHR_materials_ior-DyzPdK6b.esm.min.js +2 -0
  73. package/dist/chunks/KHR_materials_ior-DyzPdK6b.esm.min.js.map +1 -0
  74. package/dist/chunks/KHR_materials_iridescence-8ZgbULX5.esm.min.js +2 -0
  75. package/dist/chunks/KHR_materials_iridescence-8ZgbULX5.esm.min.js.map +1 -0
  76. package/dist/chunks/KHR_materials_iridescence-D2HCEadq.esm.js +72 -0
  77. package/dist/chunks/KHR_materials_iridescence-D2HCEadq.esm.js.map +1 -0
  78. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C4K79VpA.esm.min.js +2 -0
  79. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-C4K79VpA.esm.min.js.map +1 -0
  80. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DtJVJ-gl.esm.js +81 -0
  81. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DtJVJ-gl.esm.js.map +1 -0
  82. package/dist/chunks/KHR_materials_sheen-CT4KjW_v.esm.js +85 -0
  83. package/dist/chunks/KHR_materials_sheen-CT4KjW_v.esm.js.map +1 -0
  84. package/dist/chunks/KHR_materials_sheen-DQt5abo-.esm.min.js +2 -0
  85. package/dist/chunks/KHR_materials_sheen-DQt5abo-.esm.min.js.map +1 -0
  86. package/dist/chunks/KHR_materials_specular-CCvL1awH.esm.min.js +2 -0
  87. package/dist/chunks/KHR_materials_specular-CCvL1awH.esm.min.js.map +1 -0
  88. package/dist/chunks/KHR_materials_specular-CgLKBQCa.esm.js +75 -0
  89. package/dist/chunks/KHR_materials_specular-CgLKBQCa.esm.js.map +1 -0
  90. package/dist/chunks/KHR_materials_transmission-B64oDwox.esm.js +307 -0
  91. package/dist/chunks/KHR_materials_transmission-B64oDwox.esm.js.map +1 -0
  92. package/dist/chunks/KHR_materials_transmission-C6yPYKde.esm.min.js +2 -0
  93. package/dist/chunks/KHR_materials_transmission-C6yPYKde.esm.min.js.map +1 -0
  94. package/dist/chunks/KHR_materials_unlit-BGPDq328.esm.js +74 -0
  95. package/dist/chunks/KHR_materials_unlit-BGPDq328.esm.js.map +1 -0
  96. package/dist/chunks/KHR_materials_unlit-Sz3qCEGr.esm.min.js +2 -0
  97. package/dist/chunks/KHR_materials_unlit-Sz3qCEGr.esm.min.js.map +1 -0
  98. package/dist/chunks/KHR_materials_variants-Cqw7xft3.esm.min.js +2 -0
  99. package/dist/chunks/KHR_materials_variants-Cqw7xft3.esm.min.js.map +1 -0
  100. package/dist/chunks/KHR_materials_variants-D7rYTNoB.esm.js +262 -0
  101. package/dist/chunks/KHR_materials_variants-D7rYTNoB.esm.js.map +1 -0
  102. package/dist/chunks/KHR_materials_volume-BBsNt0LM.esm.js +87 -0
  103. package/dist/chunks/KHR_materials_volume-BBsNt0LM.esm.js.map +1 -0
  104. package/dist/chunks/KHR_materials_volume-DfWO7kG_.esm.min.js +2 -0
  105. package/dist/chunks/KHR_materials_volume-DfWO7kG_.esm.min.js.map +1 -0
  106. package/dist/chunks/KHR_mesh_quantization-BiDGkiGh.esm.min.js +2 -0
  107. package/dist/chunks/KHR_mesh_quantization-BiDGkiGh.esm.min.js.map +1 -0
  108. package/dist/chunks/KHR_mesh_quantization-fE1qitjF.esm.js +26 -0
  109. package/dist/chunks/KHR_mesh_quantization-fE1qitjF.esm.js.map +1 -0
  110. package/dist/chunks/KHR_node_hoverability-DaOK-Y48.esm.min.js +2 -0
  111. package/dist/chunks/KHR_node_hoverability-DaOK-Y48.esm.min.js.map +1 -0
  112. package/dist/chunks/KHR_node_hoverability-glogCdHq.esm.js +39 -0
  113. package/dist/chunks/KHR_node_hoverability-glogCdHq.esm.js.map +1 -0
  114. package/dist/chunks/KHR_node_visibility-BCVXn2la.esm.min.js +2 -0
  115. package/dist/chunks/KHR_node_visibility-BCVXn2la.esm.min.js.map +1 -0
  116. package/dist/chunks/KHR_node_visibility-CCfVtnan.esm.js +46 -0
  117. package/dist/chunks/KHR_node_visibility-CCfVtnan.esm.js.map +1 -0
  118. package/dist/chunks/KHR_texture_basisu-_cpZJuOo.esm.min.js +2 -0
  119. package/dist/chunks/KHR_texture_basisu-_cpZJuOo.esm.min.js.map +1 -0
  120. package/dist/chunks/KHR_texture_basisu-nhRrTq0b.esm.js +43 -0
  121. package/dist/chunks/KHR_texture_basisu-nhRrTq0b.esm.js.map +1 -0
  122. package/dist/chunks/KHR_texture_transform-AgI_J0Ru.esm.js +63 -0
  123. package/dist/chunks/KHR_texture_transform-AgI_J0Ru.esm.js.map +1 -0
  124. package/dist/chunks/KHR_texture_transform-CgcA7bhJ.esm.min.js +2 -0
  125. package/dist/chunks/KHR_texture_transform-CgcA7bhJ.esm.min.js.map +1 -0
  126. package/dist/chunks/KHR_xmp_json_ld-C37VZwlU.esm.min.js +2 -0
  127. package/dist/chunks/KHR_xmp_json_ld-C37VZwlU.esm.min.js.map +1 -0
  128. package/dist/chunks/KHR_xmp_json_ld-Cm4z6qFH.esm.js +51 -0
  129. package/dist/chunks/KHR_xmp_json_ld-Cm4z6qFH.esm.js.map +1 -0
  130. package/dist/chunks/MSFT_audio_emitter-4EFTMS8D.esm.js +2207 -0
  131. package/dist/chunks/MSFT_audio_emitter-4EFTMS8D.esm.js.map +1 -0
  132. package/dist/chunks/MSFT_audio_emitter-Czn1DAbD.esm.min.js +2 -0
  133. package/dist/chunks/MSFT_audio_emitter-Czn1DAbD.esm.min.js.map +1 -0
  134. package/dist/chunks/MSFT_lod-Bn4FnO5A.esm.js +337 -0
  135. package/dist/chunks/MSFT_lod-Bn4FnO5A.esm.js.map +1 -0
  136. package/dist/chunks/MSFT_lod-DDB-SKXR.esm.min.js +2 -0
  137. package/dist/chunks/MSFT_lod-DDB-SKXR.esm.min.js.map +1 -0
  138. package/dist/chunks/MSFT_minecraftMesh-APRwcxWb.esm.min.js +2 -0
  139. package/dist/chunks/MSFT_minecraftMesh-APRwcxWb.esm.min.js.map +1 -0
  140. package/dist/chunks/MSFT_minecraftMesh-DPvby_FZ.esm.js +46 -0
  141. package/dist/chunks/MSFT_minecraftMesh-DPvby_FZ.esm.js.map +1 -0
  142. package/dist/chunks/MSFT_sRGBFactors-D33sXFGi.esm.js +47 -0
  143. package/dist/chunks/MSFT_sRGBFactors-D33sXFGi.esm.js.map +1 -0
  144. package/dist/chunks/MSFT_sRGBFactors-OsUqZSue.esm.min.js +2 -0
  145. package/dist/chunks/MSFT_sRGBFactors-OsUqZSue.esm.min.js.map +1 -0
  146. package/dist/chunks/animationGroup-BR3zskS8.esm.js +2482 -0
  147. package/dist/chunks/animationGroup-BR3zskS8.esm.js.map +1 -0
  148. package/dist/chunks/animationGroup-ChIp5GuO.esm.min.js +2 -0
  149. package/dist/chunks/animationGroup-ChIp5GuO.esm.min.js.map +1 -0
  150. package/dist/chunks/assetContainer-DLSDgjTx.esm.min.js +2 -0
  151. package/dist/chunks/assetContainer-DLSDgjTx.esm.min.js.map +1 -0
  152. package/dist/chunks/assetContainer-cm8rvay3.esm.js +1720 -0
  153. package/dist/chunks/assetContainer-cm8rvay3.esm.js.map +1 -0
  154. package/dist/chunks/audioEngine-Cx5dB73O.esm.js +305 -0
  155. package/dist/chunks/audioEngine-Cx5dB73O.esm.js.map +1 -0
  156. package/dist/chunks/audioEngine-hKZ2m0jY.esm.min.js +2 -0
  157. package/dist/chunks/audioEngine-hKZ2m0jY.esm.min.js.map +1 -0
  158. package/dist/chunks/bakedVertexAnimation-BCUFE4CP.esm.min.js +2 -0
  159. package/dist/chunks/bakedVertexAnimation-BCUFE4CP.esm.min.js.map +1 -0
  160. package/dist/chunks/bakedVertexAnimation-ByPKjjzz.esm.js +114 -0
  161. package/dist/chunks/bakedVertexAnimation-ByPKjjzz.esm.js.map +1 -0
  162. package/dist/chunks/basisTextureLoader-BIqCbGFg.esm.min.js +2 -0
  163. package/dist/chunks/basisTextureLoader-BIqCbGFg.esm.min.js.map +1 -0
  164. package/dist/chunks/basisTextureLoader-CT8X4ynA.esm.js +600 -0
  165. package/dist/chunks/basisTextureLoader-CT8X4ynA.esm.js.map +1 -0
  166. package/dist/chunks/dds-BDOPTCsA.esm.min.js +2 -0
  167. package/dist/chunks/dds-BDOPTCsA.esm.min.js.map +1 -0
  168. package/dist/chunks/dds-BYrGO6eI.esm.js +540 -0
  169. package/dist/chunks/dds-BYrGO6eI.esm.js.map +1 -0
  170. package/dist/chunks/ddsTextureLoader-BbrffKmM.esm.min.js +2 -0
  171. package/dist/chunks/ddsTextureLoader-BbrffKmM.esm.min.js.map +1 -0
  172. package/dist/chunks/ddsTextureLoader-C36kkIBH.esm.js +88 -0
  173. package/dist/chunks/ddsTextureLoader-C36kkIBH.esm.js.map +1 -0
  174. package/dist/chunks/decalFragment-07cq9QvS.esm.min.js +2 -0
  175. package/dist/chunks/decalFragment-07cq9QvS.esm.min.js.map +1 -0
  176. package/dist/chunks/decalFragment-B16Nfnl3.esm.js +18 -0
  177. package/dist/chunks/decalFragment-B16Nfnl3.esm.js.map +1 -0
  178. package/dist/chunks/default.fragment-BkjbMxBE.esm.min.js +2 -0
  179. package/dist/chunks/default.fragment-BkjbMxBE.esm.min.js.map +1 -0
  180. package/dist/chunks/default.fragment-C-8jVS2k.esm.min.js +2 -0
  181. package/dist/chunks/default.fragment-C-8jVS2k.esm.min.js.map +1 -0
  182. package/dist/chunks/default.fragment-C3Pectqi.esm.js +515 -0
  183. package/dist/chunks/default.fragment-C3Pectqi.esm.js.map +1 -0
  184. package/dist/chunks/default.fragment-D3LhG5le.esm.js +446 -0
  185. package/dist/chunks/default.fragment-D3LhG5le.esm.js.map +1 -0
  186. package/dist/chunks/default.vertex-CPx_2Z0S.esm.js +181 -0
  187. package/dist/chunks/default.vertex-CPx_2Z0S.esm.js.map +1 -0
  188. package/dist/chunks/default.vertex-CVMUuXku.esm.js +202 -0
  189. package/dist/chunks/default.vertex-CVMUuXku.esm.js.map +1 -0
  190. package/dist/chunks/default.vertex-CbVQZVXB.esm.min.js +2 -0
  191. package/dist/chunks/default.vertex-CbVQZVXB.esm.min.js.map +1 -0
  192. package/dist/chunks/default.vertex-S3Wv9p0Q.esm.min.js +2 -0
  193. package/dist/chunks/default.vertex-S3Wv9p0Q.esm.min.js.map +1 -0
  194. package/dist/chunks/defaultUboDeclaration-BdxOUPT0.esm.min.js +2 -0
  195. package/dist/chunks/defaultUboDeclaration-BdxOUPT0.esm.min.js.map +1 -0
  196. package/dist/chunks/defaultUboDeclaration-CUaZKOKG.esm.min.js +2 -0
  197. package/dist/chunks/defaultUboDeclaration-CUaZKOKG.esm.min.js.map +1 -0
  198. package/dist/chunks/defaultUboDeclaration-DdcmVbYg.esm.js +15 -0
  199. package/dist/chunks/defaultUboDeclaration-DdcmVbYg.esm.js.map +1 -0
  200. package/dist/chunks/defaultUboDeclaration-rLhenj1H.esm.js +13 -0
  201. package/dist/chunks/defaultUboDeclaration-rLhenj1H.esm.js.map +1 -0
  202. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
  203. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
  204. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
  205. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
  206. package/dist/chunks/dumpTools-CPmY0U7D.esm.js +200 -0
  207. package/dist/chunks/dumpTools-CPmY0U7D.esm.js.map +1 -0
  208. package/dist/chunks/dumpTools-DVDwJ2sz.esm.min.js +2 -0
  209. package/dist/chunks/dumpTools-DVDwJ2sz.esm.min.js.map +1 -0
  210. package/dist/chunks/engine-BqSrdURz.esm.min.js +2 -0
  211. package/dist/chunks/engine-BqSrdURz.esm.min.js.map +1 -0
  212. package/dist/chunks/engine-D_GgT2Nf.esm.js +2216 -0
  213. package/dist/chunks/engine-D_GgT2Nf.esm.js.map +1 -0
  214. package/dist/chunks/engine.common-CN1Lug5p.esm.js +1162 -0
  215. package/dist/chunks/engine.common-CN1Lug5p.esm.js.map +1 -0
  216. package/dist/chunks/engine.common-DgiXKhLy.esm.min.js +2 -0
  217. package/dist/chunks/engine.common-DgiXKhLy.esm.min.js.map +1 -0
  218. package/dist/chunks/envTextureLoader-BORNR9vu.esm.min.js +2 -0
  219. package/dist/chunks/envTextureLoader-BORNR9vu.esm.min.js.map +1 -0
  220. package/dist/chunks/envTextureLoader-DHwsXTfw.esm.js +64 -0
  221. package/dist/chunks/envTextureLoader-DHwsXTfw.esm.js.map +1 -0
  222. package/dist/chunks/environmentTextureTools-B2vnsFq-.esm.js +382 -0
  223. package/dist/chunks/environmentTextureTools-B2vnsFq-.esm.js.map +1 -0
  224. package/dist/chunks/environmentTextureTools-BYQHZH-c.esm.min.js +2 -0
  225. package/dist/chunks/environmentTextureTools-BYQHZH-c.esm.min.js.map +1 -0
  226. package/dist/chunks/exrTextureLoader-B8FQohBr.esm.js +1683 -0
  227. package/dist/chunks/exrTextureLoader-B8FQohBr.esm.js.map +1 -0
  228. package/dist/chunks/exrTextureLoader-D8xP0GLQ.esm.min.js +2 -0
  229. package/dist/chunks/exrTextureLoader-D8xP0GLQ.esm.min.js.map +1 -0
  230. package/dist/chunks/fogFragment-5YT33bDn.esm.js +102 -0
  231. package/dist/chunks/fogFragment-5YT33bDn.esm.js.map +1 -0
  232. package/dist/chunks/fogFragment-BOBZ2KwN.esm.min.js +2 -0
  233. package/dist/chunks/fogFragment-BOBZ2KwN.esm.min.js.map +1 -0
  234. package/dist/chunks/fogFragment-CLENZGuB.esm.js +101 -0
  235. package/dist/chunks/fogFragment-CLENZGuB.esm.js.map +1 -0
  236. package/dist/chunks/fogFragment-D9dudohA.esm.min.js +2 -0
  237. package/dist/chunks/fogFragment-D9dudohA.esm.min.js.map +1 -0
  238. package/dist/chunks/fresnelFunction-BkO99b6C.esm.js +12 -0
  239. package/dist/chunks/fresnelFunction-BkO99b6C.esm.js.map +1 -0
  240. package/dist/chunks/fresnelFunction-CqiLsMCu.esm.min.js +2 -0
  241. package/dist/chunks/fresnelFunction-CqiLsMCu.esm.min.js.map +1 -0
  242. package/dist/chunks/glTFLoader-CkL-dxBD.esm.min.js +2 -0
  243. package/dist/chunks/glTFLoader-CkL-dxBD.esm.min.js.map +1 -0
  244. package/dist/chunks/glTFLoader-IEHRfiUn.esm.js +7586 -0
  245. package/dist/chunks/glTFLoader-IEHRfiUn.esm.js.map +1 -0
  246. package/dist/chunks/glTFLoaderAnimation-CV32Nmqb.esm.js +77 -0
  247. package/dist/chunks/glTFLoaderAnimation-CV32Nmqb.esm.js.map +1 -0
  248. package/dist/chunks/glTFLoaderAnimation-Cq2ziV9o.esm.min.js +2 -0
  249. package/dist/chunks/glTFLoaderAnimation-Cq2ziV9o.esm.min.js.map +1 -0
  250. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
  251. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
  252. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
  253. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
  254. package/dist/chunks/harmonicsFunctions-B5QCEZvF.esm.js +34 -0
  255. package/dist/chunks/harmonicsFunctions-B5QCEZvF.esm.js.map +1 -0
  256. package/dist/chunks/harmonicsFunctions-BxLCgoIQ.esm.min.js +2 -0
  257. package/dist/chunks/harmonicsFunctions-BxLCgoIQ.esm.min.js.map +1 -0
  258. package/dist/chunks/harmonicsFunctions-Daxnf8NE.esm.min.js +2 -0
  259. package/dist/chunks/harmonicsFunctions-Daxnf8NE.esm.min.js.map +1 -0
  260. package/dist/chunks/harmonicsFunctions-UzG0C-sm.esm.js +35 -0
  261. package/dist/chunks/harmonicsFunctions-UzG0C-sm.esm.js.map +1 -0
  262. package/dist/chunks/hdrTextureLoader-BpVjKGyb.esm.min.js +2 -0
  263. package/dist/chunks/hdrTextureLoader-BpVjKGyb.esm.min.js.map +1 -0
  264. package/dist/chunks/hdrTextureLoader-DgW8CxRF.esm.js +253 -0
  265. package/dist/chunks/hdrTextureLoader-DgW8CxRF.esm.js.map +1 -0
  266. package/dist/chunks/helperFunctions-BFgvMG5S.esm.min.js +2 -0
  267. package/dist/chunks/helperFunctions-BFgvMG5S.esm.min.js.map +1 -0
  268. package/dist/chunks/helperFunctions-BatAhE6u.esm.js +108 -0
  269. package/dist/chunks/helperFunctions-BatAhE6u.esm.js.map +1 -0
  270. package/dist/chunks/helperFunctions-qECwmiwu.esm.min.js +2 -0
  271. package/dist/chunks/helperFunctions-qECwmiwu.esm.min.js.map +1 -0
  272. package/dist/chunks/helperFunctions-vbA-oTJx.esm.js +80 -0
  273. package/dist/chunks/helperFunctions-vbA-oTJx.esm.js.map +1 -0
  274. package/dist/chunks/iesTextureLoader-Ccd5pvbh.esm.min.js +2 -0
  275. package/dist/chunks/iesTextureLoader-Ccd5pvbh.esm.min.js.map +1 -0
  276. package/dist/chunks/iesTextureLoader-nMYnOfhm.esm.js +189 -0
  277. package/dist/chunks/iesTextureLoader-nMYnOfhm.esm.js.map +1 -0
  278. package/dist/chunks/index-BHIM4QBr.esm.min.js +57 -0
  279. package/dist/chunks/index-BHIM4QBr.esm.min.js.map +1 -0
  280. package/dist/chunks/index-CtkZLm9J.esm.js +74717 -0
  281. package/dist/chunks/index-CtkZLm9J.esm.js.map +1 -0
  282. package/dist/chunks/ktxTextureLoader-CkkvHzY3.esm.js +814 -0
  283. package/dist/chunks/ktxTextureLoader-CkkvHzY3.esm.js.map +1 -0
  284. package/dist/chunks/ktxTextureLoader-CwGlHia2.esm.min.js +2 -0
  285. package/dist/chunks/ktxTextureLoader-CwGlHia2.esm.min.js.map +1 -0
  286. package/dist/chunks/logDepthDeclaration-BiUSPlzz.esm.js +35 -0
  287. package/dist/chunks/logDepthDeclaration-BiUSPlzz.esm.js.map +1 -0
  288. package/dist/chunks/logDepthDeclaration-Bq2fzMbS.esm.js +11 -0
  289. package/dist/chunks/logDepthDeclaration-Bq2fzMbS.esm.js.map +1 -0
  290. package/dist/chunks/logDepthDeclaration-C8DJP16D.esm.min.js +2 -0
  291. package/dist/chunks/logDepthDeclaration-C8DJP16D.esm.min.js.map +1 -0
  292. package/dist/chunks/logDepthDeclaration-DJpvEdPG.esm.min.js +2 -0
  293. package/dist/chunks/logDepthDeclaration-DJpvEdPG.esm.min.js.map +1 -0
  294. package/dist/chunks/logDepthVertex-C00_obGd.esm.min.js +2 -0
  295. package/dist/chunks/logDepthVertex-C00_obGd.esm.min.js.map +1 -0
  296. package/dist/chunks/logDepthVertex-CYIGBMYd.esm.js +77 -0
  297. package/dist/chunks/logDepthVertex-CYIGBMYd.esm.js.map +1 -0
  298. package/dist/chunks/logDepthVertex-CxT8FVOf.esm.js +81 -0
  299. package/dist/chunks/logDepthVertex-CxT8FVOf.esm.js.map +1 -0
  300. package/dist/chunks/logDepthVertex-SyM_Fu5K.esm.min.js +2 -0
  301. package/dist/chunks/logDepthVertex-SyM_Fu5K.esm.min.js.map +1 -0
  302. package/dist/chunks/mainUVVaryingDeclaration-BaIG4IFB.esm.js +11 -0
  303. package/dist/chunks/mainUVVaryingDeclaration-BaIG4IFB.esm.js.map +1 -0
  304. package/dist/chunks/mainUVVaryingDeclaration-CQzOmEIM.esm.min.js +2 -0
  305. package/dist/chunks/mainUVVaryingDeclaration-CQzOmEIM.esm.min.js.map +1 -0
  306. package/dist/chunks/mainUVVaryingDeclaration-D100Qvmm.esm.min.js +2 -0
  307. package/dist/chunks/mainUVVaryingDeclaration-D100Qvmm.esm.min.js.map +1 -0
  308. package/dist/chunks/mainUVVaryingDeclaration-OSD7irdC.esm.js +11 -0
  309. package/dist/chunks/mainUVVaryingDeclaration-OSD7irdC.esm.js.map +1 -0
  310. package/dist/chunks/meshUboDeclaration--wzKOTOT.esm.min.js +2 -0
  311. package/dist/chunks/meshUboDeclaration--wzKOTOT.esm.min.js.map +1 -0
  312. package/dist/chunks/meshUboDeclaration-DIi9ZPDc.esm.js +26 -0
  313. package/dist/chunks/meshUboDeclaration-DIi9ZPDc.esm.js.map +1 -0
  314. package/dist/chunks/objFileLoader-Cda8pwUd.esm.js +1338 -0
  315. package/dist/chunks/objFileLoader-Cda8pwUd.esm.js.map +1 -0
  316. package/dist/chunks/objFileLoader-kzI-pZ8o.esm.min.js +2 -0
  317. package/dist/chunks/objFileLoader-kzI-pZ8o.esm.min.js.map +1 -0
  318. package/dist/chunks/oitFragment-4cP4dKVP.esm.min.js +2 -0
  319. package/dist/chunks/oitFragment-4cP4dKVP.esm.min.js.map +1 -0
  320. package/dist/chunks/oitFragment-Bz1w36ia.esm.js +1078 -0
  321. package/dist/chunks/oitFragment-Bz1w36ia.esm.js.map +1 -0
  322. package/dist/chunks/oitFragment-DUkW-kmb.esm.min.js +2 -0
  323. package/dist/chunks/oitFragment-DUkW-kmb.esm.min.js.map +1 -0
  324. package/dist/chunks/oitFragment-DiuTTpNa.esm.js +1240 -0
  325. package/dist/chunks/oitFragment-DiuTTpNa.esm.js.map +1 -0
  326. package/dist/chunks/pass.fragment-B8l5NRgR.esm.min.js +2 -0
  327. package/dist/chunks/pass.fragment-B8l5NRgR.esm.min.js.map +1 -0
  328. package/dist/chunks/pass.fragment-BF4UEoT8.esm.min.js +2 -0
  329. package/dist/chunks/pass.fragment-BF4UEoT8.esm.min.js.map +1 -0
  330. package/dist/chunks/pass.fragment-CD3_26yo.esm.js +15 -0
  331. package/dist/chunks/pass.fragment-CD3_26yo.esm.js.map +1 -0
  332. package/dist/chunks/pass.fragment-DfeELUEn.esm.js +15 -0
  333. package/dist/chunks/pass.fragment-DfeELUEn.esm.js.map +1 -0
  334. package/dist/chunks/pbr.fragment-BDylAp64.esm.min.js +2 -0
  335. package/dist/chunks/pbr.fragment-BDylAp64.esm.min.js.map +1 -0
  336. package/dist/chunks/pbr.fragment-C1qko419.esm.min.js +2 -0
  337. package/dist/chunks/pbr.fragment-C1qko419.esm.min.js.map +1 -0
  338. package/dist/chunks/pbr.fragment-EBVxSAEQ.esm.js +3232 -0
  339. package/dist/chunks/pbr.fragment-EBVxSAEQ.esm.js.map +1 -0
  340. package/dist/chunks/pbr.fragment-lt62m8b7.esm.js +3273 -0
  341. package/dist/chunks/pbr.fragment-lt62m8b7.esm.js.map +1 -0
  342. package/dist/chunks/pbr.vertex-CGRL_eY2.esm.js +339 -0
  343. package/dist/chunks/pbr.vertex-CGRL_eY2.esm.js.map +1 -0
  344. package/dist/chunks/pbr.vertex-CHv4zeYj.esm.min.js +2 -0
  345. package/dist/chunks/pbr.vertex-CHv4zeYj.esm.min.js.map +1 -0
  346. package/dist/chunks/pbr.vertex-Dk4h9ywZ.esm.min.js +2 -0
  347. package/dist/chunks/pbr.vertex-Dk4h9ywZ.esm.min.js.map +1 -0
  348. package/dist/chunks/pbr.vertex-DopP5mYu.esm.js +214 -0
  349. package/dist/chunks/pbr.vertex-DopP5mYu.esm.js.map +1 -0
  350. package/dist/chunks/postprocess.vertex-Bt30-Flh.esm.min.js +2 -0
  351. package/dist/chunks/postprocess.vertex-Bt30-Flh.esm.min.js.map +1 -0
  352. package/dist/chunks/postprocess.vertex-pLUOpXIY.esm.js +20 -0
  353. package/dist/chunks/postprocess.vertex-pLUOpXIY.esm.js.map +1 -0
  354. package/dist/chunks/rawTexture-78KJgWfq.esm.js +191 -0
  355. package/dist/chunks/rawTexture-78KJgWfq.esm.js.map +1 -0
  356. package/dist/chunks/rawTexture-CCCnj14W.esm.min.js +2 -0
  357. package/dist/chunks/rawTexture-CCCnj14W.esm.min.js.map +1 -0
  358. package/dist/chunks/ray-CfhmGTmj.esm.js +946 -0
  359. package/dist/chunks/ray-CfhmGTmj.esm.js.map +1 -0
  360. package/dist/chunks/ray-Du89cGmz.esm.min.js +2 -0
  361. package/dist/chunks/ray-Du89cGmz.esm.min.js.map +1 -0
  362. package/dist/chunks/rgbdDecode.fragment-BHAQKD_5.esm.js +13 -0
  363. package/dist/chunks/rgbdDecode.fragment-BHAQKD_5.esm.js.map +1 -0
  364. package/dist/chunks/rgbdDecode.fragment-CV6q4aIi.esm.js +13 -0
  365. package/dist/chunks/rgbdDecode.fragment-CV6q4aIi.esm.js.map +1 -0
  366. package/dist/chunks/rgbdDecode.fragment-DEu4F_6T.esm.min.js +2 -0
  367. package/dist/chunks/rgbdDecode.fragment-DEu4F_6T.esm.min.js.map +1 -0
  368. package/dist/chunks/rgbdDecode.fragment-DiJfgZKv.esm.min.js +2 -0
  369. package/dist/chunks/rgbdDecode.fragment-DiJfgZKv.esm.min.js.map +1 -0
  370. package/dist/chunks/rgbdEncode.fragment-CR30N0Mr.esm.js +13 -0
  371. package/dist/chunks/rgbdEncode.fragment-CR30N0Mr.esm.js.map +1 -0
  372. package/dist/chunks/rgbdEncode.fragment-CUE3DGC8.esm.min.js +2 -0
  373. package/dist/chunks/rgbdEncode.fragment-CUE3DGC8.esm.min.js.map +1 -0
  374. package/dist/chunks/rgbdEncode.fragment-DdFs5QJM.esm.js +13 -0
  375. package/dist/chunks/rgbdEncode.fragment-DdFs5QJM.esm.js.map +1 -0
  376. package/dist/chunks/rgbdEncode.fragment-omm81hdD.esm.min.js +2 -0
  377. package/dist/chunks/rgbdEncode.fragment-omm81hdD.esm.min.js.map +1 -0
  378. package/dist/chunks/splatFileLoader-BnaOhITn.esm.js +3379 -0
  379. package/dist/chunks/splatFileLoader-BnaOhITn.esm.js.map +1 -0
  380. package/dist/chunks/splatFileLoader-CuMIDOsR.esm.min.js +2 -0
  381. package/dist/chunks/splatFileLoader-CuMIDOsR.esm.min.js.map +1 -0
  382. package/dist/chunks/spotLight-Ca0-j1Op.esm.js +701 -0
  383. package/dist/chunks/spotLight-Ca0-j1Op.esm.js.map +1 -0
  384. package/dist/chunks/spotLight-DXuSbTaJ.esm.min.js +2 -0
  385. package/dist/chunks/spotLight-DXuSbTaJ.esm.min.js.map +1 -0
  386. package/dist/chunks/standardMaterial-DKyaZtcm.esm.js +1805 -0
  387. package/dist/chunks/standardMaterial-DKyaZtcm.esm.js.map +1 -0
  388. package/dist/chunks/standardMaterial-h3ccobBt.esm.min.js +2 -0
  389. package/dist/chunks/standardMaterial-h3ccobBt.esm.min.js.map +1 -0
  390. package/dist/chunks/stlFileLoader-CDv97liE.esm.js +238 -0
  391. package/dist/chunks/stlFileLoader-CDv97liE.esm.js.map +1 -0
  392. package/dist/chunks/stlFileLoader-e2ImyWaM.esm.min.js +2 -0
  393. package/dist/chunks/stlFileLoader-e2ImyWaM.esm.min.js.map +1 -0
  394. package/dist/chunks/tgaTextureLoader-DJaEph-Q.esm.js +349 -0
  395. package/dist/chunks/tgaTextureLoader-DJaEph-Q.esm.js.map +1 -0
  396. package/dist/chunks/tgaTextureLoader-slv-QvZW.esm.min.js +2 -0
  397. package/dist/chunks/tgaTextureLoader-slv-QvZW.esm.min.js.map +1 -0
  398. package/dist/chunks/thinEngine-Ue9ZAvRK.esm.js +3848 -0
  399. package/dist/chunks/thinEngine-Ue9ZAvRK.esm.js.map +1 -0
  400. package/dist/chunks/thinEngine-pihAbdON.esm.min.js +2 -0
  401. package/dist/chunks/thinEngine-pihAbdON.esm.min.js.map +1 -0
  402. package/dist/chunks/thinInstanceMesh-BgfKoejL.esm.min.js +2 -0
  403. package/dist/chunks/thinInstanceMesh-BgfKoejL.esm.min.js.map +1 -0
  404. package/dist/chunks/thinInstanceMesh-V41szD4h.esm.js +314 -0
  405. package/dist/chunks/thinInstanceMesh-V41szD4h.esm.js.map +1 -0
  406. package/dist/chunks/vertexColorMixing-CZsK7mYP.esm.min.js +2 -0
  407. package/dist/chunks/vertexColorMixing-CZsK7mYP.esm.min.js.map +1 -0
  408. package/dist/chunks/vertexColorMixing-DKVusFas.esm.js +522 -0
  409. package/dist/chunks/vertexColorMixing-DKVusFas.esm.js.map +1 -0
  410. package/dist/chunks/vertexColorMixing-DeZKI8QK.esm.js +412 -0
  411. package/dist/chunks/vertexColorMixing-DeZKI8QK.esm.js.map +1 -0
  412. package/dist/chunks/vertexColorMixing-axGN1U7X.esm.min.js +2 -0
  413. package/dist/chunks/vertexColorMixing-axGN1U7X.esm.min.js.map +1 -0
  414. package/dist/chunks/webgpuEngine-COis70hT.esm.js +11533 -0
  415. package/dist/chunks/webgpuEngine-COis70hT.esm.js.map +1 -0
  416. package/dist/chunks/webgpuEngine-Cx_GlShD.esm.min.js +2 -0
  417. package/dist/chunks/webgpuEngine-Cx_GlShD.esm.min.js.map +1 -0
  418. package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
  419. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
  420. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
  421. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
  422. package/lib/index.d.ts +559 -0
  423. package/lib/index.js +2083 -0
  424. package/lib/index.js.map +1 -0
  425. package/package.json +19 -28
  426. package/readme.md +28 -28
  427. package/configuration/configuration.d.ts +0 -107
  428. package/configuration/configuration.js +0 -16
  429. package/configuration/configuration.js.map +0 -1
  430. package/configuration/configurationCompatibility.d.ts +0 -8
  431. package/configuration/configurationCompatibility.js +0 -66
  432. package/configuration/configurationCompatibility.js.map +0 -1
  433. package/configuration/configurationContainer.d.ts +0 -10
  434. package/configuration/configurationContainer.js +0 -10
  435. package/configuration/configurationContainer.js.map +0 -1
  436. package/configuration/globals.d.ts +0 -6
  437. package/configuration/globals.js +0 -18
  438. package/configuration/globals.js.map +0 -1
  439. package/configuration/index.d.ts +0 -2
  440. package/configuration/index.js +0 -4
  441. package/configuration/index.js.map +0 -1
  442. package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
  443. package/configuration/interfaces/cameraConfiguration.js +0 -2
  444. package/configuration/interfaces/cameraConfiguration.js.map +0 -1
  445. package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
  446. package/configuration/interfaces/colorGradingConfiguration.js +0 -2
  447. package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
  448. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
  449. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
  450. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
  451. package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
  452. package/configuration/interfaces/environmentMapConfiguration.js +0 -2
  453. package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
  454. package/configuration/interfaces/groundConfiguration.d.ts +0 -24
  455. package/configuration/interfaces/groundConfiguration.js +0 -2
  456. package/configuration/interfaces/groundConfiguration.js.map +0 -1
  457. package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
  458. package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
  459. package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
  460. package/configuration/interfaces/index.d.ts +0 -15
  461. package/configuration/interfaces/index.js +0 -16
  462. package/configuration/interfaces/index.js.map +0 -1
  463. package/configuration/interfaces/lightConfiguration.d.ts +0 -60
  464. package/configuration/interfaces/lightConfiguration.js +0 -2
  465. package/configuration/interfaces/lightConfiguration.js.map +0 -1
  466. package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
  467. package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
  468. package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
  469. package/configuration/interfaces/modelConfiguration.d.ts +0 -65
  470. package/configuration/interfaces/modelConfiguration.js +0 -2
  471. package/configuration/interfaces/modelConfiguration.js.map +0 -1
  472. package/configuration/interfaces/observersConfiguration.d.ts +0 -5
  473. package/configuration/interfaces/observersConfiguration.js +0 -2
  474. package/configuration/interfaces/observersConfiguration.js.map +0 -1
  475. package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
  476. package/configuration/interfaces/sceneConfiguration.js +0 -2
  477. package/configuration/interfaces/sceneConfiguration.js.map +0 -1
  478. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
  479. package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
  480. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
  481. package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
  482. package/configuration/interfaces/skyboxConfiguration.js +0 -2
  483. package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
  484. package/configuration/interfaces/templateConfiguration.d.ts +0 -67
  485. package/configuration/interfaces/templateConfiguration.js +0 -2
  486. package/configuration/interfaces/templateConfiguration.js.map +0 -1
  487. package/configuration/interfaces/vrConfiguration.d.ts +0 -16
  488. package/configuration/interfaces/vrConfiguration.js +0 -2
  489. package/configuration/interfaces/vrConfiguration.js.map +0 -1
  490. package/configuration/loader.d.ts +0 -4
  491. package/configuration/loader.js +0 -17
  492. package/configuration/loader.js.map +0 -1
  493. package/configuration/mappers.d.ts +0 -43
  494. package/configuration/mappers.js +0 -193
  495. package/configuration/mappers.js.map +0 -1
  496. package/configuration/renderOnlyLoader.d.ts +0 -33
  497. package/configuration/renderOnlyLoader.js +0 -162
  498. package/configuration/renderOnlyLoader.js.map +0 -1
  499. package/configuration/types/default.d.ts +0 -6
  500. package/configuration/types/default.js +0 -121
  501. package/configuration/types/default.js.map +0 -1
  502. package/configuration/types/environmentMap.d.ts +0 -5
  503. package/configuration/types/environmentMap.js +0 -14
  504. package/configuration/types/environmentMap.js.map +0 -1
  505. package/configuration/types/extended.d.ts +0 -6
  506. package/configuration/types/extended.js +0 -317
  507. package/configuration/types/extended.js.map +0 -1
  508. package/configuration/types/index.d.ts +0 -14
  509. package/configuration/types/index.js +0 -51
  510. package/configuration/types/index.js.map +0 -1
  511. package/configuration/types/minimal.d.ts +0 -6
  512. package/configuration/types/minimal.js +0 -43
  513. package/configuration/types/minimal.js.map +0 -1
  514. package/configuration/types/renderOnlyDefault.d.ts +0 -30
  515. package/configuration/types/renderOnlyDefault.js +0 -31
  516. package/configuration/types/renderOnlyDefault.js.map +0 -1
  517. package/configuration/types/shadowLight.d.ts +0 -9
  518. package/configuration/types/shadowLight.js +0 -64
  519. package/configuration/types/shadowLight.js.map +0 -1
  520. package/helper/index.d.ts +0 -29
  521. package/helper/index.js +0 -66
  522. package/helper/index.js.map +0 -1
  523. package/index.d.ts +0 -30
  524. package/index.js +0 -46
  525. package/index.js.map +0 -1
  526. package/initializer.d.ts +0 -11
  527. package/initializer.js +0 -35
  528. package/initializer.js.map +0 -1
  529. package/interfaces.d.ts +0 -5
  530. package/interfaces.js +0 -7
  531. package/interfaces.js.map +0 -1
  532. package/labs/environmentSerializer.d.ts +0 -126
  533. package/labs/environmentSerializer.js +0 -191
  534. package/labs/environmentSerializer.js.map +0 -1
  535. package/labs/texture.d.ts +0 -183
  536. package/labs/texture.js +0 -351
  537. package/labs/texture.js.map +0 -1
  538. package/labs/viewerLabs.d.ts +0 -51
  539. package/labs/viewerLabs.js +0 -134
  540. package/labs/viewerLabs.js.map +0 -1
  541. package/loader/modelLoader.d.ts +0 -56
  542. package/loader/modelLoader.js +0 -202
  543. package/loader/modelLoader.js.map +0 -1
  544. package/loader/plugins/applyMaterialConfig.d.ts +0 -12
  545. package/loader/plugins/applyMaterialConfig.js +0 -16
  546. package/loader/plugins/applyMaterialConfig.js.map +0 -1
  547. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
  548. package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
  549. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
  550. package/loader/plugins/index.d.ts +0 -19
  551. package/loader/plugins/index.js +0 -44
  552. package/loader/plugins/index.js.map +0 -1
  553. package/loader/plugins/loaderPlugin.d.ts +0 -24
  554. package/loader/plugins/loaderPlugin.js +0 -2
  555. package/loader/plugins/loaderPlugin.js.map +0 -1
  556. package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
  557. package/loader/plugins/msftLodLoaderPlugin.js +0 -21
  558. package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
  559. package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
  560. package/loader/plugins/telemetryLoaderPlugin.js +0 -36
  561. package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
  562. package/managers/observablesManager.d.ts +0 -66
  563. package/managers/observablesManager.js +0 -35
  564. package/managers/observablesManager.js.map +0 -1
  565. package/managers/sceneManager.d.ts +0 -245
  566. package/managers/sceneManager.js +0 -1375
  567. package/managers/sceneManager.js.map +0 -1
  568. package/managers/telemetryManager.d.ts +0 -78
  569. package/managers/telemetryManager.js +0 -117
  570. package/managers/telemetryManager.js.map +0 -1
  571. package/model/modelAnimation.d.ts +0 -215
  572. package/model/modelAnimation.js +0 -237
  573. package/model/modelAnimation.js.map +0 -1
  574. package/model/viewerModel.d.ts +0 -233
  575. package/model/viewerModel.js +0 -673
  576. package/model/viewerModel.js.map +0 -1
  577. package/optimizer/custom/extended.d.ts +0 -13
  578. package/optimizer/custom/extended.js +0 -101
  579. package/optimizer/custom/extended.js.map +0 -1
  580. package/optimizer/custom/index.d.ts +0 -9
  581. package/optimizer/custom/index.js +0 -26
  582. package/optimizer/custom/index.js.map +0 -1
  583. package/renderOnlyIndex.d.ts +0 -11
  584. package/renderOnlyIndex.js +0 -18
  585. package/renderOnlyIndex.js.map +0 -1
  586. package/templating/eventManager.d.ts +0 -35
  587. package/templating/eventManager.js +0 -66
  588. package/templating/eventManager.js.map +0 -1
  589. package/templating/plugins/hdButtonPlugin.d.ts +0 -9
  590. package/templating/plugins/hdButtonPlugin.js +0 -22
  591. package/templating/plugins/hdButtonPlugin.js.map +0 -1
  592. package/templating/plugins/printButton.d.ts +0 -9
  593. package/templating/plugins/printButton.js +0 -41
  594. package/templating/plugins/printButton.js.map +0 -1
  595. package/templating/templateManager.d.ts +0 -197
  596. package/templating/templateManager.js +0 -561
  597. package/templating/templateManager.js.map +0 -1
  598. package/templating/viewerTemplatePlugin.d.ts +0 -21
  599. package/templating/viewerTemplatePlugin.js +0 -69
  600. package/templating/viewerTemplatePlugin.js.map +0 -1
  601. package/viewer/defaultViewer.d.ts +0 -130
  602. package/viewer/defaultViewer.js +0 -672
  603. package/viewer/defaultViewer.js.map +0 -1
  604. package/viewer/renderOnlyViewer.d.ts +0 -9
  605. package/viewer/renderOnlyViewer.js +0 -46
  606. package/viewer/renderOnlyViewer.js.map +0 -1
  607. package/viewer/viewer.d.ts +0 -258
  608. package/viewer/viewer.js +0 -783
  609. package/viewer/viewer.js.map +0 -1
  610. package/viewer/viewerManager.d.ts +0 -58
  611. package/viewer/viewerManager.js +0 -91
  612. package/viewer/viewerManager.js.map +0 -1
  613. package/viewer/viewerWithTemplate.d.ts +0 -9
  614. package/viewer/viewerWithTemplate.js +0 -20
  615. package/viewer/viewerWithTemplate.js.map +0 -1
@@ -0,0 +1,382 @@
1
+ import { L as Logger, T as Tools, c as ILog2, C as Constants, bx as PostProcess, I as InternalTexture, B as BaseTexture, S as SphericalPolynomial, v as Vector3 } from './index-CtkZLm9J.esm.js';
2
+ import './dumpTools-CPmY0U7D.esm.js';
3
+
4
+ const DefaultEnvironmentTextureImageType = "image/png";
5
+ const CurrentVersion = 2;
6
+ /**
7
+ * Magic number identifying the env file.
8
+ */
9
+ const MagicBytes = [0x86, 0x16, 0x87, 0x96, 0xf6, 0xd6, 0x96, 0x36];
10
+ /**
11
+ * Gets the environment info from an env file.
12
+ * @param data The array buffer containing the .env bytes.
13
+ * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.
14
+ */
15
+ function GetEnvInfo(data) {
16
+ const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);
17
+ let pos = 0;
18
+ for (let i = 0; i < MagicBytes.length; i++) {
19
+ if (dataView.getUint8(pos++) !== MagicBytes[i]) {
20
+ Logger.Error("Not a babylon environment map");
21
+ return null;
22
+ }
23
+ }
24
+ // Read json manifest - collect characters up to null terminator
25
+ let manifestString = "";
26
+ let charCode = 0x00;
27
+ while ((charCode = dataView.getUint8(pos++))) {
28
+ manifestString += String.fromCharCode(charCode);
29
+ }
30
+ let manifest = JSON.parse(manifestString);
31
+ manifest = normalizeEnvInfo(manifest);
32
+ if (manifest.specular) {
33
+ // Extend the header with the position of the payload.
34
+ manifest.specular.specularDataPosition = pos;
35
+ // Fallback to 0.8 exactly if lodGenerationScale is not defined for backward compatibility.
36
+ manifest.specular.lodGenerationScale = manifest.specular.lodGenerationScale || 0.8;
37
+ }
38
+ return manifest;
39
+ }
40
+ /**
41
+ * Normalizes any supported version of the environment file info to the latest version
42
+ * @param info environment file info on any supported version
43
+ * @returns environment file info in the latest supported version
44
+ * @private
45
+ */
46
+ function normalizeEnvInfo(info) {
47
+ if (info.version > CurrentVersion) {
48
+ throw new Error(`Unsupported babylon environment map version "${info.version}". Latest supported version is "${CurrentVersion}".`);
49
+ }
50
+ if (info.version === 2) {
51
+ return info;
52
+ }
53
+ // Migrate a v1 info to v2
54
+ info = { ...info, version: 2, imageType: DefaultEnvironmentTextureImageType };
55
+ return info;
56
+ }
57
+ /**
58
+ * Creates the ArrayBufferViews used for initializing environment texture image data.
59
+ * @param data the image data
60
+ * @param info parameters that determine what views will be created for accessing the underlying buffer
61
+ * @returns the views described by info providing access to the underlying buffer
62
+ */
63
+ function CreateImageDataArrayBufferViews(data, info) {
64
+ info = normalizeEnvInfo(info);
65
+ const specularInfo = info.specular;
66
+ // Double checks the enclosed info
67
+ let mipmapsCount = Math.log2(info.width);
68
+ mipmapsCount = Math.round(mipmapsCount) + 1;
69
+ if (specularInfo.mipmaps.length !== 6 * mipmapsCount) {
70
+ throw new Error(`Unsupported specular mipmaps number "${specularInfo.mipmaps.length}"`);
71
+ }
72
+ const imageData = new Array(mipmapsCount);
73
+ for (let i = 0; i < mipmapsCount; i++) {
74
+ imageData[i] = new Array(6);
75
+ for (let face = 0; face < 6; face++) {
76
+ const imageInfo = specularInfo.mipmaps[i * 6 + face];
77
+ imageData[i][face] = new Uint8Array(data.buffer, data.byteOffset + specularInfo.specularDataPosition + imageInfo.position, imageInfo.length);
78
+ }
79
+ }
80
+ return imageData;
81
+ }
82
+ /**
83
+ * Uploads the texture info contained in the env file to the GPU.
84
+ * @param texture defines the internal texture to upload to
85
+ * @param data defines the data to load
86
+ * @param info defines the texture info retrieved through the GetEnvInfo method
87
+ * @returns a promise
88
+ */
89
+ function UploadEnvLevelsAsync(texture, data, info) {
90
+ info = normalizeEnvInfo(info);
91
+ const specularInfo = info.specular;
92
+ if (!specularInfo) {
93
+ // Nothing else parsed so far
94
+ return Promise.resolve();
95
+ }
96
+ texture._lodGenerationScale = specularInfo.lodGenerationScale;
97
+ const imageData = CreateImageDataArrayBufferViews(data, info);
98
+ return UploadLevelsAsync(texture, imageData, info.imageType);
99
+ }
100
+ function _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture) {
101
+ return new Promise((resolve, reject) => {
102
+ if (expandTexture) {
103
+ const tempTexture = engine.createTexture(null, true, true, null, Constants.TEXTURE_NEAREST_SAMPLINGMODE, null, (message) => {
104
+ reject(message);
105
+ }, image);
106
+ rgbdPostProcess?.onEffectCreatedObservable.addOnce((effect) => {
107
+ effect.executeWhenCompiled(() => {
108
+ // Uncompress the data to a RTT
109
+ rgbdPostProcess.externalTextureSamplerBinding = true;
110
+ rgbdPostProcess.onApply = (effect) => {
111
+ effect._bindTexture("textureSampler", tempTexture);
112
+ effect.setFloat2("scale", 1, engine._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1);
113
+ };
114
+ if (!engine.scenes.length) {
115
+ return;
116
+ }
117
+ engine.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, true, face, i);
118
+ // Cleanup
119
+ engine.restoreDefaultFramebuffer();
120
+ tempTexture.dispose();
121
+ URL.revokeObjectURL(url);
122
+ resolve();
123
+ });
124
+ });
125
+ }
126
+ else {
127
+ engine._uploadImageToTexture(texture, image, face, i);
128
+ // Upload the face to the non lod texture support
129
+ if (generateNonLODTextures) {
130
+ const lodTexture = lodTextures[i];
131
+ if (lodTexture) {
132
+ engine._uploadImageToTexture(lodTexture._texture, image, face, 0);
133
+ }
134
+ }
135
+ resolve();
136
+ }
137
+ });
138
+ }
139
+ /**
140
+ * Uploads the levels of image data to the GPU.
141
+ * @param texture defines the internal texture to upload to
142
+ * @param imageData defines the array buffer views of image data [mipmap][face]
143
+ * @param imageType the mime type of the image data
144
+ * @returns a promise
145
+ */
146
+ async function UploadLevelsAsync(texture, imageData, imageType = DefaultEnvironmentTextureImageType) {
147
+ if (!Tools.IsExponentOfTwo(texture.width)) {
148
+ throw new Error("Texture size must be a power of two");
149
+ }
150
+ const mipmapsCount = ILog2(texture.width) + 1;
151
+ // Gets everything ready.
152
+ const engine = texture.getEngine();
153
+ let expandTexture = false;
154
+ let generateNonLODTextures = false;
155
+ let rgbdPostProcess = null;
156
+ let cubeRtt = null;
157
+ let lodTextures = null;
158
+ const caps = engine.getCaps();
159
+ texture.format = Constants.TEXTUREFORMAT_RGBA;
160
+ texture.type = Constants.TEXTURETYPE_UNSIGNED_INT;
161
+ texture.generateMipMaps = true;
162
+ texture._cachedAnisotropicFilteringLevel = null;
163
+ engine.updateTextureSamplingMode(Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, texture);
164
+ // Add extra process if texture lod is not supported
165
+ if (!caps.textureLOD) {
166
+ expandTexture = false;
167
+ generateNonLODTextures = true;
168
+ lodTextures = {};
169
+ }
170
+ // in webgl 1 there are no ways to either render or copy lod level information for float textures.
171
+ else if (!engine._features.supportRenderAndCopyToLodForFloatTextures) {
172
+ expandTexture = false;
173
+ }
174
+ // If half float available we can uncompress the texture
175
+ else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {
176
+ expandTexture = true;
177
+ texture.type = Constants.TEXTURETYPE_HALF_FLOAT;
178
+ }
179
+ // If full float available we can uncompress the texture
180
+ else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {
181
+ expandTexture = true;
182
+ texture.type = Constants.TEXTURETYPE_FLOAT;
183
+ }
184
+ // Expand the texture if possible
185
+ let shaderLanguage = 0 /* ShaderLanguage.GLSL */;
186
+ if (expandTexture) {
187
+ if (engine.isWebGPU) {
188
+ shaderLanguage = 1 /* ShaderLanguage.WGSL */;
189
+ await import('./rgbdDecode.fragment-CV6q4aIi.esm.js');
190
+ }
191
+ else {
192
+ await import('./rgbdDecode.fragment-BHAQKD_5.esm.js');
193
+ }
194
+ // Simply run through the decode PP
195
+ rgbdPostProcess = new PostProcess("rgbdDecode", "rgbdDecode", null, null, 1, null, Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, engine, false, undefined, texture.type, undefined, null, false, undefined, shaderLanguage);
196
+ texture._isRGBD = false;
197
+ texture.invertY = false;
198
+ cubeRtt = engine.createRenderTargetCubeTexture(texture.width, {
199
+ generateDepthBuffer: false,
200
+ generateMipMaps: true,
201
+ generateStencilBuffer: false,
202
+ samplingMode: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,
203
+ type: texture.type,
204
+ format: Constants.TEXTUREFORMAT_RGBA,
205
+ });
206
+ }
207
+ else {
208
+ texture._isRGBD = true;
209
+ texture.invertY = true;
210
+ // In case of missing support, applies the same patch than DDS files.
211
+ if (generateNonLODTextures) {
212
+ const mipSlices = 3;
213
+ const scale = texture._lodGenerationScale;
214
+ const offset = texture._lodGenerationOffset;
215
+ for (let i = 0; i < mipSlices; i++) {
216
+ //compute LOD from even spacing in smoothness (matching shader calculation)
217
+ const smoothness = i / (mipSlices - 1);
218
+ const roughness = 1 - smoothness;
219
+ const minLODIndex = offset; // roughness = 0
220
+ const maxLODIndex = (mipmapsCount - 1) * scale + offset; // roughness = 1 (mipmaps start from 0)
221
+ const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness;
222
+ const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex));
223
+ const glTextureFromLod = new InternalTexture(engine, 2 /* InternalTextureSource.Temp */);
224
+ glTextureFromLod.isCube = true;
225
+ glTextureFromLod.invertY = true;
226
+ glTextureFromLod.generateMipMaps = false;
227
+ engine.updateTextureSamplingMode(Constants.TEXTURE_LINEAR_LINEAR, glTextureFromLod);
228
+ // Wrap in a base texture for easy binding.
229
+ const lodTexture = new BaseTexture(null);
230
+ lodTexture._isCube = true;
231
+ lodTexture._texture = glTextureFromLod;
232
+ lodTextures[mipmapIndex] = lodTexture;
233
+ switch (i) {
234
+ case 0:
235
+ texture._lodTextureLow = lodTexture;
236
+ break;
237
+ case 1:
238
+ texture._lodTextureMid = lodTexture;
239
+ break;
240
+ case 2:
241
+ texture._lodTextureHigh = lodTexture;
242
+ break;
243
+ }
244
+ }
245
+ }
246
+ }
247
+ const promises = [];
248
+ // All mipmaps up to provided number of images
249
+ for (let i = 0; i < imageData.length; i++) {
250
+ // All faces
251
+ for (let face = 0; face < 6; face++) {
252
+ // Constructs an image element from image data
253
+ const bytes = imageData[i][face];
254
+ const blob = new Blob([bytes], { type: imageType });
255
+ const url = URL.createObjectURL(blob);
256
+ let promise;
257
+ if (engine._features.forceBitmapOverHTMLImageElement) {
258
+ promise = engine.createImageBitmap(blob, { premultiplyAlpha: "none" }).then((img) => {
259
+ return _OnImageReadyAsync(img, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture);
260
+ });
261
+ }
262
+ else {
263
+ const image = new Image();
264
+ image.src = url;
265
+ // Enqueue promise to upload to the texture.
266
+ promise = new Promise((resolve, reject) => {
267
+ image.onload = () => {
268
+ _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture)
269
+ .then(() => resolve())
270
+ .catch((reason) => {
271
+ reject(reason);
272
+ });
273
+ };
274
+ image.onerror = (error) => {
275
+ reject(error);
276
+ };
277
+ });
278
+ }
279
+ promises.push(promise);
280
+ }
281
+ }
282
+ // Fill remaining mipmaps with black textures.
283
+ if (imageData.length < mipmapsCount) {
284
+ let data;
285
+ const size = Math.pow(2, mipmapsCount - 1 - imageData.length);
286
+ const dataLength = size * size * 4;
287
+ switch (texture.type) {
288
+ case Constants.TEXTURETYPE_UNSIGNED_INT: {
289
+ data = new Uint8Array(dataLength);
290
+ break;
291
+ }
292
+ case Constants.TEXTURETYPE_HALF_FLOAT: {
293
+ data = new Uint16Array(dataLength);
294
+ break;
295
+ }
296
+ case Constants.TEXTURETYPE_FLOAT: {
297
+ data = new Float32Array(dataLength);
298
+ break;
299
+ }
300
+ }
301
+ for (let i = imageData.length; i < mipmapsCount; i++) {
302
+ for (let face = 0; face < 6; face++) {
303
+ engine._uploadArrayBufferViewToTexture(texture, data, face, i);
304
+ }
305
+ }
306
+ }
307
+ // Once all done, finishes the cleanup and return
308
+ return Promise.all(promises).then(() => {
309
+ // Release temp RTT.
310
+ if (cubeRtt) {
311
+ engine._releaseTexture(texture);
312
+ cubeRtt._swapAndDie(texture);
313
+ }
314
+ // Release temp Post Process.
315
+ if (rgbdPostProcess) {
316
+ rgbdPostProcess.dispose();
317
+ }
318
+ // Flag internal texture as ready in case they are in use.
319
+ if (generateNonLODTextures) {
320
+ if (texture._lodTextureHigh && texture._lodTextureHigh._texture) {
321
+ texture._lodTextureHigh._texture.isReady = true;
322
+ }
323
+ if (texture._lodTextureMid && texture._lodTextureMid._texture) {
324
+ texture._lodTextureMid._texture.isReady = true;
325
+ }
326
+ if (texture._lodTextureLow && texture._lodTextureLow._texture) {
327
+ texture._lodTextureLow._texture.isReady = true;
328
+ }
329
+ }
330
+ });
331
+ }
332
+ /**
333
+ * Uploads spherical polynomials information to the texture.
334
+ * @param texture defines the texture we are trying to upload the information to
335
+ * @param info defines the environment texture info retrieved through the GetEnvInfo method
336
+ */
337
+ function UploadEnvSpherical(texture, info) {
338
+ info = normalizeEnvInfo(info);
339
+ const irradianceInfo = info.irradiance;
340
+ if (!irradianceInfo) {
341
+ return;
342
+ }
343
+ const sp = new SphericalPolynomial();
344
+ Vector3.FromArrayToRef(irradianceInfo.x, 0, sp.x);
345
+ Vector3.FromArrayToRef(irradianceInfo.y, 0, sp.y);
346
+ Vector3.FromArrayToRef(irradianceInfo.z, 0, sp.z);
347
+ Vector3.FromArrayToRef(irradianceInfo.xx, 0, sp.xx);
348
+ Vector3.FromArrayToRef(irradianceInfo.yy, 0, sp.yy);
349
+ Vector3.FromArrayToRef(irradianceInfo.zz, 0, sp.zz);
350
+ Vector3.FromArrayToRef(irradianceInfo.yz, 0, sp.yz);
351
+ Vector3.FromArrayToRef(irradianceInfo.zx, 0, sp.zx);
352
+ Vector3.FromArrayToRef(irradianceInfo.xy, 0, sp.xy);
353
+ texture._sphericalPolynomial = sp;
354
+ }
355
+ /**
356
+ * @internal
357
+ */
358
+ function _UpdateRGBDAsync(internalTexture, data, sphericalPolynomial, lodScale, lodOffset) {
359
+ const proxy = internalTexture
360
+ .getEngine()
361
+ .createRawCubeTexture(null, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression);
362
+ const proxyPromise = UploadLevelsAsync(proxy, data).then(() => internalTexture);
363
+ internalTexture.onRebuildCallback = (_internalTexture) => {
364
+ return {
365
+ proxy: proxyPromise,
366
+ isReady: true,
367
+ isAsync: true,
368
+ };
369
+ };
370
+ internalTexture._source = 13 /* InternalTextureSource.CubeRawRGBD */;
371
+ internalTexture._bufferViewArrayArray = data;
372
+ internalTexture._lodGenerationScale = lodScale;
373
+ internalTexture._lodGenerationOffset = lodOffset;
374
+ internalTexture._sphericalPolynomial = sphericalPolynomial;
375
+ return UploadLevelsAsync(internalTexture, data).then(() => {
376
+ internalTexture.isReady = true;
377
+ return internalTexture;
378
+ });
379
+ }
380
+
381
+ export { GetEnvInfo as G, UploadEnvSpherical as U, _UpdateRGBDAsync as _, UploadEnvLevelsAsync as a };
382
+ //# sourceMappingURL=environmentTextureTools-B2vnsFq-.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentTextureTools-B2vnsFq-.esm.js","sources":["../../../../../dev/core/dist/Misc/environmentTextureTools.js"],"sourcesContent":["import { Tools } from \"./tools\";\nimport { Vector3 } from \"../Maths/math.vector\";\nimport { ILog2 } from \"../Maths/math.scalar.functions\";\nimport { SphericalPolynomial } from \"../Maths/sphericalPolynomial\";\nimport { InternalTexture } from \"../Materials/Textures/internalTexture\";\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\nimport { Constants } from \"../Engines/constants\";\nimport { Scene } from \"../scene\";\nimport { PostProcess } from \"../PostProcesses/postProcess\";\nimport { Logger } from \"../Misc/logger\";\nimport { RGBDTextureTools } from \"./rgbdTextureTools\";\nimport \"../Materials/Textures/baseTexture.polynomial\";\nimport { DumpDataAsync } from \"../Misc/dumpTools\";\nconst DefaultEnvironmentTextureImageType = \"image/png\";\nconst CurrentVersion = 2;\n/**\n * Magic number identifying the env file.\n */\nconst MagicBytes = [0x86, 0x16, 0x87, 0x96, 0xf6, 0xd6, 0x96, 0x36];\n/**\n * Gets the environment info from an env file.\n * @param data The array buffer containing the .env bytes.\n * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.\n */\nexport function GetEnvInfo(data) {\n const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);\n let pos = 0;\n for (let i = 0; i < MagicBytes.length; i++) {\n if (dataView.getUint8(pos++) !== MagicBytes[i]) {\n Logger.Error(\"Not a babylon environment map\");\n return null;\n }\n }\n // Read json manifest - collect characters up to null terminator\n let manifestString = \"\";\n let charCode = 0x00;\n while ((charCode = dataView.getUint8(pos++))) {\n manifestString += String.fromCharCode(charCode);\n }\n let manifest = JSON.parse(manifestString);\n manifest = normalizeEnvInfo(manifest);\n if (manifest.specular) {\n // Extend the header with the position of the payload.\n manifest.specular.specularDataPosition = pos;\n // Fallback to 0.8 exactly if lodGenerationScale is not defined for backward compatibility.\n manifest.specular.lodGenerationScale = manifest.specular.lodGenerationScale || 0.8;\n }\n return manifest;\n}\n/**\n * Normalizes any supported version of the environment file info to the latest version\n * @param info environment file info on any supported version\n * @returns environment file info in the latest supported version\n * @private\n */\nexport function normalizeEnvInfo(info) {\n if (info.version > CurrentVersion) {\n throw new Error(`Unsupported babylon environment map version \"${info.version}\". Latest supported version is \"${CurrentVersion}\".`);\n }\n if (info.version === 2) {\n return info;\n }\n // Migrate a v1 info to v2\n info = { ...info, version: 2, imageType: DefaultEnvironmentTextureImageType };\n return info;\n}\n/**\n * Creates an environment texture from a loaded cube texture.\n * @param texture defines the cube texture to convert in env file\n * @param options options for the conversion process\n * @param options.imageType the mime type for the encoded images, with support for \"image/png\" (default) and \"image/webp\"\n * @param options.imageQuality the image quality of encoded WebP images.\n * @returns a promise containing the environment data if successful.\n */\nexport async function CreateEnvTextureAsync(texture, options = {}) {\n const internalTexture = texture.getInternalTexture();\n if (!internalTexture) {\n return Promise.reject(\"The cube texture is invalid.\");\n }\n const imageType = options.imageType ?? DefaultEnvironmentTextureImageType;\n const engine = internalTexture.getEngine();\n if (texture.textureType !== Constants.TEXTURETYPE_HALF_FLOAT &&\n texture.textureType !== Constants.TEXTURETYPE_FLOAT &&\n texture.textureType !== Constants.TEXTURETYPE_UNSIGNED_BYTE &&\n texture.textureType !== Constants.TEXTURETYPE_UNSIGNED_BYTE &&\n texture.textureType !== Constants.TEXTURETYPE_UNSIGNED_INTEGER &&\n texture.textureType !== -1) {\n return Promise.reject(\"The cube texture should allow HDR (Full Float or Half Float).\");\n }\n let textureType = Constants.TEXTURETYPE_FLOAT;\n if (!engine.getCaps().textureFloatRender) {\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\n if (!engine.getCaps().textureHalfFloatRender) {\n return Promise.reject(\"Env texture can only be created when the browser supports half float or full float rendering.\");\n }\n }\n // sphericalPolynomial is lazy loaded so simply accessing it should trigger the computation.\n texture.sphericalPolynomial;\n // Lets keep track of the polynomial promise so we can wait for it to be ready before generating the pixels.\n const sphericalPolynomialPromise = texture.getInternalTexture()?._sphericalPolynomialPromise;\n const cubeWidth = internalTexture.width;\n const hostingScene = new Scene(engine);\n const specularTextures = {};\n // As we are going to readPixels the faces of the cube, make sure the drawing/update commands for the cube texture are fully sent to the GPU in case it is drawn for the first time in this very frame!\n engine.flushFramebuffer();\n // Read and collect all mipmaps data from the cube.\n const mipmapsCount = ILog2(internalTexture.width);\n for (let i = 0; i <= mipmapsCount; i++) {\n const faceWidth = Math.pow(2, mipmapsCount - i);\n // All faces of the cube.\n for (let face = 0; face < 6; face++) {\n let faceData = await texture.readPixels(face, i, undefined, false);\n if (faceData && faceData.byteLength === faceData.length) {\n const faceDataFloat = new Float32Array(faceData.byteLength * 4);\n for (let i = 0; i < faceData.byteLength; i++) {\n faceDataFloat[i] = faceData[i] / 255;\n // Gamma to linear\n faceDataFloat[i] = Math.pow(faceDataFloat[i], 2.2);\n }\n faceData = faceDataFloat;\n }\n else if (faceData && texture.gammaSpace) {\n const floatData = faceData;\n for (let i = 0; i < floatData.length; i++) {\n // Gamma to linear\n floatData[i] = Math.pow(floatData[i], 2.2);\n }\n }\n const tempTexture = engine.createRawTexture(faceData, faceWidth, faceWidth, Constants.TEXTUREFORMAT_RGBA, false, true, Constants.TEXTURE_NEAREST_SAMPLINGMODE, null, textureType);\n await RGBDTextureTools.EncodeTextureToRGBD(tempTexture, hostingScene, textureType);\n const rgbdEncodedData = await engine._readTexturePixels(tempTexture, faceWidth, faceWidth);\n const imageEncodedData = await DumpDataAsync(faceWidth, faceWidth, rgbdEncodedData, imageType, undefined, false, true, options.imageQuality);\n specularTextures[i * 6 + face] = imageEncodedData;\n tempTexture.dispose();\n }\n }\n // We can delete the hosting scene keeping track of all the creation objects\n hostingScene.dispose();\n // Ensure completion of the polynomial creation promise.\n if (sphericalPolynomialPromise) {\n await sphericalPolynomialPromise;\n }\n // Creates the json header for the env texture\n const info = {\n version: CurrentVersion,\n width: cubeWidth,\n imageType,\n irradiance: _CreateEnvTextureIrradiance(texture),\n specular: {\n mipmaps: [],\n lodGenerationScale: texture.lodGenerationScale,\n },\n };\n // Sets the specular image data information\n let position = 0;\n for (let i = 0; i <= mipmapsCount; i++) {\n for (let face = 0; face < 6; face++) {\n const byteLength = specularTextures[i * 6 + face].byteLength;\n info.specular.mipmaps.push({\n length: byteLength,\n position: position,\n });\n position += byteLength;\n }\n }\n // Encode the JSON as an array buffer\n const infoString = JSON.stringify(info);\n const infoBuffer = new ArrayBuffer(infoString.length + 1);\n const infoView = new Uint8Array(infoBuffer); // Limited to ascii subset matching unicode.\n for (let i = 0, strLen = infoString.length; i < strLen; i++) {\n infoView[i] = infoString.charCodeAt(i);\n }\n // Ends up with a null terminator for easier parsing\n infoView[infoString.length] = 0x00;\n // Computes the final required size and creates the storage\n const totalSize = MagicBytes.length + position + infoBuffer.byteLength;\n const finalBuffer = new ArrayBuffer(totalSize);\n const finalBufferView = new Uint8Array(finalBuffer);\n const dataView = new DataView(finalBuffer);\n // Copy the magic bytes identifying the file in\n let pos = 0;\n for (let i = 0; i < MagicBytes.length; i++) {\n dataView.setUint8(pos++, MagicBytes[i]);\n }\n // Add the json info\n finalBufferView.set(new Uint8Array(infoBuffer), pos);\n pos += infoBuffer.byteLength;\n // Finally inserts the texture data\n for (let i = 0; i <= mipmapsCount; i++) {\n for (let face = 0; face < 6; face++) {\n const dataBuffer = specularTextures[i * 6 + face];\n finalBufferView.set(new Uint8Array(dataBuffer), pos);\n pos += dataBuffer.byteLength;\n }\n }\n // Voila\n return finalBuffer;\n}\n/**\n * Creates a JSON representation of the spherical data.\n * @param texture defines the texture containing the polynomials\n * @returns the JSON representation of the spherical info\n */\nfunction _CreateEnvTextureIrradiance(texture) {\n const polynmials = texture.sphericalPolynomial;\n if (polynmials == null) {\n return null;\n }\n return {\n x: [polynmials.x.x, polynmials.x.y, polynmials.x.z],\n y: [polynmials.y.x, polynmials.y.y, polynmials.y.z],\n z: [polynmials.z.x, polynmials.z.y, polynmials.z.z],\n xx: [polynmials.xx.x, polynmials.xx.y, polynmials.xx.z],\n yy: [polynmials.yy.x, polynmials.yy.y, polynmials.yy.z],\n zz: [polynmials.zz.x, polynmials.zz.y, polynmials.zz.z],\n yz: [polynmials.yz.x, polynmials.yz.y, polynmials.yz.z],\n zx: [polynmials.zx.x, polynmials.zx.y, polynmials.zx.z],\n xy: [polynmials.xy.x, polynmials.xy.y, polynmials.xy.z],\n };\n}\n/**\n * Creates the ArrayBufferViews used for initializing environment texture image data.\n * @param data the image data\n * @param info parameters that determine what views will be created for accessing the underlying buffer\n * @returns the views described by info providing access to the underlying buffer\n */\nexport function CreateImageDataArrayBufferViews(data, info) {\n info = normalizeEnvInfo(info);\n const specularInfo = info.specular;\n // Double checks the enclosed info\n let mipmapsCount = Math.log2(info.width);\n mipmapsCount = Math.round(mipmapsCount) + 1;\n if (specularInfo.mipmaps.length !== 6 * mipmapsCount) {\n throw new Error(`Unsupported specular mipmaps number \"${specularInfo.mipmaps.length}\"`);\n }\n const imageData = new Array(mipmapsCount);\n for (let i = 0; i < mipmapsCount; i++) {\n imageData[i] = new Array(6);\n for (let face = 0; face < 6; face++) {\n const imageInfo = specularInfo.mipmaps[i * 6 + face];\n imageData[i][face] = new Uint8Array(data.buffer, data.byteOffset + specularInfo.specularDataPosition + imageInfo.position, imageInfo.length);\n }\n }\n return imageData;\n}\n/**\n * Uploads the texture info contained in the env file to the GPU.\n * @param texture defines the internal texture to upload to\n * @param data defines the data to load\n * @param info defines the texture info retrieved through the GetEnvInfo method\n * @returns a promise\n */\nexport function UploadEnvLevelsAsync(texture, data, info) {\n info = normalizeEnvInfo(info);\n const specularInfo = info.specular;\n if (!specularInfo) {\n // Nothing else parsed so far\n return Promise.resolve();\n }\n texture._lodGenerationScale = specularInfo.lodGenerationScale;\n const imageData = CreateImageDataArrayBufferViews(data, info);\n return UploadLevelsAsync(texture, imageData, info.imageType);\n}\nfunction _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture) {\n return new Promise((resolve, reject) => {\n if (expandTexture) {\n const tempTexture = engine.createTexture(null, true, true, null, Constants.TEXTURE_NEAREST_SAMPLINGMODE, null, (message) => {\n reject(message);\n }, image);\n rgbdPostProcess?.onEffectCreatedObservable.addOnce((effect) => {\n effect.executeWhenCompiled(() => {\n // Uncompress the data to a RTT\n rgbdPostProcess.externalTextureSamplerBinding = true;\n rgbdPostProcess.onApply = (effect) => {\n effect._bindTexture(\"textureSampler\", tempTexture);\n effect.setFloat2(\"scale\", 1, engine._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1);\n };\n if (!engine.scenes.length) {\n return;\n }\n engine.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, true, face, i);\n // Cleanup\n engine.restoreDefaultFramebuffer();\n tempTexture.dispose();\n URL.revokeObjectURL(url);\n resolve();\n });\n });\n }\n else {\n engine._uploadImageToTexture(texture, image, face, i);\n // Upload the face to the non lod texture support\n if (generateNonLODTextures) {\n const lodTexture = lodTextures[i];\n if (lodTexture) {\n engine._uploadImageToTexture(lodTexture._texture, image, face, 0);\n }\n }\n resolve();\n }\n });\n}\n/**\n * Uploads the levels of image data to the GPU.\n * @param texture defines the internal texture to upload to\n * @param imageData defines the array buffer views of image data [mipmap][face]\n * @param imageType the mime type of the image data\n * @returns a promise\n */\nexport async function UploadLevelsAsync(texture, imageData, imageType = DefaultEnvironmentTextureImageType) {\n if (!Tools.IsExponentOfTwo(texture.width)) {\n throw new Error(\"Texture size must be a power of two\");\n }\n const mipmapsCount = ILog2(texture.width) + 1;\n // Gets everything ready.\n const engine = texture.getEngine();\n let expandTexture = false;\n let generateNonLODTextures = false;\n let rgbdPostProcess = null;\n let cubeRtt = null;\n let lodTextures = null;\n const caps = engine.getCaps();\n texture.format = Constants.TEXTUREFORMAT_RGBA;\n texture.type = Constants.TEXTURETYPE_UNSIGNED_INT;\n texture.generateMipMaps = true;\n texture._cachedAnisotropicFilteringLevel = null;\n engine.updateTextureSamplingMode(Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, texture);\n // Add extra process if texture lod is not supported\n if (!caps.textureLOD) {\n expandTexture = false;\n generateNonLODTextures = true;\n lodTextures = {};\n }\n // in webgl 1 there are no ways to either render or copy lod level information for float textures.\n else if (!engine._features.supportRenderAndCopyToLodForFloatTextures) {\n expandTexture = false;\n }\n // If half float available we can uncompress the texture\n else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\n expandTexture = true;\n texture.type = Constants.TEXTURETYPE_HALF_FLOAT;\n }\n // If full float available we can uncompress the texture\n else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\n expandTexture = true;\n texture.type = Constants.TEXTURETYPE_FLOAT;\n }\n // Expand the texture if possible\n let shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n if (expandTexture) {\n if (engine.isWebGPU) {\n shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n await import(\"../ShadersWGSL/rgbdDecode.fragment\");\n }\n else {\n await import(\"../Shaders/rgbdDecode.fragment\");\n }\n // Simply run through the decode PP\n rgbdPostProcess = new PostProcess(\"rgbdDecode\", \"rgbdDecode\", null, null, 1, null, Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, engine, false, undefined, texture.type, undefined, null, false, undefined, shaderLanguage);\n texture._isRGBD = false;\n texture.invertY = false;\n cubeRtt = engine.createRenderTargetCubeTexture(texture.width, {\n generateDepthBuffer: false,\n generateMipMaps: true,\n generateStencilBuffer: false,\n samplingMode: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\n type: texture.type,\n format: Constants.TEXTUREFORMAT_RGBA,\n });\n }\n else {\n texture._isRGBD = true;\n texture.invertY = true;\n // In case of missing support, applies the same patch than DDS files.\n if (generateNonLODTextures) {\n const mipSlices = 3;\n const scale = texture._lodGenerationScale;\n const offset = texture._lodGenerationOffset;\n for (let i = 0; i < mipSlices; i++) {\n //compute LOD from even spacing in smoothness (matching shader calculation)\n const smoothness = i / (mipSlices - 1);\n const roughness = 1 - smoothness;\n const minLODIndex = offset; // roughness = 0\n const maxLODIndex = (mipmapsCount - 1) * scale + offset; // roughness = 1 (mipmaps start from 0)\n const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness;\n const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex));\n const glTextureFromLod = new InternalTexture(engine, 2 /* InternalTextureSource.Temp */);\n glTextureFromLod.isCube = true;\n glTextureFromLod.invertY = true;\n glTextureFromLod.generateMipMaps = false;\n engine.updateTextureSamplingMode(Constants.TEXTURE_LINEAR_LINEAR, glTextureFromLod);\n // Wrap in a base texture for easy binding.\n const lodTexture = new BaseTexture(null);\n lodTexture._isCube = true;\n lodTexture._texture = glTextureFromLod;\n lodTextures[mipmapIndex] = lodTexture;\n switch (i) {\n case 0:\n texture._lodTextureLow = lodTexture;\n break;\n case 1:\n texture._lodTextureMid = lodTexture;\n break;\n case 2:\n texture._lodTextureHigh = lodTexture;\n break;\n }\n }\n }\n }\n const promises = [];\n // All mipmaps up to provided number of images\n for (let i = 0; i < imageData.length; i++) {\n // All faces\n for (let face = 0; face < 6; face++) {\n // Constructs an image element from image data\n const bytes = imageData[i][face];\n const blob = new Blob([bytes], { type: imageType });\n const url = URL.createObjectURL(blob);\n let promise;\n if (engine._features.forceBitmapOverHTMLImageElement) {\n promise = engine.createImageBitmap(blob, { premultiplyAlpha: \"none\" }).then((img) => {\n return _OnImageReadyAsync(img, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture);\n });\n }\n else {\n const image = new Image();\n image.src = url;\n // Enqueue promise to upload to the texture.\n promise = new Promise((resolve, reject) => {\n image.onload = () => {\n _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture)\n .then(() => resolve())\n .catch((reason) => {\n reject(reason);\n });\n };\n image.onerror = (error) => {\n reject(error);\n };\n });\n }\n promises.push(promise);\n }\n }\n // Fill remaining mipmaps with black textures.\n if (imageData.length < mipmapsCount) {\n let data;\n const size = Math.pow(2, mipmapsCount - 1 - imageData.length);\n const dataLength = size * size * 4;\n switch (texture.type) {\n case Constants.TEXTURETYPE_UNSIGNED_INT: {\n data = new Uint8Array(dataLength);\n break;\n }\n case Constants.TEXTURETYPE_HALF_FLOAT: {\n data = new Uint16Array(dataLength);\n break;\n }\n case Constants.TEXTURETYPE_FLOAT: {\n data = new Float32Array(dataLength);\n break;\n }\n }\n for (let i = imageData.length; i < mipmapsCount; i++) {\n for (let face = 0; face < 6; face++) {\n engine._uploadArrayBufferViewToTexture(texture, data, face, i);\n }\n }\n }\n // Once all done, finishes the cleanup and return\n return Promise.all(promises).then(() => {\n // Release temp RTT.\n if (cubeRtt) {\n engine._releaseTexture(texture);\n cubeRtt._swapAndDie(texture);\n }\n // Release temp Post Process.\n if (rgbdPostProcess) {\n rgbdPostProcess.dispose();\n }\n // Flag internal texture as ready in case they are in use.\n if (generateNonLODTextures) {\n if (texture._lodTextureHigh && texture._lodTextureHigh._texture) {\n texture._lodTextureHigh._texture.isReady = true;\n }\n if (texture._lodTextureMid && texture._lodTextureMid._texture) {\n texture._lodTextureMid._texture.isReady = true;\n }\n if (texture._lodTextureLow && texture._lodTextureLow._texture) {\n texture._lodTextureLow._texture.isReady = true;\n }\n }\n });\n}\n/**\n * Uploads spherical polynomials information to the texture.\n * @param texture defines the texture we are trying to upload the information to\n * @param info defines the environment texture info retrieved through the GetEnvInfo method\n */\nexport function UploadEnvSpherical(texture, info) {\n info = normalizeEnvInfo(info);\n const irradianceInfo = info.irradiance;\n if (!irradianceInfo) {\n return;\n }\n const sp = new SphericalPolynomial();\n Vector3.FromArrayToRef(irradianceInfo.x, 0, sp.x);\n Vector3.FromArrayToRef(irradianceInfo.y, 0, sp.y);\n Vector3.FromArrayToRef(irradianceInfo.z, 0, sp.z);\n Vector3.FromArrayToRef(irradianceInfo.xx, 0, sp.xx);\n Vector3.FromArrayToRef(irradianceInfo.yy, 0, sp.yy);\n Vector3.FromArrayToRef(irradianceInfo.zz, 0, sp.zz);\n Vector3.FromArrayToRef(irradianceInfo.yz, 0, sp.yz);\n Vector3.FromArrayToRef(irradianceInfo.zx, 0, sp.zx);\n Vector3.FromArrayToRef(irradianceInfo.xy, 0, sp.xy);\n texture._sphericalPolynomial = sp;\n}\n/**\n * @internal\n */\nexport function _UpdateRGBDAsync(internalTexture, data, sphericalPolynomial, lodScale, lodOffset) {\n const proxy = internalTexture\n .getEngine()\n .createRawCubeTexture(null, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression);\n const proxyPromise = UploadLevelsAsync(proxy, data).then(() => internalTexture);\n internalTexture.onRebuildCallback = (_internalTexture) => {\n return {\n proxy: proxyPromise,\n isReady: true,\n isAsync: true,\n };\n };\n internalTexture._source = 13 /* InternalTextureSource.CubeRawRGBD */;\n internalTexture._bufferViewArrayArray = data;\n internalTexture._lodGenerationScale = lodScale;\n internalTexture._lodGenerationOffset = lodOffset;\n internalTexture._sphericalPolynomial = sphericalPolynomial;\n return UploadLevelsAsync(internalTexture, data).then(() => {\n internalTexture.isReady = true;\n return internalTexture;\n });\n}\n/**\n * Sets of helpers addressing the serialization and deserialization of environment texture\n * stored in a BabylonJS env file.\n * Those files are usually stored as .env files.\n */\nexport const EnvironmentTextureTools = {\n /**\n * Gets the environment info from an env file.\n * @param data The array buffer containing the .env bytes.\n * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.\n */\n GetEnvInfo,\n /**\n * Creates an environment texture from a loaded cube texture.\n * @param texture defines the cube texture to convert in env file\n * @param options options for the conversion process\n * @param options.imageType the mime type for the encoded images, with support for \"image/png\" (default) and \"image/webp\"\n * @param options.imageQuality the image quality of encoded WebP images.\n * @returns a promise containing the environment data if successful.\n */\n CreateEnvTextureAsync,\n /**\n * Creates the ArrayBufferViews used for initializing environment texture image data.\n * @param data the image data\n * @param info parameters that determine what views will be created for accessing the underlying buffer\n * @returns the views described by info providing access to the underlying buffer\n */\n CreateImageDataArrayBufferViews,\n /**\n * Uploads the texture info contained in the env file to the GPU.\n * @param texture defines the internal texture to upload to\n * @param data defines the data to load\n * @param info defines the texture info retrieved through the GetEnvInfo method\n * @returns a promise\n */\n UploadEnvLevelsAsync,\n /**\n * Uploads the levels of image data to the GPU.\n * @param texture defines the internal texture to upload to\n * @param imageData defines the array buffer views of image data [mipmap][face]\n * @param imageType the mime type of the image data\n * @returns a promise\n */\n UploadLevelsAsync,\n /**\n * Uploads spherical polynomials information to the texture.\n * @param texture defines the texture we are trying to upload the information to\n * @param info defines the environment texture info retrieved through the GetEnvInfo method\n */\n UploadEnvSpherical,\n};\n//# sourceMappingURL=environmentTextureTools.js.map"],"names":[],"mappings":";;;AAaA,MAAM,kCAAkC,GAAG,WAAW;AACtD,MAAM,cAAc,GAAG,CAAC;AACxB;AACA;AACA;AACA,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AACnE;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAE;AACjC,IAAI,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;AAChF,IAAI,IAAI,GAAG,GAAG,CAAC;AACf,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChD,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE;AACxD,YAAY,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC;AACzD,YAAY,OAAO,IAAI;AACvB;AACA;AACA;AACA,IAAI,IAAI,cAAc,GAAG,EAAE;AAC3B,IAAI,IAAI,QAAQ,GAAG,IAAI;AACvB,IAAI,QAAQ,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG;AAClD,QAAQ,cAAc,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;AACvD;AACA,IAA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,eAAe,CAAC;AACnF,IAAI,eAAe,CAAC,iBAAiB,GAAG,CAAC,gBAAgB,KAAK;AAC9D,QAAQ,OAAO;AACf,YAAY,KAAK,EAAE,YAAY;AAC/B,YAAY,OAAO,EAAE,IAAI;AACzB,YAAY,OAAO,EAAE,IAAI;AACzB,SAAS;AACT,KAAK;AACL,IAAI,eAAe,CAAC,OAAO,GAAG,EAAE;AAChC,IAAI,eAAe,CAAC,qBAAqB,GAAG,IAAI;AAChD,IAAI,eAAe,CAAC,mBAAmB,GAAG,QAAQ;AAClD,IAAI,eAAe,CAAC,oBAAoB,GAAG,SAAS;AACpD,IAAI,eAAe,CAAC,oBAAoB,GAAG,mBAAmB;AAC9D,IAAI,OAAO,iBAAiB,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM;AAC/D,QAAQ,eAAe,CAAC,OAAO,GAAG,IAAI;AACtC,QAAQ,OAAO,eAAe;AAC9B,KAAK,CAAC;AACN;;;;"}
@@ -0,0 +1,2 @@
1
+ import{L as e,T as t,c as r,C as n,bx as o,I as a,B as i,S as s,v as l}from"./index-BHIM4QBr.esm.min.js";import"./dumpTools-DVDwJ2sz.esm.min.js";const u="image/png",p=[134,22,135,150,246,214,150,54];function c(t){const r=new DataView(t.buffer,t.byteOffset,t.byteLength);let n=0;for(let t=0;t<p.length;t++)if(r.getUint8(n++)!==p[t])return e.Error("Not a babylon environment map"),null;let o="",a=0;for(;a=r.getUint8(n++);)o+=String.fromCharCode(a);let i=JSON.parse(o);return i=T(i),i.specular&&(i.specular.specularDataPosition=n,i.specular.lodGenerationScale=i.specular.lodGenerationScale||.8),i}function T(e){if(e.version>2)throw new Error(`Unsupported babylon environment map version "${e.version}". Latest supported version is "2".`);return 2===e.version?e:e={...e,version:2,imageType:u}}function d(e,t,r){const n=(r=T(r)).specular;if(!n)return Promise.resolve();e._lodGenerationScale=n.lodGenerationScale;const o=function(e,t){const r=(t=T(t)).specular;let n=Math.log2(t.width);if(n=Math.round(n)+1,r.mipmaps.length!==6*n)throw new Error(`Unsupported specular mipmaps number "${r.mipmaps.length}"`);const o=new Array(n);for(let t=0;t<n;t++){o[t]=new Array(6);for(let n=0;n<6;n++){const a=r.mipmaps[6*t+n];o[t][n]=new Uint8Array(e.buffer,e.byteOffset+r.specularDataPosition+a.position,a.length)}}return o}(t,r);return m(e,o,r.imageType)}function f(e,t,r,o,a,i,s,l,u,p,c){return new Promise(((T,d)=>{if(r){const r=t.createTexture(null,!0,!0,null,n.TEXTURE_NEAREST_SAMPLINGMODE,null,(e=>{d(e)}),e);o?.onEffectCreatedObservable.addOnce((n=>{n.executeWhenCompiled((()=>{o.externalTextureSamplerBinding=!0,o.onApply=n=>{n._bindTexture("textureSampler",r),n.setFloat2("scale",1,t._features.needsInvertingBitmap&&e instanceof ImageBitmap?-1:1)},t.scenes.length&&(t.scenes[0].postProcessManager.directRender([o],p,!0,i,s),t.restoreDefaultFramebuffer(),r.dispose(),URL.revokeObjectURL(a),T())}))}))}else{if(t._uploadImageToTexture(c,e,i,s),l){const r=u[s];r&&t._uploadImageToTexture(r._texture,e,i,0)}T()}}))}async function m(e,s,l=u){if(!t.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");const p=r(e.width)+1,c=e.getEngine();let T=!1,d=!1,m=null,_=null,x=null;const y=c.getCaps();e.format=n.TEXTUREFORMAT_RGBA,e.type=n.TEXTURETYPE_UNSIGNED_INT,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,c.updateTextureSamplingMode(n.TEXTURE_TRILINEAR_SAMPLINGMODE,e),y.textureLOD?c._features.supportRenderAndCopyToLodForFloatTextures?y.textureHalfFloatRender&&y.textureHalfFloatLinearFiltering?(T=!0,e.type=n.TEXTURETYPE_HALF_FLOAT):y.textureFloatRender&&y.textureFloatLinearFiltering&&(T=!0,e.type=n.TEXTURETYPE_FLOAT):T=!1:(T=!1,d=!0,x={});let g=0;if(T)c.isWebGPU?(g=1,await import("./rgbdDecode.fragment-DEu4F_6T.esm.min.js")):await import("./rgbdDecode.fragment-DiJfgZKv.esm.min.js"),m=new o("rgbdDecode","rgbdDecode",null,null,1,null,n.TEXTURE_TRILINEAR_SAMPLINGMODE,c,!1,void 0,e.type,void 0,null,!1,void 0,g),e._isRGBD=!1,e.invertY=!1,_=c.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:n.TEXTURE_TRILINEAR_SAMPLINGMODE,type:e.type,format:n.TEXTUREFORMAT_RGBA});else if(e._isRGBD=!0,e.invertY=!0,d){const t=3,r=e._lodGenerationScale,o=e._lodGenerationOffset;for(let s=0;s<t;s++){const l=(p-1)*r+o,u=o+(l-o)*(1-s/(t-1)),T=Math.round(Math.min(Math.max(u,0),l)),d=new a(c,2);d.isCube=!0,d.invertY=!0,d.generateMipMaps=!1,c.updateTextureSamplingMode(n.TEXTURE_LINEAR_LINEAR,d);const f=new i(null);switch(f._isCube=!0,f._texture=d,x[T]=f,s){case 0:e._lodTextureLow=f;break;case 1:e._lodTextureMid=f;break;case 2:e._lodTextureHigh=f}}}const E=[];for(let t=0;t<s.length;t++)for(let r=0;r<6;r++){const n=s[t][r],o=new Blob([n],{type:l}),a=URL.createObjectURL(o);let i;if(c._features.forceBitmapOverHTMLImageElement)i=c.createImageBitmap(o,{premultiplyAlpha:"none"}).then((n=>f(n,c,T,m,a,r,t,d,x,_,e)));else{const n=new Image;n.src=a,i=new Promise(((o,i)=>{n.onload=()=>{f(n,c,T,m,a,r,t,d,x,_,e).then((()=>o())).catch((e=>{i(e)}))},n.onerror=e=>{i(e)}}))}E.push(i)}if(s.length<p){let t;const r=Math.pow(2,p-1-s.length),o=r*r*4;switch(e.type){case n.TEXTURETYPE_UNSIGNED_INT:t=new Uint8Array(o);break;case n.TEXTURETYPE_HALF_FLOAT:t=new Uint16Array(o);break;case n.TEXTURETYPE_FLOAT:t=new Float32Array(o)}for(let r=s.length;r<p;r++)for(let n=0;n<6;n++)c._uploadArrayBufferViewToTexture(e,t,n,r)}return Promise.all(E).then((()=>{_&&(c._releaseTexture(e),_._swapAndDie(e)),m&&m.dispose(),d&&(e._lodTextureHigh&&e._lodTextureHigh._texture&&(e._lodTextureHigh._texture.isReady=!0),e._lodTextureMid&&e._lodTextureMid._texture&&(e._lodTextureMid._texture.isReady=!0),e._lodTextureLow&&e._lodTextureLow._texture&&(e._lodTextureLow._texture.isReady=!0))}))}function _(e,t){const r=(t=T(t)).irradiance;if(!r)return;const n=new s;l.FromArrayToRef(r.x,0,n.x),l.FromArrayToRef(r.y,0,n.y),l.FromArrayToRef(r.z,0,n.z),l.FromArrayToRef(r.xx,0,n.xx),l.FromArrayToRef(r.yy,0,n.yy),l.FromArrayToRef(r.zz,0,n.zz),l.FromArrayToRef(r.yz,0,n.yz),l.FromArrayToRef(r.zx,0,n.zx),l.FromArrayToRef(r.xy,0,n.xy),e._sphericalPolynomial=n}function x(e,t,r,n,o){const a=m(e.getEngine().createRawCubeTexture(null,e.width,e.format,e.type,e.generateMipMaps,e.invertY,e.samplingMode,e._compression),t).then((()=>e));return e.onRebuildCallback=e=>({proxy:a,isReady:!0,isAsync:!0}),e._source=13,e._bufferViewArrayArray=t,e._lodGenerationScale=n,e._lodGenerationOffset=o,e._sphericalPolynomial=r,m(e,t).then((()=>(e.isReady=!0,e)))}export{c as G,_ as U,x as _,d as a};
2
+ //# sourceMappingURL=environmentTextureTools-BYQHZH-c.esm.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentTextureTools-BYQHZH-c.esm.min.js","sources":["../../../../../dev/core/dist/Misc/environmentTextureTools.js"],"sourcesContent":["import { Tools } from \"./tools\";\nimport { Vector3 } from \"../Maths/math.vector\";\nimport { ILog2 } from \"../Maths/math.scalar.functions\";\nimport { SphericalPolynomial } from \"../Maths/sphericalPolynomial\";\nimport { InternalTexture } from \"../Materials/Textures/internalTexture\";\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\nimport { Constants } from \"../Engines/constants\";\nimport { Scene } from \"../scene\";\nimport { PostProcess } from \"../PostProcesses/postProcess\";\nimport { Logger } from \"../Misc/logger\";\nimport { RGBDTextureTools } from \"./rgbdTextureTools\";\nimport \"../Materials/Textures/baseTexture.polynomial\";\nimport { DumpDataAsync } from \"../Misc/dumpTools\";\nconst DefaultEnvironmentTextureImageType = \"image/png\";\nconst CurrentVersion = 2;\n/**\n * Magic number identifying the env file.\n */\nconst MagicBytes = [0x86, 0x16, 0x87, 0x96, 0xf6, 0xd6, 0x96, 0x36];\n/**\n * Gets the environment info from an env file.\n * @param data The array buffer containing the .env bytes.\n * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.\n */\nexport function GetEnvInfo(data) {\n const dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);\n let pos = 0;\n for (let i = 0; i < MagicBytes.length; i++) {\n if (dataView.getUint8(pos++) !== MagicBytes[i]) {\n Logger.Error(\"Not a babylon environment map\");\n return null;\n }\n }\n // Read json manifest - collect characters up to null terminator\n let manifestString = \"\";\n let charCode = 0x00;\n while ((charCode = dataView.getUint8(pos++))) {\n manifestString += String.fromCharCode(charCode);\n }\n let manifest = JSON.parse(manifestString);\n manifest = normalizeEnvInfo(manifest);\n if (manifest.specular) {\n // Extend the header with the position of the payload.\n manifest.specular.specularDataPosition = pos;\n // Fallback to 0.8 exactly if lodGenerationScale is not defined for backward compatibility.\n manifest.specular.lodGenerationScale = manifest.specular.lodGenerationScale || 0.8;\n }\n return manifest;\n}\n/**\n * Normalizes any supported version of the environment file info to the latest version\n * @param info environment file info on any supported version\n * @returns environment file info in the latest supported version\n * @private\n */\nexport function normalizeEnvInfo(info) {\n if (info.version > CurrentVersion) {\n throw new Error(`Unsupported babylon environment map version \"${info.version}\". Latest supported version is \"${CurrentVersion}\".`);\n }\n if (info.version === 2) {\n return info;\n }\n // Migrate a v1 info to v2\n info = { ...info, version: 2, imageType: DefaultEnvironmentTextureImageType };\n return info;\n}\n/**\n * Creates an environment texture from a loaded cube texture.\n * @param texture defines the cube texture to convert in env file\n * @param options options for the conversion process\n * @param options.imageType the mime type for the encoded images, with support for \"image/png\" (default) and \"image/webp\"\n * @param options.imageQuality the image quality of encoded WebP images.\n * @returns a promise containing the environment data if successful.\n */\nexport async function CreateEnvTextureAsync(texture, options = {}) {\n const internalTexture = texture.getInternalTexture();\n if (!internalTexture) {\n return Promise.reject(\"The cube texture is invalid.\");\n }\n const imageType = options.imageType ?? DefaultEnvironmentTextureImageType;\n const engine = internalTexture.getEngine();\n if (texture.textureType !== Constants.TEXTURETYPE_HALF_FLOAT &&\n texture.textureType !== Constants.TEXTURETYPE_FLOAT &&\n texture.textureType !== Constants.TEXTURETYPE_UNSIGNED_BYTE &&\n texture.textureType !== Constants.TEXTURETYPE_UNSIGNED_BYTE &&\n texture.textureType !== Constants.TEXTURETYPE_UNSIGNED_INTEGER &&\n texture.textureType !== -1) {\n return Promise.reject(\"The cube texture should allow HDR (Full Float or Half Float).\");\n }\n let textureType = Constants.TEXTURETYPE_FLOAT;\n if (!engine.getCaps().textureFloatRender) {\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\n if (!engine.getCaps().textureHalfFloatRender) {\n return Promise.reject(\"Env texture can only be created when the browser supports half float or full float rendering.\");\n }\n }\n // sphericalPolynomial is lazy loaded so simply accessing it should trigger the computation.\n texture.sphericalPolynomial;\n // Lets keep track of the polynomial promise so we can wait for it to be ready before generating the pixels.\n const sphericalPolynomialPromise = texture.getInternalTexture()?._sphericalPolynomialPromise;\n const cubeWidth = internalTexture.width;\n const hostingScene = new Scene(engine);\n const specularTextures = {};\n // As we are going to readPixels the faces of the cube, make sure the drawing/update commands for the cube texture are fully sent to the GPU in case it is drawn for the first time in this very frame!\n engine.flushFramebuffer();\n // Read and collect all mipmaps data from the cube.\n const mipmapsCount = ILog2(internalTexture.width);\n for (let i = 0; i <= mipmapsCount; i++) {\n const faceWidth = Math.pow(2, mipmapsCount - i);\n // All faces of the cube.\n for (let face = 0; face < 6; face++) {\n let faceData = await texture.readPixels(face, i, undefined, false);\n if (faceData && faceData.byteLength === faceData.length) {\n const faceDataFloat = new Float32Array(faceData.byteLength * 4);\n for (let i = 0; i < faceData.byteLength; i++) {\n faceDataFloat[i] = faceData[i] / 255;\n // Gamma to linear\n faceDataFloat[i] = Math.pow(faceDataFloat[i], 2.2);\n }\n faceData = faceDataFloat;\n }\n else if (faceData && texture.gammaSpace) {\n const floatData = faceData;\n for (let i = 0; i < floatData.length; i++) {\n // Gamma to linear\n floatData[i] = Math.pow(floatData[i], 2.2);\n }\n }\n const tempTexture = engine.createRawTexture(faceData, faceWidth, faceWidth, Constants.TEXTUREFORMAT_RGBA, false, true, Constants.TEXTURE_NEAREST_SAMPLINGMODE, null, textureType);\n await RGBDTextureTools.EncodeTextureToRGBD(tempTexture, hostingScene, textureType);\n const rgbdEncodedData = await engine._readTexturePixels(tempTexture, faceWidth, faceWidth);\n const imageEncodedData = await DumpDataAsync(faceWidth, faceWidth, rgbdEncodedData, imageType, undefined, false, true, options.imageQuality);\n specularTextures[i * 6 + face] = imageEncodedData;\n tempTexture.dispose();\n }\n }\n // We can delete the hosting scene keeping track of all the creation objects\n hostingScene.dispose();\n // Ensure completion of the polynomial creation promise.\n if (sphericalPolynomialPromise) {\n await sphericalPolynomialPromise;\n }\n // Creates the json header for the env texture\n const info = {\n version: CurrentVersion,\n width: cubeWidth,\n imageType,\n irradiance: _CreateEnvTextureIrradiance(texture),\n specular: {\n mipmaps: [],\n lodGenerationScale: texture.lodGenerationScale,\n },\n };\n // Sets the specular image data information\n let position = 0;\n for (let i = 0; i <= mipmapsCount; i++) {\n for (let face = 0; face < 6; face++) {\n const byteLength = specularTextures[i * 6 + face].byteLength;\n info.specular.mipmaps.push({\n length: byteLength,\n position: position,\n });\n position += byteLength;\n }\n }\n // Encode the JSON as an array buffer\n const infoString = JSON.stringify(info);\n const infoBuffer = new ArrayBuffer(infoString.length + 1);\n const infoView = new Uint8Array(infoBuffer); // Limited to ascii subset matching unicode.\n for (let i = 0, strLen = infoString.length; i < strLen; i++) {\n infoView[i] = infoString.charCodeAt(i);\n }\n // Ends up with a null terminator for easier parsing\n infoView[infoString.length] = 0x00;\n // Computes the final required size and creates the storage\n const totalSize = MagicBytes.length + position + infoBuffer.byteLength;\n const finalBuffer = new ArrayBuffer(totalSize);\n const finalBufferView = new Uint8Array(finalBuffer);\n const dataView = new DataView(finalBuffer);\n // Copy the magic bytes identifying the file in\n let pos = 0;\n for (let i = 0; i < MagicBytes.length; i++) {\n dataView.setUint8(pos++, MagicBytes[i]);\n }\n // Add the json info\n finalBufferView.set(new Uint8Array(infoBuffer), pos);\n pos += infoBuffer.byteLength;\n // Finally inserts the texture data\n for (let i = 0; i <= mipmapsCount; i++) {\n for (let face = 0; face < 6; face++) {\n const dataBuffer = specularTextures[i * 6 + face];\n finalBufferView.set(new Uint8Array(dataBuffer), pos);\n pos += dataBuffer.byteLength;\n }\n }\n // Voila\n return finalBuffer;\n}\n/**\n * Creates a JSON representation of the spherical data.\n * @param texture defines the texture containing the polynomials\n * @returns the JSON representation of the spherical info\n */\nfunction _CreateEnvTextureIrradiance(texture) {\n const polynmials = texture.sphericalPolynomial;\n if (polynmials == null) {\n return null;\n }\n return {\n x: [polynmials.x.x, polynmials.x.y, polynmials.x.z],\n y: [polynmials.y.x, polynmials.y.y, polynmials.y.z],\n z: [polynmials.z.x, polynmials.z.y, polynmials.z.z],\n xx: [polynmials.xx.x, polynmials.xx.y, polynmials.xx.z],\n yy: [polynmials.yy.x, polynmials.yy.y, polynmials.yy.z],\n zz: [polynmials.zz.x, polynmials.zz.y, polynmials.zz.z],\n yz: [polynmials.yz.x, polynmials.yz.y, polynmials.yz.z],\n zx: [polynmials.zx.x, polynmials.zx.y, polynmials.zx.z],\n xy: [polynmials.xy.x, polynmials.xy.y, polynmials.xy.z],\n };\n}\n/**\n * Creates the ArrayBufferViews used for initializing environment texture image data.\n * @param data the image data\n * @param info parameters that determine what views will be created for accessing the underlying buffer\n * @returns the views described by info providing access to the underlying buffer\n */\nexport function CreateImageDataArrayBufferViews(data, info) {\n info = normalizeEnvInfo(info);\n const specularInfo = info.specular;\n // Double checks the enclosed info\n let mipmapsCount = Math.log2(info.width);\n mipmapsCount = Math.round(mipmapsCount) + 1;\n if (specularInfo.mipmaps.length !== 6 * mipmapsCount) {\n throw new Error(`Unsupported specular mipmaps number \"${specularInfo.mipmaps.length}\"`);\n }\n const imageData = new Array(mipmapsCount);\n for (let i = 0; i < mipmapsCount; i++) {\n imageData[i] = new Array(6);\n for (let face = 0; face < 6; face++) {\n const imageInfo = specularInfo.mipmaps[i * 6 + face];\n imageData[i][face] = new Uint8Array(data.buffer, data.byteOffset + specularInfo.specularDataPosition + imageInfo.position, imageInfo.length);\n }\n }\n return imageData;\n}\n/**\n * Uploads the texture info contained in the env file to the GPU.\n * @param texture defines the internal texture to upload to\n * @param data defines the data to load\n * @param info defines the texture info retrieved through the GetEnvInfo method\n * @returns a promise\n */\nexport function UploadEnvLevelsAsync(texture, data, info) {\n info = normalizeEnvInfo(info);\n const specularInfo = info.specular;\n if (!specularInfo) {\n // Nothing else parsed so far\n return Promise.resolve();\n }\n texture._lodGenerationScale = specularInfo.lodGenerationScale;\n const imageData = CreateImageDataArrayBufferViews(data, info);\n return UploadLevelsAsync(texture, imageData, info.imageType);\n}\nfunction _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture) {\n return new Promise((resolve, reject) => {\n if (expandTexture) {\n const tempTexture = engine.createTexture(null, true, true, null, Constants.TEXTURE_NEAREST_SAMPLINGMODE, null, (message) => {\n reject(message);\n }, image);\n rgbdPostProcess?.onEffectCreatedObservable.addOnce((effect) => {\n effect.executeWhenCompiled(() => {\n // Uncompress the data to a RTT\n rgbdPostProcess.externalTextureSamplerBinding = true;\n rgbdPostProcess.onApply = (effect) => {\n effect._bindTexture(\"textureSampler\", tempTexture);\n effect.setFloat2(\"scale\", 1, engine._features.needsInvertingBitmap && image instanceof ImageBitmap ? -1 : 1);\n };\n if (!engine.scenes.length) {\n return;\n }\n engine.scenes[0].postProcessManager.directRender([rgbdPostProcess], cubeRtt, true, face, i);\n // Cleanup\n engine.restoreDefaultFramebuffer();\n tempTexture.dispose();\n URL.revokeObjectURL(url);\n resolve();\n });\n });\n }\n else {\n engine._uploadImageToTexture(texture, image, face, i);\n // Upload the face to the non lod texture support\n if (generateNonLODTextures) {\n const lodTexture = lodTextures[i];\n if (lodTexture) {\n engine._uploadImageToTexture(lodTexture._texture, image, face, 0);\n }\n }\n resolve();\n }\n });\n}\n/**\n * Uploads the levels of image data to the GPU.\n * @param texture defines the internal texture to upload to\n * @param imageData defines the array buffer views of image data [mipmap][face]\n * @param imageType the mime type of the image data\n * @returns a promise\n */\nexport async function UploadLevelsAsync(texture, imageData, imageType = DefaultEnvironmentTextureImageType) {\n if (!Tools.IsExponentOfTwo(texture.width)) {\n throw new Error(\"Texture size must be a power of two\");\n }\n const mipmapsCount = ILog2(texture.width) + 1;\n // Gets everything ready.\n const engine = texture.getEngine();\n let expandTexture = false;\n let generateNonLODTextures = false;\n let rgbdPostProcess = null;\n let cubeRtt = null;\n let lodTextures = null;\n const caps = engine.getCaps();\n texture.format = Constants.TEXTUREFORMAT_RGBA;\n texture.type = Constants.TEXTURETYPE_UNSIGNED_INT;\n texture.generateMipMaps = true;\n texture._cachedAnisotropicFilteringLevel = null;\n engine.updateTextureSamplingMode(Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, texture);\n // Add extra process if texture lod is not supported\n if (!caps.textureLOD) {\n expandTexture = false;\n generateNonLODTextures = true;\n lodTextures = {};\n }\n // in webgl 1 there are no ways to either render or copy lod level information for float textures.\n else if (!engine._features.supportRenderAndCopyToLodForFloatTextures) {\n expandTexture = false;\n }\n // If half float available we can uncompress the texture\n else if (caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering) {\n expandTexture = true;\n texture.type = Constants.TEXTURETYPE_HALF_FLOAT;\n }\n // If full float available we can uncompress the texture\n else if (caps.textureFloatRender && caps.textureFloatLinearFiltering) {\n expandTexture = true;\n texture.type = Constants.TEXTURETYPE_FLOAT;\n }\n // Expand the texture if possible\n let shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n if (expandTexture) {\n if (engine.isWebGPU) {\n shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n await import(\"../ShadersWGSL/rgbdDecode.fragment\");\n }\n else {\n await import(\"../Shaders/rgbdDecode.fragment\");\n }\n // Simply run through the decode PP\n rgbdPostProcess = new PostProcess(\"rgbdDecode\", \"rgbdDecode\", null, null, 1, null, Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, engine, false, undefined, texture.type, undefined, null, false, undefined, shaderLanguage);\n texture._isRGBD = false;\n texture.invertY = false;\n cubeRtt = engine.createRenderTargetCubeTexture(texture.width, {\n generateDepthBuffer: false,\n generateMipMaps: true,\n generateStencilBuffer: false,\n samplingMode: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\n type: texture.type,\n format: Constants.TEXTUREFORMAT_RGBA,\n });\n }\n else {\n texture._isRGBD = true;\n texture.invertY = true;\n // In case of missing support, applies the same patch than DDS files.\n if (generateNonLODTextures) {\n const mipSlices = 3;\n const scale = texture._lodGenerationScale;\n const offset = texture._lodGenerationOffset;\n for (let i = 0; i < mipSlices; i++) {\n //compute LOD from even spacing in smoothness (matching shader calculation)\n const smoothness = i / (mipSlices - 1);\n const roughness = 1 - smoothness;\n const minLODIndex = offset; // roughness = 0\n const maxLODIndex = (mipmapsCount - 1) * scale + offset; // roughness = 1 (mipmaps start from 0)\n const lodIndex = minLODIndex + (maxLODIndex - minLODIndex) * roughness;\n const mipmapIndex = Math.round(Math.min(Math.max(lodIndex, 0), maxLODIndex));\n const glTextureFromLod = new InternalTexture(engine, 2 /* InternalTextureSource.Temp */);\n glTextureFromLod.isCube = true;\n glTextureFromLod.invertY = true;\n glTextureFromLod.generateMipMaps = false;\n engine.updateTextureSamplingMode(Constants.TEXTURE_LINEAR_LINEAR, glTextureFromLod);\n // Wrap in a base texture for easy binding.\n const lodTexture = new BaseTexture(null);\n lodTexture._isCube = true;\n lodTexture._texture = glTextureFromLod;\n lodTextures[mipmapIndex] = lodTexture;\n switch (i) {\n case 0:\n texture._lodTextureLow = lodTexture;\n break;\n case 1:\n texture._lodTextureMid = lodTexture;\n break;\n case 2:\n texture._lodTextureHigh = lodTexture;\n break;\n }\n }\n }\n }\n const promises = [];\n // All mipmaps up to provided number of images\n for (let i = 0; i < imageData.length; i++) {\n // All faces\n for (let face = 0; face < 6; face++) {\n // Constructs an image element from image data\n const bytes = imageData[i][face];\n const blob = new Blob([bytes], { type: imageType });\n const url = URL.createObjectURL(blob);\n let promise;\n if (engine._features.forceBitmapOverHTMLImageElement) {\n promise = engine.createImageBitmap(blob, { premultiplyAlpha: \"none\" }).then((img) => {\n return _OnImageReadyAsync(img, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture);\n });\n }\n else {\n const image = new Image();\n image.src = url;\n // Enqueue promise to upload to the texture.\n promise = new Promise((resolve, reject) => {\n image.onload = () => {\n _OnImageReadyAsync(image, engine, expandTexture, rgbdPostProcess, url, face, i, generateNonLODTextures, lodTextures, cubeRtt, texture)\n .then(() => resolve())\n .catch((reason) => {\n reject(reason);\n });\n };\n image.onerror = (error) => {\n reject(error);\n };\n });\n }\n promises.push(promise);\n }\n }\n // Fill remaining mipmaps with black textures.\n if (imageData.length < mipmapsCount) {\n let data;\n const size = Math.pow(2, mipmapsCount - 1 - imageData.length);\n const dataLength = size * size * 4;\n switch (texture.type) {\n case Constants.TEXTURETYPE_UNSIGNED_INT: {\n data = new Uint8Array(dataLength);\n break;\n }\n case Constants.TEXTURETYPE_HALF_FLOAT: {\n data = new Uint16Array(dataLength);\n break;\n }\n case Constants.TEXTURETYPE_FLOAT: {\n data = new Float32Array(dataLength);\n break;\n }\n }\n for (let i = imageData.length; i < mipmapsCount; i++) {\n for (let face = 0; face < 6; face++) {\n engine._uploadArrayBufferViewToTexture(texture, data, face, i);\n }\n }\n }\n // Once all done, finishes the cleanup and return\n return Promise.all(promises).then(() => {\n // Release temp RTT.\n if (cubeRtt) {\n engine._releaseTexture(texture);\n cubeRtt._swapAndDie(texture);\n }\n // Release temp Post Process.\n if (rgbdPostProcess) {\n rgbdPostProcess.dispose();\n }\n // Flag internal texture as ready in case they are in use.\n if (generateNonLODTextures) {\n if (texture._lodTextureHigh && texture._lodTextureHigh._texture) {\n texture._lodTextureHigh._texture.isReady = true;\n }\n if (texture._lodTextureMid && texture._lodTextureMid._texture) {\n texture._lodTextureMid._texture.isReady = true;\n }\n if (texture._lodTextureLow && texture._lodTextureLow._texture) {\n texture._lodTextureLow._texture.isReady = true;\n }\n }\n });\n}\n/**\n * Uploads spherical polynomials information to the texture.\n * @param texture defines the texture we are trying to upload the information to\n * @param info defines the environment texture info retrieved through the GetEnvInfo method\n */\nexport function UploadEnvSpherical(texture, info) {\n info = normalizeEnvInfo(info);\n const irradianceInfo = info.irradiance;\n if (!irradianceInfo) {\n return;\n }\n const sp = new SphericalPolynomial();\n Vector3.FromArrayToRef(irradianceInfo.x, 0, sp.x);\n Vector3.FromArrayToRef(irradianceInfo.y, 0, sp.y);\n Vector3.FromArrayToRef(irradianceInfo.z, 0, sp.z);\n Vector3.FromArrayToRef(irradianceInfo.xx, 0, sp.xx);\n Vector3.FromArrayToRef(irradianceInfo.yy, 0, sp.yy);\n Vector3.FromArrayToRef(irradianceInfo.zz, 0, sp.zz);\n Vector3.FromArrayToRef(irradianceInfo.yz, 0, sp.yz);\n Vector3.FromArrayToRef(irradianceInfo.zx, 0, sp.zx);\n Vector3.FromArrayToRef(irradianceInfo.xy, 0, sp.xy);\n texture._sphericalPolynomial = sp;\n}\n/**\n * @internal\n */\nexport function _UpdateRGBDAsync(internalTexture, data, sphericalPolynomial, lodScale, lodOffset) {\n const proxy = internalTexture\n .getEngine()\n .createRawCubeTexture(null, internalTexture.width, internalTexture.format, internalTexture.type, internalTexture.generateMipMaps, internalTexture.invertY, internalTexture.samplingMode, internalTexture._compression);\n const proxyPromise = UploadLevelsAsync(proxy, data).then(() => internalTexture);\n internalTexture.onRebuildCallback = (_internalTexture) => {\n return {\n proxy: proxyPromise,\n isReady: true,\n isAsync: true,\n };\n };\n internalTexture._source = 13 /* InternalTextureSource.CubeRawRGBD */;\n internalTexture._bufferViewArrayArray = data;\n internalTexture._lodGenerationScale = lodScale;\n internalTexture._lodGenerationOffset = lodOffset;\n internalTexture._sphericalPolynomial = sphericalPolynomial;\n return UploadLevelsAsync(internalTexture, data).then(() => {\n internalTexture.isReady = true;\n return internalTexture;\n });\n}\n/**\n * Sets of helpers addressing the serialization and deserialization of environment texture\n * stored in a BabylonJS env file.\n * Those files are usually stored as .env files.\n */\nexport const EnvironmentTextureTools = {\n /**\n * Gets the environment info from an env file.\n * @param data The array buffer containing the .env bytes.\n * @returns the environment file info (the json header) if successfully parsed, normalized to the latest supported version.\n */\n GetEnvInfo,\n /**\n * Creates an environment texture from a loaded cube texture.\n * @param texture defines the cube texture to convert in env file\n * @param options options for the conversion process\n * @param options.imageType the mime type for the encoded images, with support for \"image/png\" (default) and \"image/webp\"\n * @param options.imageQuality the image quality of encoded WebP images.\n * @returns a promise containing the environment data if successful.\n */\n CreateEnvTextureAsync,\n /**\n * Creates the ArrayBufferViews used for initializing environment texture image data.\n * @param data the image data\n * @param info parameters that determine what views will be created for accessing the underlying buffer\n * @returns the views described by info providing access to the underlying buffer\n */\n CreateImageDataArrayBufferViews,\n /**\n * Uploads the texture info contained in the env file to the GPU.\n * @param texture defines the internal texture to upload to\n * @param data defines the data to load\n * @param info defines the texture info retrieved through the GetEnvInfo method\n * @returns a promise\n */\n UploadEnvLevelsAsync,\n /**\n * Uploads the levels of image data to the GPU.\n * @param texture defines the internal texture to upload to\n * @param imageData defines the array buffer views of image data [mipmap][face]\n * @param imageType the mime type of the image data\n * @returns a promise\n */\n UploadLevelsAsync,\n /**\n * Uploads spherical polynomials information to the texture.\n * @param texture defines the texture we are trying to upload the information to\n * @param info defines the environment texture info retrieved through the GetEnvInfo method\n */\n UploadEnvSpherical,\n};\n//# sourceMappingURL=environmentTextureTools.js.map"],"names":["DefaultEnvironmentTextureImageType","MagicBytes","GetEnvInfo","data","dataView","DataView","buffer","byteOffset","byteLength","pos","i","length","getUint8","Logger","Error","manifestString","charCode","String","fromCharCode","manifest","JSON","parse","normalizeEnvInfo","specular","specularDataPosition","lodGenerationScale","info","version","imageType","UploadEnvLevelsAsync","texture","specularInfo","Promise","resolve","_lodGenerationScale","imageData","mipmapsCount","Math","log2","width","round","mipmaps","Array","face","imageInfo","Uint8Array","position","CreateImageDataArrayBufferViews","UploadLevelsAsync","_OnImageReadyAsync","image","engine","expandTexture","rgbdPostProcess","url","generateNonLODTextures","lodTextures","cubeRtt","reject","tempTexture","createTexture","Constants","TEXTURE_NEAREST_SAMPLINGMODE","message","onEffectCreatedObservable","addOnce","effect","executeWhenCompiled","externalTextureSamplerBinding","onApply","_bindTexture","setFloat2","_features","needsInvertingBitmap","ImageBitmap","scenes","postProcessManager","directRender","restoreDefaultFramebuffer","dispose","URL","revokeObjectURL","_uploadImageToTexture","lodTexture","_texture","async","Tools","IsExponentOfTwo","ILog2","getEngine","caps","getCaps","format","TEXTUREFORMAT_RGBA","type","TEXTURETYPE_UNSIGNED_INT","generateMipMaps","_cachedAnisotropicFilteringLevel","updateTextureSamplingMode","TEXTURE_TRILINEAR_SAMPLINGMODE","textureLOD","supportRenderAndCopyToLodForFloatTextures","textureHalfFloatRender","textureHalfFloatLinearFiltering","TEXTURETYPE_HALF_FLOAT","textureFloatRender","textureFloatLinearFiltering","TEXTURETYPE_FLOAT","shaderLanguage","isWebGPU","import","PostProcess","undefined","_isRGBD","invertY","createRenderTargetCubeTexture","generateDepthBuffer","generateStencilBuffer","samplingMode","mipSlices","scale","offset","_lodGenerationOffset","maxLODIndex","lodIndex","mipmapIndex","min","max","glTextureFromLod","InternalTexture","isCube","TEXTURE_LINEAR_LINEAR","BaseTexture","_isCube","_lodTextureLow","_lodTextureMid","_lodTextureHigh","promises","bytes","blob","Blob","createObjectURL","promise","forceBitmapOverHTMLImageElement","createImageBitmap","premultiplyAlpha","then","img","Image","src","onload","catch","reason","onerror","error","push","size","pow","dataLength","Uint16Array","Float32Array","_uploadArrayBufferViewToTexture","all","_releaseTexture","_swapAndDie","isReady","UploadEnvSpherical","irradianceInfo","irradiance","sp","SphericalPolynomial","Vector3","FromArrayToRef","x","y","z","xx","yy","zz","yz","zx","xy","_sphericalPolynomial","_UpdateRGBDAsync","internalTexture","sphericalPolynomial","lodScale","lodOffset","proxyPromise","createRawCubeTexture","_compression","onRebuildCallback","_internalTexture","proxy","isAsync","_source","_bufferViewArrayArray"],"mappings":"iJAaA,MAAMA,EAAqC,YAKrCC,EAAa,CAAC,IAAM,GAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAMvD,SAASC,EAAWC,GACvB,MAAMC,EAAW,IAAIC,SAASF,EAAKG,OAAQH,EAAKI,WAAYJ,EAAKK,YACjE,IAAIC,EAAM,EACV,IAAK,IAAIC,EAAI,EAAGA,EAAIT,EAAWU,OAAQD,IACnC,GAAIN,EAASQ,SAASH,OAAWR,EAAWS,GAExC,OADAG,EAAOC,MAAM,iCACN,KAIf,IAAIC,EAAiB,GACjBC,EAAW,EACf,KAAQA,EAAWZ,EAASQ,SAASH,MACjCM,GAAkBE,OAAOC,aAAaF,GAE1C,IAAIG,EAAWC,KAAKC,MAAMN,GAQ1B,OAPAI,EAAWG,EAAiBH,GACxBA,EAASI,WAETJ,EAASI,SAASC,qBAAuBf,EAEzCU,EAASI,SAASE,mBAAqBN,EAASI,SAASE,oBAAsB,IAE5EN,CACX,CAOO,SAASG,EAAiBI,GAC7B,GAAIA,EAAKC,QA1CU,EA2Cf,MAAM,IAAIb,MAAM,gDAAgDY,EAAKC,8CAEzE,OAAqB,IAAjBD,EAAKC,QACED,EAGXA,EAAO,IAAKA,EAAMC,QAAS,EAAGC,UAAW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