@luma.gl/engine 10.0.0-rc.1 → 10.0.0-rc.2

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 (437) hide show
  1. package/THIRD-PARTY-NOTICES.md +82 -0
  2. package/dist/animation/animation-track.d.ts +7 -0
  3. package/dist/animation/animation-track.d.ts.map +1 -1
  4. package/dist/animation/animation-track.js.map +1 -1
  5. package/dist/animation/node-animation-binding.cjs +1 -0
  6. package/dist/animation/node-animation-binding.d.ts +2 -1
  7. package/dist/animation/node-animation-binding.d.ts.map +1 -1
  8. package/dist/animation/node-animation-binding.js +6 -0
  9. package/dist/animation/node-animation-binding.js.map +1 -1
  10. package/dist/animation/scenegraph-gpu-animation-layout.cjs +99 -0
  11. package/dist/animation/scenegraph-gpu-animation-layout.d.ts +69 -0
  12. package/dist/animation/scenegraph-gpu-animation-layout.d.ts.map +1 -0
  13. package/dist/animation/scenegraph-gpu-animation-layout.js +90 -0
  14. package/dist/animation/scenegraph-gpu-animation-layout.js.map +1 -0
  15. package/dist/animation/scenegraph-gpu-animation.cjs +281 -0
  16. package/dist/animation/scenegraph-gpu-animation.d.ts +54 -0
  17. package/dist/animation/scenegraph-gpu-animation.d.ts.map +1 -0
  18. package/dist/animation/scenegraph-gpu-animation.js +274 -0
  19. package/dist/animation/scenegraph-gpu-animation.js.map +1 -0
  20. package/dist/arrow/arrow-picking.cjs +4 -3
  21. package/dist/arrow/arrow-picking.d.ts +15 -5
  22. package/dist/arrow/arrow-picking.d.ts.map +1 -1
  23. package/dist/arrow/arrow-picking.js +16 -5
  24. package/dist/arrow/arrow-picking.js.map +1 -1
  25. package/dist/arrow/index.cjs.map +1 -1
  26. package/dist/dist.dev.js +1671 -1105
  27. package/dist/dist.min.js +69 -70
  28. package/dist/effects/glfx-effects.cjs +261 -0
  29. package/dist/effects/glfx-effects.d.ts +959 -0
  30. package/dist/effects/glfx-effects.d.ts.map +1 -0
  31. package/dist/effects/glfx-effects.js +200 -0
  32. package/dist/effects/glfx-effects.js.map +1 -0
  33. package/dist/effects/graph/gpu-effect-operation.cjs +402 -0
  34. package/dist/effects/graph/gpu-effect-operation.d.ts +101 -0
  35. package/dist/effects/graph/gpu-effect-operation.d.ts.map +1 -0
  36. package/dist/effects/graph/gpu-effect-operation.js +410 -0
  37. package/dist/effects/graph/gpu-effect-operation.js.map +1 -0
  38. package/dist/effects/graph/temporal-graph-history.cjs +48 -0
  39. package/dist/effects/graph/temporal-graph-history.d.ts +17 -0
  40. package/dist/effects/graph/temporal-graph-history.d.ts.map +1 -0
  41. package/dist/effects/graph/temporal-graph-history.js +30 -0
  42. package/dist/effects/graph/temporal-graph-history.js.map +1 -0
  43. package/dist/effects/index.cjs +117 -30
  44. package/dist/effects/index.cjs.map +3 -3
  45. package/dist/effects/index.d.ts +34 -18
  46. package/dist/effects/index.d.ts.map +1 -1
  47. package/dist/effects/index.js +31 -18
  48. package/dist/effects/index.js.map +1 -1
  49. package/dist/effects/passes/postprocessing/fxaa/fxaa.cjs +9 -2
  50. package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts +19 -0
  51. package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
  52. package/dist/effects/passes/postprocessing/fxaa/fxaa.js +6 -0
  53. package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
  54. package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.cjs +9 -2
  55. package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts +41 -0
  56. package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts.map +1 -1
  57. package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js +6 -0
  58. package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js.map +1 -1
  59. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.cjs +200 -13
  60. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts +992 -6
  61. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts.map +1 -1
  62. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js +199 -10
  63. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js.map +1 -1
  64. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts +3 -3
  65. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts.map +1 -1
  66. package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.js.map +1 -1
  67. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.cjs +41 -40
  68. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +116 -8
  69. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
  70. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js +38 -37
  71. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js.map +1 -1
  72. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.cjs +83 -66
  73. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +470 -2
  74. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
  75. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js +80 -62
  76. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js.map +1 -1
  77. package/dist/effects/passes/screen-space/copy-pass.cjs +7 -0
  78. package/dist/effects/passes/screen-space/copy-pass.d.ts +1 -0
  79. package/dist/effects/passes/screen-space/copy-pass.d.ts.map +1 -1
  80. package/dist/effects/passes/screen-space/copy-pass.js +4 -0
  81. package/dist/effects/passes/screen-space/copy-pass.js.map +1 -1
  82. package/dist/effects/passes/screen-space/depth-aware-blur.cjs +14 -5
  83. package/dist/effects/passes/screen-space/depth-aware-blur.d.ts +125 -17
  84. package/dist/effects/passes/screen-space/depth-aware-blur.d.ts.map +1 -1
  85. package/dist/effects/passes/screen-space/depth-aware-blur.js +11 -3
  86. package/dist/effects/passes/screen-space/depth-aware-blur.js.map +1 -1
  87. package/dist/effects/passes/screen-space/dof.cjs +19 -3
  88. package/dist/effects/passes/screen-space/dof.d.ts +181 -0
  89. package/dist/effects/passes/screen-space/dof.d.ts.map +1 -1
  90. package/dist/effects/passes/screen-space/dof.js +17 -3
  91. package/dist/effects/passes/screen-space/dof.js.map +1 -1
  92. package/dist/effects/passes/screen-space/gtao.cjs +82 -62
  93. package/dist/effects/passes/screen-space/gtao.d.ts +608 -3
  94. package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
  95. package/dist/effects/passes/screen-space/gtao.js +83 -60
  96. package/dist/effects/passes/screen-space/gtao.js.map +1 -1
  97. package/dist/effects/passes/screen-space/hdr-auto-exposure.cjs +103 -79
  98. package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts +225 -3
  99. package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts.map +1 -1
  100. package/dist/effects/passes/screen-space/hdr-auto-exposure.js +102 -77
  101. package/dist/effects/passes/screen-space/hdr-auto-exposure.js.map +1 -1
  102. package/dist/effects/passes/screen-space/height-fog.cjs +14 -0
  103. package/dist/effects/passes/screen-space/height-fog.d.ts +71 -0
  104. package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
  105. package/dist/effects/passes/screen-space/height-fog.js +16 -3
  106. package/dist/effects/passes/screen-space/height-fog.js.map +1 -1
  107. package/dist/effects/passes/screen-space/motion-blur.cjs +7 -8
  108. package/dist/effects/passes/screen-space/motion-blur.d.ts +41 -2
  109. package/dist/effects/passes/screen-space/motion-blur.d.ts.map +1 -1
  110. package/dist/effects/passes/screen-space/motion-blur.js +6 -6
  111. package/dist/effects/passes/screen-space/motion-blur.js.map +1 -1
  112. package/dist/effects/passes/screen-space/outlines.cjs +143 -18
  113. package/dist/effects/passes/screen-space/outlines.d.ts +162 -3
  114. package/dist/effects/passes/screen-space/outlines.d.ts.map +1 -1
  115. package/dist/effects/passes/screen-space/outlines.js +137 -15
  116. package/dist/effects/passes/screen-space/outlines.js.map +1 -1
  117. package/dist/effects/passes/screen-space/screen-space-global-illumination.cjs +70 -61
  118. package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +309 -2
  119. package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
  120. package/dist/effects/passes/screen-space/screen-space-global-illumination.js +69 -59
  121. package/dist/effects/passes/screen-space/screen-space-global-illumination.js.map +1 -1
  122. package/dist/effects/passes/screen-space/screen-space-reflections.cjs +151 -83
  123. package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +778 -7
  124. package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
  125. package/dist/effects/passes/screen-space/screen-space-reflections.js +148 -79
  126. package/dist/effects/passes/screen-space/screen-space-reflections.js.map +1 -1
  127. package/dist/effects/passes/screen-space/selection-outline.cjs +12 -2
  128. package/dist/effects/passes/screen-space/selection-outline.d.ts +44 -0
  129. package/dist/effects/passes/screen-space/selection-outline.d.ts.map +1 -1
  130. package/dist/effects/passes/screen-space/selection-outline.js +9 -0
  131. package/dist/effects/passes/screen-space/selection-outline.js.map +1 -1
  132. package/dist/effects/passes/screen-space/ssao.cjs +66 -43
  133. package/dist/effects/passes/screen-space/ssao.d.ts +647 -2
  134. package/dist/effects/passes/screen-space/ssao.d.ts.map +1 -1
  135. package/dist/effects/passes/screen-space/ssao.js +64 -41
  136. package/dist/effects/passes/screen-space/ssao.js.map +1 -1
  137. package/dist/effects/passes/screen-space/temporal-antialiasing.cjs +42 -30
  138. package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts +107 -6
  139. package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts.map +1 -1
  140. package/dist/effects/passes/screen-space/temporal-antialiasing.js +40 -27
  141. package/dist/effects/passes/screen-space/temporal-antialiasing.js.map +1 -1
  142. package/dist/effects/passes/screen-space/temporal-frame.cjs +34 -0
  143. package/dist/effects/passes/screen-space/temporal-frame.d.ts +23 -0
  144. package/dist/effects/passes/screen-space/temporal-frame.d.ts.map +1 -0
  145. package/dist/effects/passes/screen-space/temporal-frame.js +16 -0
  146. package/dist/effects/passes/screen-space/temporal-frame.js.map +1 -0
  147. package/dist/effects/passes/screen-space/volumetric-fog.cjs +25 -22
  148. package/dist/effects/passes/screen-space/volumetric-fog.d.ts +161 -2
  149. package/dist/effects/passes/screen-space/volumetric-fog.d.ts.map +1 -1
  150. package/dist/effects/passes/screen-space/volumetric-fog.js +27 -21
  151. package/dist/effects/passes/screen-space/volumetric-fog.js.map +1 -1
  152. package/dist/effects/temporal-upscale/index.cjs +40 -0
  153. package/dist/effects/temporal-upscale/index.d.ts +5 -0
  154. package/dist/effects/temporal-upscale/index.d.ts.map +1 -0
  155. package/dist/effects/temporal-upscale/index.js +6 -0
  156. package/dist/effects/temporal-upscale/index.js.map +1 -0
  157. package/dist/effects/temporal-upscale/temporal-math.cjs +202 -0
  158. package/dist/effects/temporal-upscale/temporal-math.d.ts +101 -0
  159. package/dist/effects/temporal-upscale/temporal-math.d.ts.map +1 -0
  160. package/dist/effects/temporal-upscale/temporal-math.js +202 -0
  161. package/dist/effects/temporal-upscale/temporal-math.js.map +1 -0
  162. package/dist/effects/temporal-upscale/temporal-upscale-shaders.cjs +353 -0
  163. package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts +7 -0
  164. package/dist/effects/temporal-upscale/temporal-upscale-shaders.d.ts.map +1 -0
  165. package/dist/effects/temporal-upscale/temporal-upscale-shaders.js +321 -0
  166. package/dist/effects/temporal-upscale/temporal-upscale-shaders.js.map +1 -0
  167. package/dist/effects/temporal-upscale/temporal-upscaler.cjs +392 -0
  168. package/dist/effects/temporal-upscale/temporal-upscaler.d.ts +143 -0
  169. package/dist/effects/temporal-upscale/temporal-upscaler.d.ts.map +1 -0
  170. package/dist/effects/temporal-upscale/temporal-upscaler.js +385 -0
  171. package/dist/effects/temporal-upscale/temporal-upscaler.js.map +1 -0
  172. package/dist/gltf/gltf/create-gltf-model.cjs +34 -71
  173. package/dist/gltf/gltf/create-gltf-model.d.ts +3 -0
  174. package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
  175. package/dist/gltf/gltf/create-gltf-model.js +40 -74
  176. package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
  177. package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +46 -4
  178. package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +9 -1
  179. package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
  180. package/dist/gltf/gltf/create-scenegraph-from-gltf.js +54 -4
  181. package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
  182. package/dist/gltf/gltf/gltf-animated-crowd.cjs +25 -136
  183. package/dist/gltf/gltf/gltf-animated-crowd.d.ts +4 -8
  184. package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
  185. package/dist/gltf/gltf/gltf-animated-crowd.js +27 -139
  186. package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
  187. package/dist/gltf/gltf/gltf-animation-nodes.cjs +84 -0
  188. package/dist/gltf/gltf/gltf-animation-nodes.d.ts +11 -0
  189. package/dist/gltf/gltf/gltf-animation-nodes.d.ts.map +1 -0
  190. package/dist/gltf/gltf/gltf-animation-nodes.js +62 -0
  191. package/dist/gltf/gltf/gltf-animation-nodes.js.map +1 -0
  192. package/dist/gltf/gltf/gltf-animator.cjs +8 -2
  193. package/dist/gltf/gltf/gltf-animator.d.ts +6 -1
  194. package/dist/gltf/gltf/gltf-animator.d.ts.map +1 -1
  195. package/dist/gltf/gltf/gltf-animator.js +10 -2
  196. package/dist/gltf/gltf/gltf-animator.js.map +1 -1
  197. package/dist/gltf/gltf/gltf-gpu-animation-controller.cjs +81 -0
  198. package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts +9 -0
  199. package/dist/gltf/gltf/gltf-gpu-animation-controller.d.ts.map +1 -0
  200. package/dist/gltf/gltf/gltf-gpu-animation-controller.js +67 -0
  201. package/dist/gltf/gltf/gltf-gpu-animation-controller.js.map +1 -0
  202. package/dist/gltf/gltf/gltf-gpu-animation.cjs +33 -28
  203. package/dist/gltf/gltf/gltf-gpu-animation.d.ts +7 -26
  204. package/dist/gltf/gltf/gltf-gpu-animation.d.ts.map +1 -1
  205. package/dist/gltf/gltf/gltf-gpu-animation.js +29 -28
  206. package/dist/gltf/gltf/gltf-gpu-animation.js.map +1 -1
  207. package/dist/gltf/index.cjs.map +3 -3
  208. package/dist/gltf/index.d.ts +2 -2
  209. package/dist/gltf/index.d.ts.map +1 -1
  210. package/dist/gltf/index.js.map +1 -1
  211. package/dist/gltf/parsers/parse-gltf.cjs +4 -2
  212. package/dist/gltf/parsers/parse-gltf.d.ts +3 -0
  213. package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
  214. package/dist/gltf/parsers/parse-gltf.js +7 -2
  215. package/dist/gltf/parsers/parse-gltf.js.map +1 -1
  216. package/dist/graph/models/index.cjs.map +2 -2
  217. package/dist/graph/physics/index.cjs +5 -0
  218. package/dist/graph/physics/index.cjs.map +3 -3
  219. package/dist/graph/physics/index.d.ts +1 -0
  220. package/dist/graph/physics/index.d.ts.map +1 -1
  221. package/dist/graph/physics/index.js +1 -0
  222. package/dist/graph/physics/index.js.map +1 -1
  223. package/dist/graph/physics/physics-controller-geometry.cjs +21 -0
  224. package/dist/graph/physics/physics-controller-geometry.d.ts +8 -1
  225. package/dist/graph/physics/physics-controller-geometry.d.ts.map +1 -1
  226. package/dist/graph/physics/physics-controller-geometry.js +22 -0
  227. package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
  228. package/dist/graph/physics/scenegraph-session.d.ts +1 -1
  229. package/dist/graph/physics/scenegraph-session.d.ts.map +1 -1
  230. package/dist/graph/tables/index.cjs.map +2 -2
  231. package/dist/index.cjs +16 -0
  232. package/dist/index.cjs.map +3 -3
  233. package/dist/index.d.ts +6 -0
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js +4 -0
  236. package/dist/index.js.map +1 -1
  237. package/dist/lighting/ambient-occlusion-pass.cjs +47 -28
  238. package/dist/lighting/ambient-occlusion-pass.d.ts +12 -0
  239. package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
  240. package/dist/lighting/ambient-occlusion-pass.js +45 -26
  241. package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
  242. package/dist/lighting/clustered-light-grid.cjs +71 -20
  243. package/dist/lighting/clustered-light-grid.d.ts +37 -0
  244. package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
  245. package/dist/lighting/clustered-light-grid.js +68 -18
  246. package/dist/lighting/clustered-light-grid.js.map +1 -1
  247. package/dist/lighting/contact-shadow-composite.cjs +72 -51
  248. package/dist/lighting/contact-shadow-composite.d.ts +274 -3
  249. package/dist/lighting/contact-shadow-composite.d.ts.map +1 -1
  250. package/dist/lighting/contact-shadow-composite.js +72 -50
  251. package/dist/lighting/contact-shadow-composite.js.map +1 -1
  252. package/dist/lighting/contact-shadow-pass.cjs +50 -39
  253. package/dist/lighting/contact-shadow-pass.d.ts +8 -0
  254. package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
  255. package/dist/lighting/contact-shadow-pass.js +47 -37
  256. package/dist/lighting/contact-shadow-pass.js.map +1 -1
  257. package/dist/lighting/cortao/cortao-occluder-lookup-table.cjs +96 -0
  258. package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts +41 -0
  259. package/dist/lighting/cortao/cortao-occluder-lookup-table.d.ts.map +1 -0
  260. package/dist/lighting/cortao/cortao-occluder-lookup-table.js +94 -0
  261. package/dist/lighting/cortao/cortao-occluder-lookup-table.js.map +1 -0
  262. package/dist/lighting/cortao/cortao-parameters.cjs +127 -0
  263. package/dist/lighting/cortao/cortao-parameters.d.ts +95 -0
  264. package/dist/lighting/cortao/cortao-parameters.d.ts.map +1 -0
  265. package/dist/lighting/cortao/cortao-parameters.js +122 -0
  266. package/dist/lighting/cortao/cortao-parameters.js.map +1 -0
  267. package/dist/lighting/cortao/cortao-pass.cjs +100 -0
  268. package/dist/lighting/cortao/cortao-pass.d.ts +33 -0
  269. package/dist/lighting/cortao/cortao-pass.d.ts.map +1 -0
  270. package/dist/lighting/cortao/cortao-pass.js +84 -0
  271. package/dist/lighting/cortao/cortao-pass.js.map +1 -0
  272. package/dist/lighting/cortao/cortao-passes.cjs +42 -0
  273. package/dist/lighting/cortao/cortao-passes.d.ts +38 -0
  274. package/dist/lighting/cortao/cortao-passes.d.ts.map +1 -0
  275. package/dist/lighting/cortao/cortao-passes.js +19 -0
  276. package/dist/lighting/cortao/cortao-passes.js.map +1 -0
  277. package/dist/lighting/cortao/cortao-shaders-wgsl.cjs +606 -0
  278. package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts +49 -0
  279. package/dist/lighting/cortao/cortao-shaders-wgsl.d.ts.map +1 -0
  280. package/dist/lighting/cortao/cortao-shaders-wgsl.js +610 -0
  281. package/dist/lighting/cortao/cortao-shaders-wgsl.js.map +1 -0
  282. package/dist/lighting/cortao/cortao-shaders.cjs +667 -0
  283. package/dist/lighting/cortao/cortao-shaders.d.ts +118 -0
  284. package/dist/lighting/cortao/cortao-shaders.d.ts.map +1 -0
  285. package/dist/lighting/cortao/cortao-shaders.js +657 -0
  286. package/dist/lighting/cortao/cortao-shaders.js.map +1 -0
  287. package/dist/lighting/cortao/cortao-upsample.cjs +191 -0
  288. package/dist/lighting/cortao/cortao-upsample.d.ts +16 -0
  289. package/dist/lighting/cortao/cortao-upsample.d.ts.map +1 -0
  290. package/dist/lighting/cortao/cortao-upsample.js +159 -0
  291. package/dist/lighting/cortao/cortao-upsample.js.map +1 -0
  292. package/dist/lighting/cortao/cortao-webgl-passes.cjs +229 -0
  293. package/dist/lighting/cortao/cortao-webgl-passes.d.ts +28 -0
  294. package/dist/lighting/cortao/cortao-webgl-passes.d.ts.map +1 -0
  295. package/dist/lighting/cortao/cortao-webgl-passes.js +212 -0
  296. package/dist/lighting/cortao/cortao-webgl-passes.js.map +1 -0
  297. package/dist/lighting/cortao/cortao-webgpu-passes.cjs +348 -0
  298. package/dist/lighting/cortao/cortao-webgpu-passes.d.ts +31 -0
  299. package/dist/lighting/cortao/cortao-webgpu-passes.d.ts.map +1 -0
  300. package/dist/lighting/cortao/cortao-webgpu-passes.js +335 -0
  301. package/dist/lighting/cortao/cortao-webgpu-passes.js.map +1 -0
  302. package/dist/lighting/index.cjs +13 -2
  303. package/dist/lighting/index.cjs.map +3 -3
  304. package/dist/lighting/index.d.ts +11 -6
  305. package/dist/lighting/index.d.ts.map +1 -1
  306. package/dist/lighting/index.js +6 -5
  307. package/dist/lighting/index.js.map +1 -1
  308. package/dist/lighting/shadow-map-renderer.cjs +40 -37
  309. package/dist/lighting/shadow-map-renderer.d.ts +15 -0
  310. package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
  311. package/dist/lighting/shadow-map-renderer.js +37 -35
  312. package/dist/lighting/shadow-map-renderer.js.map +1 -1
  313. package/dist/model/gpu-vector-model.cjs +39 -16
  314. package/dist/model/gpu-vector-model.d.ts +8 -0
  315. package/dist/model/gpu-vector-model.d.ts.map +1 -1
  316. package/dist/model/gpu-vector-model.js +46 -18
  317. package/dist/model/gpu-vector-model.js.map +1 -1
  318. package/dist/passes/effect-renderer.cjs +155 -0
  319. package/dist/passes/effect-renderer.d.ts +158 -0
  320. package/dist/passes/effect-renderer.d.ts.map +1 -0
  321. package/dist/passes/effect-renderer.js +143 -0
  322. package/dist/passes/effect-renderer.js.map +1 -0
  323. package/dist/passes/scene-capture-pass.cjs +42 -0
  324. package/dist/passes/scene-capture-pass.d.ts +29 -0
  325. package/dist/passes/scene-capture-pass.d.ts.map +1 -0
  326. package/dist/passes/scene-capture-pass.js +21 -0
  327. package/dist/passes/scene-capture-pass.js.map +1 -0
  328. package/dist/passes/shader-pass-renderer.cjs +94 -68
  329. package/dist/passes/shader-pass-renderer.d.ts +32 -15
  330. package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
  331. package/dist/passes/shader-pass-renderer.js +104 -76
  332. package/dist/passes/shader-pass-renderer.js.map +1 -1
  333. package/dist/scenegraph/model-node.cjs +2 -0
  334. package/dist/scenegraph/model-node.d.ts +4 -0
  335. package/dist/scenegraph/model-node.d.ts.map +1 -1
  336. package/dist/scenegraph/model-node.js +2 -0
  337. package/dist/scenegraph/model-node.js.map +1 -1
  338. package/dist/splats/gpu-paged-splat-renderer.cjs +52 -8
  339. package/dist/splats/gpu-paged-splat-renderer.d.ts +16 -3
  340. package/dist/splats/gpu-paged-splat-renderer.d.ts.map +1 -1
  341. package/dist/splats/gpu-paged-splat-renderer.js +55 -9
  342. package/dist/splats/gpu-paged-splat-renderer.js.map +1 -1
  343. package/dist/splats/gpu-paged-splat-shaders.cjs +3 -1
  344. package/dist/splats/gpu-paged-splat-shaders.d.ts.map +1 -1
  345. package/dist/splats/gpu-paged-splat-shaders.js +3 -1
  346. package/dist/splats/gpu-paged-splat-shaders.js.map +1 -1
  347. package/dist/splats/index.cjs.map +2 -2
  348. package/dist/text/fonts/atlas/browser-font-atlas.cjs +10 -1
  349. package/dist/text/fonts/atlas/browser-font-atlas.d.ts +3 -1
  350. package/dist/text/fonts/atlas/browser-font-atlas.d.ts.map +1 -1
  351. package/dist/text/fonts/atlas/browser-font-atlas.js +10 -2
  352. package/dist/text/fonts/atlas/browser-font-atlas.js.map +1 -1
  353. package/dist/text/fonts/atlas/lru-cache.cjs +4 -0
  354. package/dist/text/fonts/atlas/lru-cache.d.ts +3 -1
  355. package/dist/text/fonts/atlas/lru-cache.d.ts.map +1 -1
  356. package/dist/text/fonts/atlas/lru-cache.js +4 -0
  357. package/dist/text/fonts/atlas/lru-cache.js.map +1 -1
  358. package/dist/text/fonts/index.cjs +2 -0
  359. package/dist/text/fonts/index.cjs.map +1 -1
  360. package/dist/text/fonts/index.d.ts +1 -1
  361. package/dist/text/fonts/index.d.ts.map +1 -1
  362. package/dist/text/fonts/index.js +1 -1
  363. package/dist/text/fonts/index.js.map +1 -1
  364. package/dist/text/index.cjs.map +1 -1
  365. package/package.json +8 -8
  366. package/src/animation/animation-track.ts +5 -0
  367. package/src/animation/node-animation-binding.ts +9 -8
  368. package/src/animation/scenegraph-gpu-animation-layout.ts +195 -0
  369. package/src/animation/scenegraph-gpu-animation.ts +340 -0
  370. package/src/arrow/arrow-picking.ts +23 -11
  371. package/src/effects/README.md +38 -14
  372. package/src/effects/glfx-effects.ts +227 -0
  373. package/src/effects/graph/gpu-effect-operation.ts +601 -0
  374. package/src/effects/graph/temporal-graph-history.ts +46 -0
  375. package/src/effects/index.ts +81 -19
  376. package/src/effects/passes/postprocessing/fxaa/fxaa.ts +8 -0
  377. package/src/effects/passes/postprocessing/image-adjust-filters/tone-mapping.ts +8 -0
  378. package/src/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.ts +219 -19
  379. package/src/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.ts +6 -6
  380. package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +45 -45
  381. package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +88 -68
  382. package/src/effects/passes/screen-space/copy-pass.ts +4 -0
  383. package/src/effects/passes/screen-space/depth-aware-blur.ts +13 -3
  384. package/src/effects/passes/screen-space/dof.ts +20 -3
  385. package/src/effects/passes/screen-space/gtao.ts +91 -65
  386. package/src/effects/passes/screen-space/hdr-auto-exposure.ts +109 -84
  387. package/src/effects/passes/screen-space/height-fog.ts +18 -3
  388. package/src/effects/passes/screen-space/motion-blur.ts +8 -7
  389. package/src/effects/passes/screen-space/outlines.ts +143 -17
  390. package/src/effects/passes/screen-space/screen-space-global-illumination.ts +75 -64
  391. package/src/effects/passes/screen-space/screen-space-reflections.ts +158 -95
  392. package/src/effects/passes/screen-space/selection-outline.ts +11 -0
  393. package/src/effects/passes/screen-space/ssao.ts +76 -45
  394. package/src/effects/passes/screen-space/temporal-antialiasing.ts +43 -33
  395. package/src/effects/passes/screen-space/temporal-frame.ts +33 -0
  396. package/src/effects/passes/screen-space/volumetric-fog.ts +30 -24
  397. package/src/effects/temporal-upscale/index.ts +20 -0
  398. package/src/effects/temporal-upscale/temporal-math.ts +308 -0
  399. package/src/effects/temporal-upscale/temporal-upscale-shaders.ts +326 -0
  400. package/src/effects/temporal-upscale/temporal-upscaler.ts +538 -0
  401. package/src/gltf/gltf/create-gltf-model.ts +59 -90
  402. package/src/gltf/gltf/create-scenegraph-from-gltf.ts +71 -5
  403. package/src/gltf/gltf/gltf-animated-crowd.ts +30 -177
  404. package/src/gltf/gltf/gltf-animation-nodes.ts +82 -0
  405. package/src/gltf/gltf/gltf-animator.ts +15 -4
  406. package/src/gltf/gltf/gltf-gpu-animation-controller.ts +88 -0
  407. package/src/gltf/gltf/gltf-gpu-animation.ts +53 -60
  408. package/src/gltf/index.ts +5 -0
  409. package/src/gltf/parsers/parse-gltf.ts +12 -2
  410. package/src/graph/physics/index.ts +4 -0
  411. package/src/graph/physics/physics-controller-geometry.ts +33 -1
  412. package/src/index.ts +25 -0
  413. package/src/lighting/ambient-occlusion-pass.ts +62 -28
  414. package/src/lighting/clustered-light-grid.ts +87 -30
  415. package/src/lighting/contact-shadow-composite.ts +80 -52
  416. package/src/lighting/contact-shadow-pass.ts +59 -39
  417. package/src/lighting/cortao/cortao-occluder-lookup-table.ts +138 -0
  418. package/src/lighting/cortao/cortao-parameters.ts +218 -0
  419. package/src/lighting/cortao/cortao-pass.ts +136 -0
  420. package/src/lighting/cortao/cortao-passes.ts +50 -0
  421. package/src/lighting/cortao/cortao-shaders-wgsl.ts +633 -0
  422. package/src/lighting/cortao/cortao-shaders.ts +674 -0
  423. package/src/lighting/cortao/cortao-upsample.ts +177 -0
  424. package/src/lighting/cortao/cortao-webgl-passes.ts +284 -0
  425. package/src/lighting/cortao/cortao-webgpu-passes.ts +430 -0
  426. package/src/lighting/index.ts +12 -3
  427. package/src/lighting/shadow-map-renderer.ts +57 -43
  428. package/src/model/gpu-vector-model.ts +47 -18
  429. package/src/passes/effect-renderer.ts +332 -0
  430. package/src/passes/scene-capture-pass.ts +51 -0
  431. package/src/passes/shader-pass-renderer.ts +164 -115
  432. package/src/scenegraph/model-node.ts +5 -0
  433. package/src/splats/gpu-paged-splat-renderer.ts +77 -9
  434. package/src/splats/gpu-paged-splat-shaders.ts +7 -1
  435. package/src/text/fonts/atlas/browser-font-atlas.ts +12 -2
  436. package/src/text/fonts/atlas/lru-cache.ts +6 -1
  437. package/src/text/fonts/index.ts +1 -0
