@luma.gl/engine 10.0.0-alpha.9 → 10.0.0-beta.1

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 (381) hide show
  1. package/LICENSE +4 -4
  2. package/THIRD-PARTY-NOTICES.md +185 -0
  3. package/dist/animation/node-animation-binding.cjs +10 -0
  4. package/dist/animation/node-animation-binding.d.ts +1 -1
  5. package/dist/animation/node-animation-binding.d.ts.map +1 -1
  6. package/dist/animation/node-animation-binding.js +10 -0
  7. package/dist/animation/node-animation-binding.js.map +1 -1
  8. package/dist/arrow/index.cjs.map +2 -2
  9. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +12 -13
  10. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts.map +1 -1
  11. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +22 -17
  12. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
  13. package/dist/arrow/renderers/text/renderers/arrow-text-shaders.cjs +1 -1
  14. package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js +1 -1
  15. package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js.map +1 -1
  16. package/dist/compute/computation.cjs +1 -1
  17. package/dist/compute/computation.js +1 -1
  18. package/dist/compute/computation.js.map +1 -1
  19. package/dist/compute/swap.d.ts +2 -2
  20. package/dist/compute/swap.d.ts.map +1 -1
  21. package/dist/compute/swap.js.map +1 -1
  22. package/dist/dist.dev.js +887 -381
  23. package/dist/dist.min.js +74 -67
  24. package/dist/dynamic-texture/video-texture.cjs +1 -1
  25. package/dist/dynamic-texture/video-texture.d.ts +3 -3
  26. package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
  27. package/dist/dynamic-texture/video-texture.js +1 -1
  28. package/dist/dynamic-texture/video-texture.js.map +1 -1
  29. package/dist/effects/index.cjs.map +1 -1
  30. package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
  31. package/dist/effects/passes/postprocessing/fxaa/fxaa.js +2 -1
  32. package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
  33. package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
  34. package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +2 -0
  35. package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -1
  36. package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -1
  37. package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js +2 -0
  38. package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -1
  39. package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
  40. package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js +2 -0
  41. package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -1
  42. package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -1
  43. package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js +2 -0
  44. package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js.map +1 -1
  45. package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -1
  46. package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js +2 -0
  47. package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -1
  48. package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
  49. package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js +2 -0
  50. package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -1
  51. package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -1
  52. package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js +2 -0
  53. package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -1
  54. package/dist/gltf/gltf/animations/animations.d.ts +1 -1
  55. package/dist/gltf/gltf/animations/animations.d.ts.map +1 -1
  56. package/dist/gltf/gltf/create-gltf-model.cjs +3 -0
  57. package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
  58. package/dist/gltf/gltf/create-gltf-model.js +4 -0
  59. package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
  60. package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +80 -12
  61. package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +8 -1
  62. package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
  63. package/dist/gltf/gltf/create-scenegraph-from-gltf.js +82 -14
  64. package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
  65. package/dist/gltf/gltf/gltf-billboard.cjs +6 -1
  66. package/dist/gltf/gltf/gltf-billboard.d.ts.map +1 -1
  67. package/dist/gltf/gltf/gltf-billboard.js +6 -1
  68. package/dist/gltf/gltf/gltf-billboard.js.map +1 -1
  69. package/dist/gltf/gltf/gltf-extension-support.cjs +2 -2
  70. package/dist/gltf/gltf/gltf-extension-support.js +2 -2
  71. package/dist/gltf/gltf/gltf-extension-support.js.map +1 -1
  72. package/dist/gltf/index.cjs +2 -0
  73. package/dist/gltf/index.cjs.map +3 -3
  74. package/dist/gltf/index.d.ts +1 -1
  75. package/dist/gltf/index.d.ts.map +1 -1
  76. package/dist/gltf/index.js +1 -1
  77. package/dist/gltf/index.js.map +1 -1
  78. package/dist/gltf/parsers/parse-gltf-animations.cjs +8 -5
  79. package/dist/gltf/parsers/parse-gltf-animations.js +20 -5
  80. package/dist/gltf/parsers/parse-gltf-animations.js.map +1 -1
  81. package/dist/gltf/parsers/parse-gltf-lights.cjs +36 -72
  82. package/dist/gltf/parsers/parse-gltf-lights.d.ts +6 -2
  83. package/dist/gltf/parsers/parse-gltf-lights.d.ts.map +1 -1
  84. package/dist/gltf/parsers/parse-gltf-lights.js +34 -91
  85. package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
  86. package/dist/gltf/parsers/parse-gltf-metadata.cjs +60 -0
  87. package/dist/gltf/parsers/parse-gltf-metadata.d.ts +5 -0
  88. package/dist/gltf/parsers/parse-gltf-metadata.d.ts.map +1 -0
  89. package/dist/gltf/parsers/parse-gltf-metadata.js +39 -0
  90. package/dist/gltf/parsers/parse-gltf-metadata.js.map +1 -0
  91. package/dist/gltf/parsers/parse-gltf.cjs +4 -1
  92. package/dist/gltf/parsers/parse-gltf.d.ts +10 -2
  93. package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
  94. package/dist/gltf/parsers/parse-gltf.js +3 -0
  95. package/dist/gltf/parsers/parse-gltf.js.map +1 -1
  96. package/dist/gltf/parsers/parse-pbr-material.cjs +13 -3
  97. package/dist/gltf/parsers/parse-pbr-material.d.ts +7 -2
  98. package/dist/gltf/parsers/parse-pbr-material.d.ts.map +1 -1
  99. package/dist/gltf/parsers/parse-pbr-material.js +17 -5
  100. package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
  101. package/dist/gltf/pbr/pbr-environment.cjs +21 -3
  102. package/dist/gltf/pbr/pbr-environment.d.ts +3 -0
  103. package/dist/gltf/pbr/pbr-environment.d.ts.map +1 -1
  104. package/dist/gltf/pbr/pbr-environment.js +19 -1
  105. package/dist/gltf/pbr/pbr-environment.js.map +1 -1
  106. package/dist/gltf/pbr/pbr-material.d.ts +3 -3
  107. package/dist/gltf/pbr/pbr-material.d.ts.map +1 -1
  108. package/dist/gltf/types/gltf-json-schema.d.ts.map +1 -1
  109. package/dist/gltf/types/gltf-json-schema.js +1 -0
  110. package/dist/gltf/types/gltf-json-schema.js.map +1 -1
  111. package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
  112. package/dist/gltf/types/gltf-postprocessed-schema.js +1 -0
  113. package/dist/gltf/types/gltf-postprocessed-schema.js.map +1 -1
  114. package/dist/graph/models/index.cjs.map +1 -1
  115. package/dist/graph/models/path/path-attribute-model.cjs +4 -1
  116. package/dist/graph/models/path/path-attribute-model.d.ts +3 -1
  117. package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -1
  118. package/dist/graph/models/path/path-attribute-model.js +6 -1
  119. package/dist/graph/models/path/path-attribute-model.js.map +1 -1
  120. package/dist/graph/models/path/path-storage-model.cjs +4 -1
  121. package/dist/graph/models/path/path-storage-model.d.ts +3 -1
  122. package/dist/graph/models/path/path-storage-model.d.ts.map +1 -1
  123. package/dist/graph/models/path/path-storage-model.js +6 -1
  124. package/dist/graph/models/path/path-storage-model.js.map +1 -1
  125. package/dist/graph/physics/index.cjs.map +2 -2
  126. package/dist/graph/physics/physics-controller.cjs +42 -0
  127. package/dist/graph/physics/physics-controller.d.ts +12 -1
  128. package/dist/graph/physics/physics-controller.d.ts.map +1 -1
  129. package/dist/graph/physics/physics-controller.js +41 -0
  130. package/dist/graph/physics/physics-controller.js.map +1 -1
  131. package/dist/graph/physics/scenegraph-instance.cjs +7 -0
  132. package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
  133. package/dist/graph/physics/scenegraph-instance.js +8 -0
  134. package/dist/graph/physics/scenegraph-instance.js.map +1 -1
  135. package/dist/graph/tables/gpu-table-model.cjs +2 -2
  136. package/dist/graph/tables/gpu-table-model.d.ts +2 -1
  137. package/dist/graph/tables/gpu-table-model.d.ts.map +1 -1
  138. package/dist/graph/tables/gpu-table-model.js +2 -2
  139. package/dist/graph/tables/gpu-table-model.js.map +1 -1
  140. package/dist/graph/tables/index.cjs.map +1 -1
  141. package/dist/index.cjs +13 -0
  142. package/dist/index.cjs.map +3 -3
  143. package/dist/index.d.ts +5 -0
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +3 -0
  146. package/dist/index.js.map +1 -1
  147. package/dist/lighting/ambient-occlusion-pass.cjs +126 -0
  148. package/dist/lighting/ambient-occlusion-pass.d.ts +31 -0
  149. package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -0
  150. package/dist/lighting/ambient-occlusion-pass.js +108 -0
  151. package/dist/lighting/ambient-occlusion-pass.js.map +1 -0
  152. package/dist/lighting/clustered-light-grid.cjs +378 -0
  153. package/dist/lighting/clustered-light-grid.d.ts +94 -0
  154. package/dist/lighting/clustered-light-grid.d.ts.map +1 -0
  155. package/dist/lighting/clustered-light-grid.js +370 -0
  156. package/dist/lighting/clustered-light-grid.js.map +1 -0
  157. package/dist/lighting/contact-shadow-composite.cjs +80 -0
  158. package/dist/lighting/contact-shadow-composite.d.ts +6 -0
  159. package/dist/lighting/contact-shadow-composite.d.ts.map +1 -0
  160. package/dist/lighting/contact-shadow-composite.js +59 -0
  161. package/dist/lighting/contact-shadow-composite.js.map +1 -0
  162. package/dist/lighting/contact-shadow-pass.cjs +102 -0
  163. package/dist/lighting/contact-shadow-pass.d.ts +23 -0
  164. package/dist/lighting/contact-shadow-pass.d.ts.map +1 -0
  165. package/dist/lighting/contact-shadow-pass.js +85 -0
  166. package/dist/lighting/contact-shadow-pass.js.map +1 -0
  167. package/dist/lighting/index.cjs +128 -0
  168. package/dist/lighting/index.cjs.map +6 -0
  169. package/dist/lighting/index.d.ts +35 -0
  170. package/dist/lighting/index.d.ts.map +1 -0
  171. package/dist/lighting/index.js +22 -0
  172. package/dist/lighting/index.js.map +1 -0
  173. package/dist/lighting/lightmap-atlas.cjs +246 -0
  174. package/dist/lighting/lightmap-atlas.d.ts +53 -0
  175. package/dist/lighting/lightmap-atlas.d.ts.map +1 -0
  176. package/dist/lighting/lightmap-atlas.js +279 -0
  177. package/dist/lighting/lightmap-atlas.js.map +1 -0
  178. package/dist/lighting/lightmap-baker.cjs +238 -0
  179. package/dist/lighting/lightmap-baker.d.ts +62 -0
  180. package/dist/lighting/lightmap-baker.d.ts.map +1 -0
  181. package/dist/lighting/lightmap-baker.js +236 -0
  182. package/dist/lighting/lightmap-baker.js.map +1 -0
  183. package/dist/lighting/lightmap-data.cjs +117 -0
  184. package/dist/lighting/lightmap-data.d.ts +20 -0
  185. package/dist/lighting/lightmap-data.d.ts.map +1 -0
  186. package/dist/lighting/lightmap-data.js +110 -0
  187. package/dist/lighting/lightmap-data.js.map +1 -0
  188. package/dist/lighting/lightmap-environment.cjs +61 -0
  189. package/dist/lighting/lightmap-environment.d.ts +18 -0
  190. package/dist/lighting/lightmap-environment.d.ts.map +1 -0
  191. package/dist/lighting/lightmap-environment.js +46 -0
  192. package/dist/lighting/lightmap-environment.js.map +1 -0
  193. package/dist/lighting/pbr-environment.cjs +45 -0
  194. package/dist/lighting/pbr-environment.d.ts +25 -0
  195. package/dist/lighting/pbr-environment.d.ts.map +1 -0
  196. package/dist/lighting/pbr-environment.js +30 -0
  197. package/dist/lighting/pbr-environment.js.map +1 -0
  198. package/dist/lighting/pbr-material.cjs +75 -0
  199. package/dist/lighting/pbr-material.d.ts +33 -0
  200. package/dist/lighting/pbr-material.d.ts.map +1 -0
  201. package/dist/lighting/pbr-material.js +52 -0
  202. package/dist/lighting/pbr-material.js.map +1 -0
  203. package/dist/lighting/pbr-model.cjs +579 -0
  204. package/dist/lighting/pbr-model.d.ts +45 -0
  205. package/dist/lighting/pbr-model.d.ts.map +1 -0
  206. package/dist/lighting/pbr-model.js +545 -0
  207. package/dist/lighting/pbr-model.js.map +1 -0
  208. package/dist/lighting/pbr-surface-pass.cjs +116 -0
  209. package/dist/lighting/pbr-surface-pass.d.ts +35 -0
  210. package/dist/lighting/pbr-surface-pass.d.ts.map +1 -0
  211. package/dist/lighting/pbr-surface-pass.js +98 -0
  212. package/dist/lighting/pbr-surface-pass.js.map +1 -0
  213. package/dist/lighting/prefiltered-environment.cjs +275 -0
  214. package/dist/lighting/prefiltered-environment.d.ts +56 -0
  215. package/dist/lighting/prefiltered-environment.d.ts.map +1 -0
  216. package/dist/lighting/prefiltered-environment.js +264 -0
  217. package/dist/lighting/prefiltered-environment.js.map +1 -0
  218. package/dist/lighting/reflection-probe.cjs +321 -0
  219. package/dist/lighting/reflection-probe.d.ts +77 -0
  220. package/dist/lighting/reflection-probe.d.ts.map +1 -0
  221. package/dist/lighting/reflection-probe.js +298 -0
  222. package/dist/lighting/reflection-probe.js.map +1 -0
  223. package/dist/lighting/shadow-map-renderer.cjs +631 -0
  224. package/dist/lighting/shadow-map-renderer.d.ts +92 -0
  225. package/dist/lighting/shadow-map-renderer.d.ts.map +1 -0
  226. package/dist/lighting/shadow-map-renderer.js +622 -0
  227. package/dist/lighting/shadow-map-renderer.js.map +1 -0
  228. package/dist/lighting/shadow-quality.cjs +58 -0
  229. package/dist/lighting/shadow-quality.d.ts +13 -0
  230. package/dist/lighting/shadow-quality.d.ts.map +1 -0
  231. package/dist/lighting/shadow-quality.js +37 -0
  232. package/dist/lighting/shadow-quality.js.map +1 -0
  233. package/dist/material/material.cjs +3 -0
  234. package/dist/material/material.d.ts +2 -0
  235. package/dist/material/material.d.ts.map +1 -1
  236. package/dist/material/material.js +3 -0
  237. package/dist/material/material.js.map +1 -1
  238. package/dist/model/gpu-vector-model.cjs +20 -3
  239. package/dist/model/gpu-vector-model.d.ts +20 -2
  240. package/dist/model/gpu-vector-model.d.ts.map +1 -1
  241. package/dist/model/gpu-vector-model.js +21 -3
  242. package/dist/model/gpu-vector-model.js.map +1 -1
  243. package/dist/models/light-model-utils.cjs +2 -2
  244. package/dist/models/light-model-utils.d.ts +2 -1
  245. package/dist/models/light-model-utils.d.ts.map +1 -1
  246. package/dist/models/light-model-utils.js +2 -2
  247. package/dist/models/light-model-utils.js.map +1 -1
  248. package/dist/scenegraph/controllers/punctual-light-controller.cjs +121 -0
  249. package/dist/scenegraph/controllers/punctual-light-controller.d.ts +31 -0
  250. package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -0
  251. package/dist/scenegraph/controllers/punctual-light-controller.js +117 -0
  252. package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -0
  253. package/dist/scenegraph/scene-metadata.cjs +43 -0
  254. package/dist/scenegraph/scene-metadata.d.ts +9 -0
  255. package/dist/scenegraph/scene-metadata.d.ts.map +1 -0
  256. package/dist/scenegraph/scene-metadata.js +21 -0
  257. package/dist/scenegraph/scene-metadata.js.map +1 -0
  258. package/dist/scenegraph/scenegraph-interaction.cjs +99 -0
  259. package/dist/scenegraph/scenegraph-interaction.d.ts +47 -0
  260. package/dist/scenegraph/scenegraph-interaction.d.ts.map +1 -0
  261. package/dist/scenegraph/scenegraph-interaction.js +79 -0
  262. package/dist/scenegraph/scenegraph-interaction.js.map +1 -0
  263. package/dist/scenegraph/scenegraph-node.cjs +10 -0
  264. package/dist/scenegraph/scenegraph-node.d.ts +10 -0
  265. package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
  266. package/dist/scenegraph/scenegraph-node.js +10 -0
  267. package/dist/scenegraph/scenegraph-node.js.map +1 -1
  268. package/dist/text/experimental.cjs.map +1 -1
  269. package/dist/text/fonts/atlas/text-utils.cjs +1 -1
  270. package/dist/text/fonts/atlas/text-utils.js +1 -1
  271. package/dist/text/fonts/atlas/text-utils.js.map +1 -1
  272. package/dist/text/fonts/index.cjs.map +1 -1
  273. package/dist/text/index.cjs +2 -0
  274. package/dist/text/index.cjs.map +2 -2
  275. package/dist/text/index.d.ts +1 -1
  276. package/dist/text/index.d.ts.map +1 -1
  277. package/dist/text/index.js +1 -1
  278. package/dist/text/index.js.map +1 -1
  279. package/dist/text/text-2d/index.cjs +3 -0
  280. package/dist/text/text-2d/index.d.ts +1 -0
  281. package/dist/text/text-2d/index.d.ts.map +1 -1
  282. package/dist/text/text-2d/index.js +1 -0
  283. package/dist/text/text-2d/index.js.map +1 -1
  284. package/dist/text/text-2d/model-utils/text-code-point-source.cjs +41 -0
  285. package/dist/text/text-2d/model-utils/text-code-point-source.d.ts +8 -0
  286. package/dist/text/text-2d/model-utils/text-code-point-source.d.ts.map +1 -0
  287. package/dist/text/text-2d/model-utils/text-code-point-source.js +23 -0
  288. package/dist/text/text-2d/model-utils/text-code-point-source.js.map +1 -0
  289. package/dist/text/text-2d/models/text-attribute-model.cjs +4 -1
  290. package/dist/text/text-2d/models/text-attribute-model.d.ts +3 -1
  291. package/dist/text/text-2d/models/text-attribute-model.d.ts.map +1 -1
  292. package/dist/text/text-2d/models/text-attribute-model.js +6 -1
  293. package/dist/text/text-2d/models/text-attribute-model.js.map +1 -1
  294. package/dist/text/text-2d/models/text-dictionary-model.cjs +4 -1
  295. package/dist/text/text-2d/models/text-dictionary-model.d.ts +3 -1
  296. package/dist/text/text-2d/models/text-dictionary-model.d.ts.map +1 -1
  297. package/dist/text/text-2d/models/text-dictionary-model.js +6 -1
  298. package/dist/text/text-2d/models/text-dictionary-model.js.map +1 -1
  299. package/dist/text/text-2d/models/text-storage-model.cjs +4 -1
  300. package/dist/text/text-2d/models/text-storage-model.d.ts +3 -1
  301. package/dist/text/text-2d/models/text-storage-model.d.ts.map +1 -1
  302. package/dist/text/text-2d/models/text-storage-model.js +6 -1
  303. package/dist/text/text-2d/models/text-storage-model.js.map +1 -1
  304. package/licenses/cesium.txt +207 -0
  305. package/licenses/deck-community.txt +19 -0
  306. package/licenses/deck.txt +19 -0
  307. package/licenses/glfx.txt +19 -0
  308. package/licenses/gltf-loader-ts.txt +21 -0
  309. package/licenses/magenta-font.txt +13 -0
  310. package/licenses/nvidia-fxaa.txt +25 -0
  311. package/licenses/philogl.txt +19 -0
  312. package/licenses/spark.txt +21 -0
  313. package/licenses/three.txt +21 -0
  314. package/package.json +17 -9
  315. package/src/animation/node-animation-binding.ts +18 -1
  316. package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +23 -19
  317. package/src/arrow/renderers/text/renderers/arrow-text-shaders.ts +1 -1
  318. package/src/compute/computation.ts +1 -1
  319. package/src/compute/swap.ts +2 -2
  320. package/src/dynamic-texture/video-texture.ts +9 -3
  321. package/src/effects/passes/postprocessing/fxaa/fxaa.ts +2 -1
  322. package/src/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +2 -0
  323. package/src/effects/passes/postprocessing/image-adjust-filters/denoise.ts +2 -0
  324. package/src/effects/passes/postprocessing/image-adjust-filters/huesaturation.ts +2 -0
  325. package/src/effects/passes/postprocessing/image-adjust-filters/noise.ts +2 -0
  326. package/src/effects/passes/postprocessing/image-adjust-filters/sepia.ts +2 -0
  327. package/src/effects/passes/postprocessing/image-adjust-filters/vibrance.ts +2 -0
  328. package/src/effects/passes/postprocessing/image-adjust-filters/vignette.ts +2 -0
  329. package/src/gltf/gltf/animations/animations.ts +8 -1
  330. package/src/gltf/gltf/create-gltf-model.ts +4 -0
  331. package/src/gltf/gltf/create-scenegraph-from-gltf.ts +98 -17
  332. package/src/gltf/gltf/gltf-billboard.ts +6 -1
  333. package/src/gltf/gltf/gltf-extension-support.ts +2 -2
  334. package/src/gltf/index.ts +1 -0
  335. package/src/gltf/parsers/parse-gltf-animations.ts +22 -8
  336. package/src/gltf/parsers/parse-gltf-lights.ts +42 -130
  337. package/src/gltf/parsers/parse-gltf-metadata.ts +40 -0
  338. package/src/gltf/parsers/parse-gltf.ts +11 -2
  339. package/src/gltf/parsers/parse-pbr-material.ts +35 -7
  340. package/src/gltf/pbr/pbr-environment.ts +27 -1
  341. package/src/gltf/pbr/pbr-material.ts +8 -3
  342. package/src/gltf/types/gltf-json-schema.ts +1 -0
  343. package/src/gltf/types/gltf-postprocessed-schema.ts +1 -0
  344. package/src/graph/models/path/path-attribute-model.ts +10 -1
  345. package/src/graph/models/path/path-storage-model.ts +10 -1
  346. package/src/graph/physics/physics-controller.ts +55 -1
  347. package/src/graph/physics/scenegraph-instance.ts +10 -0
  348. package/src/graph/tables/gpu-table-model.ts +3 -2
  349. package/src/index.ts +17 -0
  350. package/src/lighting/ambient-occlusion-pass.ts +130 -0
  351. package/src/lighting/clustered-light-grid.ts +481 -0
  352. package/src/lighting/contact-shadow-composite.ts +67 -0
  353. package/src/lighting/contact-shadow-pass.ts +107 -0
  354. package/src/lighting/index.ts +125 -0
  355. package/src/lighting/lightmap-atlas.ts +348 -0
  356. package/src/lighting/lightmap-baker.ts +306 -0
  357. package/src/lighting/lightmap-data.ts +138 -0
  358. package/src/lighting/lightmap-environment.ts +70 -0
  359. package/src/lighting/pbr-environment.ts +55 -0
  360. package/src/lighting/pbr-material.ts +85 -0
  361. package/src/lighting/pbr-model.ts +608 -0
  362. package/src/lighting/pbr-surface-pass.ts +122 -0
  363. package/src/lighting/prefiltered-environment.ts +354 -0
  364. package/src/lighting/reflection-probe.ts +360 -0
  365. package/src/lighting/shadow-map-renderer.ts +918 -0
  366. package/src/lighting/shadow-quality.ts +50 -0
  367. package/src/material/material.ts +3 -0
  368. package/src/model/gpu-vector-model.ts +42 -4
  369. package/src/models/light-model-utils.ts +3 -2
  370. package/src/scenegraph/controllers/punctual-light-controller.ts +172 -0
  371. package/src/scenegraph/scene-metadata.ts +23 -0
  372. package/src/scenegraph/scenegraph-interaction.ts +131 -0
  373. package/src/scenegraph/scenegraph-node.ts +12 -0
  374. package/src/splats/README.md +1 -1
  375. package/src/text/fonts/atlas/text-utils.ts +1 -1
  376. package/src/text/index.ts +1 -0
  377. package/src/text/text-2d/index.ts +1 -0
  378. package/src/text/text-2d/model-utils/text-code-point-source.ts +34 -0
  379. package/src/text/text-2d/models/text-attribute-model.ts +10 -1
  380. package/src/text/text-2d/models/text-dictionary-model.ts +10 -1
  381. package/src/text/text-2d/models/text-storage-model.ts +10 -1
