@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
@@ -0,0 +1,360 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
3
+
4
+ import {
5
+ assert,
6
+ Buffer,
7
+ type Device,
8
+ type Framebuffer,
9
+ Texture,
10
+ type TextureView
11
+ } from '@luma.gl/core';
12
+ import {Matrix4, type NumberArray3} from '@math.gl/core';
13
+ import {PBR_ENVIRONMENT_FRAGMENT_WGSL, pbrEnvironmentFilter} from '@luma.gl/shaders';
14
+ import {ClipSpace} from '../models/clip-space';
15
+ import {ShaderInputs} from '../shader-inputs';
16
+
17
+ const FACES: {direction: NumberArray3; up: NumberArray3}[] = [
18
+ {direction: [1, 0, 0], up: [0, -1, 0]},
19
+ {direction: [-1, 0, 0], up: [0, -1, 0]},
20
+ {direction: [0, 1, 0], up: [0, 0, 1]},
21
+ {direction: [0, -1, 0], up: [0, 0, -1]},
22
+ {direction: [0, 0, 1], up: [0, -1, 0]},
23
+ {direction: [0, 0, -1], up: [0, -1, 0]}
24
+ ];
25
+
26
+ export type ReflectionProbeView = {
27
+ face: number;
28
+ framebuffer: Framebuffer;
29
+ /** Face rotation. The renderer subtracts the GPU origin before applying this matrix. */
30
+ viewMatrix: Matrix4;
31
+ projectionMatrix: Matrix4;
32
+ /** One vec4f containing the capture origin; borrowed until the next update cycle. */
33
+ origin: Buffer;
34
+ /** Snapshot of all source poses, shared across the six capture faces. */
35
+ matrices: Buffer;
36
+ };
37
+
38
+ export type ReflectionProbeUpdate = {
39
+ /** Producer buffer with COPY_SRC usage and a column-major float32 matrix at matrixIndex. */
40
+ matrices: Buffer;
41
+ matrixIndex: number;
42
+ /** Last completed frame's measured CPU-to-GPU-completion work, in milliseconds. */
43
+ frameMilliseconds?: number;
44
+ /** When false, finish any current refresh and retain it until the scene changes. */
45
+ refresh?: boolean;
46
+ /** World-space directions from the probe toward the views that sample it. */
47
+ viewDirections?: readonly Readonly<NumberArray3>[];
48
+ draw: (view: ReflectionProbeView) => void;
49
+ };
50
+
51
+ export type ReflectionProbeProps = {
52
+ size?: number;
53
+ sampleCount?: number;
54
+ frameBudgetMilliseconds?: number;
55
+ maximumFacesPerFrame?: number;
56
+ /** Capture and publish in the same frame, with the budget controlling filtering quality. */
57
+ refreshMode?: 'incremental' | 'same-frame';
58
+ /** Number of specular mips, including the sharp capture. Defaults to four, up to the texture limit. */
59
+ mipLevels?: number;
60
+ };
61
+
62
+ /** WebGPU capture and specular filtering with a complete, double-buffered publication. */
63
+ export class ReflectionProbe {
64
+ private readonly device: Device;
65
+ private readonly origin: Buffer;
66
+ private matrixSnapshot?: Buffer;
67
+ private readonly capture: Texture;
68
+ private readonly depth: Texture;
69
+ private readonly targets: [Texture, Texture];
70
+ private readonly views: TextureView[] = [];
71
+ private readonly framebuffers: Framebuffer[] = [];
72
+ private readonly captureTargets: Framebuffer[] = [];
73
+ private readonly filterTargets: Framebuffer[][][] = [];
74
+ private readonly filter: ClipSpace;
75
+ private readonly size: number;
76
+ private readonly sampleCount: number;
77
+ private activeSampleCount: number;
78
+ private readonly budget: number;
79
+ private readonly maximumFaces: number;
80
+ private readonly sameFrame: boolean;
81
+ private readonly projectionMatrix = new Matrix4([
82
+ 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1
83
+ ]).multiplyRight(new Matrix4().perspective({fovy: Math.PI / 2, aspect: 1, near: 0.05, far: 100}));
84
+ private readonly pendingFaces = new Set<number>();
85
+ private captureCount = 0;
86
+ private filteredCount = 0;
87
+ private front: number | undefined;
88
+ private back = 0;
89
+ private credit = 0;
90
+ private pausedFrames = 0;
91
+ private destroyed = false;
92
+
93
+ constructor(device: Device, props: ReflectionProbeProps = {}) {
94
+ assert(device.type === 'webgpu');
95
+ this.device = device;
96
+ this.size = props.size ?? 32;
97
+ this.sampleCount = props.sampleCount ?? 16;
98
+ this.activeSampleCount = this.sampleCount;
99
+ this.budget = props.frameBudgetMilliseconds ?? 1000 / 60;
100
+ this.maximumFaces = props.maximumFacesPerFrame ?? 2;
101
+ this.sameFrame = props.refreshMode === 'same-frame';
102
+ assert(
103
+ Number.isInteger(this.size) &&
104
+ this.size > 0 &&
105
+ this.size <= device.limits.maxTextureDimension2D
106
+ );
107
+ assert(Number.isInteger(this.sampleCount) && this.sampleCount > 0 && this.sampleCount <= 1024);
108
+ assert(Number.isFinite(this.budget) && this.budget > 0);
109
+ assert(Number.isInteger(this.maximumFaces) && this.maximumFaces > 0 && this.maximumFaces <= 6);
110
+ const capabilities = device.getTextureFormatCapabilities('rgba16float');
111
+ assert(capabilities.render && capabilities.filter);
112
+ const requestedMipLevels = props.mipLevels ?? 4;
113
+ assert(Number.isSafeInteger(requestedMipLevels) && requestedMipLevels > 0);
114
+ const mipLevels = Math.min(requestedMipLevels, device.getMipLevelCount(this.size, this.size));
115
+ this.origin = device.createBuffer({byteLength: 16, usage: Buffer.STORAGE | Buffer.COPY_DST});
116
+ this.capture = this.createCube('reflection-capture', 1);
117
+ this.targets = [
118
+ this.createCube('reflection-filter-a', mipLevels),
119
+ this.createCube('reflection-filter-b', mipLevels)
120
+ ];
121
+ this.depth = device.createTexture({
122
+ width: this.size,
123
+ height: this.size,
124
+ format: 'depth24plus',
125
+ usage: Texture.RENDER
126
+ });
127
+ for (let face = 0; face < FACES.length; face++)
128
+ this.captureTargets.push(this.createTarget(this.capture, face, 0, this.depth));
129
+ for (const texture of this.targets) {
130
+ this.filterTargets.push(
131
+ FACES.map((_, face) =>
132
+ Array.from({length: mipLevels - 1}, (_, mip) => this.createTarget(texture, face, mip + 1))
133
+ )
134
+ );
135
+ }
136
+ this.filter = new ClipSpace(device, {
137
+ id: 'reflection-probe-filter',
138
+ source: PBR_ENVIRONMENT_FRAGMENT_WGSL,
139
+ defines: {PBR_ENVIRONMENT_CUBE_SOURCE: true},
140
+ modules: [pbrEnvironmentFilter],
141
+ shaderInputs: new ShaderInputs({pbrEnvironmentFilter}),
142
+ colorAttachmentFormats: ['rgba16float'],
143
+ parameters: {depthWriteEnabled: false}
144
+ });
145
+ }
146
+
147
+ get texture(): Texture | undefined {
148
+ return this.front === undefined ? undefined : this.targets[this.front];
149
+ }
150
+
151
+ /**
152
+ * Record capture and filtering before the main draw. A budget estimate controls work or quality.
153
+ * Returns the number of face work units recorded. Submit the frame before calling again.
154
+ */
155
+ update(options: ReflectionProbeUpdate): number {
156
+ assert(!this.destroyed);
157
+ assert(options.matrices.device === this.device && options.matrices.usage & Buffer.COPY_SRC);
158
+ assert(
159
+ Number.isSafeInteger(options.matrixIndex) &&
160
+ options.matrixIndex >= 0 &&
161
+ (options.matrixIndex + 1) * 64 <= options.matrices.byteLength
162
+ );
163
+ if (options.refresh === false && this.front !== undefined && this.captureCount === 0) return 0;
164
+ const snapshotChanged = this.matrixSnapshot?.byteLength !== options.matrices.byteLength;
165
+ if (snapshotChanged) {
166
+ this.matrixSnapshot?.destroy();
167
+ this.matrixSnapshot = this.device.createBuffer({
168
+ byteLength: options.matrices.byteLength,
169
+ usage: Buffer.STORAGE | Buffer.COPY_DST | Buffer.COPY_SRC
170
+ });
171
+ this.captureCount = 0;
172
+ this.filteredCount = 0;
173
+ this.pendingFaces.clear();
174
+ }
175
+ const measured = options.frameMilliseconds;
176
+ const headroom =
177
+ measured !== undefined && Number.isFinite(measured)
178
+ ? Math.max(0, Math.min(this.budget, this.budget - measured))
179
+ : this.budget / 4;
180
+ let available: number;
181
+ if (this.sameFrame) {
182
+ // Keep the probe in step with the scene. Recover quality only with spare
183
+ // headroom so the sample count stays stable near the frame budget.
184
+ if (measured !== undefined && Number.isFinite(measured)) {
185
+ if (measured > this.budget) {
186
+ this.activeSampleCount = Math.max(
187
+ Math.min(4, this.sampleCount),
188
+ Math.floor(this.activeSampleCount / 2)
189
+ );
190
+ } else if (headroom >= this.budget / 4) {
191
+ this.activeSampleCount = Math.min(this.sampleCount, this.activeSampleCount + 1);
192
+ }
193
+ }
194
+ available = FACES.length * 2;
195
+ } else {
196
+ this.credit = Math.min(this.maximumFaces, this.credit + headroom);
197
+ available = Math.floor(this.credit);
198
+ if (available === 0 && ++this.pausedFrames >= 3) available = 1;
199
+ if (available === 0) return 0;
200
+ this.credit = Math.max(0, this.credit - available);
201
+ }
202
+ this.pausedFrames = 0;
203
+
204
+ if (this.captureCount === 0 && this.filteredCount === 0) {
205
+ this.device.commandEncoder.copyBufferToBuffer({
206
+ sourceBuffer: options.matrices,
207
+ destinationBuffer: this.matrixSnapshot!,
208
+ size: options.matrices.byteLength
209
+ });
210
+ this.device.commandEncoder.copyBufferToBuffer({
211
+ sourceBuffer: this.matrixSnapshot!,
212
+ sourceOffset: options.matrixIndex * 64 + 48,
213
+ destinationBuffer: this.origin,
214
+ size: 16
215
+ });
216
+ for (let face = 0; face < FACES.length; face++) this.pendingFaces.add(face);
217
+ }
218
+ let used = 0;
219
+ while (used < available && this.captureCount < FACES.length) {
220
+ const face = this.nextFace(options.viewDirections ?? []);
221
+ const {direction, up} = FACES[face];
222
+ options.draw({
223
+ face,
224
+ framebuffer: this.captureTargets[face],
225
+ viewMatrix: new Matrix4().lookAt({eye: [0, 0, 0], center: direction, up}),
226
+ projectionMatrix: this.projectionMatrix,
227
+ matrices: this.matrixSnapshot!,
228
+ origin: this.origin
229
+ });
230
+ this.pendingFaces.delete(face);
231
+ this.captureCount++;
232
+ used++;
233
+ }
234
+ while (used < available && this.filteredCount < FACES.length) {
235
+ this.filterFace(this.filteredCount);
236
+ this.filteredCount++;
237
+ used++;
238
+ }
239
+ if (this.filteredCount === FACES.length) {
240
+ this.front = this.back;
241
+ this.back = 1 - this.back;
242
+ this.captureCount = 0;
243
+ this.filteredCount = 0;
244
+ }
245
+ return used;
246
+ }
247
+
248
+ destroy(): void {
249
+ if (this.destroyed) return;
250
+ this.destroyed = true;
251
+ this.filter.destroy();
252
+ for (const framebuffer of this.framebuffers) framebuffer.destroy();
253
+ for (const view of this.views) view.destroy();
254
+ for (const target of this.targets) target.destroy();
255
+ this.capture.destroy();
256
+ this.depth.destroy();
257
+ this.origin.destroy();
258
+ this.matrixSnapshot?.destroy();
259
+ }
260
+
261
+ private nextFace(directions: readonly Readonly<NumberArray3>[]): number {
262
+ let bestFace = -1;
263
+ let bestScore = -Infinity;
264
+ for (const face of this.pendingFaces) {
265
+ const normal = FACES[face].direction;
266
+ const score = directions.length
267
+ ? Math.max(
268
+ ...directions.map(direction => {
269
+ const length = Math.hypot(...direction);
270
+ return length > 0
271
+ ? (normal[0] * direction[0] + normal[1] * direction[1] + normal[2] * direction[2]) /
272
+ length
273
+ : 0;
274
+ })
275
+ )
276
+ : 0;
277
+ if (score > bestScore) {
278
+ bestScore = score;
279
+ bestFace = face;
280
+ }
281
+ }
282
+ return bestFace;
283
+ }
284
+
285
+ private createCube(id: string, mipLevels: number): Texture {
286
+ return this.device.createTexture({
287
+ id,
288
+ dimension: 'cube',
289
+ width: this.size,
290
+ height: this.size,
291
+ depth: 6,
292
+ format: 'rgba16float',
293
+ mipLevels,
294
+ usage: Texture.RENDER | Texture.SAMPLE | Texture.COPY_SRC | Texture.COPY_DST,
295
+ sampler: {minFilter: 'linear', magFilter: 'linear', mipmapFilter: 'linear'}
296
+ });
297
+ }
298
+
299
+ private createTarget(
300
+ texture: Texture,
301
+ face: number,
302
+ mip: number,
303
+ depth: Texture | null = null
304
+ ): Framebuffer {
305
+ const view = texture.createView({
306
+ dimension: '2d',
307
+ baseArrayLayer: face,
308
+ arrayLayerCount: 1,
309
+ baseMipLevel: mip,
310
+ mipLevelCount: 1
311
+ });
312
+ this.views.push(view);
313
+ const size = Math.max(1, this.size >> mip);
314
+ const framebuffer = this.device.createFramebuffer({
315
+ width: size,
316
+ height: size,
317
+ colorAttachments: [view],
318
+ depthStencilAttachment: depth
319
+ });
320
+ this.framebuffers.push(framebuffer);
321
+ return framebuffer;
322
+ }
323
+
324
+ private filterFace(face: number): void {
325
+ const targets = this.filterTargets[this.back][face];
326
+ this.device.commandEncoder.copyTextureToTexture({
327
+ sourceTexture: this.capture,
328
+ destinationTexture: this.targets[this.back],
329
+ origin: [0, 0, face],
330
+ destinationOrigin: [0, 0, face],
331
+ width: this.size,
332
+ height: this.size,
333
+ depthOrArrayLayers: 1
334
+ });
335
+ for (const [index, framebuffer] of targets.entries()) {
336
+ const mip = index + 1;
337
+ this.filter.shaderInputs.setProps({
338
+ pbrEnvironmentFilter: {
339
+ face,
340
+ roughness: mip / targets.length,
341
+ mode: 0,
342
+ sampleCount: this.activeSampleCount,
343
+ sourceEncoding: 0,
344
+ pbrEnvironmentSource: this.capture
345
+ }
346
+ });
347
+ this.filter.predraw(this.device.commandEncoder);
348
+ const pass = this.device.beginRenderPass({
349
+ framebuffer,
350
+ clearColor: [0, 0, 0, 1],
351
+ clearDepth: false
352
+ });
353
+ try {
354
+ this.filter.draw(pass);
355
+ } finally {
356
+ pass.end();
357
+ }
358
+ }
359
+ }
360
+ }