@babylonjs/viewer 7.35.1 → 7.35.2-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 (599) 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_image_based-I6dGStsg.esm.min.js +2 -0
  7. package/dist/chunks/EXT_lights_image_based-I6dGStsg.esm.min.js.map +1 -0
  8. package/dist/chunks/EXT_lights_image_based-gqNsOFez.esm.js +171 -0
  9. package/dist/chunks/EXT_lights_image_based-gqNsOFez.esm.js.map +1 -0
  10. package/dist/chunks/EXT_mesh_gpu_instancing-DFS6xr5n.esm.min.js +2 -0
  11. package/dist/chunks/EXT_mesh_gpu_instancing-DFS6xr5n.esm.min.js.map +1 -0
  12. package/dist/chunks/EXT_mesh_gpu_instancing-lOryCKIX.esm.js +86 -0
  13. package/dist/chunks/EXT_mesh_gpu_instancing-lOryCKIX.esm.js.map +1 -0
  14. package/dist/chunks/EXT_meshopt_compression-BQZ0hBff.esm.js +134 -0
  15. package/dist/chunks/EXT_meshopt_compression-BQZ0hBff.esm.js.map +1 -0
  16. package/dist/chunks/EXT_meshopt_compression-Dv_WoTzw.esm.min.js +2 -0
  17. package/dist/chunks/EXT_meshopt_compression-Dv_WoTzw.esm.min.js.map +1 -0
  18. package/dist/chunks/EXT_texture_avif-BLib9ZsW.esm.js +44 -0
  19. package/dist/chunks/EXT_texture_avif-BLib9ZsW.esm.js.map +1 -0
  20. package/dist/chunks/EXT_texture_avif-BMUg03OA.esm.min.js +2 -0
  21. package/dist/chunks/EXT_texture_avif-BMUg03OA.esm.min.js.map +1 -0
  22. package/dist/chunks/EXT_texture_webp-DPJIMXIs.esm.js +43 -0
  23. package/dist/chunks/EXT_texture_webp-DPJIMXIs.esm.js.map +1 -0
  24. package/dist/chunks/EXT_texture_webp-DPzL7RO5.esm.min.js +2 -0
  25. package/dist/chunks/EXT_texture_webp-DPzL7RO5.esm.min.js.map +1 -0
  26. package/dist/chunks/ExtrasAsMetadata-CL0k4Btm.esm.js +64 -0
  27. package/dist/chunks/ExtrasAsMetadata-CL0k4Btm.esm.js.map +1 -0
  28. package/dist/chunks/ExtrasAsMetadata-O8gteBcK.esm.min.js +2 -0
  29. package/dist/chunks/ExtrasAsMetadata-O8gteBcK.esm.min.js.map +1 -0
  30. package/dist/chunks/KHR_animation_pointer-BFyC08_R.esm.js +343 -0
  31. package/dist/chunks/KHR_animation_pointer-BFyC08_R.esm.js.map +1 -0
  32. package/dist/chunks/KHR_animation_pointer-BZvneRZ7.esm.min.js +2 -0
  33. package/dist/chunks/KHR_animation_pointer-BZvneRZ7.esm.min.js.map +1 -0
  34. package/dist/chunks/KHR_draco_mesh_compression-CjzLflHM.esm.js +610 -0
  35. package/dist/chunks/KHR_draco_mesh_compression-CjzLflHM.esm.js.map +1 -0
  36. package/dist/chunks/KHR_draco_mesh_compression-sHuqiNW-.esm.min.js +2 -0
  37. package/dist/chunks/KHR_draco_mesh_compression-sHuqiNW-.esm.min.js.map +1 -0
  38. package/dist/chunks/KHR_interactivity-CA1NQ9Fc.esm.js +4033 -0
  39. package/dist/chunks/KHR_interactivity-CA1NQ9Fc.esm.js.map +1 -0
  40. package/dist/chunks/KHR_interactivity-CVvexOkD.esm.min.js +2 -0
  41. package/dist/chunks/KHR_interactivity-CVvexOkD.esm.min.js.map +1 -0
  42. package/dist/chunks/KHR_lights_punctual-CIEvgNk7.esm.js +1253 -0
  43. package/dist/chunks/KHR_lights_punctual-CIEvgNk7.esm.js.map +1 -0
  44. package/dist/chunks/KHR_lights_punctual-CTm7ey2n.esm.min.js +2 -0
  45. package/dist/chunks/KHR_lights_punctual-CTm7ey2n.esm.min.js.map +1 -0
  46. package/dist/chunks/KHR_materials_anisotropy-B8l2iZjl.esm.min.js +2 -0
  47. package/dist/chunks/KHR_materials_anisotropy-B8l2iZjl.esm.min.js.map +1 -0
  48. package/dist/chunks/KHR_materials_anisotropy-vnjucfaw.esm.js +65 -0
  49. package/dist/chunks/KHR_materials_anisotropy-vnjucfaw.esm.js.map +1 -0
  50. package/dist/chunks/KHR_materials_clearcoat-BhZGttd-.esm.js +96 -0
  51. package/dist/chunks/KHR_materials_clearcoat-BhZGttd-.esm.js.map +1 -0
  52. package/dist/chunks/KHR_materials_clearcoat-BlhYeFYN.esm.min.js +2 -0
  53. package/dist/chunks/KHR_materials_clearcoat-BlhYeFYN.esm.min.js.map +1 -0
  54. package/dist/chunks/KHR_materials_diffuse_transmission-DJiKAnah.esm.js +97 -0
  55. package/dist/chunks/KHR_materials_diffuse_transmission-DJiKAnah.esm.js.map +1 -0
  56. package/dist/chunks/KHR_materials_diffuse_transmission-DmzdysxQ.esm.min.js +2 -0
  57. package/dist/chunks/KHR_materials_diffuse_transmission-DmzdysxQ.esm.min.js.map +1 -0
  58. package/dist/chunks/KHR_materials_dispersion-B1e8i3BQ.esm.js +62 -0
  59. package/dist/chunks/KHR_materials_dispersion-B1e8i3BQ.esm.js.map +1 -0
  60. package/dist/chunks/KHR_materials_dispersion-B_uhZ_r0.esm.min.js +2 -0
  61. package/dist/chunks/KHR_materials_dispersion-B_uhZ_r0.esm.min.js.map +1 -0
  62. package/dist/chunks/KHR_materials_emissive_strength-Bdc1fhX3.esm.js +55 -0
  63. package/dist/chunks/KHR_materials_emissive_strength-Bdc1fhX3.esm.js.map +1 -0
  64. package/dist/chunks/KHR_materials_emissive_strength-CujgLUsQ.esm.min.js +2 -0
  65. package/dist/chunks/KHR_materials_emissive_strength-CujgLUsQ.esm.min.js.map +1 -0
  66. package/dist/chunks/KHR_materials_ior-DAITk5f0.esm.js +64 -0
  67. package/dist/chunks/KHR_materials_ior-DAITk5f0.esm.js.map +1 -0
  68. package/dist/chunks/KHR_materials_ior-DDjIIueh.esm.min.js +2 -0
  69. package/dist/chunks/KHR_materials_ior-DDjIIueh.esm.min.js.map +1 -0
  70. package/dist/chunks/KHR_materials_iridescence-Bs4XQdUc.esm.js +72 -0
  71. package/dist/chunks/KHR_materials_iridescence-Bs4XQdUc.esm.js.map +1 -0
  72. package/dist/chunks/KHR_materials_iridescence-CofsEJxf.esm.min.js +2 -0
  73. package/dist/chunks/KHR_materials_iridescence-CofsEJxf.esm.min.js.map +1 -0
  74. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D2cm0Qti.esm.js +81 -0
  75. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-D2cm0Qti.esm.js.map +1 -0
  76. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-Na22WakQ.esm.min.js +2 -0
  77. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-Na22WakQ.esm.min.js.map +1 -0
  78. package/dist/chunks/KHR_materials_sheen-BCY5GSrv.esm.js +85 -0
  79. package/dist/chunks/KHR_materials_sheen-BCY5GSrv.esm.js.map +1 -0
  80. package/dist/chunks/KHR_materials_sheen-BEHiRviB.esm.min.js +2 -0
  81. package/dist/chunks/KHR_materials_sheen-BEHiRviB.esm.min.js.map +1 -0
  82. package/dist/chunks/KHR_materials_specular-BFt2dwLj.esm.js +75 -0
  83. package/dist/chunks/KHR_materials_specular-BFt2dwLj.esm.js.map +1 -0
  84. package/dist/chunks/KHR_materials_specular-BGIPQ1rQ.esm.min.js +2 -0
  85. package/dist/chunks/KHR_materials_specular-BGIPQ1rQ.esm.min.js.map +1 -0
  86. package/dist/chunks/KHR_materials_transmission-BgbdeIB3.esm.js +307 -0
  87. package/dist/chunks/KHR_materials_transmission-BgbdeIB3.esm.js.map +1 -0
  88. package/dist/chunks/KHR_materials_transmission-C-tRBJu4.esm.min.js +2 -0
  89. package/dist/chunks/KHR_materials_transmission-C-tRBJu4.esm.min.js.map +1 -0
  90. package/dist/chunks/KHR_materials_unlit-CcRsVA_x.esm.min.js +2 -0
  91. package/dist/chunks/KHR_materials_unlit-CcRsVA_x.esm.min.js.map +1 -0
  92. package/dist/chunks/KHR_materials_unlit-DNhfBz4E.esm.js +74 -0
  93. package/dist/chunks/KHR_materials_unlit-DNhfBz4E.esm.js.map +1 -0
  94. package/dist/chunks/KHR_materials_variants-77adpgBk.esm.min.js +2 -0
  95. package/dist/chunks/KHR_materials_variants-77adpgBk.esm.min.js.map +1 -0
  96. package/dist/chunks/KHR_materials_variants-CSaSbOzl.esm.js +238 -0
  97. package/dist/chunks/KHR_materials_variants-CSaSbOzl.esm.js.map +1 -0
  98. package/dist/chunks/KHR_materials_volume-AOCoYNKI.esm.min.js +2 -0
  99. package/dist/chunks/KHR_materials_volume-AOCoYNKI.esm.min.js.map +1 -0
  100. package/dist/chunks/KHR_materials_volume-BWHhpmNH.esm.js +87 -0
  101. package/dist/chunks/KHR_materials_volume-BWHhpmNH.esm.js.map +1 -0
  102. package/dist/chunks/KHR_mesh_quantization-BB7EL2M1.esm.min.js +2 -0
  103. package/dist/chunks/KHR_mesh_quantization-BB7EL2M1.esm.min.js.map +1 -0
  104. package/dist/chunks/KHR_mesh_quantization-D2-xHrHe.esm.js +26 -0
  105. package/dist/chunks/KHR_mesh_quantization-D2-xHrHe.esm.js.map +1 -0
  106. package/dist/chunks/KHR_node_visibility-Di8sseTY.esm.min.js +2 -0
  107. package/dist/chunks/KHR_node_visibility-Di8sseTY.esm.min.js.map +1 -0
  108. package/dist/chunks/KHR_node_visibility-qzuskO3u.esm.js +46 -0
  109. package/dist/chunks/KHR_node_visibility-qzuskO3u.esm.js.map +1 -0
  110. package/dist/chunks/KHR_texture_basisu-BUP7AAVF.esm.min.js +2 -0
  111. package/dist/chunks/KHR_texture_basisu-BUP7AAVF.esm.min.js.map +1 -0
  112. package/dist/chunks/KHR_texture_basisu-C60Bt2Ic.esm.js +43 -0
  113. package/dist/chunks/KHR_texture_basisu-C60Bt2Ic.esm.js.map +1 -0
  114. package/dist/chunks/KHR_texture_transform-BUOLLEYP.esm.min.js +2 -0
  115. package/dist/chunks/KHR_texture_transform-BUOLLEYP.esm.min.js.map +1 -0
  116. package/dist/chunks/KHR_texture_transform-Dg-cPDyd.esm.js +63 -0
  117. package/dist/chunks/KHR_texture_transform-Dg-cPDyd.esm.js.map +1 -0
  118. package/dist/chunks/KHR_xmp_json_ld-CsFE0gfF.esm.min.js +2 -0
  119. package/dist/chunks/KHR_xmp_json_ld-CsFE0gfF.esm.min.js.map +1 -0
  120. package/dist/chunks/KHR_xmp_json_ld-DgCKwEEO.esm.js +51 -0
  121. package/dist/chunks/KHR_xmp_json_ld-DgCKwEEO.esm.js.map +1 -0
  122. package/dist/chunks/MSFT_audio_emitter-VHBse1UH.esm.js +2207 -0
  123. package/dist/chunks/MSFT_audio_emitter-VHBse1UH.esm.js.map +1 -0
  124. package/dist/chunks/MSFT_audio_emitter-iFlly5g-.esm.min.js +2 -0
  125. package/dist/chunks/MSFT_audio_emitter-iFlly5g-.esm.min.js.map +1 -0
  126. package/dist/chunks/MSFT_lod-Bwsctx65.esm.js +337 -0
  127. package/dist/chunks/MSFT_lod-Bwsctx65.esm.js.map +1 -0
  128. package/dist/chunks/MSFT_lod-CbiRs9Kc.esm.min.js +2 -0
  129. package/dist/chunks/MSFT_lod-CbiRs9Kc.esm.min.js.map +1 -0
  130. package/dist/chunks/MSFT_minecraftMesh-Dl6WKmxG.esm.min.js +2 -0
  131. package/dist/chunks/MSFT_minecraftMesh-Dl6WKmxG.esm.min.js.map +1 -0
  132. package/dist/chunks/MSFT_minecraftMesh-MBaTkra4.esm.js +46 -0
  133. package/dist/chunks/MSFT_minecraftMesh-MBaTkra4.esm.js.map +1 -0
  134. package/dist/chunks/MSFT_sRGBFactors-DJvNL0IJ.esm.js +47 -0
  135. package/dist/chunks/MSFT_sRGBFactors-DJvNL0IJ.esm.js.map +1 -0
  136. package/dist/chunks/MSFT_sRGBFactors-Drf21tSs.esm.min.js +2 -0
  137. package/dist/chunks/MSFT_sRGBFactors-Drf21tSs.esm.min.js.map +1 -0
  138. package/dist/chunks/animationGroup-CgbfLDgX.esm.min.js +2 -0
  139. package/dist/chunks/animationGroup-CgbfLDgX.esm.min.js.map +1 -0
  140. package/dist/chunks/animationGroup-eowyl97W.esm.js +2482 -0
  141. package/dist/chunks/animationGroup-eowyl97W.esm.js.map +1 -0
  142. package/dist/chunks/assetContainer-Bsqe9swA.esm.min.js +2 -0
  143. package/dist/chunks/assetContainer-Bsqe9swA.esm.min.js.map +1 -0
  144. package/dist/chunks/assetContainer-DO29qm5j.esm.js +1720 -0
  145. package/dist/chunks/assetContainer-DO29qm5j.esm.js.map +1 -0
  146. package/dist/chunks/audioEngine-ByiWmXaG.esm.js +305 -0
  147. package/dist/chunks/audioEngine-ByiWmXaG.esm.js.map +1 -0
  148. package/dist/chunks/audioEngine-Tyl5gl5Y.esm.min.js +2 -0
  149. package/dist/chunks/audioEngine-Tyl5gl5Y.esm.min.js.map +1 -0
  150. package/dist/chunks/bakedVertexAnimation-BxUlezN-.esm.min.js +2 -0
  151. package/dist/chunks/bakedVertexAnimation-BxUlezN-.esm.min.js.map +1 -0
  152. package/dist/chunks/bakedVertexAnimation-Co7tF_AI.esm.js +114 -0
  153. package/dist/chunks/bakedVertexAnimation-Co7tF_AI.esm.js.map +1 -0
  154. package/dist/chunks/basisTextureLoader-C6h2HrT5.esm.min.js +2 -0
  155. package/dist/chunks/basisTextureLoader-C6h2HrT5.esm.min.js.map +1 -0
  156. package/dist/chunks/basisTextureLoader-CFdjlTQv.esm.js +600 -0
  157. package/dist/chunks/basisTextureLoader-CFdjlTQv.esm.js.map +1 -0
  158. package/dist/chunks/dds--AOY6KMC.esm.js +540 -0
  159. package/dist/chunks/dds--AOY6KMC.esm.js.map +1 -0
  160. package/dist/chunks/dds-mtdSIG7y.esm.min.js +2 -0
  161. package/dist/chunks/dds-mtdSIG7y.esm.min.js.map +1 -0
  162. package/dist/chunks/ddsTextureLoader-CS64tfyO.esm.min.js +2 -0
  163. package/dist/chunks/ddsTextureLoader-CS64tfyO.esm.min.js.map +1 -0
  164. package/dist/chunks/ddsTextureLoader-Cm3kvldL.esm.js +88 -0
  165. package/dist/chunks/ddsTextureLoader-Cm3kvldL.esm.js.map +1 -0
  166. package/dist/chunks/decalFragment-B_EoELPt.esm.min.js +2 -0
  167. package/dist/chunks/decalFragment-B_EoELPt.esm.min.js.map +1 -0
  168. package/dist/chunks/decalFragment-CrQo80qe.esm.js +18 -0
  169. package/dist/chunks/decalFragment-CrQo80qe.esm.js.map +1 -0
  170. package/dist/chunks/default.fragment-B7BZK7Wn.esm.js +433 -0
  171. package/dist/chunks/default.fragment-B7BZK7Wn.esm.js.map +1 -0
  172. package/dist/chunks/default.fragment-CDe0T1Vr.esm.min.js +2 -0
  173. package/dist/chunks/default.fragment-CDe0T1Vr.esm.min.js.map +1 -0
  174. package/dist/chunks/default.fragment-DE-fL82A.esm.min.js +2 -0
  175. package/dist/chunks/default.fragment-DE-fL82A.esm.min.js.map +1 -0
  176. package/dist/chunks/default.fragment-OyO2ek5x.esm.js +497 -0
  177. package/dist/chunks/default.fragment-OyO2ek5x.esm.js.map +1 -0
  178. package/dist/chunks/default.vertex-CNUfzDP1.esm.js +181 -0
  179. package/dist/chunks/default.vertex-CNUfzDP1.esm.js.map +1 -0
  180. package/dist/chunks/default.vertex-CfR6AC0W.esm.js +201 -0
  181. package/dist/chunks/default.vertex-CfR6AC0W.esm.js.map +1 -0
  182. package/dist/chunks/default.vertex-CxON4TPV.esm.min.js +2 -0
  183. package/dist/chunks/default.vertex-CxON4TPV.esm.min.js.map +1 -0
  184. package/dist/chunks/default.vertex-vn2_ZsRf.esm.min.js +2 -0
  185. package/dist/chunks/default.vertex-vn2_ZsRf.esm.min.js.map +1 -0
  186. package/dist/chunks/defaultUboDeclaration-DOEnRk8l.esm.min.js +2 -0
  187. package/dist/chunks/defaultUboDeclaration-DOEnRk8l.esm.min.js.map +1 -0
  188. package/dist/chunks/defaultUboDeclaration-D_cdCN09.esm.js +15 -0
  189. package/dist/chunks/defaultUboDeclaration-D_cdCN09.esm.js.map +1 -0
  190. package/dist/chunks/defaultUboDeclaration-DulGgNIT.esm.js +13 -0
  191. package/dist/chunks/defaultUboDeclaration-DulGgNIT.esm.js.map +1 -0
  192. package/dist/chunks/defaultUboDeclaration-DuvDKzIc.esm.min.js +2 -0
  193. package/dist/chunks/defaultUboDeclaration-DuvDKzIc.esm.min.js.map +1 -0
  194. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
  195. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
  196. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
  197. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
  198. package/dist/chunks/dumpTools-CDmW-p2A.esm.js +200 -0
  199. package/dist/chunks/dumpTools-CDmW-p2A.esm.js.map +1 -0
  200. package/dist/chunks/dumpTools-hJHAozcu.esm.min.js +2 -0
  201. package/dist/chunks/dumpTools-hJHAozcu.esm.min.js.map +1 -0
  202. package/dist/chunks/engine-CfBkxMlv.esm.min.js +2 -0
  203. package/dist/chunks/engine-CfBkxMlv.esm.min.js.map +1 -0
  204. package/dist/chunks/engine-DaA20vkg.esm.js +2187 -0
  205. package/dist/chunks/engine-DaA20vkg.esm.js.map +1 -0
  206. package/dist/chunks/engine.common-B1nX1uOv.esm.min.js +2 -0
  207. package/dist/chunks/engine.common-B1nX1uOv.esm.min.js.map +1 -0
  208. package/dist/chunks/engine.common-Da03TQs0.esm.js +1103 -0
  209. package/dist/chunks/engine.common-Da03TQs0.esm.js.map +1 -0
  210. package/dist/chunks/envTextureLoader-BRXi1pZo.esm.js +64 -0
  211. package/dist/chunks/envTextureLoader-BRXi1pZo.esm.js.map +1 -0
  212. package/dist/chunks/envTextureLoader-CS1eu96I.esm.min.js +2 -0
  213. package/dist/chunks/envTextureLoader-CS1eu96I.esm.min.js.map +1 -0
  214. package/dist/chunks/environmentTextureTools-BCSQExyv.esm.js +382 -0
  215. package/dist/chunks/environmentTextureTools-BCSQExyv.esm.js.map +1 -0
  216. package/dist/chunks/environmentTextureTools-DaBia0zg.esm.min.js +2 -0
  217. package/dist/chunks/environmentTextureTools-DaBia0zg.esm.min.js.map +1 -0
  218. package/dist/chunks/exrTextureLoader-DOcIuOg9.esm.min.js +2 -0
  219. package/dist/chunks/exrTextureLoader-DOcIuOg9.esm.min.js.map +1 -0
  220. package/dist/chunks/exrTextureLoader-NVzNFU10.esm.js +1682 -0
  221. package/dist/chunks/exrTextureLoader-NVzNFU10.esm.js.map +1 -0
  222. package/dist/chunks/fogFragment-7C9DmW8b.esm.js +102 -0
  223. package/dist/chunks/fogFragment-7C9DmW8b.esm.js.map +1 -0
  224. package/dist/chunks/fogFragment-B9F5aJAx.esm.min.js +2 -0
  225. package/dist/chunks/fogFragment-B9F5aJAx.esm.min.js.map +1 -0
  226. package/dist/chunks/fogFragment-BnQp0Spj.esm.js +101 -0
  227. package/dist/chunks/fogFragment-BnQp0Spj.esm.js.map +1 -0
  228. package/dist/chunks/fogFragment-Rqu9S2gV.esm.min.js +2 -0
  229. package/dist/chunks/fogFragment-Rqu9S2gV.esm.min.js.map +1 -0
  230. package/dist/chunks/fresnelFunction--bGC1bW6.esm.min.js +2 -0
  231. package/dist/chunks/fresnelFunction--bGC1bW6.esm.min.js.map +1 -0
  232. package/dist/chunks/fresnelFunction-YurpC61U.esm.js +12 -0
  233. package/dist/chunks/fresnelFunction-YurpC61U.esm.js.map +1 -0
  234. package/dist/chunks/glTFLoader--eb4oZZe.esm.min.js +2 -0
  235. package/dist/chunks/glTFLoader--eb4oZZe.esm.min.js.map +1 -0
  236. package/dist/chunks/glTFLoader-DDABr3tc.esm.js +7595 -0
  237. package/dist/chunks/glTFLoader-DDABr3tc.esm.js.map +1 -0
  238. package/dist/chunks/glTFLoaderAnimation-C_jvKQZc.esm.min.js +2 -0
  239. package/dist/chunks/glTFLoaderAnimation-C_jvKQZc.esm.min.js.map +1 -0
  240. package/dist/chunks/glTFLoaderAnimation-Ce1T-HK4.esm.js +77 -0
  241. package/dist/chunks/glTFLoaderAnimation-Ce1T-HK4.esm.js.map +1 -0
  242. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
  243. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
  244. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
  245. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
  246. package/dist/chunks/harmonicsFunctions-BVJDExzF.esm.js +35 -0
  247. package/dist/chunks/harmonicsFunctions-BVJDExzF.esm.js.map +1 -0
  248. package/dist/chunks/harmonicsFunctions-Cpf19SYh.esm.min.js +2 -0
  249. package/dist/chunks/harmonicsFunctions-Cpf19SYh.esm.min.js.map +1 -0
  250. package/dist/chunks/harmonicsFunctions-EwGi7mvH.esm.js +34 -0
  251. package/dist/chunks/harmonicsFunctions-EwGi7mvH.esm.js.map +1 -0
  252. package/dist/chunks/harmonicsFunctions-sCDYMnE7.esm.min.js +2 -0
  253. package/dist/chunks/harmonicsFunctions-sCDYMnE7.esm.min.js.map +1 -0
  254. package/dist/chunks/hdrTextureLoader-CHt5g_Ro.esm.js +252 -0
  255. package/dist/chunks/hdrTextureLoader-CHt5g_Ro.esm.js.map +1 -0
  256. package/dist/chunks/hdrTextureLoader-CcljcQGM.esm.min.js +2 -0
  257. package/dist/chunks/hdrTextureLoader-CcljcQGM.esm.min.js.map +1 -0
  258. package/dist/chunks/helperFunctions-BLQP90J_.esm.min.js +2 -0
  259. package/dist/chunks/helperFunctions-BLQP90J_.esm.min.js.map +1 -0
  260. package/dist/chunks/helperFunctions-BeWEDUrw.esm.js +108 -0
  261. package/dist/chunks/helperFunctions-BeWEDUrw.esm.js.map +1 -0
  262. package/dist/chunks/helperFunctions-CkmR3WUA.esm.min.js +2 -0
  263. package/dist/chunks/helperFunctions-CkmR3WUA.esm.min.js.map +1 -0
  264. package/dist/chunks/helperFunctions-Vnio5Zy4.esm.js +80 -0
  265. package/dist/chunks/helperFunctions-Vnio5Zy4.esm.js.map +1 -0
  266. package/dist/chunks/index-CVMH5-nD.esm.js +74148 -0
  267. package/dist/chunks/index-CVMH5-nD.esm.js.map +1 -0
  268. package/dist/chunks/index-bkYfr-SD.esm.min.js +57 -0
  269. package/dist/chunks/index-bkYfr-SD.esm.min.js.map +1 -0
  270. package/dist/chunks/ktxTextureLoader-CmYn3AjU.esm.min.js +2 -0
  271. package/dist/chunks/ktxTextureLoader-CmYn3AjU.esm.min.js.map +1 -0
  272. package/dist/chunks/ktxTextureLoader-Ct4ygDpl.esm.js +814 -0
  273. package/dist/chunks/ktxTextureLoader-Ct4ygDpl.esm.js.map +1 -0
  274. package/dist/chunks/logDepthDeclaration-CCVJgklB.esm.js +11 -0
  275. package/dist/chunks/logDepthDeclaration-CCVJgklB.esm.js.map +1 -0
  276. package/dist/chunks/logDepthDeclaration-CmefuysH.esm.min.js +2 -0
  277. package/dist/chunks/logDepthDeclaration-CmefuysH.esm.min.js.map +1 -0
  278. package/dist/chunks/logDepthDeclaration-kbT8jgiS.esm.js +35 -0
  279. package/dist/chunks/logDepthDeclaration-kbT8jgiS.esm.js.map +1 -0
  280. package/dist/chunks/logDepthDeclaration-utQE6RQm.esm.min.js +2 -0
  281. package/dist/chunks/logDepthDeclaration-utQE6RQm.esm.min.js.map +1 -0
  282. package/dist/chunks/logDepthVertex-BwAXuZcJ.esm.js +77 -0
  283. package/dist/chunks/logDepthVertex-BwAXuZcJ.esm.js.map +1 -0
  284. package/dist/chunks/logDepthVertex-CIU5ihJc.esm.min.js +2 -0
  285. package/dist/chunks/logDepthVertex-CIU5ihJc.esm.min.js.map +1 -0
  286. package/dist/chunks/logDepthVertex-DBdj3JQF.esm.js +77 -0
  287. package/dist/chunks/logDepthVertex-DBdj3JQF.esm.js.map +1 -0
  288. package/dist/chunks/logDepthVertex-L5SVOP7a.esm.min.js +2 -0
  289. package/dist/chunks/logDepthVertex-L5SVOP7a.esm.min.js.map +1 -0
  290. package/dist/chunks/mainUVVaryingDeclaration-BjN3rZcV.esm.js +11 -0
  291. package/dist/chunks/mainUVVaryingDeclaration-BjN3rZcV.esm.js.map +1 -0
  292. package/dist/chunks/mainUVVaryingDeclaration-CS8fR4k6.esm.min.js +2 -0
  293. package/dist/chunks/mainUVVaryingDeclaration-CS8fR4k6.esm.min.js.map +1 -0
  294. package/dist/chunks/mainUVVaryingDeclaration-F_ldv7kC.esm.min.js +2 -0
  295. package/dist/chunks/mainUVVaryingDeclaration-F_ldv7kC.esm.min.js.map +1 -0
  296. package/dist/chunks/mainUVVaryingDeclaration-JJ1eiwN7.esm.js +11 -0
  297. package/dist/chunks/mainUVVaryingDeclaration-JJ1eiwN7.esm.js.map +1 -0
  298. package/dist/chunks/meshUboDeclaration-Cqhjf76p.esm.min.js +2 -0
  299. package/dist/chunks/meshUboDeclaration-Cqhjf76p.esm.min.js.map +1 -0
  300. package/dist/chunks/meshUboDeclaration-TC3Qb9qA.esm.js +24 -0
  301. package/dist/chunks/meshUboDeclaration-TC3Qb9qA.esm.js.map +1 -0
  302. package/dist/chunks/objFileLoader-DUbUzdM7.esm.js +1338 -0
  303. package/dist/chunks/objFileLoader-DUbUzdM7.esm.js.map +1 -0
  304. package/dist/chunks/objFileLoader-cuX0R9Ll.esm.min.js +2 -0
  305. package/dist/chunks/objFileLoader-cuX0R9Ll.esm.min.js.map +1 -0
  306. package/dist/chunks/oitFragment-BuvtdYuN.esm.min.js +2 -0
  307. package/dist/chunks/oitFragment-BuvtdYuN.esm.min.js.map +1 -0
  308. package/dist/chunks/oitFragment-CsHXm-hs.esm.min.js +2 -0
  309. package/dist/chunks/oitFragment-CsHXm-hs.esm.min.js.map +1 -0
  310. package/dist/chunks/oitFragment-Jsj4VCRm.esm.js +1051 -0
  311. package/dist/chunks/oitFragment-Jsj4VCRm.esm.js.map +1 -0
  312. package/dist/chunks/oitFragment-bE1j7vLE.esm.js +1210 -0
  313. package/dist/chunks/oitFragment-bE1j7vLE.esm.js.map +1 -0
  314. package/dist/chunks/pass.fragment-7Tm4v4I5.esm.min.js +2 -0
  315. package/dist/chunks/pass.fragment-7Tm4v4I5.esm.min.js.map +1 -0
  316. package/dist/chunks/pass.fragment-Bim4VPEO.esm.js +15 -0
  317. package/dist/chunks/pass.fragment-Bim4VPEO.esm.js.map +1 -0
  318. package/dist/chunks/pass.fragment-CYz9acmH.esm.js +15 -0
  319. package/dist/chunks/pass.fragment-CYz9acmH.esm.js.map +1 -0
  320. package/dist/chunks/pass.fragment-CzPpw3iK.esm.min.js +2 -0
  321. package/dist/chunks/pass.fragment-CzPpw3iK.esm.min.js.map +1 -0
  322. package/dist/chunks/pbr.fragment-C0EyEtjU.esm.js +3218 -0
  323. package/dist/chunks/pbr.fragment-C0EyEtjU.esm.js.map +1 -0
  324. package/dist/chunks/pbr.fragment-D7KGHlr3.esm.min.js +2 -0
  325. package/dist/chunks/pbr.fragment-D7KGHlr3.esm.min.js.map +1 -0
  326. package/dist/chunks/pbr.fragment-DRo704mz.esm.js +3164 -0
  327. package/dist/chunks/pbr.fragment-DRo704mz.esm.js.map +1 -0
  328. package/dist/chunks/pbr.fragment-Dw30RsZq.esm.min.js +2 -0
  329. package/dist/chunks/pbr.fragment-Dw30RsZq.esm.min.js.map +1 -0
  330. package/dist/chunks/pbr.vertex-BFjD6j1a.esm.min.js +2 -0
  331. package/dist/chunks/pbr.vertex-BFjD6j1a.esm.min.js.map +1 -0
  332. package/dist/chunks/pbr.vertex-BNL0Ih3S.esm.js +214 -0
  333. package/dist/chunks/pbr.vertex-BNL0Ih3S.esm.js.map +1 -0
  334. package/dist/chunks/pbr.vertex-DCYsZj4K.esm.js +338 -0
  335. package/dist/chunks/pbr.vertex-DCYsZj4K.esm.js.map +1 -0
  336. package/dist/chunks/pbr.vertex-DQWB7B3n.esm.min.js +2 -0
  337. package/dist/chunks/pbr.vertex-DQWB7B3n.esm.min.js.map +1 -0
  338. package/dist/chunks/postprocess.vertex-BKTxzIr3.esm.js +20 -0
  339. package/dist/chunks/postprocess.vertex-BKTxzIr3.esm.js.map +1 -0
  340. package/dist/chunks/postprocess.vertex-BLM-tBsI.esm.min.js +2 -0
  341. package/dist/chunks/postprocess.vertex-BLM-tBsI.esm.min.js.map +1 -0
  342. package/dist/chunks/rawTexture-B4sxPzau.esm.js +191 -0
  343. package/dist/chunks/rawTexture-B4sxPzau.esm.js.map +1 -0
  344. package/dist/chunks/rawTexture-C8eTjsTL.esm.min.js +2 -0
  345. package/dist/chunks/rawTexture-C8eTjsTL.esm.min.js.map +1 -0
  346. package/dist/chunks/rgbdDecode.fragment-B1JRUB2c.esm.js +17 -0
  347. package/dist/chunks/rgbdDecode.fragment-B1JRUB2c.esm.js.map +1 -0
  348. package/dist/chunks/rgbdDecode.fragment-BQDhe3Gm.esm.min.js +2 -0
  349. package/dist/chunks/rgbdDecode.fragment-BQDhe3Gm.esm.min.js.map +1 -0
  350. package/dist/chunks/rgbdDecode.fragment-Bqwzk3c0.esm.js +17 -0
  351. package/dist/chunks/rgbdDecode.fragment-Bqwzk3c0.esm.js.map +1 -0
  352. package/dist/chunks/rgbdDecode.fragment-De929itq.esm.min.js +2 -0
  353. package/dist/chunks/rgbdDecode.fragment-De929itq.esm.min.js.map +1 -0
  354. package/dist/chunks/rgbdEncode.fragment-B2mbOgZ1.esm.js +17 -0
  355. package/dist/chunks/rgbdEncode.fragment-B2mbOgZ1.esm.js.map +1 -0
  356. package/dist/chunks/rgbdEncode.fragment-BR4bMAPw.esm.min.js +2 -0
  357. package/dist/chunks/rgbdEncode.fragment-BR4bMAPw.esm.min.js.map +1 -0
  358. package/dist/chunks/rgbdEncode.fragment-CnnkzvSU.esm.min.js +2 -0
  359. package/dist/chunks/rgbdEncode.fragment-CnnkzvSU.esm.min.js.map +1 -0
  360. package/dist/chunks/rgbdEncode.fragment-DdsDf_tZ.esm.js +17 -0
  361. package/dist/chunks/rgbdEncode.fragment-DdsDf_tZ.esm.js.map +1 -0
  362. package/dist/chunks/splatFileLoader-ByV2g6RW.esm.js +3947 -0
  363. package/dist/chunks/splatFileLoader-ByV2g6RW.esm.js.map +1 -0
  364. package/dist/chunks/splatFileLoader-DZtkydoO.esm.min.js +2 -0
  365. package/dist/chunks/splatFileLoader-DZtkydoO.esm.min.js.map +1 -0
  366. package/dist/chunks/standardMaterial-DUti--Yk.esm.js +1805 -0
  367. package/dist/chunks/standardMaterial-DUti--Yk.esm.js.map +1 -0
  368. package/dist/chunks/standardMaterial-DxPZ0yEO.esm.min.js +2 -0
  369. package/dist/chunks/standardMaterial-DxPZ0yEO.esm.min.js.map +1 -0
  370. package/dist/chunks/stlFileLoader-BddM0ohC.esm.js +238 -0
  371. package/dist/chunks/stlFileLoader-BddM0ohC.esm.js.map +1 -0
  372. package/dist/chunks/stlFileLoader-Daj_Ow9k.esm.min.js +2 -0
  373. package/dist/chunks/stlFileLoader-Daj_Ow9k.esm.min.js.map +1 -0
  374. package/dist/chunks/tgaTextureLoader-DDmm8z9e.esm.js +349 -0
  375. package/dist/chunks/tgaTextureLoader-DDmm8z9e.esm.js.map +1 -0
  376. package/dist/chunks/tgaTextureLoader-NZ1m7gDb.esm.min.js +2 -0
  377. package/dist/chunks/tgaTextureLoader-NZ1m7gDb.esm.min.js.map +1 -0
  378. package/dist/chunks/thinEngine-CvGTeAY9.esm.js +3723 -0
  379. package/dist/chunks/thinEngine-CvGTeAY9.esm.js.map +1 -0
  380. package/dist/chunks/thinEngine-Czvj0W_2.esm.min.js +2 -0
  381. package/dist/chunks/thinEngine-Czvj0W_2.esm.min.js.map +1 -0
  382. package/dist/chunks/thinInstanceMesh-BGeYKYJu.esm.js +314 -0
  383. package/dist/chunks/thinInstanceMesh-BGeYKYJu.esm.js.map +1 -0
  384. package/dist/chunks/thinInstanceMesh-Byk1sPWi.esm.min.js +2 -0
  385. package/dist/chunks/thinInstanceMesh-Byk1sPWi.esm.min.js.map +1 -0
  386. package/dist/chunks/vertexColorMixing-5MVqrbuQ.esm.js +412 -0
  387. package/dist/chunks/vertexColorMixing-5MVqrbuQ.esm.js.map +1 -0
  388. package/dist/chunks/vertexColorMixing-BTHtPksv.esm.min.js +2 -0
  389. package/dist/chunks/vertexColorMixing-BTHtPksv.esm.min.js.map +1 -0
  390. package/dist/chunks/vertexColorMixing-C-JxO1th.esm.js +522 -0
  391. package/dist/chunks/vertexColorMixing-C-JxO1th.esm.js.map +1 -0
  392. package/dist/chunks/vertexColorMixing-DpW1_vsz.esm.min.js +2 -0
  393. package/dist/chunks/vertexColorMixing-DpW1_vsz.esm.min.js.map +1 -0
  394. package/dist/chunks/webgpuEngine-Dz_96swZ.esm.min.js +2 -0
  395. package/dist/chunks/webgpuEngine-Dz_96swZ.esm.min.js.map +1 -0
  396. package/dist/chunks/webgpuEngine-iwYQqIrX.esm.js +11465 -0
  397. package/dist/chunks/webgpuEngine-iwYQqIrX.esm.js.map +1 -0
  398. package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
  399. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
  400. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
  401. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
  402. package/docs/ViewerDefault.jpg +0 -0
  403. package/docs/ViewerParts.jpg +0 -0
  404. package/docs/ViewerSlots.jpg +0 -0
  405. package/docs/ViewerStyled.jpg +0 -0
  406. package/lib/index.d.ts +534 -0
  407. package/lib/index.js +1939 -0
  408. package/lib/index.js.map +1 -0
  409. package/package.json +18 -27
  410. package/readme.md +145 -21
  411. package/configuration/configuration.d.ts +0 -107
  412. package/configuration/configuration.js +0 -16
  413. package/configuration/configuration.js.map +0 -1
  414. package/configuration/configurationCompatibility.d.ts +0 -8
  415. package/configuration/configurationCompatibility.js +0 -66
  416. package/configuration/configurationCompatibility.js.map +0 -1
  417. package/configuration/configurationContainer.d.ts +0 -10
  418. package/configuration/configurationContainer.js +0 -10
  419. package/configuration/configurationContainer.js.map +0 -1
  420. package/configuration/globals.d.ts +0 -6
  421. package/configuration/globals.js +0 -18
  422. package/configuration/globals.js.map +0 -1
  423. package/configuration/index.d.ts +0 -2
  424. package/configuration/index.js +0 -4
  425. package/configuration/index.js.map +0 -1
  426. package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
  427. package/configuration/interfaces/cameraConfiguration.js +0 -2
  428. package/configuration/interfaces/cameraConfiguration.js.map +0 -1
  429. package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
  430. package/configuration/interfaces/colorGradingConfiguration.js +0 -2
  431. package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
  432. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
  433. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
  434. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
  435. package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
  436. package/configuration/interfaces/environmentMapConfiguration.js +0 -2
  437. package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
  438. package/configuration/interfaces/groundConfiguration.d.ts +0 -24
  439. package/configuration/interfaces/groundConfiguration.js +0 -2
  440. package/configuration/interfaces/groundConfiguration.js.map +0 -1
  441. package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
  442. package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
  443. package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
  444. package/configuration/interfaces/index.d.ts +0 -15
  445. package/configuration/interfaces/index.js +0 -16
  446. package/configuration/interfaces/index.js.map +0 -1
  447. package/configuration/interfaces/lightConfiguration.d.ts +0 -60
  448. package/configuration/interfaces/lightConfiguration.js +0 -2
  449. package/configuration/interfaces/lightConfiguration.js.map +0 -1
  450. package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
  451. package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
  452. package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
  453. package/configuration/interfaces/modelConfiguration.d.ts +0 -65
  454. package/configuration/interfaces/modelConfiguration.js +0 -2
  455. package/configuration/interfaces/modelConfiguration.js.map +0 -1
  456. package/configuration/interfaces/observersConfiguration.d.ts +0 -5
  457. package/configuration/interfaces/observersConfiguration.js +0 -2
  458. package/configuration/interfaces/observersConfiguration.js.map +0 -1
  459. package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
  460. package/configuration/interfaces/sceneConfiguration.js +0 -2
  461. package/configuration/interfaces/sceneConfiguration.js.map +0 -1
  462. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
  463. package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
  464. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
  465. package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
  466. package/configuration/interfaces/skyboxConfiguration.js +0 -2
  467. package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
  468. package/configuration/interfaces/templateConfiguration.d.ts +0 -67
  469. package/configuration/interfaces/templateConfiguration.js +0 -2
  470. package/configuration/interfaces/templateConfiguration.js.map +0 -1
  471. package/configuration/interfaces/vrConfiguration.d.ts +0 -16
  472. package/configuration/interfaces/vrConfiguration.js +0 -2
  473. package/configuration/interfaces/vrConfiguration.js.map +0 -1
  474. package/configuration/loader.d.ts +0 -4
  475. package/configuration/loader.js +0 -17
  476. package/configuration/loader.js.map +0 -1
  477. package/configuration/mappers.d.ts +0 -43
  478. package/configuration/mappers.js +0 -193
  479. package/configuration/mappers.js.map +0 -1
  480. package/configuration/renderOnlyLoader.d.ts +0 -33
  481. package/configuration/renderOnlyLoader.js +0 -162
  482. package/configuration/renderOnlyLoader.js.map +0 -1
  483. package/configuration/types/default.d.ts +0 -6
  484. package/configuration/types/default.js +0 -121
  485. package/configuration/types/default.js.map +0 -1
  486. package/configuration/types/environmentMap.d.ts +0 -5
  487. package/configuration/types/environmentMap.js +0 -14
  488. package/configuration/types/environmentMap.js.map +0 -1
  489. package/configuration/types/extended.d.ts +0 -6
  490. package/configuration/types/extended.js +0 -317
  491. package/configuration/types/extended.js.map +0 -1
  492. package/configuration/types/index.d.ts +0 -14
  493. package/configuration/types/index.js +0 -51
  494. package/configuration/types/index.js.map +0 -1
  495. package/configuration/types/minimal.d.ts +0 -6
  496. package/configuration/types/minimal.js +0 -43
  497. package/configuration/types/minimal.js.map +0 -1
  498. package/configuration/types/renderOnlyDefault.d.ts +0 -30
  499. package/configuration/types/renderOnlyDefault.js +0 -31
  500. package/configuration/types/renderOnlyDefault.js.map +0 -1
  501. package/configuration/types/shadowLight.d.ts +0 -9
  502. package/configuration/types/shadowLight.js +0 -64
  503. package/configuration/types/shadowLight.js.map +0 -1
  504. package/helper/index.d.ts +0 -29
  505. package/helper/index.js +0 -66
  506. package/helper/index.js.map +0 -1
  507. package/index.d.ts +0 -30
  508. package/index.js +0 -46
  509. package/index.js.map +0 -1
  510. package/initializer.d.ts +0 -11
  511. package/initializer.js +0 -35
  512. package/initializer.js.map +0 -1
  513. package/interfaces.d.ts +0 -5
  514. package/interfaces.js +0 -7
  515. package/interfaces.js.map +0 -1
  516. package/labs/environmentSerializer.d.ts +0 -126
  517. package/labs/environmentSerializer.js +0 -191
  518. package/labs/environmentSerializer.js.map +0 -1
  519. package/labs/texture.d.ts +0 -183
  520. package/labs/texture.js +0 -351
  521. package/labs/texture.js.map +0 -1
  522. package/labs/viewerLabs.d.ts +0 -51
  523. package/labs/viewerLabs.js +0 -134
  524. package/labs/viewerLabs.js.map +0 -1
  525. package/loader/modelLoader.d.ts +0 -56
  526. package/loader/modelLoader.js +0 -202
  527. package/loader/modelLoader.js.map +0 -1
  528. package/loader/plugins/applyMaterialConfig.d.ts +0 -12
  529. package/loader/plugins/applyMaterialConfig.js +0 -16
  530. package/loader/plugins/applyMaterialConfig.js.map +0 -1
  531. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
  532. package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
  533. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
  534. package/loader/plugins/index.d.ts +0 -19
  535. package/loader/plugins/index.js +0 -44
  536. package/loader/plugins/index.js.map +0 -1
  537. package/loader/plugins/loaderPlugin.d.ts +0 -24
  538. package/loader/plugins/loaderPlugin.js +0 -2
  539. package/loader/plugins/loaderPlugin.js.map +0 -1
  540. package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
  541. package/loader/plugins/msftLodLoaderPlugin.js +0 -21
  542. package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
  543. package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
  544. package/loader/plugins/telemetryLoaderPlugin.js +0 -36
  545. package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
  546. package/managers/observablesManager.d.ts +0 -66
  547. package/managers/observablesManager.js +0 -35
  548. package/managers/observablesManager.js.map +0 -1
  549. package/managers/sceneManager.d.ts +0 -245
  550. package/managers/sceneManager.js +0 -1375
  551. package/managers/sceneManager.js.map +0 -1
  552. package/managers/telemetryManager.d.ts +0 -78
  553. package/managers/telemetryManager.js +0 -117
  554. package/managers/telemetryManager.js.map +0 -1
  555. package/model/modelAnimation.d.ts +0 -215
  556. package/model/modelAnimation.js +0 -237
  557. package/model/modelAnimation.js.map +0 -1
  558. package/model/viewerModel.d.ts +0 -233
  559. package/model/viewerModel.js +0 -673
  560. package/model/viewerModel.js.map +0 -1
  561. package/optimizer/custom/extended.d.ts +0 -13
  562. package/optimizer/custom/extended.js +0 -101
  563. package/optimizer/custom/extended.js.map +0 -1
  564. package/optimizer/custom/index.d.ts +0 -9
  565. package/optimizer/custom/index.js +0 -26
  566. package/optimizer/custom/index.js.map +0 -1
  567. package/renderOnlyIndex.d.ts +0 -11
  568. package/renderOnlyIndex.js +0 -18
  569. package/renderOnlyIndex.js.map +0 -1
  570. package/templating/eventManager.d.ts +0 -35
  571. package/templating/eventManager.js +0 -66
  572. package/templating/eventManager.js.map +0 -1
  573. package/templating/plugins/hdButtonPlugin.d.ts +0 -9
  574. package/templating/plugins/hdButtonPlugin.js +0 -22
  575. package/templating/plugins/hdButtonPlugin.js.map +0 -1
  576. package/templating/plugins/printButton.d.ts +0 -9
  577. package/templating/plugins/printButton.js +0 -41
  578. package/templating/plugins/printButton.js.map +0 -1
  579. package/templating/templateManager.d.ts +0 -197
  580. package/templating/templateManager.js +0 -561
  581. package/templating/templateManager.js.map +0 -1
  582. package/templating/viewerTemplatePlugin.d.ts +0 -21
  583. package/templating/viewerTemplatePlugin.js +0 -69
  584. package/templating/viewerTemplatePlugin.js.map +0 -1
  585. package/viewer/defaultViewer.d.ts +0 -130
  586. package/viewer/defaultViewer.js +0 -672
  587. package/viewer/defaultViewer.js.map +0 -1
  588. package/viewer/renderOnlyViewer.d.ts +0 -9
  589. package/viewer/renderOnlyViewer.js +0 -46
  590. package/viewer/renderOnlyViewer.js.map +0 -1
  591. package/viewer/viewer.d.ts +0 -258
  592. package/viewer/viewer.js +0 -783
  593. package/viewer/viewer.js.map +0 -1
  594. package/viewer/viewerManager.d.ts +0 -58
  595. package/viewer/viewerManager.js +0 -91
  596. package/viewer/viewerManager.js.map +0 -1
  597. package/viewer/viewerWithTemplate.d.ts +0 -9
  598. package/viewer/viewerWithTemplate.js +0 -20
  599. package/viewer/viewerWithTemplate.js.map +0 -1