@@ -6,7 +6,14 @@ import type {AnimationBinding} from './animation-track';
6
6
  import type {GroupNode} from '../scenegraph/group-node';
7
7
  import {setMorphWeights} from '../scenegraph/controllers/morph-controller';
8
8
 
9
- export type NodeAnimationProperty = 'translation' | 'rotation' | 'scale' | 'weights' | 'visibility';
9
+ export type NodeAnimationProperty =
10
+ | 'translation'
11
+ | 'rotation'
12
+ | 'scale'
13
+ | 'weights'
14
+ | 'visibility'
15
+ | 'selectable'
16
+ | 'hoverable';
10
17
 
11
18
  /** Bind a property once to a node reference; playback does not resolve asset IDs. */
12
19
  export function makeNodeAnimationBinding(
@@ -28,6 +35,10 @@ export function makeNodeAnimationBinding(
28
35
  return Array.from((node.userData['morphWeights'] as readonly number[] | undefined) ?? []);
29
36
  case 'visibility':
30
37
  return [node.display ? 1 : 0];
38
+ case 'selectable':
39
+ return [node.selectable ? 1 : 0];
40
+ case 'hoverable':
41
+ return [node.hoverable ? 1 : 0];
31
42
  }
32
43
  },
33
44
  setValue: value => {
@@ -44,6 +55,12 @@ export function makeNodeAnimationBinding(
44
55
  case 'weights':
45
56
  setMorphWeights(node, value);
46
57
  break;
58
+ case 'selectable':
59
+ node.setProps({selectable: value[0] !== 0});
60
+ break;
61
+ case 'hoverable':
62
+ node.setProps({hoverable: value[0] !== 0});
63
+ break;
47
64
  case 'visibility':
48
65
  node.setProps({display: value[0] !== 0});
49
66
  options.onVisibilityChange?.();
@@ -65,23 +65,27 @@ export async function makeGPUSplatDataFromGLTFScene(
65
65
  ) {
66
66
  throw new Error('Unsupported decoded glTF Gaussian splat primitive');
67
67
  }
68
+ const result = descriptor.decoded;
69
+ const table =
70
+ result &&
71
+ typeof result === 'object' &&
72
+ 'shape' in result &&
73
+ result.shape === 'arrow-table' &&
74
+ 'data' in result
75
+ ? result.data
76
+ : result;
68
77
  if (
69
- typeof descriptor.decoded !== 'object' ||
70
- descriptor.decoded === null ||
71
- !('data' in descriptor.decoded) ||
72
- !('shape' in descriptor.decoded) ||
73
- descriptor.decoded.shape !== 'arrow-table'
78
+ !table ||
79
+ typeof table !== 'object' ||
80
+ !('batches' in table) ||
81
+ !Array.isArray(table.batches) ||
82
+ !('getChild' in table) ||
83
+ typeof table.getChild !== 'function'
74
84
  ) {
75
85
  throw new Error('Decoded glTF splats require a Mesh Arrow table');
76
86
  }
77
- // Decoded data is a loader result, not a glTF accessor-bearing primitive.
78
- const decoded = descriptor.decoded as GPUSplatArrowSource & {
79
- data: GPUSplatArrowTableLike;
80
- };
81
- if (!decoded.data || !Array.isArray(decoded.data.batches)) {
82
- throw new Error('Decoded glTF splats require a Mesh Arrow table');
83
- }
84
- consumedSourceBatches = decoded.data.batches.length;
87
+ const decoded = table as GPUSplatArrowTableLike;
88
+ consumedSourceBatches = decoded.batches.length;
85
89
  const declaredFeature = primitive.extensions?.EXT_mesh_features?.featureIds?.find(
86
90
  (feature: {attribute?: number}) => feature.attribute !== undefined
87
91
  );
@@ -102,11 +106,11 @@ export async function makeGPUSplatDataFromGLTFScene(
102
106
  ) {
103
107
  throw new Error('glTF Gaussian splat feature IDs must be unsigned integers');
104
108
  }
105
- if (values.length !== decoded.data.numRows) {
109
+ if (values.length !== decoded.numRows) {
106
110
  throw new Error('glTF Gaussian splat feature-ID count does not match decoded splats');
107
111
  }
108
112
  let offset = 0;
109
- const recordBatches = decoded.data.batches.map(recordBatch => {
113
+ const recordBatches = decoded.batches.map(recordBatch => {
110
114
  const ids = values.subarray(offset, offset + recordBatch.numRows);
111
115
  offset += recordBatch.numRows;
112
116
  const vector = makeVector(ids);
@@ -118,12 +122,12 @@ export async function makeGPUSplatDataFromGLTFScene(
118
122
  };
119
123
  });
120
124
  const table = {
121
- numRows: decoded.data.numRows,
122
- schema: decoded.data.schema,
125
+ numRows: decoded.numRows,
126
+ schema: decoded.schema,
123
127
  batches: recordBatches,
124
- getChild: (name: string) => decoded.data.getChild(name)
128
+ getChild: (name: string) => decoded.getChild(name)
125
129
  };
126
- source = {...decoded, data: table};
130
+ source = table;
127
131
  }
128
132
  batches = makeGPUSplatDataFromArrow(device, source, {
129
133
  sourceBatchIndex,
@@ -47,7 +47,7 @@ export function configureArrowTextShaderAssembler<ShaderAssemblerType extends Sh
47
47
  return shaderAssembler;
48
48
  }
49
49
 
50
- shaderAssembler.addShaderHook({
50
+ shaderAssembler.addShaderInjectionTarget({
51
51
  name: 'TEXT_ATTRIBUTE_VERTEX_TRANSFORM',
52
52
  stage: 'vertex',
53
53
  glsl: {
@@ -185,7 +185,7 @@ export class Computation {
185
185
 
186
186
  const platformInfo = getPlatformInfo(device);
187
187
  const resolvedPlugins = resolveShaderPlugins(this.props.plugins, platformInfo.shaderLanguage);
188
- if (resolvedPlugins.hooks.length > 0) {
188
+ if (resolvedPlugins.injectionTargets.length > 0) {
189
189
  throw new Error('Computation does not support ShaderPlugin render hooks');
190
190
  }
191
191
  if (
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
5
  import type {BufferProps, FramebufferProps} from '@luma.gl/core';
6
- import {Device, Resource, Buffer, Framebuffer, Texture} from '@luma.gl/core';
6
+ import {Device, DeviceResource, Buffer, Framebuffer, Texture} from '@luma.gl/core';
7
7
 
8
8
  /**
9
9
  * Helper class for working with repeated transformations / computations
@@ -11,7 +11,7 @@ import {Device, Resource, Buffer, Framebuffer, Texture} from '@luma.gl/core';
11
11
  * @note the two resources are expected to be structurally identical (same size, length, format, etc)
12
12
  * @note the two resources can be destroyed by calling `destroy()`
13
13
  */
14
- export class Swap<T extends Resource<any>> {
14
+ export class Swap<T extends DeviceResource<any>> {
15
15
  id: string;
16
16
 
17
17
  /** The current resource - usually the source for renders or computations */
@@ -2,13 +2,19 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import type {Device, ExternalTexture, ResourceProps, Sampler, SamplerProps} from '@luma.gl/core';
5
+ import type {
6
+ Device,
7
+ ExternalTexture,
8
+ DeviceResourceProps,
9
+ Sampler,
10
+ SamplerProps
11
+ } from '@luma.gl/core';
6
12
  import {Texture, assert} from '@luma.gl/core';
7
13
  import {uid} from '../utils/uid';
8
14
  import type {TextureBindingLayout, TextureBindingSource} from '@luma.gl/core/dynamic';
9
15
 
10
16
  /** Properties for a live video binding source. */
11
- export type VideoTextureProps = Pick<ResourceProps, 'id'> & {
17
+ export type VideoTextureProps = Pick<DeviceResourceProps, 'id'> & {
12
18
  /** Caller-owned live video source followed by this binding source. */
13
19
  source: HTMLVideoElement | VideoFrame;
14
20
  /** Color space requested for copied or imported video data. */
@@ -62,7 +68,7 @@ export class VideoTexture implements TextureBindingSource {
62
68
  return this._updateTimestamp;
63
69
  }
64
70
 
65
- /** Resource label used by debug output. */
71
+ /** DeviceResource label used by debug output. */
66
72
  get [Symbol.toStringTag]() {
67
73
  return 'VideoTexture';
68
74
  }
@@ -1,6 +1,7 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
4
5
 
5
6
  import type {ShaderPass} from '@luma.gl/shaders';
6
7
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -1,6 +1,8 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright (C) 2011 by Evan Wallace
5
+ // Classic filter adapted from glfx.js; see the package THIRD-PARTY-NOTICES.md.
4
6
 
5
7
  import type {ShaderPass} from '@luma.gl/shaders';
6
8
 
@@ -13,7 +13,14 @@ export type GLTFAnimation = {
13
13
  };
14
14
 
15
15
  /** Supported glTF animation target paths. */
16
- export type GLTFAnimationPath = 'translation' | 'rotation' | 'scale' | 'weights' | 'visibility';
16
+ export type GLTFAnimationPath =
17
+ | 'translation'
18
+ | 'rotation'
19
+ | 'scale'
20
+ | 'weights'
21
+ | 'visibility'
22
+ | 'selectable'
23
+ | 'hoverable';
17
24
 
18
25
  /** Parsed glTF animation channel that targets a scenegraph node. */
19
26
  export type GLTFNodeAnimationChannel = {
@@ -549,6 +549,10 @@ export function createGLTFMaterial(device: Device, options: CreateGLTFMaterialOp
549
549
 
550
550
  const pbrMaterialProps = {...options.parsedPPBRMaterial.uniforms};
551
551
  delete pbrMaterialProps.camera;
552
+ // Environment controls belong to the scene uniforms of each model, not to the material.
553
+ delete pbrMaterialProps.environmentIntensity;
554
+ delete pbrMaterialProps.environmentRotation;
555
+ delete pbrMaterialProps.environmentMipCount;
552
556
  const materialBindings = Object.fromEntries(
553
557
  Object.entries({
554
558
  ...pbrMaterialProps,
@@ -2,13 +2,24 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
+ import {parseGLTFMetadata} from '../parsers/parse-gltf-metadata';
5
6
  import {parseGLTFJointDeclarations} from '../parsers/parse-gltf-joints';
6
7
  import {Device} from '@luma.gl/core';
7
- import {GroupNode, Material, ModelNode, JointController} from '@luma.gl/engine';
8
+ import {
9
+ GroupNode,
10
+ Material,
11
+ ModelNode,
12
+ JointController,
13
+ BillboardController
14
+ } from '@luma.gl/engine';
8
15
  import {GLTFPostprocessed} from '../types/gltf-postprocessed-schema';
9
16
  import {Light} from '@luma.gl/shaders';
10
17
  import {parseGLTF, type ParseGLTFOptions} from '../parsers/parse-gltf';
11
- import {parseGLTFLights} from '../parsers/parse-gltf-lights';
18
+ import {bindGLTFPunctualLights} from '../parsers/parse-gltf-lights';
19
+ import {
20
+ PunctualLightController,
21
+ type PunctualLightDefinition
22
+ } from '../../scenegraph/controllers/punctual-light-controller';
12
23
  import {GLTFAnimator} from './gltf-animator';
13
24
  import {parseGLTFSkins} from './gltf-skin';
14
25
  import {SkinController, MaterialVariants} from '@luma.gl/engine';
@@ -20,6 +31,7 @@ import {
20
31
  type GLTFExtensionSupport
21
32
  } from './gltf-extension-support';
22
33
  import {parseGLTFMaterialVariants} from './gltf-material-variants';
34
+ import {parseGLTFBillboards} from './gltf-billboard';
23
35
 
24
36
  export type GLTFScenegraphBounds = {
25
37
  /** World-space axis-aligned bounds for the scene or model. */
@@ -36,6 +48,10 @@ export type GLTFScenegraphBounds = {
36
48
 
37
49
  /** Scenegraph bundle returned from a parsed glTF asset. */
38
50
  export type GLTFScenegraphs = {
51
+ /** Opt-in camera-facing scene traversal using resolved runtime node bindings. */
52
+ billboards: BillboardController | null;
53
+ /** Metadata associated with source asset and scene resources. */
54
+ metadata: import('@luma.gl/engine').SceneMetadata;
39
55
  /** Shared physical joint declarations, separate from skeletal skinning. */
40
56
  joints: JointController;
41
57
  jointIssues: {code: string; path: string; message: string}[];
@@ -53,6 +69,8 @@ export type GLTFScenegraphs = {
53
69
  animations: GLTFAnimation[];
54
70
  /** Parsed punctual lights from the asset. */
55
71
  lights: Light[];
72
+ /** Updates punctual lights after programmatic transform or visibility changes. */
73
+ punctualLights: PunctualLightController;
56
74
  /** Extensions reported by the asset and whether luma.gl supports them. */
57
75
  extensionSupport: Map<string, GLTFExtensionSupport>;
58
76
  /** Camera-friendly bounds for each scene in `scenes`, in matching order. */
@@ -83,10 +101,28 @@ export function createScenegraphsFromGLTF(
83
101
  gltf: GLTFPostprocessed,
84
102
  options?: ParseGLTFOptions
85
103
  ): GLTFScenegraphs {
104
+ const metadata = parseGLTFMetadata(gltf);
86
105
  if (options?.strictExtensions) {
87
106
  assertSupportedGLTFExtensions(gltf, device);
88
107
  }
89
108
 
109
+ // Validate the optional profile before parseGLTF allocates models, textures, or buffers.
110
+ if (options?.billboards) {
111
+ const validationNodes = new Map<number, GroupNode>();
112
+ gltf.nodes.forEach((node, index) => {
113
+ if (node.extensions?.['KHR_billboard']) validationNodes.set(index, new GroupNode());
114
+ });
115
+ const validation = new BillboardController(
116
+ parseGLTFBillboards({
117
+ gltf,
118
+ scenes: [],
119
+ gltfNodeIndexToNodeMap: validationNodes,
120
+ allowLegacyYAxis: options.billboards.allowLegacyYAxis
121
+ })
122
+ );
123
+ validation.destroy();
124
+ }
125
+
90
126
  const {
91
127
  scenes,
92
128
  materials,
@@ -97,14 +133,57 @@ export function createScenegraphsFromGLTF(
97
133
  materialInstances
98
134
  } = parseGLTF(device, gltf, options);
99
135
 
136
+ const billboards = options?.billboards
137
+ ? new BillboardController(
138
+ parseGLTFBillboards({
139
+ gltf,
140
+ scenes,
141
+ gltfNodeIndexToNodeMap,
142
+ allowLegacyYAxis: options.billboards.allowLegacyYAxis
143
+ })
144
+ )
145
+ : null;
146
+ scenes.forEach((scene, index) => {
147
+ const packet = metadata.get('scene', index);
148
+ if (packet) scene.metadata['xmp'] = packet;
149
+ const geometryMetadata = gltf.scenes[index]?.extensions?.['FB_geometry_metadata'];
150
+ if (geometryMetadata) scene.metadata['fb:geometry'] = geometryMetadata;
151
+ });
152
+ const meshPackets = new Map<string, Record<string, unknown>>();
153
+ gltf.meshes.forEach((mesh, index) => {
154
+ const packet = metadata.get('mesh', index);
155
+ if (!packet) return;
156
+ meshPackets.set(mesh.id, packet);
157
+ const group = gltfMeshIdToNodeMap.get(mesh.id);
158
+ if (group) group.metadata['xmp'] = packet;
159
+ });
160
+ gltfNodeIndexToNodeMap.forEach((node, index) => {
161
+ const packet = metadata.get('node', index);
162
+ if (packet) node.metadata['xmp'] = packet;
163
+ if (!meshPackets.size) return;
164
+ const sourceMesh = gltf.nodes[index]?.mesh;
165
+ const meshPacket = sourceMesh && meshPackets.get(sourceMesh.id);
166
+ const mesh = node.userData['gltfMesh'];
167
+ if (meshPacket && mesh instanceof GroupNode) mesh.metadata['xmp'] = meshPacket;
168
+ });
169
+ materials.forEach((material, index) => {
170
+ const packet = metadata.get('material', index);
171
+ if (packet) {
172
+ material.metadata['xmp'] = packet;
173
+ for (const instance of materialInstances.get(index) || []) instance.metadata['xmp'] = packet;
174
+ }
175
+ });
176
+
100
177
  const jointDeclarations = parseGLTFJointDeclarations(gltf, gltfNodeIndexToNodeMap);
101
178
  const joints = new JointController(jointDeclarations.declarations.map(item => item.joint));
102
179
  const animations = parseGLTFAnimations(gltf);
103
180
  const sourceLights =
104
- (gltf as GLTFPostprocessed & {lights?: Record<string, any>[]}).lights ||
105
- (gltf.extensions?.['KHR_lights_punctual']?.['lights'] as Record<string, any>[] | undefined) ||
181
+ (gltf as GLTFPostprocessed & {lights?: PunctualLightDefinition[]}).lights ||
182
+ (gltf.extensions?.['KHR_lights_punctual']?.['lights'] as
183
+ | PunctualLightDefinition[]
184
+ | undefined) ||
106
185
  [];
107
- const lightDefinitions = sourceLights.map(light => ({
186
+ const lightDefinitions = sourceLights.map<PunctualLightDefinition>(light => ({
108
187
  ...light,
109
188
  ...(Array.isArray(light['color']) ? {color: [...light['color']]} : {}),
110
189
  ...(light['spot'] ? {spot: {...light['spot']}} : {})
@@ -119,21 +198,16 @@ export function createScenegraphsFromGLTF(
119
198
  }
120
199
  return runtimeCamera;
121
200
  });
122
- const lightOptions = {
123
- useByteColors: options?.useByteColors ?? true,
124
- nodeVisibility: gltfNodeIdToNodeMap,
125
- lightDefinitions
126
- };
127
- const lights = parseGLTFLights(gltf, lightOptions);
128
- const refreshLights = () => {
129
- lights.splice(0, lights.length, ...parseGLTFLights(gltf, lightOptions));
130
- };
201
+ const lightBindings = bindGLTFPunctualLights(gltf.nodes, gltfNodeIdToNodeMap, lightDefinitions);
202
+ const punctualLights = new PunctualLightController(lightBindings, options?.useByteColors ?? true);
203
+ const lights = punctualLights.lights;
204
+ const refreshLights = () => punctualLights.update();
131
205
  const animator = new GLTFAnimator({
132
- properties: options?.properties ?? undefined,
133
206
  onVisibilityChange: refreshLights,
207
+ onLightChange: refreshLights,
208
+ properties: options?.properties ?? undefined,
134
209
  cameras,
135
210
  lightDefinitions,
136
- onLightChange: refreshLights,
137
211
  animations,
138
212
  gltfNodeIdToNodeMap,
139
213
  materials,
@@ -144,7 +218,10 @@ export function createScenegraphsFromGLTF(
144
218
  const sceneBounds = scenes.map(scene => getScenegraphBounds(scene.getBounds()));
145
219
  const modelBounds = getCombinedScenegraphBounds(sceneBounds);
146
220
  const skins = new SkinController(parseGLTFSkins({device, gltf, scenes, gltfNodeIndexToNodeMap}));
147
- animator.setUpdateHandler(() => skins.update());
221
+ animator.setUpdateHandler(() => {
222
+ skins.update();
223
+ if (lightBindings.length) refreshLights();
224
+ });
148
225
 
149
226
  let destroyed = false;
150
227
  const destroy = (): void => {
@@ -153,6 +230,7 @@ export function createScenegraphsFromGLTF(
153
230
  }
154
231
  destroyed = true;
155
232
  skins.destroy();
233
+ billboards?.destroy();
156
234
 
157
235
  const groups = new Set<GroupNode>([
158
236
  ...scenes,
@@ -195,8 +273,10 @@ export function createScenegraphsFromGLTF(
195
273
  };
196
274
 
197
275
  return {
276
+ metadata,
198
277
  scenes,
199
278
  materials,
279
+ billboards,
200
280
  variants,
201
281
  joints,
202
282
  jointIssues: jointDeclarations.issues,
@@ -204,6 +284,7 @@ export function createScenegraphsFromGLTF(
204
284
  animator,
205
285
  animations,
206
286
  lights,
287
+ punctualLights,
207
288
  extensionSupport,
208
289
  sceneBounds,
209
290
  modelBounds,
@@ -41,7 +41,12 @@ export function parseGLTFBillboards(props: ParseGLTFBillboardsProps): BillboardC
41
41
  );
42
42
  bindings.push({
43
43
  node,
44
- definition: {...definition, rotationAxis: definition.rotationAxis === 'y' ? 'y' : 'all'},
44
+ definition: {
45
+ ...definition,
46
+ ...(definition.viewDirection ? {viewDirection: [...definition.viewDirection]} : {}),
47
+ ...(definition.up ? {up: [...definition.up]} : {}),
48
+ rotationAxis: definition.rotationAxis === 'y' ? 'y' : 'all'
49
+ },
45
50
  matrixAuthored: Boolean(source.matrix)
46
51
  });
47
52
  });
@@ -296,9 +296,9 @@ const GLTF_EXTENSION_SUPPORT_REGISTRY: Record<string, GLTFExtensionSupportDefini
296
296
  comment: 'Metadata payloads remain in the loaded glTF, but luma.gl does not interpret them.'
297
297
  },
298
298
  KHR_xmp_json_ld: {
299
- supportLevel: 'none',
299
+ supportLevel: 'parsed-and-wired',
300
300
  standardStatus: 'ratified',
301
- comment: 'Metadata is preserved in the glTF, but luma.gl does not interpret it.'
301
+ comment: 'XMP packet references are available through scene metadata.'
302
302
  },
303
303
  EXT_lights_image_based: {
304
304
  supportLevel: 'none',
package/src/gltf/index.ts CHANGED
@@ -72,6 +72,7 @@ export {
72
72
  } from './parsers/parse-pbr-material';
73
73
  export {
74
74
  loadPBREnvironment,
75
+ resolveLoadedPBREnvironment,
75
76
  type PBREnvironment,
76
77
  type PBREnvironmentProps
77
78
  } from './pbr/pbr-environment';
@@ -249,10 +249,21 @@ function parseNodePointerAnimationChannel(
249
249
  pointerSegments[2] === 'extensions' &&
250
250
  pointerSegments[3] === 'KHR_node_visibility' &&
251
251
  pointerSegments[4] === 'visible';
252
- if (pointerSegments.length !== 3 && !isVisibilityPointer) {
252
+ const isSelectablePointer =
253
+ pointerSegments.length === 5 &&
254
+ pointerSegments[2] === 'extensions' &&
255
+ pointerSegments[3] === 'KHR_node_selectability' &&
256
+ pointerSegments[4] === 'selectable';
257
+ const isHoverablePointer =
258
+ pointerSegments.length === 5 &&
259
+ pointerSegments[2] === 'extensions' &&
260
+ pointerSegments[3] === 'KHR_node_hoverability' &&
261
+ pointerSegments[4] === 'hoverable';
262
+ const isBooleanPointer = isVisibilityPointer || isSelectablePointer || isHoverablePointer;
263
+ if (pointerSegments.length !== 3 && !isBooleanPointer) {
253
264
  warnUnsupportedAnimationPointer(
254
265
  pointer,
255
- 'node pointers must target transforms, morph weights, or KHR_node_visibility.visible'
266
+ 'node pointers must target transforms, morph weights, visibility, selectability, or hoverability'
256
267
  );
257
268
  return null;
258
269
  }
@@ -266,15 +277,18 @@ function parseNodePointerAnimationChannel(
266
277
  return null;
267
278
  }
268
279
 
269
- if (isVisibilityPointer && sampler.interpolation !== 'STEP') {
270
- warnUnsupportedAnimationPointer(
271
- pointer,
272
- 'boolean visibility animation requires STEP interpolation'
273
- );
280
+ if (isBooleanPointer && sampler.interpolation !== 'STEP') {
281
+ warnUnsupportedAnimationPointer(pointer, 'boolean node animation requires STEP interpolation');
274
282
  return null;
275
283
  }
276
284
 
277
- const path = isVisibilityPointer ? 'visibility' : getNodeAnimationPath(pointerSegments[2]);
285
+ const path = isVisibilityPointer
286
+ ? 'visibility'
287
+ : isSelectablePointer
288
+ ? 'selectable'
289
+ : isHoverablePointer
290
+ ? 'hoverable'
291
+ : getNodeAnimationPath(pointerSegments[2]);
278
292
  if (!path) {
279
293
  warnUnsupportedAnimationPointer(
280
294
  pointer,