@@ -2,7 +2,15 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import type {Binding, BindingDeclaration, CommandEncoder, TextureFormatColor} from '@luma.gl/core';
5
+ import type {
6
+ Binding,
7
+ BindingDeclaration,
8
+ CommandEncoder,
9
+ ComputePass,
10
+ TextureFormat,
11
+ TextureFormatColor,
12
+ TextureView
13
+ } from '@luma.gl/core';
6
14
  import {Buffer, Device, Framebuffer, RenderPass, Texture} from '@luma.gl/core';
7
15
  import type {
8
16
  ShaderPass,
@@ -24,17 +32,23 @@ import {getFragmentShaderForRenderPass} from './get-fragment-shader';
24
32
  import {textureTransform} from './texture-transform-module';
25
33
 
26
34
  type ShaderPassLike = ShaderPass | CompositeShaderPass;
35
+ type ComputeStage = Omit<CompositeShaderPassComputeOptimization, 'replacedPasses'>;
27
36
  type ShaderSubPass = NonNullable<ShaderPass['passes']>[0];
28
37
 
29
- type EffectiveSubPass = {
38
+ /** @internal One resolved fullscreen draw, before GPU objects are constructed. */
39
+ export type PlannedFullscreenPass = {
30
40
  ownerName: string;
31
41
  shaderPass: ShaderPass;
32
- subPassRenderer: SubPassRenderer;
42
+ subPass: ShaderSubPass;
33
43
  inputs?: Partial<Record<string, ShaderPassInputSource<string>>>;
34
44
  output?: 'previous' | string;
35
45
  uniforms?: Record<string, unknown>;
36
46
  };
37
47
 
48
+ type EffectiveSubPass = Omit<PlannedFullscreenPass, 'subPass'> & {
49
+ subPassRenderer: SubPassRenderer;
50
+ };
51
+
38
52
  type ManagedRenderTarget = {
39
53
  name: string;
40
54
  spec: ShaderPassRenderTarget;
@@ -165,9 +179,19 @@ export class ShaderPassRenderer {
165
179
  return false;
166
180
  }
167
181
 
168
- const framebuffer = this.device
169
- .getDefaultCanvasContext()
170
- .getCurrentFramebuffer({depthStencilFormat: false});
182
+ this.drawOutput(commandEncoder, outputTexture, null);
183
+ return true;
184
+ }
185
+
186
+ /** @internal Records presentation of a completed effect output. */
187
+ protected drawOutput(
188
+ commandEncoder: CommandEncoder,
189
+ outputTexture: Texture,
190
+ target: Framebuffer | null
191
+ ): void {
192
+ const framebuffer =
193
+ target ??
194
+ this.device.getDefaultCanvasContext().getCurrentFramebuffer({depthStencilFormat: false});
171
195
  // Prepare fullscreen presentation bindings before opening the render pass so WebGPU
172
196
  // uploads stay on the parent command encoder rather than the active render pass encoder.
173
197
  this.textureModel.setProps({backgroundTexture: outputTexture});
@@ -177,9 +201,11 @@ export class ShaderPassRenderer {
177
201
  framebuffer,
178
202
  clearDepth: false
179
203
  });
180
- this.textureModel.draw(renderPass);
181
- renderPass.end();
182
- return true;
204
+ try {
205
+ this.textureModel.draw(renderPass);
206
+ } finally {
207
+ renderPass.end();
208
+ }
183
209
  }
184
210
 
185
211
  /** Runs the shaderPasses in sequence on the sourceTexture and returns a texture with the results.
@@ -313,7 +339,7 @@ class PassRenderer {
313
339
  passDefinition: ShaderPassLike;
314
340
  renderTargets: Record<string, ManagedRenderTarget>;
315
341
  subPassExecutions: EffectiveSubPass[];
316
- computeRenderer?: CompositeShaderPassComputeRenderer;
342
+ computeRenderer?: FullscreenComputePass;
317
343
 
318
344
  constructor(
319
345
  device: Device,
@@ -328,31 +354,29 @@ class PassRenderer {
328
354
  if (isCompositeShaderPass(passDefinition)) {
329
355
  validateRenderTargetNames(passDefinition.name, passDefinition.renderTargets || {});
330
356
  this.renderTargets = createManagedRenderTargets(device, passDefinition.renderTargets || {});
331
- if (supportsComputeOptimization(device, passDefinition)) {
332
- this.computeRenderer = new CompositeShaderPassComputeRenderer(
357
+ const {compute, passes} = planFullscreenPasses(device, passDefinition);
358
+ if (compute) {
359
+ this.computeRenderer = new FullscreenComputePass(
333
360
  device,
334
- passDefinition.compute!,
335
- this.renderTargets,
336
- shaderInputs
361
+ compute,
362
+ Object.fromEntries(
363
+ Object.entries(this.renderTargets).map(([name, target]) => [
364
+ name,
365
+ target.texture.format
366
+ ])
367
+ )
337
368
  );
338
369
  }
339
- const executableSteps = this.computeRenderer
340
- ? passDefinition.steps.filter(
341
- step => !passDefinition.compute!.replacedPasses.includes(step.shaderPass.name)
342
- )
343
- : passDefinition.steps;
344
- this.subPassExecutions = executableSteps.flatMap(step =>
345
- this.createStepExecutions(passDefinition, step, flipY)
346
- );
370
+ this.subPassExecutions = this.createPassExecutions(passes, flipY);
347
371
  return;
348
372
  }
349
373
 
350
374
  validateShaderPassDoesNotOwnRenderTargets(passDefinition, passDefinition.name);
351
375
  this.renderTargets = {};
352
- this.subPassExecutions = this.createPassExecutions(passDefinition, {
353
- ownerName: passDefinition.name,
376
+ this.subPassExecutions = this.createPassExecutions(
377
+ planShaderSubpasses(passDefinition, passDefinition.name),
354
378
  flipY
355
- });
379
+ );
356
380
  }
357
381
 
358
382
  destroy() {
@@ -381,8 +405,23 @@ class PassRenderer {
381
405
  options.originalTexture,
382
406
  options.previousTexture
383
407
  );
384
- this.computeRenderer.encode(options.commandEncoder, sourceTexture, options.runtimeUniforms);
385
- for (const targetName of Object.values(this.computeRenderer.optimization.outputs)) {
408
+ const {optimization} = this.computeRenderer;
409
+ const outputs = Object.fromEntries(
410
+ Object.entries(optimization.outputs).map(([binding, targetName]) => [
411
+ binding,
412
+ this.renderTargets[targetName].texture.view
413
+ ])
414
+ );
415
+ this.computeRenderer.prepare(options.commandEncoder, sourceTexture.view, outputs, {
416
+ ...this.shaderInputs.getUniformValues()[optimization.uniformModule],
417
+ ...optimization.uniforms,
418
+ ...options.runtimeUniforms[optimization.uniformModule]
419
+ });
420
+ const target = this.renderTargets[Object.values(optimization.outputs)[0]].texture;
421
+ const pass = options.commandEncoder.beginComputePass({id: optimization.name});
422
+ this.computeRenderer.dispatch(pass, target.width, target.height);
423
+ pass.end();
424
+ for (const targetName of Object.values(optimization.outputs)) {
386
425
  this.markTargetWritten(targetName);
387
426
  }
388
427
  }
@@ -516,52 +555,15 @@ class PassRenderer {
516
555
  return resolvedBindings;
517
556
  }
518
557
 
519
- private createStepExecutions(
520
- compositeShaderPass: CompositeShaderPass,
521
- step: CompositeShaderPass['steps'][number],
522
- flipY: boolean
523
- ): EffectiveSubPass[] {
524
- validateShaderPassDoesNotOwnRenderTargets(
525
- step.shaderPass,
526
- `${compositeShaderPass.name}/${step.shaderPass.name}`
527
- );
528
-
529
- return this.createPassExecutions(step.shaderPass, {
530
- ownerName: `${compositeShaderPass.name}/${step.shaderPass.name}`,
531
- firstInputs: step.inputs,
532
- lastOutput: step.output,
533
- uniformOverrides: step.uniforms,
534
- flipY
535
- });
536
- }
537
-
538
558
  private createPassExecutions(
539
- shaderPass: ShaderPass,
540
- options: {
541
- ownerName: string;
542
- firstInputs?: Partial<Record<string, ShaderPassInputSource<string>>>;
543
- lastOutput?: 'previous' | string;
544
- uniformOverrides?: Record<string, unknown>;
545
- flipY: boolean;
546
- }
559
+ passes: PlannedFullscreenPass[],
560
+ flipY: boolean
547
561
  ): EffectiveSubPass[] {
548
- const subPasses = shaderPass.passes || [];
549
- return subPasses.map((subPass, index) => {
550
- const isFirstSubPass = index === 0;
551
- const isLastSubPass = index === subPasses.length - 1;
552
- const inputs =
553
- isFirstSubPass && options.firstInputs !== undefined ? options.firstInputs : subPass.inputs;
554
- const output =
555
- isLastSubPass && options.lastOutput !== undefined ? options.lastOutput : subPass.output;
556
- validateSubPassRouting(options.ownerName, inputs, output, this.renderTargets);
557
-
562
+ return passes.map(({subPass, ...pass}) => {
563
+ validateSubPassRouting(pass.ownerName, pass.inputs, pass.output, this.renderTargets);
558
564
  return {
559
- ownerName: options.ownerName,
560
- shaderPass,
561
- subPassRenderer: new SubPassRenderer(this.device, shaderPass, subPass, options.flipY),
562
- inputs,
563
- output,
564
- uniforms: mergeUniforms(options.uniformOverrides, subPass.uniforms)
565
+ ...pass,
566
+ subPassRenderer: new SubPassRenderer(this.device, pass.shaderPass, subPass, flipY)
565
567
  };
566
568
  });
567
569
  }
@@ -591,24 +593,19 @@ class PassRenderer {
591
593
  }
592
594
  }
593
595
 
594
- /** Executes one optional WebGPU compute replacement before the remaining fragment passes. */
595
- class CompositeShaderPassComputeRenderer {
596
- readonly optimization: CompositeShaderPassComputeOptimization;
596
+ /** @internal Shared executable for a fused fullscreen compute stage. */
597
+ export class FullscreenComputePass {
598
+ readonly optimization: ComputeStage;
597
599
 
598
- private readonly renderTargets: Record<string, ManagedRenderTarget>;
599
- private readonly shaderInputs: ShaderInputs;
600
600
  private readonly computation: Computation;
601
601
  private readonly parameterBuffer: Buffer;
602
602
 
603
603
  constructor(
604
604
  device: Device,
605
- optimization: CompositeShaderPassComputeOptimization,
606
- renderTargets: Record<string, ManagedRenderTarget>,
607
- shaderInputs: ShaderInputs
605
+ optimization: ComputeStage,
606
+ outputFormats: Record<string, TextureFormat>
608
607
  ) {
609
608
  this.optimization = optimization;
610
- this.renderTargets = renderTargets;
611
- this.shaderInputs = shaderInputs;
612
609
  this.parameterBuffer = device.createBuffer({
613
610
  id: `${optimization.name}-parameters`,
614
611
  byteLength: Math.max(Math.ceil(optimization.uniformNames.length / 4) * 16, 16),
@@ -621,7 +618,7 @@ class CompositeShaderPassComputeRenderer {
621
618
  group: 0,
622
619
  location: outputIndex + 2,
623
620
  access: 'write-only',
624
- format: renderTargets[targetName].texture.format
621
+ format: outputFormats[targetName]
625
622
  })
626
623
  );
627
624
  try {
@@ -648,16 +645,13 @@ class CompositeShaderPassComputeRenderer {
648
645
  }
649
646
  }
650
647
 
651
- encode(
648
+ /** Binds the current graph or renderer resources and records its uniform upload. */
649
+ prepare(
652
650
  commandEncoder: CommandEncoder,
653
- sourceTexture: Texture,
654
- runtimeUniforms: Record<string, Record<string, unknown>>
651
+ source: TextureView,
652
+ outputs: Record<string, TextureView>,
653
+ effectiveUniforms: Record<string, unknown>
655
654
  ): void {
656
- const effectiveUniforms = {
657
- ...(this.shaderInputs.getUniformValues()[this.optimization.uniformModule] || {}),
658
- ...this.optimization.uniforms,
659
- ...(runtimeUniforms[this.optimization.uniformModule] || {})
660
- };
661
655
  const uniformValues = new Float32Array(
662
656
  Math.max(Math.ceil(this.optimization.uniformNames.length / 4) * 4, 4)
663
657
  );
@@ -665,27 +659,27 @@ class CompositeShaderPassComputeRenderer {
665
659
  const value = effectiveUniforms[uniformName];
666
660
  uniformValues[uniformIndex] = typeof value === 'number' ? value : 0;
667
661
  }
668
- this.parameterBuffer.write(uniformValues);
669
-
670
- const outputEntries = Object.entries(this.optimization.outputs);
671
- const bindings: Record<string, Binding> = {
662
+ this.parameterBuffer.device.writeBufferViaCommandEncoder(
663
+ commandEncoder,
664
+ this.parameterBuffer,
665
+ uniformValues
666
+ );
667
+ this.computation.setBindings({
672
668
  [this.optimization.uniformBinding]: this.parameterBuffer,
673
- sourceTexture: sourceTexture.view
674
- };
675
- for (const [bindingName, targetName] of outputEntries) {
676
- bindings[bindingName] = this.renderTargets[targetName].texture.view;
677
- }
678
- this.computation.setBindings(bindings);
669
+ sourceTexture: source,
670
+ ...outputs
671
+ });
679
672
  this.computation.predraw(commandEncoder);
680
- const dispatchTarget = this.renderTargets[outputEntries[0][1]].texture;
681
- const computePass = commandEncoder.beginComputePass({id: this.optimization.name});
673
+ }
674
+
675
+ /** Dispatches against the dimensions of the first declared storage output. */
676
+ dispatch(pass: ComputePass, width: number, height: number): void {
682
677
  this.computation.dispatch(
683
- computePass,
684
- Math.ceil(dispatchTarget.width / this.optimization.workgroupSize[0]),
685
- Math.ceil(dispatchTarget.height / this.optimization.workgroupSize[1]),
678
+ pass,
679
+ Math.ceil(width / this.optimization.workgroupSize[0]),
680
+ Math.ceil(height / this.optimization.workgroupSize[1]),
686
681
  1
687
682
  );
688
- computePass.end();
689
683
  }
690
684
 
691
685
  destroy(): void {
@@ -694,14 +688,15 @@ class CompositeShaderPassComputeRenderer {
694
688
  }
695
689
  }
696
690
 
697
- /** Renders a single subpass of a `ShaderPass`. */
698
- class SubPassRenderer {
691
+ /** @internal Shared fullscreen draw executable. */
692
+ export class SubPassRenderer {
699
693
  model: ClipSpace;
700
694
  shaderPass: ShaderPass;
701
695
  subPass: ShaderSubPass;
702
696
  flipY: boolean;
703
697
 
704
698
  constructor(device: Device, shaderPass: ShaderPass, subPass: ShaderSubPass, flipY: boolean) {
699
+ initializeShaderModule(shaderPass);
705
700
  this.shaderPass = shaderPass;
706
701
  this.subPass = subPass;
707
702
  this.flipY = flipY;
@@ -754,9 +749,59 @@ class SubPassRenderer {
754
749
  }
755
750
  }
756
751
 
752
+ /** @internal Resolves compute selection and fullscreen draw routing for both executors. */
753
+ export function planFullscreenPasses(
754
+ device: Device,
755
+ effect: CompositeShaderPass,
756
+ options: {allowCompute?: boolean; colorFormat?: TextureFormatColor} = {}
757
+ ): {compute?: ComputeStage; passes: PlannedFullscreenPass[]} {
758
+ const fallback = effect.initialPasses?.fragment ?? [];
759
+ const compute =
760
+ options.allowCompute !== false &&
761
+ supportsComputeOptimization(device, effect, options.colorFormat)
762
+ ? effect.initialPasses
763
+ ? effect.initialPasses.compute
764
+ : effect.compute
765
+ : undefined;
766
+ const steps = effect.initialPasses
767
+ ? [...(compute ? [] : fallback), ...effect.steps]
768
+ : compute
769
+ ? effect.steps.filter(step => !effect.compute!.replacedPasses.includes(step.shaderPass.name))
770
+ : effect.steps;
771
+ return {
772
+ compute,
773
+ passes: steps.flatMap(step => {
774
+ const ownerName = effect.name + '/' + step.shaderPass.name;
775
+ validateShaderPassDoesNotOwnRenderTargets(step.shaderPass, ownerName);
776
+ return planShaderSubpasses(step.shaderPass, ownerName, step);
777
+ })
778
+ };
779
+ }
780
+
781
+ /** Applies step-level routing to the first input and last output of a shader pass. */
782
+ function planShaderSubpasses(
783
+ shaderPass: ShaderPass,
784
+ ownerName: string,
785
+ step?: CompositeShaderPass['steps'][number]
786
+ ): PlannedFullscreenPass[] {
787
+ const subPasses = shaderPass.passes ?? [];
788
+ return subPasses.map((subPass, index) => ({
789
+ ownerName,
790
+ shaderPass,
791
+ subPass,
792
+ inputs: (index === 0 ? step?.inputs : undefined) ?? subPass.inputs,
793
+ output: (index === subPasses.length - 1 ? step?.output : undefined) ?? subPass.output,
794
+ uniforms: mergeUniforms(step?.uniforms, subPass.uniforms)
795
+ }));
796
+ }
797
+
757
798
  function getExecutableShaderPasses(shaderPasses: ShaderPassLike[]): ShaderPass[] {
758
799
  return shaderPasses.flatMap(shaderPass =>
759
- isCompositeShaderPass(shaderPass) ? shaderPass.steps.map(step => step.shaderPass) : [shaderPass]
800
+ isCompositeShaderPass(shaderPass)
801
+ ? [...(shaderPass.initialPasses?.fragment ?? []), ...shaderPass.steps].map(
802
+ step => step.shaderPass
803
+ )
804
+ : [shaderPass]
760
805
  );
761
806
  }
762
807
 
@@ -767,9 +812,12 @@ function isCompositeShaderPass(shaderPass: ShaderPassLike): shaderPass is Compos
767
812
  /** @internal Returns whether a composite pass's optional compute path is valid for this device. */
768
813
  export function supportsComputeOptimization(
769
814
  device: Device,
770
- compositeShaderPass: CompositeShaderPass
815
+ compositeShaderPass: CompositeShaderPass,
816
+ colorFormat: TextureFormatColor = device.preferredColorFormat
771
817
  ): boolean {
772
- const optimization = compositeShaderPass.compute;
818
+ const optimization = compositeShaderPass.initialPasses
819
+ ? compositeShaderPass.initialPasses.compute
820
+ : compositeShaderPass.compute;
773
821
  if (!optimization || device.type !== 'webgpu') {
774
822
  return false;
775
823
  }
@@ -791,7 +839,7 @@ export function supportsComputeOptimization(
791
839
  if (!target?.storage) {
792
840
  return false;
793
841
  }
794
- const format = target.format || device.preferredColorFormat;
842
+ const format = target.format || colorFormat;
795
843
  return device.getTextureFormatCapabilities(format).store;
796
844
  });
797
845
  }
@@ -1094,9 +1142,10 @@ function getSeedFramebuffer(
1094
1142
  return swapFramebuffers.current;
1095
1143
  }
1096
1144
 
1097
- function calculateTextureScale(
1098
- sourceTexture: Texture,
1099
- outputTexture: Texture
1145
+ /** @internal Computes the texture coordinate scale for differing source and output aspects. */
1146
+ export function calculateTextureScale(
1147
+ sourceTexture: Pick<Texture, 'width' | 'height'>,
1148
+ outputTexture: Pick<Texture, 'width' | 'height'>
1100
1149
  ): [scaleX: number, scaleY: number] {
1101
1150
  const sourceAspect = sourceTexture.width / sourceTexture.height;
1102
1151
  const outputAspect = outputTexture.width / outputTexture.height;
@@ -12,10 +12,13 @@ import {
12
12
  } from './scenegraph-bounds';
13
13
  import type {ScenegraphBounds} from './scenegraph-bounds';
14
14
  import {Model} from '../model/model';
15
+ import type {ScenegraphGPUAnimationResources} from '../animation/scenegraph-gpu-animation';
15
16
 
16
17
  export type ModelNodeProps = ScenegraphNodeProps & {
17
18
  model: Model;
18
19
  managedResources?: any[];
20
+ /** Optional baked pose storage used by the primitive shader. */
21
+ gpuAnimation?: ScenegraphGPUAnimationResources;
19
22
  /** Bounds of one model instance before instance and node transforms. */
20
23
  bounds?: ScenegraphBounds;
21
24
  /** Optional per-instance transforms used to calculate aggregate local bounds. */
@@ -24,6 +27,7 @@ export type ModelNodeProps = ScenegraphNodeProps & {
24
27
 
25
28
  export class ModelNode extends ScenegraphNode {
26
29
  readonly model: Model;
30
+ readonly gpuAnimation?: ScenegraphGPUAnimationResources;
27
31
  readonly instanceMatrices: readonly NumericArray[] | null;
28
32
  bounds: ScenegraphBounds | null = null;
29
33
  managedResources: any[];
@@ -38,6 +42,7 @@ export class ModelNode extends ScenegraphNode {
38
42
 
39
43
  // Create new Model or used supplied Model
40
44
  this.model = props.model;
45
+ this.gpuAnimation = props.gpuAnimation;
41
46
  this.managedResources = props.managedResources || [];
42
47
  this.instanceMatrices = props.instanceMatrices || null;
43
48
  this.bounds = props.bounds
@@ -8,7 +8,12 @@ import {
8
8
  type Binding,
9
9
  type CommandEncoder,
10
10
  type Device,
11
+ type Framebuffer,
11
12
  type RenderPass,
13
+ type RenderPipeline,
14
+ type RenderPipelineParameters,
15
+ type TextureFormatColor,
16
+ type TextureFormatDepthStencil,
12
17
  type ShaderLayout
13
18
  } from '@luma.gl/core';
14
19
  import {Computation, Model} from '@luma.gl/engine';
@@ -24,7 +29,6 @@ import {
24
29
  } from '@luma.gl/graph/gpu-core';
25
30
  import type {GPUSplatGraphRendererProps} from './gpu-splat-graph-renderer';
26
31
  import {
27
- GPU_SPLAT_GRAPH_FEATURE_UNIFORM_BYTE_LENGTH,
28
32
  GPU_SPLAT_GRAPH_UNIFORM_BYTE_LENGTH,
29
33
  GPU_SPLAT_PROJECTED_RECORD_BYTE_LENGTH
30
34
  } from './gpu-splat-graph-shaders';
@@ -48,9 +52,19 @@ import {
48
52
 
49
53
  const WORKGROUP_SIZE = 256;
50
54
  const MINIMUM_SEMANTIC_SELECTION_CAPACITY = 64;
55
+ /** Paged feature uniforms include a 16-byte aligned RGB scale. */
56
+ const PAGED_FEATURE_UNIFORM_BYTE_LENGTH = 64;
51
57
 
52
58
  /** One intact caller-owned source page and its optional batch-local active-row frontier. */
53
59
  export type GPUPagedSplatPage = {
60
+ /** Per-page source-to-clip transform. */
61
+ modelViewProjectionMatrix?: readonly number[];
62
+ /** Camera in the page's source frame. */
63
+ cameraPosition?: readonly [number, number, number];
64
+ /** Per-page alpha multiplier. */
65
+ alphaScale?: number;
66
+ /** Linear RGB tint applied after feature evaluation. */
67
+ colorScale?: readonly [number, number, number];
54
68
  /** Stable page identity used to retain source topology and renderer-owned index buffers. */
55
69
  id: string;
56
70
  /** Original caller-owned prepared source allocation, never rewritten or destroyed here. */
@@ -229,6 +243,8 @@ export class GPUPagedSplatRenderer {
229
243
  private readonly pageRevisions = new Map<string, number>();
230
244
  private plannedSegments: PlannedSourceSegment[] = [];
231
245
  private includeRenderPass = true;
246
+ /** Pipeline variants retained for the current graph model. */
247
+ private readonly hostPipelines = new Map<string, RenderPipeline>();
232
248
  private model?: Model;
233
249
  private sortedValuesBuffer?: Buffer;
234
250
  private semanticSelectionBuffer?: Buffer;
@@ -497,12 +513,55 @@ export class GPUPagedSplatRenderer {
497
513
  return this.encodeFrame(commandEncoder, false);
498
514
  }
499
515
 
500
- /** Draws prepared splats into a caller-owned pass without clearing, ending, or submitting it. */
501
- draw(renderPass: RenderPass): void {
516
+ /**
517
+ * Draws prepared splats into a caller-owned pass without clearing, ending, or submitting it.
518
+ * Pipeline overrides apply only to this draw. Attachment formats and samples come from the pass.
519
+ */
520
+ draw(renderPass: RenderPass, parameters?: RenderPipelineParameters): void {
502
521
  if (this.isDestroyed || !this.hasPresentedContent || !this.model) {
503
522
  return;
504
523
  }
505
- renderPass.setPipeline(this.model.pipeline);
524
+ const framebuffer =
525
+ (renderPass as RenderPass & {framebuffer?: Framebuffer}).framebuffer ??
526
+ renderPass.props.framebuffer;
527
+ const colorAttachmentFormats = framebuffer?.colorAttachments.map(attachment =>
528
+ attachment ? (attachment.texture.format as TextureFormatColor) : null
529
+ ) ?? [this.device.preferredColorFormat];
530
+ const depthStencilAttachmentFormat = framebuffer?.depthStencilAttachment?.texture.format as
531
+ | TextureFormatDepthStencil
532
+ | undefined;
533
+ const resolvedParameters: RenderPipelineParameters = {
534
+ ...this.model.pipeline.props.parameters,
535
+ ...parameters,
536
+ sampleCount: framebuffer?.props.samples ?? 1
537
+ };
538
+ if (depthStencilAttachmentFormat) {
539
+ resolvedParameters.depthFormat = depthStencilAttachmentFormat;
540
+ }
541
+ for (const key of Object.keys(resolvedParameters) as (keyof RenderPipelineParameters)[]) {
542
+ if (
543
+ (!depthStencilAttachmentFormat && /^(depth|stencil)/.test(key)) ||
544
+ (resolvedParameters.blend === false && key !== 'blend' && key.startsWith('blend'))
545
+ ) {
546
+ delete resolvedParameters[key];
547
+ }
548
+ }
549
+ const key = JSON.stringify([
550
+ colorAttachmentFormats,
551
+ depthStencilAttachmentFormat,
552
+ resolvedParameters
553
+ ]);
554
+ let pipeline = this.hostPipelines.get(key);
555
+ if (!pipeline) {
556
+ pipeline = this.model.pipelineFactory.createRenderPipeline({
557
+ ...this.model.pipeline.props,
558
+ colorAttachmentFormats,
559
+ depthStencilAttachmentFormat,
560
+ parameters: resolvedParameters
561
+ });
562
+ this.hostPipelines.set(key, pipeline);
563
+ }
564
+ renderPass.setPipeline(pipeline);
506
565
  renderPass.setVertexArray(this.model.vertexArray);
507
566
  for (const segment of this.outputSegments) {
508
567
  renderPass.setBindings({
@@ -783,7 +842,7 @@ export class GPUPagedSplatRenderer {
783
842
  );
784
843
  const featureUniformBuffer = this.createUniformBuffer(
785
844
  `paged-gaussian-features-${planned.id}`,
786
- GPU_SPLAT_GRAPH_FEATURE_UNIFORM_BYTE_LENGTH
845
+ PAGED_FEATURE_UNIFORM_BYTE_LENGTH
787
846
  );
788
847
  return {
789
848
  ...planned,
@@ -1286,10 +1345,13 @@ fn main() {
1286
1345
  const uniformData = new ArrayBuffer(GPU_SPLAT_GRAPH_UNIFORM_BYTE_LENGTH);
1287
1346
  const floatValues = new Float32Array(uniformData);
1288
1347
  const integerValues = new Uint32Array(uniformData);
1289
- floatValues.set(this.props.modelViewProjectionMatrix, 0);
1348
+ floatValues.set(
1349
+ segment.page.modelViewProjectionMatrix ?? this.props.modelViewProjectionMatrix,
1350
+ 0
1351
+ );
1290
1352
  floatValues.set(this.props.viewportSize, 16);
1291
1353
  floatValues[18] = this.props.radiusScale;
1292
- floatValues[19] = this.props.alphaScale;
1354
+ floatValues[19] = this.props.alphaScale * (segment.page.alphaScale ?? 1);
1293
1355
  floatValues[20] = this.props.alphaCutoff;
1294
1356
  floatValues[21] = this.props.screenSizeCutoffPixels;
1295
1357
  floatValues[22] = this.props.gaussianSupportRadius;
@@ -1309,7 +1371,7 @@ fn main() {
1309
1371
  integerValues[31] = segment.sourceRowOffset;
1310
1372
  segment.uniformBuffer.write(new Uint8Array(uniformData));
1311
1373
 
1312
- const featureData = new ArrayBuffer(GPU_SPLAT_GRAPH_FEATURE_UNIFORM_BYTE_LENGTH);
1374
+ const featureData = new ArrayBuffer(PAGED_FEATURE_UNIFORM_BYTE_LENGTH);
1313
1375
  const featureFloatValues = new Float32Array(featureData);
1314
1376
  const featureIntegerValues = new Uint32Array(featureData);
1315
1377
  const batch = segment.page.data;
@@ -1317,7 +1379,7 @@ fn main() {
1317
1379
  batch.sphericalHarmonics && this.props.sphericalHarmonicsDegree > 0
1318
1380
  ? Math.min(batch.sphericalHarmonicsDegree, this.props.sphericalHarmonicsDegree)
1319
1381
  : 0;
1320
- featureFloatValues.set(this.props.cameraPosition, 0);
1382
+ featureFloatValues.set(segment.page.cameraPosition ?? this.props.cameraPosition, 0);
1321
1383
  featureIntegerValues[3] = degree;
1322
1384
  featureIntegerValues[4] = getSplatSphericalHarmonicCoefficientCount(
1323
1385
  batch.sphericalHarmonicsDegree
@@ -1331,6 +1393,7 @@ fn main() {
1331
1393
  ? 1
1332
1394
  : 0;
1333
1395
  featureIntegerValues[10] = this.props.semanticFilter ? 1 : 0;
1396
+ featureFloatValues.set(segment.page.colorScale ?? [1, 1, 1], 12);
1334
1397
  segment.featureUniformBuffer.write(new Uint8Array(featureData));
1335
1398
  }
1336
1399
  }
@@ -1501,6 +1564,11 @@ fn main() {
1501
1564
  this.compiledGraph?.destroy();
1502
1565
  this.compiledGraph = undefined;
1503
1566
  this.lastEncoding = undefined;
1567
+ if (this.model) {
1568
+ for (const pipeline of this.hostPipelines.values())
1569
+ this.model.pipelineFactory.release(pipeline);
1570
+ }
1571
+ this.hostPipelines.clear();
1504
1572
  this.model?.destroy();
1505
1573
  this.model = undefined;
1506
1574
  for (const buffer of this.ownedBuffers) {
@@ -113,7 +113,11 @@ export const GPU_PAGED_SPLAT_FEATURE_SHADER = replacePagedShaderSource(
113
113
  replacePagedShaderSource(
114
114
  replacePagedShaderSource(
115
115
  replacePagedShaderSource(
116
- GPU_SPLAT_FEATURE_SHADER,
116
+ replacePagedShaderSource(
117
+ GPU_SPLAT_FEATURE_SHADER,
118
+ ' semanticFilterActive: u32,\n padding: u32,\n};',
119
+ ' semanticFilterActive: u32,\n padding: u32,\n colorScale: vec3<f32>,\n};'
120
+ ),
117
121
  'const INVALID_FEATURE_DEPTH_KEY: u32 = 65535u;',
118
122
  `const INVALID_FEATURE_DEPTH_KEY: u32 = ${GPU_PAGED_SPLAT_INVALID_DEPTH_KEY}u;`
119
123
  ),
@@ -164,6 +168,8 @@ export const GPU_PAGED_SPLAT_FEATURE_SHADER = replacePagedShaderSource(
164
168
  projectedColor.a
165
169
  );
166
170
  }
171
+ let tintedColor = projectedRecords[projectedRowIndex].color;
172
+ projectedRecords[projectedRowIndex].color = vec4<f32>(tintedColor.rgb * featureUniforms.colorScale, tintedColor.a);
167
173
  atomicAdd(&drawCommands[1u], 1u);
168
174
  }
169
175
  `
@@ -73,12 +73,22 @@ const CACHE_LIMIT = 3;
73
73
 
74
74
  let cache = new LRUCache<FontAtlas>(CACHE_LIMIT);
75
75
 
76
- /** Increases the process-wide generated atlas LRU capacity. */
76
+ /** Resets the shared generated atlas cache to the requested capacity. */
77
77
  export function setFontAtlasCacheLimit(limit: number): void {
78
+ validateCacheLimit(limit);
79
+ cache = new LRUCache(limit);
80
+ }
81
+
82
+ /** Ensures the shared generated atlas cache can hold at least this many entries. */
83
+ export function ensureFontAtlasCacheCapacity(limit: number): void {
84
+ validateCacheLimit(limit);
85
+ cache.grow(limit);
86
+ }
87
+
88
+ function validateCacheLimit(limit: number): void {
78
89
  if (!Number.isFinite(limit) || limit < CACHE_LIMIT) {
79
90
  throw new Error(`Font atlas cache limit must be at least ${CACHE_LIMIT}`);
80
91
  }
81
- cache = new LRUCache(limit);
82
92
  }
83
93
 
84
94
  /** Applies stable browser-font defaults without constructing an atlas. */