@@ -0,0 +1,1253 @@
1
+ import { ak as __decorate, aU as serializeAsVector3, ao as serialize, aV as Light, a2 as Matrix, u as Vector3, aW as Axis, a4 as TmpVectors, aX as Node, R as RegisterClass, s as Texture, al as serializeAsTexture, q as Color3, aN as unregisterGLTFExtension, aO as registerGLTFExtension } from './index-CVMH5-nD.esm.js';
2
+ import { A as ArrayItem, G as GLTFLoader } from './glTFLoader-DDABr3tc.esm.js';
3
+ import './rawTexture-B4sxPzau.esm.js';
4
+ import './assetContainer-DO29qm5j.esm.js';
5
+ import './glTFLoaderAnimation-Ce1T-HK4.esm.js';
6
+
7
+ /**
8
+ * Base implementation IShadowLight
9
+ * It groups all the common behaviour in order to reduce duplication and better follow the DRY pattern.
10
+ */
11
+ class ShadowLight extends Light {
12
+ constructor() {
13
+ super(...arguments);
14
+ this._needProjectionMatrixCompute = true;
15
+ this._viewMatrix = Matrix.Identity();
16
+ this._projectionMatrix = Matrix.Identity();
17
+ }
18
+ _setPosition(value) {
19
+ this._position = value;
20
+ }
21
+ /**
22
+ * Sets the position the shadow will be casted from. Also use as the light position for both
23
+ * point and spot lights.
24
+ */
25
+ get position() {
26
+ return this._position;
27
+ }
28
+ /**
29
+ * Sets the position the shadow will be casted from. Also use as the light position for both
30
+ * point and spot lights.
31
+ */
32
+ set position(value) {
33
+ this._setPosition(value);
34
+ }
35
+ _setDirection(value) {
36
+ this._direction = value;
37
+ }
38
+ /**
39
+ * In 2d mode (needCube being false), gets the direction used to cast the shadow.
40
+ * Also use as the light direction on spot and directional lights.
41
+ */
42
+ get direction() {
43
+ return this._direction;
44
+ }
45
+ /**
46
+ * In 2d mode (needCube being false), sets the direction used to cast the shadow.
47
+ * Also use as the light direction on spot and directional lights.
48
+ */
49
+ set direction(value) {
50
+ this._setDirection(value);
51
+ }
52
+ /**
53
+ * Gets the shadow projection clipping minimum z value.
54
+ */
55
+ get shadowMinZ() {
56
+ return this._shadowMinZ;
57
+ }
58
+ /**
59
+ * Sets the shadow projection clipping minimum z value.
60
+ */
61
+ set shadowMinZ(value) {
62
+ this._shadowMinZ = value;
63
+ this.forceProjectionMatrixCompute();
64
+ }
65
+ /**
66
+ * Sets the shadow projection clipping maximum z value.
67
+ */
68
+ get shadowMaxZ() {
69
+ return this._shadowMaxZ;
70
+ }
71
+ /**
72
+ * Gets the shadow projection clipping maximum z value.
73
+ */
74
+ set shadowMaxZ(value) {
75
+ this._shadowMaxZ = value;
76
+ this.forceProjectionMatrixCompute();
77
+ }
78
+ /**
79
+ * Computes the transformed information (transformedPosition and transformedDirection in World space) of the current light
80
+ * @returns true if the information has been computed, false if it does not need to (no parenting)
81
+ */
82
+ computeTransformedInformation() {
83
+ if (this.parent && this.parent.getWorldMatrix) {
84
+ if (!this.transformedPosition) {
85
+ this.transformedPosition = Vector3.Zero();
86
+ }
87
+ Vector3.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition);
88
+ // In case the direction is present.
89
+ if (this.direction) {
90
+ if (!this.transformedDirection) {
91
+ this.transformedDirection = Vector3.Zero();
92
+ }
93
+ Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection);
94
+ }
95
+ return true;
96
+ }
97
+ return false;
98
+ }
99
+ /**
100
+ * Return the depth scale used for the shadow map.
101
+ * @returns the depth scale.
102
+ */
103
+ getDepthScale() {
104
+ return 50.0;
105
+ }
106
+ /**
107
+ * Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed.
108
+ * @param faceIndex The index of the face we are computed the direction to generate shadow
109
+ * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
110
+ */
111
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
112
+ getShadowDirection(faceIndex) {
113
+ return this.transformedDirection ? this.transformedDirection : this.direction;
114
+ }
115
+ /**
116
+ * If computeTransformedInformation has been called, returns the ShadowLight absolute position in the world. Otherwise, returns the local position.
117
+ * @returns the position vector in world space
118
+ */
119
+ getAbsolutePosition() {
120
+ return this.transformedPosition ? this.transformedPosition : this.position;
121
+ }
122
+ /**
123
+ * Sets the ShadowLight direction toward the passed target.
124
+ * @param target The point to target in local space
125
+ * @returns the updated ShadowLight direction
126
+ */
127
+ setDirectionToTarget(target) {
128
+ this.direction = Vector3.Normalize(target.subtract(this.position));
129
+ return this.direction;
130
+ }
131
+ /**
132
+ * Returns the light rotation in euler definition.
133
+ * @returns the x y z rotation in local space.
134
+ */
135
+ getRotation() {
136
+ this.direction.normalize();
137
+ const xaxis = Vector3.Cross(this.direction, Axis.Y);
138
+ const yaxis = Vector3.Cross(xaxis, this.direction);
139
+ return Vector3.RotationFromAxis(xaxis, yaxis, this.direction);
140
+ }
141
+ /**
142
+ * Returns whether or not the shadow generation require a cube texture or a 2d texture.
143
+ * @returns true if a cube texture needs to be use
144
+ */
145
+ needCube() {
146
+ return false;
147
+ }
148
+ /**
149
+ * Detects if the projection matrix requires to be recomputed this frame.
150
+ * @returns true if it requires to be recomputed otherwise, false.
151
+ */
152
+ needProjectionMatrixCompute() {
153
+ return this._needProjectionMatrixCompute;
154
+ }
155
+ /**
156
+ * Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.
157
+ */
158
+ forceProjectionMatrixCompute() {
159
+ this._needProjectionMatrixCompute = true;
160
+ }
161
+ /** @internal */
162
+ _initCache() {
163
+ super._initCache();
164
+ this._cache.position = Vector3.Zero();
165
+ }
166
+ /** @internal */
167
+ _isSynchronized() {
168
+ if (!this._cache.position.equals(this.position)) {
169
+ return false;
170
+ }
171
+ return true;
172
+ }
173
+ /**
174
+ * Computes the world matrix of the node
175
+ * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch
176
+ * @returns the world matrix
177
+ */
178
+ computeWorldMatrix(force) {
179
+ if (!force && this.isSynchronized()) {
180
+ this._currentRenderId = this.getScene().getRenderId();
181
+ return this._worldMatrix;
182
+ }
183
+ this._updateCache();
184
+ this._cache.position.copyFrom(this.position);
185
+ if (!this._worldMatrix) {
186
+ this._worldMatrix = Matrix.Identity();
187
+ }
188
+ Matrix.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix);
189
+ if (this.parent && this.parent.getWorldMatrix) {
190
+ this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix);
191
+ this._markSyncedWithParent();
192
+ }
193
+ // Cache the determinant
194
+ this._worldMatrixDeterminantIsDirty = true;
195
+ return this._worldMatrix;
196
+ }
197
+ /**
198
+ * Gets the minZ used for shadow according to both the scene and the light.
199
+ * @param activeCamera The camera we are returning the min for
200
+ * @returns the depth min z
201
+ */
202
+ getDepthMinZ(activeCamera) {
203
+ return this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
204
+ }
205
+ /**
206
+ * Gets the maxZ used for shadow according to both the scene and the light.
207
+ * @param activeCamera The camera we are returning the max for
208
+ * @returns the depth max z
209
+ */
210
+ getDepthMaxZ(activeCamera) {
211
+ return this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
212
+ }
213
+ /**
214
+ * Sets the shadow projection matrix in parameter to the generated projection matrix.
215
+ * @param matrix The matrix to updated with the projection information
216
+ * @param viewMatrix The transform matrix of the light
217
+ * @param renderList The list of mesh to render in the map
218
+ * @returns The current light
219
+ */
220
+ setShadowProjectionMatrix(matrix, viewMatrix, renderList) {
221
+ if (this.customProjectionMatrixBuilder) {
222
+ this.customProjectionMatrixBuilder(viewMatrix, renderList, matrix);
223
+ }
224
+ else {
225
+ this._setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList);
226
+ }
227
+ return this;
228
+ }
229
+ /** @internal */
230
+ _syncParentEnabledState() {
231
+ super._syncParentEnabledState();
232
+ if (!this.parent || !this.parent.getWorldMatrix) {
233
+ this.transformedPosition = null;
234
+ this.transformedDirection = null;
235
+ }
236
+ }
237
+ /**
238
+ * Returns the view matrix.
239
+ * @param faceIndex The index of the face for which we want to extract the view matrix. Only used for point light types.
240
+ * @returns The view matrix. Can be null, if a view matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
241
+ */
242
+ getViewMatrix(faceIndex) {
243
+ const lightDirection = TmpVectors.Vector3[0];
244
+ let lightPosition = this.position;
245
+ if (this.computeTransformedInformation()) {
246
+ lightPosition = this.transformedPosition;
247
+ }
248
+ Vector3.NormalizeToRef(this.getShadowDirection(faceIndex), lightDirection);
249
+ if (Math.abs(Vector3.Dot(lightDirection, Vector3.Up())) === 1.0) {
250
+ lightDirection.z = 0.0000000000001; // Required to avoid perfectly perpendicular light
251
+ }
252
+ const lightTarget = TmpVectors.Vector3[1];
253
+ lightPosition.addToRef(lightDirection, lightTarget);
254
+ Matrix.LookAtLHToRef(lightPosition, lightTarget, Vector3.Up(), this._viewMatrix);
255
+ return this._viewMatrix;
256
+ }
257
+ /**
258
+ * Returns the projection matrix.
259
+ * Note that viewMatrix and renderList are optional and are only used by lights that calculate the projection matrix from a list of meshes (e.g. directional lights with automatic extents calculation).
260
+ * @param viewMatrix The view transform matrix of the light (optional).
261
+ * @param renderList The list of meshes to take into account when calculating the projection matrix (optional).
262
+ * @returns The projection matrix. Can be null, if a projection matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
263
+ */
264
+ getProjectionMatrix(viewMatrix, renderList) {
265
+ this.setShadowProjectionMatrix(this._projectionMatrix, viewMatrix ?? this._viewMatrix, renderList ?? []);
266
+ return this._projectionMatrix;
267
+ }
268
+ }
269
+ __decorate([
270
+ serializeAsVector3()
271
+ ], ShadowLight.prototype, "position", null);
272
+ __decorate([
273
+ serializeAsVector3()
274
+ ], ShadowLight.prototype, "direction", null);
275
+ __decorate([
276
+ serialize()
277
+ ], ShadowLight.prototype, "shadowMinZ", null);
278
+ __decorate([
279
+ serialize()
280
+ ], ShadowLight.prototype, "shadowMaxZ", null);
281
+
282
+ Node.AddNodeConstructor("Light_Type_1", (name, scene) => {
283
+ return () => new DirectionalLight(name, Vector3.Zero(), scene);
284
+ });
285
+ /**
286
+ * A directional light is defined by a direction (what a surprise!).
287
+ * The light is emitted from everywhere in the specified direction, and has an infinite range.
288
+ * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.
289
+ * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
290
+ */
291
+ class DirectionalLight extends ShadowLight {
292
+ /**
293
+ * Fix frustum size for the shadow generation. This is disabled if the value is 0.
294
+ */
295
+ get shadowFrustumSize() {
296
+ return this._shadowFrustumSize;
297
+ }
298
+ /**
299
+ * Specifies a fix frustum size for the shadow generation.
300
+ */
301
+ set shadowFrustumSize(value) {
302
+ this._shadowFrustumSize = value;
303
+ this.forceProjectionMatrixCompute();
304
+ }
305
+ /**
306
+ * Gets the shadow projection scale against the optimal computed one.
307
+ * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
308
+ * This does not impact in fixed frustum size (shadowFrustumSize being set)
309
+ */
310
+ get shadowOrthoScale() {
311
+ return this._shadowOrthoScale;
312
+ }
313
+ /**
314
+ * Sets the shadow projection scale against the optimal computed one.
315
+ * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
316
+ * This does not impact in fixed frustum size (shadowFrustumSize being set)
317
+ */
318
+ set shadowOrthoScale(value) {
319
+ this._shadowOrthoScale = value;
320
+ this.forceProjectionMatrixCompute();
321
+ }
322
+ /**
323
+ * Gets or sets the orthoLeft property used to build the light frustum
324
+ */
325
+ get orthoLeft() {
326
+ return this._orthoLeft;
327
+ }
328
+ set orthoLeft(left) {
329
+ this._orthoLeft = left;
330
+ }
331
+ /**
332
+ * Gets or sets the orthoRight property used to build the light frustum
333
+ */
334
+ get orthoRight() {
335
+ return this._orthoRight;
336
+ }
337
+ set orthoRight(right) {
338
+ this._orthoRight = right;
339
+ }
340
+ /**
341
+ * Gets or sets the orthoTop property used to build the light frustum
342
+ */
343
+ get orthoTop() {
344
+ return this._orthoTop;
345
+ }
346
+ set orthoTop(top) {
347
+ this._orthoTop = top;
348
+ }
349
+ /**
350
+ * Gets or sets the orthoBottom property used to build the light frustum
351
+ */
352
+ get orthoBottom() {
353
+ return this._orthoBottom;
354
+ }
355
+ set orthoBottom(bottom) {
356
+ this._orthoBottom = bottom;
357
+ }
358
+ /**
359
+ * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
360
+ * The directional light is emitted from everywhere in the given direction.
361
+ * It can cast shadows.
362
+ * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
363
+ * @param name The friendly name of the light
364
+ * @param direction The direction of the light
365
+ * @param scene The scene the light belongs to
366
+ */
367
+ constructor(name, direction, scene) {
368
+ super(name, scene);
369
+ this._shadowFrustumSize = 0;
370
+ this._shadowOrthoScale = 0.1;
371
+ /**
372
+ * Automatically compute the projection matrix to best fit (including all the casters)
373
+ * on each frame.
374
+ */
375
+ this.autoUpdateExtends = true;
376
+ /**
377
+ * Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters)
378
+ * on each frame. autoUpdateExtends must be set to true for this to work
379
+ */
380
+ this.autoCalcShadowZBounds = false;
381
+ // Cache
382
+ this._orthoLeft = Number.MAX_VALUE;
383
+ this._orthoRight = Number.MIN_VALUE;
384
+ this._orthoTop = Number.MIN_VALUE;
385
+ this._orthoBottom = Number.MAX_VALUE;
386
+ this.position = direction.scale(-1.0);
387
+ this.direction = direction;
388
+ }
389
+ /**
390
+ * Returns the string "DirectionalLight".
391
+ * @returns The class name
392
+ */
393
+ getClassName() {
394
+ return "DirectionalLight";
395
+ }
396
+ /**
397
+ * Returns the integer 1.
398
+ * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
399
+ */
400
+ getTypeID() {
401
+ return Light.LIGHTTYPEID_DIRECTIONALLIGHT;
402
+ }
403
+ /**
404
+ * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
405
+ * Returns the DirectionalLight Shadow projection matrix.
406
+ * @param matrix
407
+ * @param viewMatrix
408
+ * @param renderList
409
+ */
410
+ _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
411
+ if (this.shadowFrustumSize > 0) {
412
+ this._setDefaultFixedFrustumShadowProjectionMatrix(matrix);
413
+ }
414
+ else {
415
+ this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList);
416
+ }
417
+ }
418
+ /**
419
+ * Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.
420
+ * Returns the DirectionalLight Shadow projection matrix.
421
+ * @param matrix
422
+ */
423
+ _setDefaultFixedFrustumShadowProjectionMatrix(matrix) {
424
+ const activeCamera = this.getScene().activeCamera;
425
+ if (!activeCamera) {
426
+ return;
427
+ }
428
+ Matrix.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ, this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);
429
+ }
430
+ /**
431
+ * Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.
432
+ * Returns the DirectionalLight Shadow projection matrix.
433
+ * @param matrix
434
+ * @param viewMatrix
435
+ * @param renderList
436
+ */
437
+ _setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList) {
438
+ const activeCamera = this.getScene().activeCamera;
439
+ if (!activeCamera) {
440
+ return;
441
+ }
442
+ // Check extends
443
+ if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {
444
+ const tempVector3 = Vector3.Zero();
445
+ this._orthoLeft = Number.MAX_VALUE;
446
+ this._orthoRight = -Number.MAX_VALUE;
447
+ this._orthoTop = -Number.MAX_VALUE;
448
+ this._orthoBottom = Number.MAX_VALUE;
449
+ let shadowMinZ = Number.MAX_VALUE;
450
+ let shadowMaxZ = -Number.MAX_VALUE;
451
+ for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {
452
+ const mesh = renderList[meshIndex];
453
+ if (!mesh) {
454
+ continue;
455
+ }
456
+ const boundingInfo = mesh.getBoundingInfo();
457
+ const boundingBox = boundingInfo.boundingBox;
458
+ for (let index = 0; index < boundingBox.vectorsWorld.length; index++) {
459
+ Vector3.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3);
460
+ if (tempVector3.x < this._orthoLeft) {
461
+ this._orthoLeft = tempVector3.x;
462
+ }
463
+ if (tempVector3.y < this._orthoBottom) {
464
+ this._orthoBottom = tempVector3.y;
465
+ }
466
+ if (tempVector3.x > this._orthoRight) {
467
+ this._orthoRight = tempVector3.x;
468
+ }
469
+ if (tempVector3.y > this._orthoTop) {
470
+ this._orthoTop = tempVector3.y;
471
+ }
472
+ if (this.autoCalcShadowZBounds) {
473
+ if (tempVector3.z < shadowMinZ) {
474
+ shadowMinZ = tempVector3.z;
475
+ }
476
+ if (tempVector3.z > shadowMaxZ) {
477
+ shadowMaxZ = tempVector3.z;
478
+ }
479
+ }
480
+ }
481
+ }
482
+ if (this.autoCalcShadowZBounds) {
483
+ this._shadowMinZ = shadowMinZ;
484
+ this._shadowMaxZ = shadowMaxZ;
485
+ }
486
+ }
487
+ const xOffset = this._orthoRight - this._orthoLeft;
488
+ const yOffset = this._orthoTop - this._orthoBottom;
489
+ const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
490
+ const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
491
+ const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
492
+ Matrix.OrthoOffCenterLHToRef(this._orthoLeft - xOffset * this.shadowOrthoScale, this._orthoRight + xOffset * this.shadowOrthoScale, this._orthoBottom - yOffset * this.shadowOrthoScale, this._orthoTop + yOffset * this.shadowOrthoScale, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, this.getScene().getEngine().isNDCHalfZRange);
493
+ }
494
+ _buildUniformLayout() {
495
+ this._uniformBuffer.addUniform("vLightData", 4);
496
+ this._uniformBuffer.addUniform("vLightDiffuse", 4);
497
+ this._uniformBuffer.addUniform("vLightSpecular", 4);
498
+ this._uniformBuffer.addUniform("shadowsInfo", 3);
499
+ this._uniformBuffer.addUniform("depthValues", 2);
500
+ this._uniformBuffer.create();
501
+ }
502
+ /**
503
+ * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
504
+ * @param effect The effect to update
505
+ * @param lightIndex The index of the light in the effect to update
506
+ * @returns The directional light
507
+ */
508
+ transferToEffect(effect, lightIndex) {
509
+ if (this.computeTransformedInformation()) {
510
+ this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex);
511
+ return this;
512
+ }
513
+ this._uniformBuffer.updateFloat4("vLightData", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex);
514
+ return this;
515
+ }
516
+ transferToNodeMaterialEffect(effect, lightDataUniformName) {
517
+ if (this.computeTransformedInformation()) {
518
+ effect.setFloat3(lightDataUniformName, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z);
519
+ return this;
520
+ }
521
+ effect.setFloat3(lightDataUniformName, this.direction.x, this.direction.y, this.direction.z);
522
+ return this;
523
+ }
524
+ /**
525
+ * Gets the minZ used for shadow according to both the scene and the light.
526
+ *
527
+ * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
528
+ * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
529
+ * (when not using reverse depth buffer / NDC half Z range)
530
+ * @param activeCamera The camera we are returning the min for
531
+ * @returns the depth min z
532
+ */
533
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
534
+ getDepthMinZ(activeCamera) {
535
+ const engine = this._scene.getEngine();
536
+ return !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
537
+ }
538
+ /**
539
+ * Gets the maxZ used for shadow according to both the scene and the light.
540
+ *
541
+ * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
542
+ * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
543
+ * (when not using reverse depth buffer / NDC half Z range)
544
+ * @param activeCamera The camera we are returning the max for
545
+ * @returns the depth max z
546
+ */
547
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
548
+ getDepthMaxZ(activeCamera) {
549
+ const engine = this._scene.getEngine();
550
+ return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;
551
+ }
552
+ /**
553
+ * Prepares the list of defines specific to the light type.
554
+ * @param defines the list of defines
555
+ * @param lightIndex defines the index of the light for the effect
556
+ */
557
+ prepareLightSpecificDefines(defines, lightIndex) {
558
+ defines["DIRLIGHT" + lightIndex] = true;
559
+ }
560
+ }
561
+ __decorate([
562
+ serialize()
563
+ ], DirectionalLight.prototype, "shadowFrustumSize", null);
564
+ __decorate([
565
+ serialize()
566
+ ], DirectionalLight.prototype, "shadowOrthoScale", null);
567
+ __decorate([
568
+ serialize()
569
+ ], DirectionalLight.prototype, "autoUpdateExtends", void 0);
570
+ __decorate([
571
+ serialize()
572
+ ], DirectionalLight.prototype, "autoCalcShadowZBounds", void 0);
573
+ __decorate([
574
+ serialize("orthoLeft")
575
+ ], DirectionalLight.prototype, "_orthoLeft", void 0);
576
+ __decorate([
577
+ serialize("orthoRight")
578
+ ], DirectionalLight.prototype, "_orthoRight", void 0);
579
+ __decorate([
580
+ serialize("orthoTop")
581
+ ], DirectionalLight.prototype, "_orthoTop", void 0);
582
+ __decorate([
583
+ serialize("orthoBottom")
584
+ ], DirectionalLight.prototype, "_orthoBottom", void 0);
585
+ // Register Class Name
586
+ RegisterClass("BABYLON.DirectionalLight", DirectionalLight);
587
+
588
+ Node.AddNodeConstructor("Light_Type_0", (name, scene) => {
589
+ return () => new PointLight(name, Vector3.Zero(), scene);
590
+ });
591
+ /**
592
+ * A point light is a light defined by an unique point in world space.
593
+ * The light is emitted in every direction from this point.
594
+ * A good example of a point light is a standard light bulb.
595
+ * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
596
+ */
597
+ class PointLight extends ShadowLight {
598
+ /**
599
+ * Getter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
600
+ * This specifies what angle the shadow will use to be created.
601
+ *
602
+ * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
603
+ */
604
+ get shadowAngle() {
605
+ return this._shadowAngle;
606
+ }
607
+ /**
608
+ * Setter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
609
+ * This specifies what angle the shadow will use to be created.
610
+ *
611
+ * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.
612
+ */
613
+ set shadowAngle(value) {
614
+ this._shadowAngle = value;
615
+ this.forceProjectionMatrixCompute();
616
+ }
617
+ /**
618
+ * Gets the direction if it has been set.
619
+ * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
620
+ */
621
+ get direction() {
622
+ return this._direction;
623
+ }
624
+ /**
625
+ * In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
626
+ */
627
+ set direction(value) {
628
+ const previousNeedCube = this.needCube();
629
+ this._direction = value;
630
+ if (this.needCube() !== previousNeedCube && this._shadowGenerators) {
631
+ const iterator = this._shadowGenerators.values();
632
+ for (let key = iterator.next(); key.done !== true; key = iterator.next()) {
633
+ const shadowGenerator = key.value;
634
+ shadowGenerator.recreateShadowMap();
635
+ }
636
+ }
637
+ }
638
+ /**
639
+ * Creates a PointLight object from the passed name and position (Vector3) and adds it in the scene.
640
+ * A PointLight emits the light in every direction.
641
+ * It can cast shadows.
642
+ * If the scene camera is already defined and you want to set your PointLight at the camera position, just set it :
643
+ * ```javascript
644
+ * var pointLight = new PointLight("pl", camera.position, scene);
645
+ * ```
646
+ * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
647
+ * @param name The light friendly name
648
+ * @param position The position of the point light in the scene
649
+ * @param scene The scene the lights belongs to
650
+ */
651
+ constructor(name, position, scene) {
652
+ super(name, scene);
653
+ this._shadowAngle = Math.PI / 2;
654
+ this.position = position;
655
+ }
656
+ /**
657
+ * Returns the string "PointLight"
658
+ * @returns the class name
659
+ */
660
+ getClassName() {
661
+ return "PointLight";
662
+ }
663
+ /**
664
+ * Returns the integer 0.
665
+ * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
666
+ */
667
+ getTypeID() {
668
+ return Light.LIGHTTYPEID_POINTLIGHT;
669
+ }
670
+ /**
671
+ * Specifies whether or not the shadowmap should be a cube texture.
672
+ * @returns true if the shadowmap needs to be a cube texture.
673
+ */
674
+ needCube() {
675
+ return !this.direction;
676
+ }
677
+ /**
678
+ * Returns a new Vector3 aligned with the PointLight cube system according to the passed cube face index (integer).
679
+ * @param faceIndex The index of the face we are computed the direction to generate shadow
680
+ * @returns The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
681
+ */
682
+ getShadowDirection(faceIndex) {
683
+ if (this.direction) {
684
+ return super.getShadowDirection(faceIndex);
685
+ }
686
+ else {
687
+ switch (faceIndex) {
688
+ case 0:
689
+ return new Vector3(1.0, 0.0, 0.0);
690
+ case 1:
691
+ return new Vector3(-1.0, 0.0, 0.0);
692
+ case 2:
693
+ return new Vector3(0.0, -1.0, 0.0);
694
+ case 3:
695
+ return new Vector3(0.0, 1.0, 0.0);
696
+ case 4:
697
+ return new Vector3(0.0, 0.0, 1.0);
698
+ case 5:
699
+ return new Vector3(0.0, 0.0, -1.0);
700
+ }
701
+ }
702
+ return Vector3.Zero();
703
+ }
704
+ /**
705
+ * Sets the passed matrix "matrix" as a left-handed perspective projection matrix with the following settings :
706
+ * - fov = PI / 2
707
+ * - aspect ratio : 1.0
708
+ * - z-near and far equal to the active camera minZ and maxZ.
709
+ * Returns the PointLight.
710
+ * @param matrix
711
+ * @param viewMatrix
712
+ * @param renderList
713
+ */
714
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
715
+ _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
716
+ const activeCamera = this.getScene().activeCamera;
717
+ if (!activeCamera) {
718
+ return;
719
+ }
720
+ const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
721
+ const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
722
+ const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
723
+ Matrix.PerspectiveFovLHToRef(this.shadowAngle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);
724
+ }
725
+ _buildUniformLayout() {
726
+ this._uniformBuffer.addUniform("vLightData", 4);
727
+ this._uniformBuffer.addUniform("vLightDiffuse", 4);
728
+ this._uniformBuffer.addUniform("vLightSpecular", 4);
729
+ this._uniformBuffer.addUniform("vLightFalloff", 4);
730
+ this._uniformBuffer.addUniform("shadowsInfo", 3);
731
+ this._uniformBuffer.addUniform("depthValues", 2);
732
+ this._uniformBuffer.create();
733
+ }
734
+ /**
735
+ * Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).
736
+ * @param effect The effect to update
737
+ * @param lightIndex The index of the light in the effect to update
738
+ * @returns The point light
739
+ */
740
+ transferToEffect(effect, lightIndex) {
741
+ if (this.computeTransformedInformation()) {
742
+ this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0.0, lightIndex);
743
+ }
744
+ else {
745
+ this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, 0, lightIndex);
746
+ }
747
+ this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, 0, 0, lightIndex);
748
+ return this;
749
+ }
750
+ transferToNodeMaterialEffect(effect, lightDataUniformName) {
751
+ if (this.computeTransformedInformation()) {
752
+ effect.setFloat3(lightDataUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z);
753
+ }
754
+ else {
755
+ effect.setFloat3(lightDataUniformName, this.position.x, this.position.y, this.position.z);
756
+ }
757
+ return this;
758
+ }
759
+ /**
760
+ * Prepares the list of defines specific to the light type.
761
+ * @param defines the list of defines
762
+ * @param lightIndex defines the index of the light for the effect
763
+ */
764
+ prepareLightSpecificDefines(defines, lightIndex) {
765
+ defines["POINTLIGHT" + lightIndex] = true;
766
+ }
767
+ }
768
+ __decorate([
769
+ serialize()
770
+ ], PointLight.prototype, "shadowAngle", null);
771
+ // Register Class Name
772
+ RegisterClass("BABYLON.PointLight", PointLight);
773
+
774
+ Node.AddNodeConstructor("Light_Type_2", (name, scene) => {
775
+ return () => new SpotLight(name, Vector3.Zero(), Vector3.Zero(), 0, 0, scene);
776
+ });
777
+ /**
778
+ * A spot light is defined by a position, a direction, an angle, and an exponent.
779
+ * These values define a cone of light starting from the position, emitting toward the direction.
780
+ * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,
781
+ * and the exponent defines the speed of the decay of the light with distance (reach).
782
+ * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
783
+ */
784
+ class SpotLight extends ShadowLight {
785
+ /**
786
+ * Gets the cone angle of the spot light in Radians.
787
+ */
788
+ get angle() {
789
+ return this._angle;
790
+ }
791
+ /**
792
+ * Sets the cone angle of the spot light in Radians.
793
+ */
794
+ set angle(value) {
795
+ this._angle = value;
796
+ this._cosHalfAngle = Math.cos(value * 0.5);
797
+ this._projectionTextureProjectionLightDirty = true;
798
+ this.forceProjectionMatrixCompute();
799
+ this._computeAngleValues();
800
+ }
801
+ /**
802
+ * Only used in gltf falloff mode, this defines the angle where
803
+ * the directional falloff will start before cutting at angle which could be seen
804
+ * as outer angle.
805
+ */
806
+ get innerAngle() {
807
+ return this._innerAngle;
808
+ }
809
+ /**
810
+ * Only used in gltf falloff mode, this defines the angle where
811
+ * the directional falloff will start before cutting at angle which could be seen
812
+ * as outer angle.
813
+ */
814
+ set innerAngle(value) {
815
+ this._innerAngle = value;
816
+ this._computeAngleValues();
817
+ }
818
+ /**
819
+ * Allows scaling the angle of the light for shadow generation only.
820
+ */
821
+ get shadowAngleScale() {
822
+ return this._shadowAngleScale;
823
+ }
824
+ /**
825
+ * Allows scaling the angle of the light for shadow generation only.
826
+ */
827
+ set shadowAngleScale(value) {
828
+ this._shadowAngleScale = value;
829
+ this.forceProjectionMatrixCompute();
830
+ }
831
+ /**
832
+ * Allows reading the projection texture
833
+ */
834
+ get projectionTextureMatrix() {
835
+ return this._projectionTextureMatrix;
836
+ }
837
+ /**
838
+ * Gets the near clip of the Spotlight for texture projection.
839
+ */
840
+ get projectionTextureLightNear() {
841
+ return this._projectionTextureLightNear;
842
+ }
843
+ /**
844
+ * Sets the near clip of the Spotlight for texture projection.
845
+ */
846
+ set projectionTextureLightNear(value) {
847
+ this._projectionTextureLightNear = value;
848
+ this._projectionTextureProjectionLightDirty = true;
849
+ }
850
+ /**
851
+ * Gets the far clip of the Spotlight for texture projection.
852
+ */
853
+ get projectionTextureLightFar() {
854
+ return this._projectionTextureLightFar;
855
+ }
856
+ /**
857
+ * Sets the far clip of the Spotlight for texture projection.
858
+ */
859
+ set projectionTextureLightFar(value) {
860
+ this._projectionTextureLightFar = value;
861
+ this._projectionTextureProjectionLightDirty = true;
862
+ }
863
+ /**
864
+ * Gets the Up vector of the Spotlight for texture projection.
865
+ */
866
+ get projectionTextureUpDirection() {
867
+ return this._projectionTextureUpDirection;
868
+ }
869
+ /**
870
+ * Sets the Up vector of the Spotlight for texture projection.
871
+ */
872
+ set projectionTextureUpDirection(value) {
873
+ this._projectionTextureUpDirection = value;
874
+ this._projectionTextureProjectionLightDirty = true;
875
+ }
876
+ /**
877
+ * Gets the projection texture of the light.
878
+ */
879
+ get projectionTexture() {
880
+ return this._projectionTexture;
881
+ }
882
+ /**
883
+ * Sets the projection texture of the light.
884
+ */
885
+ set projectionTexture(value) {
886
+ if (this._projectionTexture === value) {
887
+ return;
888
+ }
889
+ this._projectionTexture = value;
890
+ this._projectionTextureDirty = true;
891
+ if (this._projectionTexture && !this._projectionTexture.isReady()) {
892
+ if (SpotLight._IsProceduralTexture(this._projectionTexture)) {
893
+ this._projectionTexture.getEffect().executeWhenCompiled(() => {
894
+ this._markMeshesAsLightDirty();
895
+ });
896
+ }
897
+ else if (SpotLight._IsTexture(this._projectionTexture)) {
898
+ this._projectionTexture.onLoadObservable.addOnce(() => {
899
+ this._markMeshesAsLightDirty();
900
+ });
901
+ }
902
+ }
903
+ }
904
+ static _IsProceduralTexture(texture) {
905
+ return texture.onGeneratedObservable !== undefined;
906
+ }
907
+ static _IsTexture(texture) {
908
+ return texture.onLoadObservable !== undefined;
909
+ }
910
+ /**
911
+ * Gets or sets the light projection matrix as used by the projection texture
912
+ */
913
+ get projectionTextureProjectionLightMatrix() {
914
+ return this._projectionTextureProjectionLightMatrix;
915
+ }
916
+ set projectionTextureProjectionLightMatrix(projection) {
917
+ this._projectionTextureProjectionLightMatrix = projection;
918
+ this._projectionTextureProjectionLightDirty = false;
919
+ this._projectionTextureDirty = true;
920
+ }
921
+ /**
922
+ * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.
923
+ * It can cast shadows.
924
+ * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
925
+ * @param name The light friendly name
926
+ * @param position The position of the spot light in the scene
927
+ * @param direction The direction of the light in the scene
928
+ * @param angle The cone angle of the light in Radians
929
+ * @param exponent The light decay speed with the distance from the emission spot
930
+ * @param scene The scene the lights belongs to
931
+ */
932
+ constructor(name, position, direction, angle, exponent, scene) {
933
+ super(name, scene);
934
+ this._innerAngle = 0;
935
+ this._projectionTextureMatrix = Matrix.Zero();
936
+ this._projectionTextureLightNear = 1e-6;
937
+ this._projectionTextureLightFar = 1000.0;
938
+ this._projectionTextureUpDirection = Vector3.Up();
939
+ this._projectionTextureViewLightDirty = true;
940
+ this._projectionTextureProjectionLightDirty = true;
941
+ this._projectionTextureDirty = true;
942
+ this._projectionTextureViewTargetVector = Vector3.Zero();
943
+ this._projectionTextureViewLightMatrix = Matrix.Zero();
944
+ this._projectionTextureProjectionLightMatrix = Matrix.Zero();
945
+ this._projectionTextureScalingMatrix = Matrix.FromValues(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
946
+ this.position = position;
947
+ this.direction = direction;
948
+ this.angle = angle;
949
+ this.exponent = exponent;
950
+ }
951
+ /**
952
+ * Returns the string "SpotLight".
953
+ * @returns the class name
954
+ */
955
+ getClassName() {
956
+ return "SpotLight";
957
+ }
958
+ /**
959
+ * Returns the integer 2.
960
+ * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
961
+ */
962
+ getTypeID() {
963
+ return Light.LIGHTTYPEID_SPOTLIGHT;
964
+ }
965
+ /**
966
+ * Overrides the direction setter to recompute the projection texture view light Matrix.
967
+ * @param value
968
+ */
969
+ _setDirection(value) {
970
+ super._setDirection(value);
971
+ this._projectionTextureViewLightDirty = true;
972
+ }
973
+ /**
974
+ * Overrides the position setter to recompute the projection texture view light Matrix.
975
+ * @param value
976
+ */
977
+ _setPosition(value) {
978
+ super._setPosition(value);
979
+ this._projectionTextureViewLightDirty = true;
980
+ }
981
+ /**
982
+ * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
983
+ * Returns the SpotLight.
984
+ * @param matrix
985
+ * @param viewMatrix
986
+ * @param renderList
987
+ */
988
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
989
+ _setDefaultShadowProjectionMatrix(matrix, viewMatrix, renderList) {
990
+ const activeCamera = this.getScene().activeCamera;
991
+ if (!activeCamera) {
992
+ return;
993
+ }
994
+ this._shadowAngleScale = this._shadowAngleScale || 1;
995
+ const angle = this._shadowAngleScale * this._angle;
996
+ const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
997
+ const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
998
+ const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;
999
+ Matrix.PerspectiveFovLHToRef(angle, 1.0, useReverseDepthBuffer ? maxZ : minZ, useReverseDepthBuffer ? minZ : maxZ, matrix, true, this._scene.getEngine().isNDCHalfZRange, undefined, useReverseDepthBuffer);
1000
+ }
1001
+ _computeProjectionTextureViewLightMatrix() {
1002
+ this._projectionTextureViewLightDirty = false;
1003
+ this._projectionTextureDirty = true;
1004
+ this.getAbsolutePosition().addToRef(this.getShadowDirection(), this._projectionTextureViewTargetVector);
1005
+ Matrix.LookAtLHToRef(this.getAbsolutePosition(), this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);
1006
+ }
1007
+ _computeProjectionTextureProjectionLightMatrix() {
1008
+ this._projectionTextureProjectionLightDirty = false;
1009
+ this._projectionTextureDirty = true;
1010
+ const lightFar = this.projectionTextureLightFar;
1011
+ const lightNear = this.projectionTextureLightNear;
1012
+ const P = lightFar / (lightFar - lightNear);
1013
+ const Q = -P * lightNear;
1014
+ const S = 1.0 / Math.tan(this._angle / 2.0);
1015
+ const A = 1.0;
1016
+ Matrix.FromValuesToRef(S / A, 0.0, 0.0, 0.0, 0.0, S, 0.0, 0.0, 0.0, 0.0, P, 1.0, 0.0, 0.0, Q, 0.0, this._projectionTextureProjectionLightMatrix);
1017
+ }
1018
+ /**
1019
+ * Main function for light texture projection matrix computing.
1020
+ */
1021
+ _computeProjectionTextureMatrix() {
1022
+ this._projectionTextureDirty = false;
1023
+ this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix);
1024
+ if (this._projectionTexture instanceof Texture) {
1025
+ const u = this._projectionTexture.uScale / 2.0;
1026
+ const v = this._projectionTexture.vScale / 2.0;
1027
+ Matrix.FromValuesToRef(u, 0.0, 0.0, 0.0, 0.0, v, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0, this._projectionTextureScalingMatrix);
1028
+ }
1029
+ this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);
1030
+ }
1031
+ _buildUniformLayout() {
1032
+ this._uniformBuffer.addUniform("vLightData", 4);
1033
+ this._uniformBuffer.addUniform("vLightDiffuse", 4);
1034
+ this._uniformBuffer.addUniform("vLightSpecular", 4);
1035
+ this._uniformBuffer.addUniform("vLightDirection", 3);
1036
+ this._uniformBuffer.addUniform("vLightFalloff", 4);
1037
+ this._uniformBuffer.addUniform("shadowsInfo", 3);
1038
+ this._uniformBuffer.addUniform("depthValues", 2);
1039
+ this._uniformBuffer.create();
1040
+ }
1041
+ _computeAngleValues() {
1042
+ this._lightAngleScale = 1.0 / Math.max(0.001, Math.cos(this._innerAngle * 0.5) - this._cosHalfAngle);
1043
+ this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;
1044
+ }
1045
+ /**
1046
+ * Sets the passed Effect "effect" with the Light textures.
1047
+ * @param effect The effect to update
1048
+ * @param lightIndex The index of the light in the effect to update
1049
+ * @returns The light
1050
+ */
1051
+ transferTexturesToEffect(effect, lightIndex) {
1052
+ if (this.projectionTexture && this.projectionTexture.isReady()) {
1053
+ if (this._projectionTextureViewLightDirty) {
1054
+ this._computeProjectionTextureViewLightMatrix();
1055
+ }
1056
+ if (this._projectionTextureProjectionLightDirty) {
1057
+ this._computeProjectionTextureProjectionLightMatrix();
1058
+ }
1059
+ if (this._projectionTextureDirty) {
1060
+ this._computeProjectionTextureMatrix();
1061
+ }
1062
+ effect.setMatrix("textureProjectionMatrix" + lightIndex, this._projectionTextureMatrix);
1063
+ effect.setTexture("projectionLightTexture" + lightIndex, this.projectionTexture);
1064
+ }
1065
+ return this;
1066
+ }
1067
+ /**
1068
+ * Sets the passed Effect object with the SpotLight transformed position (or position if not parented) and normalized direction.
1069
+ * @param effect The effect to update
1070
+ * @param lightIndex The index of the light in the effect to update
1071
+ * @returns The spot light
1072
+ */
1073
+ transferToEffect(effect, lightIndex) {
1074
+ let normalizeDirection;
1075
+ if (this.computeTransformedInformation()) {
1076
+ this._uniformBuffer.updateFloat4("vLightData", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, lightIndex);
1077
+ normalizeDirection = Vector3.Normalize(this.transformedDirection);
1078
+ }
1079
+ else {
1080
+ this._uniformBuffer.updateFloat4("vLightData", this.position.x, this.position.y, this.position.z, this.exponent, lightIndex);
1081
+ normalizeDirection = Vector3.Normalize(this.direction);
1082
+ }
1083
+ this._uniformBuffer.updateFloat4("vLightDirection", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, this._cosHalfAngle, lightIndex);
1084
+ this._uniformBuffer.updateFloat4("vLightFalloff", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, lightIndex);
1085
+ return this;
1086
+ }
1087
+ transferToNodeMaterialEffect(effect, lightDataUniformName) {
1088
+ let normalizeDirection;
1089
+ if (this.computeTransformedInformation()) {
1090
+ normalizeDirection = Vector3.Normalize(this.transformedDirection);
1091
+ }
1092
+ else {
1093
+ normalizeDirection = Vector3.Normalize(this.direction);
1094
+ }
1095
+ if (this.getScene().useRightHandedSystem) {
1096
+ effect.setFloat3(lightDataUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z);
1097
+ }
1098
+ else {
1099
+ effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);
1100
+ }
1101
+ return this;
1102
+ }
1103
+ /**
1104
+ * Disposes the light and the associated resources.
1105
+ */
1106
+ dispose() {
1107
+ super.dispose();
1108
+ if (this._projectionTexture) {
1109
+ this._projectionTexture.dispose();
1110
+ }
1111
+ }
1112
+ /**
1113
+ * Gets the minZ used for shadow according to both the scene and the light.
1114
+ * @param activeCamera The camera we are returning the min for
1115
+ * @returns the depth min z
1116
+ */
1117
+ getDepthMinZ(activeCamera) {
1118
+ const engine = this._scene.getEngine();
1119
+ const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;
1120
+ return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? minZ : this._scene.getEngine().isNDCHalfZRange ? 0 : minZ;
1121
+ }
1122
+ /**
1123
+ * Gets the maxZ used for shadow according to both the scene and the light.
1124
+ * @param activeCamera The camera we are returning the max for
1125
+ * @returns the depth max z
1126
+ */
1127
+ getDepthMaxZ(activeCamera) {
1128
+ const engine = this._scene.getEngine();
1129
+ const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;
1130
+ return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : maxZ;
1131
+ }
1132
+ /**
1133
+ * Prepares the list of defines specific to the light type.
1134
+ * @param defines the list of defines
1135
+ * @param lightIndex defines the index of the light for the effect
1136
+ */
1137
+ prepareLightSpecificDefines(defines, lightIndex) {
1138
+ defines["SPOTLIGHT" + lightIndex] = true;
1139
+ defines["PROJECTEDLIGHTTEXTURE" + lightIndex] = this.projectionTexture && this.projectionTexture.isReady() ? true : false;
1140
+ }
1141
+ }
1142
+ __decorate([
1143
+ serialize()
1144
+ ], SpotLight.prototype, "angle", null);
1145
+ __decorate([
1146
+ serialize()
1147
+ ], SpotLight.prototype, "innerAngle", null);
1148
+ __decorate([
1149
+ serialize()
1150
+ ], SpotLight.prototype, "shadowAngleScale", null);
1151
+ __decorate([
1152
+ serialize()
1153
+ ], SpotLight.prototype, "exponent", void 0);
1154
+ __decorate([
1155
+ serialize()
1156
+ ], SpotLight.prototype, "projectionTextureLightNear", null);
1157
+ __decorate([
1158
+ serialize()
1159
+ ], SpotLight.prototype, "projectionTextureLightFar", null);
1160
+ __decorate([
1161
+ serialize()
1162
+ ], SpotLight.prototype, "projectionTextureUpDirection", null);
1163
+ __decorate([
1164
+ serializeAsTexture("projectedLightTexture")
1165
+ ], SpotLight.prototype, "_projectionTexture", void 0);
1166
+ // Register Class Name
1167
+ RegisterClass("BABYLON.SpotLight", SpotLight);
1168
+
1169
+ const NAME = "KHR_lights_punctual";
1170
+ /**
1171
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_lights_punctual/README.md)
1172
+ */
1173
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1174
+ class KHR_lights {
1175
+ /**
1176
+ * @internal
1177
+ */
1178
+ constructor(loader) {
1179
+ /**
1180
+ * The name of this extension.
1181
+ */
1182
+ this.name = NAME;
1183
+ this._loader = loader;
1184
+ this.enabled = this._loader.isExtensionUsed(NAME);
1185
+ }
1186
+ /** @internal */
1187
+ dispose() {
1188
+ this._loader = null;
1189
+ delete this._lights;
1190
+ }
1191
+ /** @internal */
1192
+ onLoading() {
1193
+ const extensions = this._loader.gltf.extensions;
1194
+ if (extensions && extensions[this.name]) {
1195
+ const extension = extensions[this.name];
1196
+ this._lights = extension.lights;
1197
+ ArrayItem.Assign(this._lights);
1198
+ }
1199
+ }
1200
+ /**
1201
+ * @internal
1202
+ */
1203
+ loadNodeAsync(context, node, assign) {
1204
+ return GLTFLoader.LoadExtensionAsync(context, node, this.name, (extensionContext, extension) => {
1205
+ this._loader._allMaterialsDirtyRequired = true;
1206
+ return this._loader.loadNodeAsync(context, node, (babylonMesh) => {
1207
+ let babylonLight;
1208
+ const light = ArrayItem.Get(extensionContext, this._lights, extension.light);
1209
+ const name = light.name || babylonMesh.name;
1210
+ this._loader.babylonScene._blockEntityCollection = !!this._loader._assetContainer;
1211
+ switch (light.type) {
1212
+ case "directional" /* KHRLightsPunctual_LightType.DIRECTIONAL */: {
1213
+ const babylonDirectionalLight = new DirectionalLight(name, Vector3.Backward(), this._loader.babylonScene);
1214
+ babylonDirectionalLight.position.setAll(0);
1215
+ babylonLight = babylonDirectionalLight;
1216
+ break;
1217
+ }
1218
+ case "point" /* KHRLightsPunctual_LightType.POINT */: {
1219
+ babylonLight = new PointLight(name, Vector3.Zero(), this._loader.babylonScene);
1220
+ break;
1221
+ }
1222
+ case "spot" /* KHRLightsPunctual_LightType.SPOT */: {
1223
+ const babylonSpotLight = new SpotLight(name, Vector3.Zero(), Vector3.Backward(), 0, 1, this._loader.babylonScene);
1224
+ babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;
1225
+ babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;
1226
+ babylonLight = babylonSpotLight;
1227
+ break;
1228
+ }
1229
+ default: {
1230
+ this._loader.babylonScene._blockEntityCollection = false;
1231
+ throw new Error(`${extensionContext}: Invalid light type (${light.type})`);
1232
+ }
1233
+ }
1234
+ babylonLight._parentContainer = this._loader._assetContainer;
1235
+ this._loader.babylonScene._blockEntityCollection = false;
1236
+ light._babylonLight = babylonLight;
1237
+ babylonLight.falloffType = Light.FALLOFF_GLTF;
1238
+ babylonLight.diffuse = light.color ? Color3.FromArray(light.color) : Color3.White();
1239
+ babylonLight.intensity = light.intensity == undefined ? 1 : light.intensity;
1240
+ babylonLight.range = light.range == undefined ? Number.MAX_VALUE : light.range;
1241
+ babylonLight.parent = babylonMesh;
1242
+ this._loader._babylonLights.push(babylonLight);
1243
+ GLTFLoader.AddPointerMetadata(babylonLight, extensionContext);
1244
+ assign(babylonMesh);
1245
+ });
1246
+ });
1247
+ }
1248
+ }
1249
+ unregisterGLTFExtension(NAME);
1250
+ registerGLTFExtension(NAME, true, (loader) => new KHR_lights(loader));
1251
+
1252
+ export { KHR_lights };
1253
+ //# sourceMappingURL=KHR_lights_punctual-CIEvgNk7.esm.js.map