@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,264 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { assert, Texture } from '@luma.gl/core';
5
+ import { getPBREnvironmentBindings } from "./pbr-environment.js";
6
+ import { ClipSpace } from "../models/clip-space.js";
7
+ import { ShaderInputs } from "../shader-inputs.js";
8
+ import { PBR_ENVIRONMENT_FRAGMENT_GLSL, PBR_ENVIRONMENT_FRAGMENT_WGSL, pbrEnvironmentFilter } from '@luma.gl/shaders';
9
+ /** Owns generated resources independently of the generator and source texture. */
10
+ export class PrefilteredEnvironment {
11
+ textures;
12
+ ownsBrdfLUTTexture;
13
+ destroyed = false;
14
+ constructor(textures, ownsBrdfLUTTexture = true) {
15
+ this.textures = textures;
16
+ this.ownsBrdfLUTTexture = ownsBrdfLUTTexture;
17
+ }
18
+ /** Returns the texture bindings declared by the IBL shader module. */
19
+ getBindings() {
20
+ return getPBREnvironmentBindings(this.textures);
21
+ }
22
+ destroy() {
23
+ if (this.destroyed)
24
+ return;
25
+ this.destroyed = true;
26
+ this.textures.diffuseTexture.destroy();
27
+ this.textures.specularTexture.destroy();
28
+ if (this.ownsBrdfLUTTexture)
29
+ this.textures.brdfLUTTexture.destroy();
30
+ }
31
+ }
32
+ /** Reusable WebGL/WebGPU equirectangular-to-IBL importance-sampling pipeline. */
33
+ export class PrefilteredEnvironmentGenerator {
34
+ device;
35
+ model;
36
+ modelFormat;
37
+ constructor(device) {
38
+ this.device = device;
39
+ }
40
+ /** Integrates all six cube faces, every roughness mip, diffuse irradiance, and the BRDF LUT. */
41
+ prepare(options) {
42
+ // Equirectangular environment sources require ordinary two-dimensional texture coordinates.
43
+ assert(options.source.dimension === '2d' &&
44
+ options.source.device === this.device &&
45
+ !options.source.destroyed);
46
+ const size = Math.max(1, Math.floor(options.size ?? 64));
47
+ const irradianceSize = Math.max(1, Math.floor(options.irradianceSize ?? 16));
48
+ const brdfLUTSize = Math.max(1, Math.floor(options.brdfLUTSize ?? 128));
49
+ const sampleCount = Math.max(1, Math.min(Math.floor(options.sampleCount ?? 64), 1024));
50
+ const format = options.format ?? 'rgba16float';
51
+ const capabilities = this.device.getTextureFormatCapabilities(format);
52
+ // Never silently clip HDR radiance to an unorm format.
53
+ assert(capabilities.render && capabilities.filter && !format.endsWith('-srgb'));
54
+ if (options.brdfLUTTexture) {
55
+ // Borrowed LUTs must use the same device and the documented split-sum convention.
56
+ assert(options.brdfLUTTexture.device === this.device &&
57
+ !options.brdfLUTTexture.destroyed &&
58
+ options.brdfLUTTexture.dimension === '2d');
59
+ }
60
+ const mipLevels = this.device.getMipLevelCount(size, size);
61
+ const allocatedTextures = [];
62
+ const framebuffers = [];
63
+ const views = [];
64
+ const allocateTexture = (properties) => {
65
+ const texture = createEnvironmentTexture(this.device, properties);
66
+ allocatedTextures.push(texture);
67
+ return texture;
68
+ };
69
+ try {
70
+ const specularTexture = allocateTexture({
71
+ id: 'pbr-environment-specular',
72
+ dimension: 'cube',
73
+ size,
74
+ mipLevels,
75
+ format
76
+ });
77
+ const diffuseTexture = allocateTexture({
78
+ id: 'pbr-environment-diffuse',
79
+ dimension: 'cube',
80
+ size: irradianceSize,
81
+ mipLevels: 1,
82
+ format
83
+ });
84
+ const brdfLUTTexture = options.brdfLUTTexture ??
85
+ allocateTexture({
86
+ id: 'pbr-environment-brdf-lut',
87
+ dimension: '2d',
88
+ size: brdfLUTSize,
89
+ mipLevels: 1,
90
+ format
91
+ });
92
+ const model = this.getFilterModel(format);
93
+ const sourceEncoding = options.sourceEncoding === 'srgb' && !options.source.format.endsWith('-srgb') ? 1 : 0;
94
+ for (let mipLevel = 0; mipLevel < mipLevels; mipLevel++) {
95
+ const mipSize = Math.max(1, size >> mipLevel);
96
+ const roughness = mipLevels > 1 ? mipLevel / (mipLevels - 1) : 0;
97
+ for (let face = 0; face < 6; face++) {
98
+ this.drawEnvironmentView({
99
+ texture: specularTexture,
100
+ size: mipSize,
101
+ mipLevel,
102
+ face,
103
+ roughness,
104
+ mode: 0,
105
+ source: options.source,
106
+ sourceEncoding,
107
+ sampleCount,
108
+ model,
109
+ framebuffers,
110
+ views
111
+ });
112
+ }
113
+ }
114
+ for (let face = 0; face < 6; face++) {
115
+ this.drawEnvironmentView({
116
+ texture: diffuseTexture,
117
+ size: irradianceSize,
118
+ mipLevel: 0,
119
+ face,
120
+ roughness: 1,
121
+ mode: 1,
122
+ source: options.source,
123
+ sourceEncoding,
124
+ sampleCount,
125
+ model,
126
+ framebuffers,
127
+ views
128
+ });
129
+ }
130
+ if (!options.brdfLUTTexture)
131
+ this.drawEnvironmentView({
132
+ texture: brdfLUTTexture,
133
+ size: brdfLUTSize,
134
+ mipLevel: 0,
135
+ face: 0,
136
+ roughness: 0,
137
+ mode: 2,
138
+ source: options.source,
139
+ sourceEncoding,
140
+ sampleCount,
141
+ model,
142
+ framebuffers,
143
+ views
144
+ });
145
+ // Queue order makes subsequent sampling safe; this is not a GPU completion wait.
146
+ this.device.submit();
147
+ return new PrefilteredEnvironment({
148
+ diffuseTexture,
149
+ specularTexture,
150
+ brdfLUTTexture
151
+ }, !options.brdfLUTTexture);
152
+ }
153
+ catch (error) {
154
+ for (const texture of allocatedTextures)
155
+ texture.destroy();
156
+ throw error;
157
+ }
158
+ finally {
159
+ for (const framebuffer of framebuffers) {
160
+ framebuffer.destroy();
161
+ }
162
+ for (const view of views) {
163
+ view.destroy();
164
+ }
165
+ }
166
+ }
167
+ /** Releases the reusable integration pipeline without destroying generated environments. */
168
+ destroy() {
169
+ this.model?.destroy();
170
+ this.model = undefined;
171
+ this.modelFormat = undefined;
172
+ }
173
+ getFilterModel(format) {
174
+ if (this.model && this.modelFormat !== format) {
175
+ this.model.destroy();
176
+ this.model = undefined;
177
+ }
178
+ if (!this.model) {
179
+ this.model = new ClipSpace(this.device, {
180
+ id: 'pbr-environment-integration-model',
181
+ fs: PBR_ENVIRONMENT_FRAGMENT_GLSL,
182
+ source: PBR_ENVIRONMENT_FRAGMENT_WGSL,
183
+ modules: [pbrEnvironmentFilter],
184
+ shaderInputs: new ShaderInputs({ pbrEnvironmentFilter }),
185
+ colorAttachmentFormats: [format],
186
+ parameters: { depthWriteEnabled: false }
187
+ });
188
+ this.modelFormat = format;
189
+ }
190
+ return this.model;
191
+ }
192
+ drawEnvironmentView(options) {
193
+ const view = options.texture.createView({
194
+ id: `${options.texture.id}-${options.face}-${options.mipLevel}`,
195
+ dimension: '2d',
196
+ baseMipLevel: options.mipLevel,
197
+ mipLevelCount: 1,
198
+ baseArrayLayer: options.face,
199
+ arrayLayerCount: 1
200
+ });
201
+ options.views.push(view);
202
+ const framebuffer = this.device.createFramebuffer({
203
+ id: `${view.id}-framebuffer`,
204
+ width: options.size,
205
+ height: options.size,
206
+ colorAttachments: [view],
207
+ depthStencilAttachment: null
208
+ });
209
+ options.framebuffers.push(framebuffer);
210
+ options.model.shaderInputs.setProps({
211
+ pbrEnvironmentFilter: {
212
+ face: options.face,
213
+ roughness: options.roughness,
214
+ mode: options.mode,
215
+ sampleCount: options.sampleCount,
216
+ sourceEncoding: options.sourceEncoding,
217
+ pbrEnvironmentSource: options.source
218
+ }
219
+ });
220
+ options.model.predraw(this.device.commandEncoder);
221
+ const renderPass = this.device.beginRenderPass({
222
+ id: `${view.id}-integration`,
223
+ framebuffer,
224
+ clearColor: [0, 0, 0, 1],
225
+ clearDepth: false
226
+ });
227
+ try {
228
+ options.model.draw(renderPass);
229
+ }
230
+ finally {
231
+ renderPass.end();
232
+ }
233
+ }
234
+ }
235
+ /** Prepares one caller-owned lighting environment without retaining the integration pipeline. */
236
+ export function createPrefilteredEnvironment(device, options) {
237
+ const generator = new PrefilteredEnvironmentGenerator(device);
238
+ try {
239
+ return generator.prepare(options);
240
+ }
241
+ finally {
242
+ generator.destroy();
243
+ }
244
+ }
245
+ function createEnvironmentTexture(device, options) {
246
+ return device.createTexture({
247
+ id: options.id,
248
+ dimension: options.dimension,
249
+ width: options.size,
250
+ height: options.size,
251
+ depth: options.dimension === 'cube' ? 6 : 1,
252
+ mipLevels: options.mipLevels,
253
+ format: options.format,
254
+ usage: Texture.SAMPLE | Texture.RENDER | Texture.COPY_SRC,
255
+ sampler: {
256
+ minFilter: 'linear',
257
+ magFilter: 'linear',
258
+ mipmapFilter: 'linear',
259
+ addressModeU: 'clamp-to-edge',
260
+ addressModeV: 'clamp-to-edge'
261
+ }
262
+ });
263
+ }
264
+ //# sourceMappingURL=prefiltered-environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefiltered-environment.js","sourceRoot":"","sources":["../../src/lighting/prefiltered-environment.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,MAAM,EAGN,OAAO,EAG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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,QAAQ;QACzD,OAAO,EAAE;YACP,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,QAAQ;YACtB,YAAY,EAAE,eAAe;YAC7B,YAAY,EAAE,eAAe;SAC9B;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,321 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var reflection_probe_exports = {};
19
+ __export(reflection_probe_exports, {
20
+ ReflectionProbe: () => ReflectionProbe
21
+ });
22
+ module.exports = __toCommonJS(reflection_probe_exports);
23
+ var import_core = require("@luma.gl/core");
24
+ var import_core2 = require("@math.gl/core");
25
+ var import_shaders = require("@luma.gl/shaders");
26
+ var import_clip_space = require("../models/clip-space.cjs");
27
+ var import_shader_inputs = require("../shader-inputs.cjs");
28
+ const FACES = [
29
+ { direction: [1, 0, 0], up: [0, -1, 0] },
30
+ { direction: [-1, 0, 0], up: [0, -1, 0] },
31
+ { direction: [0, 1, 0], up: [0, 0, 1] },
32
+ { direction: [0, -1, 0], up: [0, 0, -1] },
33
+ { direction: [0, 0, 1], up: [0, -1, 0] },
34
+ { direction: [0, 0, -1], up: [0, -1, 0] }
35
+ ];
36
+ class ReflectionProbe {
37
+ device;
38
+ origin;
39
+ matrixSnapshot;
40
+ capture;
41
+ depth;
42
+ targets;
43
+ views = [];
44
+ framebuffers = [];
45
+ captureTargets = [];
46
+ filterTargets = [];
47
+ filter;
48
+ size;
49
+ sampleCount;
50
+ activeSampleCount;
51
+ budget;
52
+ maximumFaces;
53
+ sameFrame;
54
+ projectionMatrix = new import_core2.Matrix4([
55
+ 1,
56
+ 0,
57
+ 0,
58
+ 0,
59
+ 0,
60
+ -1,
61
+ 0,
62
+ 0,
63
+ 0,
64
+ 0,
65
+ 0.5,
66
+ 0,
67
+ 0,
68
+ 0,
69
+ 0.5,
70
+ 1
71
+ ]).multiplyRight(new import_core2.Matrix4().perspective({ fovy: Math.PI / 2, aspect: 1, near: 0.05, far: 100 }));
72
+ pendingFaces = /* @__PURE__ */ new Set();
73
+ captureCount = 0;
74
+ filteredCount = 0;
75
+ front;
76
+ back = 0;
77
+ credit = 0;
78
+ pausedFrames = 0;
79
+ destroyed = false;
80
+ constructor(device, props = {}) {
81
+ (0, import_core.assert)(device.type === "webgpu");
82
+ this.device = device;
83
+ this.size = props.size ?? 32;
84
+ this.sampleCount = props.sampleCount ?? 16;
85
+ this.activeSampleCount = this.sampleCount;
86
+ this.budget = props.frameBudgetMilliseconds ?? 1e3 / 60;
87
+ this.maximumFaces = props.maximumFacesPerFrame ?? 2;
88
+ this.sameFrame = props.refreshMode === "same-frame";
89
+ (0, import_core.assert)(Number.isInteger(this.size) && this.size > 0 && this.size <= device.limits.maxTextureDimension2D);
90
+ (0, import_core.assert)(Number.isInteger(this.sampleCount) && this.sampleCount > 0 && this.sampleCount <= 1024);
91
+ (0, import_core.assert)(Number.isFinite(this.budget) && this.budget > 0);
92
+ (0, import_core.assert)(Number.isInteger(this.maximumFaces) && this.maximumFaces > 0 && this.maximumFaces <= 6);
93
+ const capabilities = device.getTextureFormatCapabilities("rgba16float");
94
+ (0, import_core.assert)(capabilities.render && capabilities.filter);
95
+ const requestedMipLevels = props.mipLevels ?? 4;
96
+ (0, import_core.assert)(Number.isSafeInteger(requestedMipLevels) && requestedMipLevels > 0);
97
+ const mipLevels = Math.min(requestedMipLevels, device.getMipLevelCount(this.size, this.size));
98
+ this.origin = device.createBuffer({ byteLength: 16, usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST });
99
+ this.capture = this.createCube("reflection-capture", 1);
100
+ this.targets = [
101
+ this.createCube("reflection-filter-a", mipLevels),
102
+ this.createCube("reflection-filter-b", mipLevels)
103
+ ];
104
+ this.depth = device.createTexture({
105
+ width: this.size,
106
+ height: this.size,
107
+ format: "depth24plus",
108
+ usage: import_core.Texture.RENDER
109
+ });
110
+ for (let face = 0; face < FACES.length; face++)
111
+ this.captureTargets.push(this.createTarget(this.capture, face, 0, this.depth));
112
+ for (const texture of this.targets) {
113
+ this.filterTargets.push(FACES.map((_, face) => Array.from({ length: mipLevels - 1 }, (_2, mip) => this.createTarget(texture, face, mip + 1))));
114
+ }
115
+ this.filter = new import_clip_space.ClipSpace(device, {
116
+ id: "reflection-probe-filter",
117
+ source: import_shaders.PBR_ENVIRONMENT_FRAGMENT_WGSL,
118
+ defines: { PBR_ENVIRONMENT_CUBE_SOURCE: true },
119
+ modules: [import_shaders.pbrEnvironmentFilter],
120
+ shaderInputs: new import_shader_inputs.ShaderInputs({ pbrEnvironmentFilter: import_shaders.pbrEnvironmentFilter }),
121
+ colorAttachmentFormats: ["rgba16float"],
122
+ parameters: { depthWriteEnabled: false }
123
+ });
124
+ }
125
+ get texture() {
126
+ return this.front === void 0 ? void 0 : this.targets[this.front];
127
+ }
128
+ /**
129
+ * Record capture and filtering before the main draw. A budget estimate controls work or quality.
130
+ * Returns the number of face work units recorded. Submit the frame before calling again.
131
+ */
132
+ update(options) {
133
+ var _a, _b;
134
+ (0, import_core.assert)(!this.destroyed);
135
+ (0, import_core.assert)(options.matrices.device === this.device && options.matrices.usage & import_core.Buffer.COPY_SRC);
136
+ (0, import_core.assert)(Number.isSafeInteger(options.matrixIndex) && options.matrixIndex >= 0 && (options.matrixIndex + 1) * 64 <= options.matrices.byteLength);
137
+ if (options.refresh === false && this.front !== void 0 && this.captureCount === 0)
138
+ return 0;
139
+ const snapshotChanged = ((_a = this.matrixSnapshot) == null ? void 0 : _a.byteLength) !== options.matrices.byteLength;
140
+ if (snapshotChanged) {
141
+ (_b = this.matrixSnapshot) == null ? void 0 : _b.destroy();
142
+ this.matrixSnapshot = this.device.createBuffer({
143
+ byteLength: options.matrices.byteLength,
144
+ usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC
145
+ });
146
+ this.captureCount = 0;
147
+ this.filteredCount = 0;
148
+ this.pendingFaces.clear();
149
+ }
150
+ const measured = options.frameMilliseconds;
151
+ const headroom = measured !== void 0 && Number.isFinite(measured) ? Math.max(0, Math.min(this.budget, this.budget - measured)) : this.budget / 4;
152
+ let available;
153
+ if (this.sameFrame) {
154
+ if (measured !== void 0 && Number.isFinite(measured)) {
155
+ if (measured > this.budget) {
156
+ this.activeSampleCount = Math.max(Math.min(4, this.sampleCount), Math.floor(this.activeSampleCount / 2));
157
+ } else if (headroom >= this.budget / 4) {
158
+ this.activeSampleCount = Math.min(this.sampleCount, this.activeSampleCount + 1);
159
+ }
160
+ }
161
+ available = FACES.length * 2;
162
+ } else {
163
+ this.credit = Math.min(this.maximumFaces, this.credit + headroom);
164
+ available = Math.floor(this.credit);
165
+ if (available === 0 && ++this.pausedFrames >= 3)
166
+ available = 1;
167
+ if (available === 0)
168
+ return 0;
169
+ this.credit = Math.max(0, this.credit - available);
170
+ }
171
+ this.pausedFrames = 0;
172
+ if (this.captureCount === 0 && this.filteredCount === 0) {
173
+ this.device.commandEncoder.copyBufferToBuffer({
174
+ sourceBuffer: options.matrices,
175
+ destinationBuffer: this.matrixSnapshot,
176
+ size: options.matrices.byteLength
177
+ });
178
+ this.device.commandEncoder.copyBufferToBuffer({
179
+ sourceBuffer: this.matrixSnapshot,
180
+ sourceOffset: options.matrixIndex * 64 + 48,
181
+ destinationBuffer: this.origin,
182
+ size: 16
183
+ });
184
+ for (let face = 0; face < FACES.length; face++)
185
+ this.pendingFaces.add(face);
186
+ }
187
+ let used = 0;
188
+ while (used < available && this.captureCount < FACES.length) {
189
+ const face = this.nextFace(options.viewDirections ?? []);
190
+ const { direction, up } = FACES[face];
191
+ options.draw({
192
+ face,
193
+ framebuffer: this.captureTargets[face],
194
+ viewMatrix: new import_core2.Matrix4().lookAt({ eye: [0, 0, 0], center: direction, up }),
195
+ projectionMatrix: this.projectionMatrix,
196
+ matrices: this.matrixSnapshot,
197
+ origin: this.origin
198
+ });
199
+ this.pendingFaces.delete(face);
200
+ this.captureCount++;
201
+ used++;
202
+ }
203
+ while (used < available && this.filteredCount < FACES.length) {
204
+ this.filterFace(this.filteredCount);
205
+ this.filteredCount++;
206
+ used++;
207
+ }
208
+ if (this.filteredCount === FACES.length) {
209
+ this.front = this.back;
210
+ this.back = 1 - this.back;
211
+ this.captureCount = 0;
212
+ this.filteredCount = 0;
213
+ }
214
+ return used;
215
+ }
216
+ destroy() {
217
+ var _a;
218
+ if (this.destroyed)
219
+ return;
220
+ this.destroyed = true;
221
+ this.filter.destroy();
222
+ for (const framebuffer of this.framebuffers)
223
+ framebuffer.destroy();
224
+ for (const view of this.views)
225
+ view.destroy();
226
+ for (const target of this.targets)
227
+ target.destroy();
228
+ this.capture.destroy();
229
+ this.depth.destroy();
230
+ this.origin.destroy();
231
+ (_a = this.matrixSnapshot) == null ? void 0 : _a.destroy();
232
+ }
233
+ nextFace(directions) {
234
+ let bestFace = -1;
235
+ let bestScore = -Infinity;
236
+ for (const face of this.pendingFaces) {
237
+ const normal = FACES[face].direction;
238
+ const score = directions.length ? Math.max(...directions.map((direction) => {
239
+ const length = Math.hypot(...direction);
240
+ return length > 0 ? (normal[0] * direction[0] + normal[1] * direction[1] + normal[2] * direction[2]) / length : 0;
241
+ })) : 0;
242
+ if (score > bestScore) {
243
+ bestScore = score;
244
+ bestFace = face;
245
+ }
246
+ }
247
+ return bestFace;
248
+ }
249
+ createCube(id, mipLevels) {
250
+ return this.device.createTexture({
251
+ id,
252
+ dimension: "cube",
253
+ width: this.size,
254
+ height: this.size,
255
+ depth: 6,
256
+ format: "rgba16float",
257
+ mipLevels,
258
+ usage: import_core.Texture.RENDER | import_core.Texture.SAMPLE | import_core.Texture.COPY_SRC | import_core.Texture.COPY_DST,
259
+ sampler: { minFilter: "linear", magFilter: "linear", mipmapFilter: "linear" }
260
+ });
261
+ }
262
+ createTarget(texture, face, mip, depth = null) {
263
+ const view = texture.createView({
264
+ dimension: "2d",
265
+ baseArrayLayer: face,
266
+ arrayLayerCount: 1,
267
+ baseMipLevel: mip,
268
+ mipLevelCount: 1
269
+ });
270
+ this.views.push(view);
271
+ const size = Math.max(1, this.size >> mip);
272
+ const framebuffer = this.device.createFramebuffer({
273
+ width: size,
274
+ height: size,
275
+ colorAttachments: [view],
276
+ depthStencilAttachment: depth
277
+ });
278
+ this.framebuffers.push(framebuffer);
279
+ return framebuffer;
280
+ }
281
+ filterFace(face) {
282
+ const targets = this.filterTargets[this.back][face];
283
+ this.device.commandEncoder.copyTextureToTexture({
284
+ sourceTexture: this.capture,
285
+ destinationTexture: this.targets[this.back],
286
+ origin: [0, 0, face],
287
+ destinationOrigin: [0, 0, face],
288
+ width: this.size,
289
+ height: this.size,
290
+ depthOrArrayLayers: 1
291
+ });
292
+ for (const [index, framebuffer] of targets.entries()) {
293
+ const mip = index + 1;
294
+ this.filter.shaderInputs.setProps({
295
+ pbrEnvironmentFilter: {
296
+ face,
297
+ roughness: mip / targets.length,
298
+ mode: 0,
299
+ sampleCount: this.activeSampleCount,
300
+ sourceEncoding: 0,
301
+ pbrEnvironmentSource: this.capture
302
+ }
303
+ });
304
+ this.filter.predraw(this.device.commandEncoder);
305
+ const pass = this.device.beginRenderPass({
306
+ framebuffer,
307
+ clearColor: [0, 0, 0, 1],
308
+ clearDepth: false
309
+ });
310
+ try {
311
+ this.filter.draw(pass);
312
+ } finally {
313
+ pass.end();
314
+ }
315
+ }
316
+ }
317
+ }
318
+ // Annotate the CommonJS export names for ESM import in node:
319
+ 0 && (module.exports = {
320
+ ReflectionProbe
321
+ });
@@ -0,0 +1,77 @@
1
+ import { Buffer, type Device, type Framebuffer, Texture } from '@luma.gl/core';
2
+ import { Matrix4, type NumberArray3 } from '@math.gl/core';
3
+ export type ReflectionProbeView = {
4
+ face: number;
5
+ framebuffer: Framebuffer;
6
+ /** Face rotation. The renderer subtracts the GPU origin before applying this matrix. */
7
+ viewMatrix: Matrix4;
8
+ projectionMatrix: Matrix4;
9
+ /** One vec4f containing the capture origin; borrowed until the next update cycle. */
10
+ origin: Buffer;
11
+ /** Snapshot of all source poses, shared across the six capture faces. */
12
+ matrices: Buffer;
13
+ };
14
+ export type ReflectionProbeUpdate = {
15
+ /** Producer buffer with COPY_SRC usage and a column-major float32 matrix at matrixIndex. */
16
+ matrices: Buffer;
17
+ matrixIndex: number;
18
+ /** Last completed frame's measured CPU-to-GPU-completion work, in milliseconds. */
19
+ frameMilliseconds?: number;
20
+ /** When false, finish any current refresh and retain it until the scene changes. */
21
+ refresh?: boolean;
22
+ /** World-space directions from the probe toward the views that sample it. */
23
+ viewDirections?: readonly Readonly<NumberArray3>[];
24
+ draw: (view: ReflectionProbeView) => void;
25
+ };
26
+ export type ReflectionProbeProps = {
27
+ size?: number;
28
+ sampleCount?: number;
29
+ frameBudgetMilliseconds?: number;
30
+ maximumFacesPerFrame?: number;
31
+ /** Capture and publish in the same frame, with the budget controlling filtering quality. */
32
+ refreshMode?: 'incremental' | 'same-frame';
33
+ /** Number of specular mips, including the sharp capture. Defaults to four, up to the texture limit. */
34
+ mipLevels?: number;
35
+ };
36
+ /** WebGPU capture and specular filtering with a complete, double-buffered publication. */
37
+ export declare class ReflectionProbe {
38
+ private readonly device;
39
+ private readonly origin;
40
+ private matrixSnapshot?;
41
+ private readonly capture;
42
+ private readonly depth;
43
+ private readonly targets;
44
+ private readonly views;
45
+ private readonly framebuffers;
46
+ private readonly captureTargets;
47
+ private readonly filterTargets;
48
+ private readonly filter;
49
+ private readonly size;
50
+ private readonly sampleCount;
51
+ private activeSampleCount;
52
+ private readonly budget;
53
+ private readonly maximumFaces;
54
+ private readonly sameFrame;
55
+ private readonly projectionMatrix;
56
+ private readonly pendingFaces;
57
+ private captureCount;
58
+ private filteredCount;
59
+ private front;
60
+ private back;
61
+ private credit;
62
+ private pausedFrames;
63
+ private destroyed;
64
+ constructor(device: Device, props?: ReflectionProbeProps);
65
+ get texture(): Texture | undefined;
66
+ /**
67
+ * Record capture and filtering before the main draw. A budget estimate controls work or quality.
68
+ * Returns the number of face work units recorded. Submit the frame before calling again.
69
+ */
70
+ update(options: ReflectionProbeUpdate): number;
71
+ destroy(): void;
72
+ private nextFace;
73
+ private createCube;
74
+ private createTarget;
75
+ private filterFace;
76
+ }
77
+ //# sourceMappingURL=reflection-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflection-probe.d.ts","sourceRoot":"","sources":["../../src/lighting/reflection-probe.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,MAAM,EACN,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,OAAO,EAER,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AAczD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,wFAAwF;IACxF,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,QAAQ,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