@luma.gl/engine 9.2.6 → 9.3.0-alpha.11

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 (198) hide show
  1. package/dist/animation-loop/animation-loop.d.ts +11 -5
  2. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  3. package/dist/animation-loop/animation-loop.js +83 -47
  4. package/dist/animation-loop/animation-loop.js.map +1 -1
  5. package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
  6. package/dist/animation-loop/make-animation-loop.js +8 -1
  7. package/dist/animation-loop/make-animation-loop.js.map +1 -1
  8. package/dist/animation-loop/request-animation-frame.d.ts.map +1 -1
  9. package/dist/animation-loop/request-animation-frame.js +23 -6
  10. package/dist/animation-loop/request-animation-frame.js.map +1 -1
  11. package/dist/compute/computation.d.ts +3 -7
  12. package/dist/compute/computation.d.ts.map +1 -1
  13. package/dist/compute/computation.js +16 -13
  14. package/dist/compute/computation.js.map +1 -1
  15. package/dist/compute/swap.d.ts +2 -0
  16. package/dist/compute/swap.d.ts.map +1 -1
  17. package/dist/compute/swap.js +10 -5
  18. package/dist/compute/swap.js.map +1 -1
  19. package/dist/debug/debug-framebuffer.d.ts +9 -4
  20. package/dist/debug/debug-framebuffer.d.ts.map +1 -1
  21. package/dist/debug/debug-framebuffer.js +91 -45
  22. package/dist/debug/debug-framebuffer.js.map +1 -1
  23. package/dist/dist.dev.js +2767 -1344
  24. package/dist/dist.min.js +326 -211
  25. package/dist/dynamic-texture/dynamic-texture.d.ts +102 -0
  26. package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -0
  27. package/dist/dynamic-texture/dynamic-texture.js +558 -0
  28. package/dist/dynamic-texture/dynamic-texture.js.map +1 -0
  29. package/dist/dynamic-texture/texture-data.d.ts +144 -0
  30. package/dist/dynamic-texture/texture-data.d.ts.map +1 -0
  31. package/dist/dynamic-texture/texture-data.js +208 -0
  32. package/dist/dynamic-texture/texture-data.js.map +1 -0
  33. package/dist/geometries/cone-geometry.d.ts +3 -1
  34. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  35. package/dist/geometries/cone-geometry.js.map +1 -1
  36. package/dist/geometries/cube-geometry.js +7 -7
  37. package/dist/geometries/cube-geometry.js.map +1 -1
  38. package/dist/geometries/cylinder-geometry.d.ts +2 -1
  39. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  40. package/dist/geometries/cylinder-geometry.js.map +1 -1
  41. package/dist/geometries/ico-sphere-geometry.js +3 -1
  42. package/dist/geometries/ico-sphere-geometry.js.map +1 -1
  43. package/dist/geometry/gpu-geometry.d.ts.map +1 -1
  44. package/dist/geometry/gpu-geometry.js +11 -3
  45. package/dist/geometry/gpu-geometry.js.map +1 -1
  46. package/dist/index.cjs +2620 -1267
  47. package/dist/index.cjs.map +4 -4
  48. package/dist/index.d.ts +20 -6
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +12 -4
  51. package/dist/index.js.map +1 -1
  52. package/dist/material/material-factory.d.ts +73 -0
  53. package/dist/material/material-factory.d.ts.map +1 -0
  54. package/dist/material/material-factory.js +111 -0
  55. package/dist/material/material-factory.js.map +1 -0
  56. package/dist/material/material.d.ts +84 -0
  57. package/dist/material/material.d.ts.map +1 -0
  58. package/dist/material/material.js +176 -0
  59. package/dist/material/material.js.map +1 -0
  60. package/dist/model/model.d.ts +47 -16
  61. package/dist/model/model.d.ts.map +1 -1
  62. package/dist/model/model.js +148 -71
  63. package/dist/model/model.js.map +1 -1
  64. package/dist/model/split-uniforms-and-bindings.d.ts +4 -3
  65. package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
  66. package/dist/model/split-uniforms-and-bindings.js +2 -2
  67. package/dist/model/split-uniforms-and-bindings.js.map +1 -1
  68. package/dist/models/billboard-texture-model.d.ts +8 -5
  69. package/dist/models/billboard-texture-model.d.ts.map +1 -1
  70. package/dist/models/billboard-texture-model.js +79 -25
  71. package/dist/models/billboard-texture-model.js.map +1 -1
  72. package/dist/models/billboard-texture-module.d.ts +1 -1
  73. package/dist/models/billboard-texture-module.js +1 -1
  74. package/dist/models/clip-space.js +7 -7
  75. package/dist/models/directional-light-model.d.ts +7 -0
  76. package/dist/models/directional-light-model.d.ts.map +1 -0
  77. package/dist/models/directional-light-model.js +23 -0
  78. package/dist/models/directional-light-model.js.map +1 -0
  79. package/dist/models/light-model-utils.d.ts +69 -0
  80. package/dist/models/light-model-utils.d.ts.map +1 -0
  81. package/dist/models/light-model-utils.js +395 -0
  82. package/dist/models/light-model-utils.js.map +1 -0
  83. package/dist/models/point-light-model.d.ts +7 -0
  84. package/dist/models/point-light-model.d.ts.map +1 -0
  85. package/dist/models/point-light-model.js +22 -0
  86. package/dist/models/point-light-model.js.map +1 -0
  87. package/dist/models/spot-light-model.d.ts +7 -0
  88. package/dist/models/spot-light-model.d.ts.map +1 -0
  89. package/dist/models/spot-light-model.js +23 -0
  90. package/dist/models/spot-light-model.js.map +1 -0
  91. package/dist/modules/picking/color-picking.d.ts +5 -9
  92. package/dist/modules/picking/color-picking.d.ts.map +1 -1
  93. package/dist/modules/picking/color-picking.js +122 -115
  94. package/dist/modules/picking/color-picking.js.map +1 -1
  95. package/dist/modules/picking/index-picking.d.ts +4 -4
  96. package/dist/modules/picking/index-picking.d.ts.map +1 -1
  97. package/dist/modules/picking/index-picking.js +36 -16
  98. package/dist/modules/picking/index-picking.js.map +1 -1
  99. package/dist/modules/picking/legacy-color-picking.d.ts +26 -0
  100. package/dist/modules/picking/legacy-color-picking.d.ts.map +1 -0
  101. package/dist/modules/picking/legacy-color-picking.js +7 -0
  102. package/dist/modules/picking/legacy-color-picking.js.map +1 -0
  103. package/dist/modules/picking/picking-manager.d.ts +29 -3
  104. package/dist/modules/picking/picking-manager.d.ts.map +1 -1
  105. package/dist/modules/picking/picking-manager.js +188 -41
  106. package/dist/modules/picking/picking-manager.js.map +1 -1
  107. package/dist/modules/picking/picking-uniforms.d.ts +13 -12
  108. package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
  109. package/dist/modules/picking/picking-uniforms.js +27 -14
  110. package/dist/modules/picking/picking-uniforms.js.map +1 -1
  111. package/dist/modules/picking/picking.d.ts +25 -0
  112. package/dist/modules/picking/picking.d.ts.map +1 -0
  113. package/dist/modules/picking/picking.js +18 -0
  114. package/dist/modules/picking/picking.js.map +1 -0
  115. package/dist/passes/get-fragment-shader.js +12 -27
  116. package/dist/passes/get-fragment-shader.js.map +1 -1
  117. package/dist/passes/shader-pass-renderer.d.ts +5 -7
  118. package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
  119. package/dist/passes/shader-pass-renderer.js +16 -42
  120. package/dist/passes/shader-pass-renderer.js.map +1 -1
  121. package/dist/scenegraph/group-node.d.ts +5 -0
  122. package/dist/scenegraph/group-node.d.ts.map +1 -1
  123. package/dist/scenegraph/group-node.js +12 -0
  124. package/dist/scenegraph/group-node.js.map +1 -1
  125. package/dist/scenegraph/model-node.d.ts +2 -2
  126. package/dist/scenegraph/model-node.d.ts.map +1 -1
  127. package/dist/scenegraph/model-node.js.map +1 -1
  128. package/dist/scenegraph/scenegraph-node.d.ts +1 -1
  129. package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
  130. package/dist/scenegraph/scenegraph-node.js +23 -15
  131. package/dist/scenegraph/scenegraph-node.js.map +1 -1
  132. package/dist/shader-inputs.d.ts +9 -7
  133. package/dist/shader-inputs.d.ts.map +1 -1
  134. package/dist/shader-inputs.js +90 -13
  135. package/dist/shader-inputs.js.map +1 -1
  136. package/dist/utils/buffer-layout-order.d.ts.map +1 -1
  137. package/dist/utils/buffer-layout-order.js +12 -2
  138. package/dist/utils/buffer-layout-order.js.map +1 -1
  139. package/dist/utils/shader-module-utils.d.ts +7 -0
  140. package/dist/utils/shader-module-utils.d.ts.map +1 -0
  141. package/dist/utils/shader-module-utils.js +46 -0
  142. package/dist/utils/shader-module-utils.js.map +1 -0
  143. package/package.json +6 -6
  144. package/src/animation-loop/animation-loop.ts +89 -50
  145. package/src/animation-loop/make-animation-loop.ts +14 -5
  146. package/src/animation-loop/request-animation-frame.ts +32 -6
  147. package/src/compute/computation.ts +32 -17
  148. package/src/compute/swap.ts +13 -7
  149. package/src/debug/debug-framebuffer.ts +139 -61
  150. package/src/dynamic-texture/dynamic-texture.ts +730 -0
  151. package/src/dynamic-texture/texture-data.ts +336 -0
  152. package/src/{async-texture/texture-setters.ts.disabled → dynamic-texture/texture-data.ts.disabled} +1 -1
  153. package/src/geometries/cone-geometry.ts +6 -1
  154. package/src/geometries/cube-geometry.ts +7 -7
  155. package/src/geometries/cylinder-geometry.ts +5 -1
  156. package/src/geometries/ico-sphere-geometry.ts +3 -1
  157. package/src/geometry/gpu-geometry.ts +11 -3
  158. package/src/index.ts +38 -8
  159. package/src/material/material-factory.ts +157 -0
  160. package/src/material/material.ts +254 -0
  161. package/src/model/model.ts +196 -93
  162. package/src/model/split-uniforms-and-bindings.ts +8 -6
  163. package/src/models/billboard-texture-model.ts +90 -29
  164. package/src/models/billboard-texture-module.ts +1 -1
  165. package/src/models/clip-space.ts +7 -7
  166. package/src/models/directional-light-model.ts +32 -0
  167. package/src/models/light-model-utils.ts +587 -0
  168. package/src/models/point-light-model.ts +31 -0
  169. package/src/models/spot-light-model.ts +32 -0
  170. package/src/modules/picking/color-picking.ts +123 -122
  171. package/src/modules/picking/index-picking.ts +36 -16
  172. package/src/modules/picking/legacy-color-picking.ts +8 -0
  173. package/src/modules/picking/picking-manager.ts +252 -50
  174. package/src/modules/picking/picking-uniforms.ts +39 -24
  175. package/src/modules/picking/picking.ts +22 -0
  176. package/src/passes/get-fragment-shader.ts +12 -27
  177. package/src/passes/shader-pass-renderer.ts +25 -48
  178. package/src/scenegraph/group-node.ts +16 -0
  179. package/src/scenegraph/model-node.ts +2 -2
  180. package/src/scenegraph/scenegraph-node.ts +27 -16
  181. package/src/shader-inputs.ts +167 -26
  182. package/src/utils/buffer-layout-order.ts +18 -2
  183. package/src/utils/shader-module-utils.ts +65 -0
  184. package/dist/async-texture/async-texture.d.ts +0 -166
  185. package/dist/async-texture/async-texture.d.ts.map +0 -1
  186. package/dist/async-texture/async-texture.js +0 -386
  187. package/dist/async-texture/async-texture.js.map +0 -1
  188. package/dist/factories/pipeline-factory.d.ts +0 -37
  189. package/dist/factories/pipeline-factory.d.ts.map +0 -1
  190. package/dist/factories/pipeline-factory.js +0 -181
  191. package/dist/factories/pipeline-factory.js.map +0 -1
  192. package/dist/factories/shader-factory.d.ts +0 -22
  193. package/dist/factories/shader-factory.d.ts.map +0 -1
  194. package/dist/factories/shader-factory.js +0 -88
  195. package/dist/factories/shader-factory.js.map +0 -1
  196. package/src/async-texture/async-texture.ts +0 -551
  197. package/src/factories/pipeline-factory.ts +0 -224
  198. package/src/factories/shader-factory.ts +0 -103
@@ -1 +1 @@
1
- {"version":3,"file":"shader-inputs.js","sourceRoot":"","sources":["../src/shader-inputs.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAClC,2HAA2H;AAC3H,OAAO,EAAC,2BAA2B,EAAe,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAC,wBAAwB,EAAC,+CAA4C;AAM7E;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IAKvB,OAAO,GAAkC;QACvC,eAAe,EAAE,KAAK;KACvB,CAAC;IAEF;;;OAGG;IACH,yBAAyB;IACzB,OAAO,CAAuE;IAE9E,gDAAgD;IAChD,cAAc,CAA2D;IACzE,mDAAmD;IACnD,cAAc,CAAsD;IACpE,sCAAsC;IACtC,qEAAqE;IAErE;;;OAGG;IACH;IACE,yBAAyB;IACzB,OAAyE,EACzE,OAA6B;QAE7B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAErC,oCAAoC;QACpC,MAAM,eAAe,GAAG,2BAA2B,CACjD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,M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buffer-layout-order.d.ts","sourceRoot":"","sources":["../../src/utils/buffer-layout-order.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AAEnE,wBAAgB,yCAAyC,CACvD,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,YAAY,EAAE,CAgBhB"}
1
+ {"version":3,"file":"buffer-layout-order.d.ts","sourceRoot":"","sources":["../../src/utils/buffer-layout-order.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AAkBnE,wBAAgB,yCAAyC,CACvD,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,YAAY,EAAE,CAgBhB"}
@@ -1,14 +1,24 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
+ function getMinLocation(attributeNames, shaderLayoutMap) {
5
+ let minLocation = Infinity;
6
+ for (const name of attributeNames) {
7
+ const location = shaderLayoutMap[name];
8
+ if (location !== undefined) {
9
+ minLocation = Math.min(minLocation, location);
10
+ }
11
+ }
12
+ return minLocation;
13
+ }
4
14
  export function sortedBufferLayoutByShaderSourceLocations(shaderLayout, bufferLayout) {
5
15
  const shaderLayoutMap = Object.fromEntries(shaderLayout.attributes.map(attr => [attr.name, attr.location]));
6
16
  const sortedLayout = bufferLayout.slice();
7
17
  sortedLayout.sort((a, b) => {
8
18
  const attributeNamesA = a.attributes ? a.attributes.map(attr => attr.attribute) : [a.name];
9
19
  const attributeNamesB = b.attributes ? b.attributes.map(attr => attr.attribute) : [b.name];
10
- const minLocationA = Math.min(...attributeNamesA.map(name => shaderLayoutMap[name]));
11
- const minLocationB = Math.min(...attributeNamesB.map(name => shaderLayoutMap[name]));
20
+ const minLocationA = getMinLocation(attributeNamesA, shaderLayoutMap);
21
+ const minLocationB = getMinLocation(attributeNamesB, shaderLayoutMap);
12
22
  return minLocationA - minLocationB;
13
23
  });
14
24
  return sortedLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-layout-order.js","sourceRoot":"","sources":["../../src/utils/buffer-layout-order.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,MAAM,UAAU,yCAAyC,CACvD,YAA0B,EAC1B,YAA4B;IAE5B,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CACxC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAChE,CAAC;IAEF,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC;IAC1C,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,MAAM,eAAe,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3F,MAAM,eAAe,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3F,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrF,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,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C,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3F,MAAM,YAAY,GAAG,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;QAEtE,OAAO,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ComputeShaderLayout, ShaderLayout } from '@luma.gl/core';
2
+ import type { ShaderModule } from '@luma.gl/shadertools';
3
+ type AnyShaderLayout = ShaderLayout | ComputeShaderLayout;
4
+ export declare function mergeShaderModuleBindingsIntoLayout<TShaderLayout extends AnyShaderLayout>(shaderLayout: TShaderLayout | null | undefined, modules: ShaderModule[]): TShaderLayout | null | undefined;
5
+ export declare function shaderModuleHasUniforms(module: ShaderModule): boolean;
6
+ export {};
7
+ //# sourceMappingURL=shader-module-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader-module-utils.d.ts","sourceRoot":"","sources":["../../src/utils/shader-module-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAEvD,KAAK,eAAe,GAAG,YAAY,GAAG,mBAAmB,CAAC;AAE1D,wBAAgB,mCAAmC,CAAC,aAAa,SAAS,eAAe,EACvF,YAAY,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EAC9C,OAAO,EAAE,YAAY,EAAE,GACtB,aAAa,GAAG,IAAI,GAAG,SAAS,CA4BlC;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAErE"}
@@ -0,0 +1,46 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export function mergeShaderModuleBindingsIntoLayout(shaderLayout, modules) {
5
+ if (!shaderLayout || !modules.some(module => module.bindingLayout?.length)) {
6
+ return shaderLayout;
7
+ }
8
+ const mergedLayout = {
9
+ ...shaderLayout,
10
+ bindings: shaderLayout.bindings.map(binding => ({ ...binding }))
11
+ };
12
+ if ('attributes' in (shaderLayout || {})) {
13
+ mergedLayout.attributes = shaderLayout?.attributes || [];
14
+ }
15
+ for (const module of modules) {
16
+ for (const bindingLayout of module.bindingLayout || []) {
17
+ for (const relatedBindingName of getRelatedBindingNames(bindingLayout.name)) {
18
+ const binding = mergedLayout.bindings.find(candidate => candidate.name === relatedBindingName);
19
+ if (binding?.group === 0) {
20
+ binding.group = bindingLayout.group;
21
+ }
22
+ }
23
+ }
24
+ }
25
+ return mergedLayout;
26
+ }
27
+ export function shaderModuleHasUniforms(module) {
28
+ return Boolean(module.uniformTypes && !isObjectEmpty(module.uniformTypes));
29
+ }
30
+ /** Returns binding-name aliases that should share the module-declared bind group. */
31
+ function getRelatedBindingNames(bindingName) {
32
+ const bindingNames = new Set([bindingName, `${bindingName}Uniforms`]);
33
+ if (!bindingName.endsWith('Uniforms')) {
34
+ bindingNames.add(`${bindingName}Sampler`);
35
+ }
36
+ return [...bindingNames];
37
+ }
38
+ function isObjectEmpty(obj) {
39
+ // @ts-ignore key is intentionally unused
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
+ for (const key in obj) {
42
+ return false;
43
+ }
44
+ return true;
45
+ }
46
+ //# sourceMappingURL=shader-module-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader-module-utils.js","sourceRoot":"","sources":["../../src/utils/shader-module-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAOpC,MAAM,UAAU,mCAAmC,CACjD,YAA8C,EAC9C,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ACjD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAS,CAAC,WAAW,EAAE,GAAG,WAAW,UAAU,CAAC,CAAC,CAAC;IAE9E,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,YAAY,CAAC,GAAG,CAAC,GAAG,WAAW,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,CAAC,GAAG,YAAY,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,yCAAyC;IACzC,6DAA6D;IAC7D,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/engine",
3
- "version": "9.2.6",
3
+ "version": "9.3.0-alpha.11",
4
4
  "description": "3D Engine Components for luma.gl",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,14 +40,14 @@
40
40
  "prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
41
41
  },
42
42
  "peerDependencies": {
43
- "@luma.gl/core": "~9.2.0",
44
- "@luma.gl/shadertools": "~9.2.0"
43
+ "@luma.gl/core": "9.3.0-alpha.6",
44
+ "@luma.gl/shadertools": "9.3.0-alpha.6"
45
45
  },
46
46
  "dependencies": {
47
47
  "@math.gl/core": "^4.1.0",
48
48
  "@math.gl/types": "^4.1.0",
49
- "@probe.gl/log": "^4.0.8",
50
- "@probe.gl/stats": "^4.0.8"
49
+ "@probe.gl/log": "^4.1.1",
50
+ "@probe.gl/stats": "^4.1.1"
51
51
  },
52
- "gitHead": "9c7a3adc09c7b23800df3f916762445ebc1fa924"
52
+ "gitHead": "06f489c5d0681bdf7bb0956ca37ce5ad56b85084"
53
53
  }
@@ -12,6 +12,7 @@ import {AnimationProps} from './animation-props';
12
12
  import {Stats, Stat} from '@probe.gl/stats';
13
13
 
14
14
  let statIdCounter = 0;
15
+ const ANIMATION_LOOP_STATS = 'Animation Loop';
15
16
 
16
17
  /** AnimationLoop properties */
17
18
  export type AnimationLoopProps = {
@@ -45,7 +46,7 @@ export class AnimationLoop {
45
46
  onFinalize: () => {},
46
47
  onError: error => console.error(error), // eslint-disable-line no-console
47
48
 
48
- stats: luma.stats.get(`animation-loop-${statIdCounter++}`),
49
+ stats: undefined!,
49
50
 
50
51
  // view parameters
51
52
  autoResizeViewport: false
@@ -58,13 +59,14 @@ export class AnimationLoop {
58
59
  animationProps: AnimationProps | null = null;
59
60
  timeline: Timeline | null = null;
60
61
  stats: Stats;
62
+ sharedStats: Stats;
61
63
  cpuTime: Stat;
62
64
  gpuTime: Stat;
63
65
  frameRate: Stat;
64
66
 
65
67
  display: any;
66
68
 
67
- needsRedraw: string | false = 'initialized';
69
+ private _needsRedraw: string | false = 'initialized';
68
70
 
69
71
  _initialized: boolean = false;
70
72
  _running: boolean = false;
@@ -73,8 +75,7 @@ export class AnimationLoop {
73
75
  _resolveNextFrame: ((animationLoop: AnimationLoop) => void) | null = null;
74
76
  _cpuStartTime: number = 0;
75
77
  _error: Error | null = null;
76
-
77
- // _gpuTimeQuery: Query | null = null;
78
+ _lastFrameTime: number = 0;
78
79
 
79
80
  /*
80
81
  * @param {HTMLCanvasElement} canvas - if provided, width and height will be passed to context
@@ -88,10 +89,12 @@ export class AnimationLoop {
88
89
  }
89
90
 
90
91
  // state
91
- this.stats = props.stats || new Stats({id: 'animation-loop-stats'});
92
+ this.stats = props.stats || new Stats({id: `animation-loop-${statIdCounter++}`});
93
+ this.sharedStats = luma.stats.get(ANIMATION_LOOP_STATS);
94
+ this.frameRate = this.stats.get('Frame Rate');
95
+ this.frameRate.setSampleSize(1);
92
96
  this.cpuTime = this.stats.get('CPU Time');
93
97
  this.gpuTime = this.stats.get('GPU Time');
94
- this.frameRate = this.stats.get('Frame Rate');
95
98
 
96
99
  this.setProps({autoResizeViewport: props.autoResizeViewport});
97
100
 
@@ -106,6 +109,7 @@ export class AnimationLoop {
106
109
  destroy(): void {
107
110
  this.stop();
108
111
  this._setDisplay(null);
112
+ this.device?._disableDebugGPUTime();
109
113
  }
110
114
 
111
115
  /** @deprecated Use .destroy() */
@@ -120,10 +124,17 @@ export class AnimationLoop {
120
124
 
121
125
  /** Flags this animation loop as needing redraw */
122
126
  setNeedsRedraw(reason: string): this {
123
- this.needsRedraw = this.needsRedraw || reason;
127
+ this._needsRedraw = this._needsRedraw || reason;
124
128
  return this;
125
129
  }
126
130
 
131
+ /** Query redraw status. Clears the flag. */
132
+ needsRedraw(): false | string {
133
+ const reason = this._needsRedraw;
134
+ this._needsRedraw = false;
135
+ return reason;
136
+ }
137
+
127
138
  setProps(props: MutableAnimationLoopProps): this {
128
139
  if ('autoResizeViewport' in props) {
129
140
  this.props.autoResizeViewport = props.autoResizeViewport || false;
@@ -145,6 +156,9 @@ export class AnimationLoop {
145
156
  // Create the WebGL context
146
157
  await this._initDevice();
147
158
  this._initialize();
159
+ if (!this._running) {
160
+ return null;
161
+ }
148
162
 
149
163
  // Note: onIntialize can return a promise (e.g. in case app needs to load resources)
150
164
  await this.props.onInitialize(this._getAnimationProps());
@@ -185,17 +199,18 @@ export class AnimationLoop {
185
199
  this._nextFramePromise = null;
186
200
  this._resolveNextFrame = null;
187
201
  this._running = false;
202
+ this._lastFrameTime = 0;
188
203
  }
189
204
  return this;
190
205
  }
191
206
 
192
207
  /** Explicitly draw a frame */
193
- redraw(): this {
208
+ redraw(time?: number): this {
194
209
  if (this.device?.isLost || this._error) {
195
210
  return this;
196
211
  }
197
212
 
198
- this._beginFrameTimers();
213
+ this._beginFrameTimers(time);
199
214
 
200
215
  this._setupFrame();
201
216
  this._updateAnimationProps();
@@ -261,7 +276,7 @@ export class AnimationLoop {
261
276
  // Default viewport setup, in case onInitialize wants to render
262
277
  this._resizeViewport();
263
278
 
264
- // this._gpuTimeQuery = Query.isSupported(this.gl, ['timers']) ? new Query(this.gl) : null;
279
+ this.device?._enableDebugGPUTime();
265
280
  }
266
281
 
267
282
  _setDisplay(display: any): void {
@@ -307,11 +322,11 @@ export class AnimationLoop {
307
322
  this._animationFrameId = null;
308
323
  }
309
324
 
310
- _animationFrame(): void {
325
+ _animationFrame(time: number): void {
311
326
  if (!this._running) {
312
327
  return;
313
328
  }
314
- this.redraw();
329
+ this.redraw(time);
315
330
  this._requestAnimationFrame();
316
331
  }
317
332
 
@@ -333,7 +348,7 @@ export class AnimationLoop {
333
348
  }
334
349
 
335
350
  _clearNeedsRedraw(): void {
336
- this.needsRedraw = false;
351
+ this._needsRedraw = false;
337
352
  }
338
353
 
339
354
  _setupFrame(): void {
@@ -406,7 +421,7 @@ export class AnimationLoop {
406
421
  this.animationProps.height = height;
407
422
  this.animationProps.aspect = aspect;
408
423
 
409
- this.animationProps.needsRedraw = this.needsRedraw;
424
+ this.animationProps.needsRedraw = this._needsRedraw;
410
425
 
411
426
  // Update time properties
412
427
  this.animationProps.engineTime = Date.now() - this.animationProps.startTime;
@@ -460,20 +475,10 @@ export class AnimationLoop {
460
475
  if (!this.device) {
461
476
  return {width: 1, height: 1, aspect: 1};
462
477
  }
463
- // https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html
464
- const [width, height] = this.device?.getDefaultCanvasContext().getDevicePixelSize() || [1, 1];
465
-
466
- // https://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html
467
- let aspect = 1;
468
- const canvas = this.device?.getDefaultCanvasContext().canvas;
469
-
470
- // @ts-expect-error
471
- if (canvas && canvas.clientHeight) {
472
- // @ts-expect-error
473
- aspect = canvas.clientWidth / canvas.clientHeight;
474
- } else if (width > 0 && height > 0) {
475
- aspect = width / height;
476
- }
478
+ // Match projection setup to the actual render target dimensions, which may
479
+ // differ from the CSS size when device-pixel scaling or backend clamping applies.
480
+ const [width, height] = this.device.getDefaultCanvasContext().getDrawingBufferSize();
481
+ const aspect = width > 0 && height > 0 ? width / height : 1;
477
482
 
478
483
  return {width, height, aspect};
479
484
  }
@@ -495,36 +500,70 @@ export class AnimationLoop {
495
500
  }
496
501
  }
497
502
 
498
- _beginFrameTimers() {
499
- this.frameRate.timeEnd();
500
- this.frameRate.timeStart();
501
-
502
- // Check if timer for last frame has completed.
503
- // GPU timer results are never available in the same
504
- // frame they are captured.
505
- // if (
506
- // this._gpuTimeQuery &&
507
- // this._gpuTimeQuery.isResultAvailable() &&
508
- // !this._gpuTimeQuery.isTimerDisjoint()
509
- // ) {
510
- // this.stats.get('GPU Time').addTime(this._gpuTimeQuery.getTimerMilliseconds());
511
- // }
503
+ _beginFrameTimers(time?: number) {
504
+ const now = time ?? (typeof performance !== 'undefined' ? performance.now() : Date.now());
505
+ if (this._lastFrameTime) {
506
+ const frameTime = now - this._lastFrameTime;
507
+ if (frameTime > 0) {
508
+ this.frameRate.addTime(frameTime);
509
+ }
510
+ }
511
+ this._lastFrameTime = now;
512
512
 
513
- // if (this._gpuTimeQuery) {
514
- // // GPU time query start
515
- // this._gpuTimeQuery.beginTimeElapsedQuery();
516
- // }
513
+ if (this.device?._isDebugGPUTimeEnabled()) {
514
+ this._consumeEncodedGpuTime();
515
+ }
517
516
 
518
517
  this.cpuTime.timeStart();
519
518
  }
520
519
 
521
520
  _endFrameTimers() {
521
+ if (this.device?._isDebugGPUTimeEnabled()) {
522
+ this._consumeEncodedGpuTime();
523
+ }
524
+
522
525
  this.cpuTime.timeEnd();
526
+ this._updateSharedStats();
527
+ }
523
528
 
524
- // if (this._gpuTimeQuery) {
525
- // // GPU time query end. Results will be available on next frame.
526
- // this._gpuTimeQuery.end();
527
- // }
529
+ _consumeEncodedGpuTime(): void {
530
+ if (!this.device) {
531
+ return;
532
+ }
533
+
534
+ const gpuTimeMs = this.device.commandEncoder._gpuTimeMs;
535
+ if (gpuTimeMs !== undefined) {
536
+ this.gpuTime.addTime(gpuTimeMs);
537
+ this.device.commandEncoder._gpuTimeMs = undefined;
538
+ }
539
+ }
540
+
541
+ _updateSharedStats(): void {
542
+ if (this.stats === this.sharedStats) {
543
+ return;
544
+ }
545
+
546
+ for (const name of Object.keys(this.sharedStats.stats)) {
547
+ if (!this.stats.stats[name]) {
548
+ delete this.sharedStats.stats[name];
549
+ }
550
+ }
551
+
552
+ this.stats.forEach(sourceStat => {
553
+ const targetStat = this.sharedStats.get(sourceStat.name, sourceStat.type);
554
+ targetStat.sampleSize = sourceStat.sampleSize;
555
+ targetStat.time = sourceStat.time;
556
+ targetStat.count = sourceStat.count;
557
+ targetStat.samples = sourceStat.samples;
558
+ targetStat.lastTiming = sourceStat.lastTiming;
559
+ targetStat.lastSampleTime = sourceStat.lastSampleTime;
560
+ targetStat.lastSampleCount = sourceStat.lastSampleCount;
561
+ targetStat._count = sourceStat._count;
562
+ targetStat._time = sourceStat._time;
563
+ targetStat._samples = sourceStat._samples;
564
+ targetStat._startTime = sourceStat._startTime;
565
+ targetStat._timerPending = sourceStat._timerPending;
566
+ });
528
567
  }
529
568
 
530
569
  // Event handling
@@ -36,14 +36,15 @@ export function makeAnimationLoop(
36
36
  device,
37
37
 
38
38
  async onInitialize(animationProps: AnimationProps): Promise<unknown> {
39
- clearError(animationProps.animationLoop.device!);
39
+ clearError(animationProps.animationLoop.device);
40
40
  try {
41
41
  // @ts-expect-error abstract to prevent instantiation
42
42
  renderLoop = new AnimationLoopTemplateCtor(animationProps);
43
43
  // Any async loading can be handled here
44
44
  return await renderLoop?.onInitialize(animationProps);
45
45
  } catch (error) {
46
- setError(animationProps.animationLoop.device!, error as Error);
46
+ console.error(error);
47
+ setError(animationProps.animationLoop.device, error as Error);
47
48
  return null;
48
49
  }
49
50
  },
@@ -63,8 +64,12 @@ export function makeAnimationLoop(
63
64
  return animationLoop;
64
65
  }
65
66
 
66
- function setError(device: Device, error: Error): void {
67
- const canvas = device?.getDefaultCanvasContext().canvas;
67
+ function setError(device: Device | null, error: Error): void {
68
+ if (!device) {
69
+ return;
70
+ }
71
+
72
+ const canvas = device.getDefaultCanvasContext().canvas;
68
73
  if (canvas instanceof HTMLCanvasElement) {
69
74
  canvas.style.overflow = 'visible';
70
75
  let errorDiv = document.getElementById('animation-loop-error');
@@ -82,7 +87,11 @@ function setError(device: Device, error: Error): void {
82
87
  }
83
88
  }
84
89
 
85
- function clearError(device: Device): void {
90
+ function clearError(device: Device | null): void {
91
+ if (!device) {
92
+ return;
93
+ }
94
+
86
95
  const errorDiv = document.getElementById('animation-loop-error');
87
96
  if (errorDiv) {
88
97
  errorDiv.remove();
@@ -7,14 +7,40 @@
7
7
  /** Node.js polyfill for requestAnimationFrame */
8
8
  // / <reference types="@types/node" />
9
9
  export function requestAnimationFramePolyfill(callback: (time?: any) => void): any {
10
- return typeof window !== 'undefined' && window.requestAnimationFrame
11
- ? window.requestAnimationFrame(callback)
12
- : setTimeout(callback, 1000 / 60);
10
+ const browserRequestAnimationFrame =
11
+ typeof window !== 'undefined'
12
+ ? window.requestAnimationFrame ||
13
+ (window as Window & {webkitRequestAnimationFrame?: (cb: FrameRequestCallback) => number})
14
+ .webkitRequestAnimationFrame ||
15
+ (window as Window & {mozRequestAnimationFrame?: (cb: FrameRequestCallback) => number})
16
+ .mozRequestAnimationFrame
17
+ : null;
18
+
19
+ if (browserRequestAnimationFrame) {
20
+ return browserRequestAnimationFrame.call(window, callback);
21
+ }
22
+
23
+ return setTimeout(
24
+ () => callback(typeof performance !== 'undefined' ? performance.now() : Date.now()),
25
+ 1000 / 60
26
+ );
13
27
  }
14
28
 
15
29
  /** Node.js polyfill for cancelAnimationFrame */
16
30
  export function cancelAnimationFramePolyfill(timerId: any): void {
17
- return typeof window !== 'undefined' && window.cancelAnimationFrame
18
- ? window.cancelAnimationFrame(timerId)
19
- : clearTimeout(timerId);
31
+ const browserCancelAnimationFrame =
32
+ typeof window !== 'undefined'
33
+ ? window.cancelAnimationFrame ||
34
+ (window as Window & {webkitCancelAnimationFrame?: (handle: number) => void})
35
+ .webkitCancelAnimationFrame ||
36
+ (window as Window & {mozCancelAnimationFrame?: (handle: number) => void})
37
+ .mozCancelAnimationFrame
38
+ : null;
39
+
40
+ if (browserCancelAnimationFrame) {
41
+ browserCancelAnimationFrame.call(window, timerId);
42
+ return;
43
+ }
44
+
45
+ clearTimeout(timerId);
20
46
  }
@@ -2,22 +2,28 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import type {DeviceFeature, ComputePipelineProps, Shader, Binding} from '@luma.gl/core';
6
5
  import {
6
+ type DeviceFeature,
7
+ type ComputePipelineProps,
8
+ type Shader,
9
+ type Binding,
7
10
  Device,
8
11
  Buffer,
9
12
  ComputePipeline,
10
13
  ComputePass,
14
+ PipelineFactory,
15
+ ShaderFactory,
11
16
  UniformStore,
12
17
  log,
13
- getTypedArrayConstructor
18
+ dataTypeDecoder
14
19
  } from '@luma.gl/core';
15
- import type {ShaderModule, PlatformInfo} from '@luma.gl/shadertools';
16
- import {ShaderAssembler, getShaderLayoutFromWGSL} from '@luma.gl/shadertools';
17
- import {TypedArray, isNumericArray} from '@math.gl/types';
20
+ import {type ShaderModule, type PlatformInfo, ShaderAssembler} from '@luma.gl/shadertools';
21
+ import {type TypedArray, isNumericArray} from '@math.gl/types';
18
22
  import {ShaderInputs} from '../shader-inputs';
19
- import {PipelineFactory} from '../factories/pipeline-factory';
20
- import {ShaderFactory} from '../factories/shader-factory';
23
+ import {
24
+ mergeShaderModuleBindingsIntoLayout,
25
+ shaderModuleHasUniforms
26
+ } from '../utils/shader-module-utils';
21
27
  import {uid} from '../utils/uid';
22
28
  // import {getDebugTableForShaderLayout} from '../debug/debug-shader-layout';
23
29
 
@@ -131,10 +137,6 @@ export class Computation {
131
137
  this.shaderInputs = props.shaderInputs || new ShaderInputs(moduleMap);
132
138
  this.setShaderInputs(this.shaderInputs);
133
139
 
134
- // Support WGSL shader layout introspection
135
- // TODO - Don't modify props!!
136
- this.props.shaderLayout ||= getShaderLayoutFromWGSL(this.props.source);
137
-
138
140
  // Setup shader assembler
139
141
  const platformInfo = getPlatformInfo(device);
140
142
 
@@ -142,6 +144,9 @@ export class Computation {
142
144
  const modules =
143
145
  (this.props.modules?.length > 0 ? this.props.modules : this.shaderInputs?.getModules()) || [];
144
146
 
147
+ this.props.shaderLayout =
148
+ mergeShaderModuleBindingsIntoLayout(this.props.shaderLayout, modules) || null;
149
+
145
150
  this.pipelineFactory =
146
151
  props.pipelineFactory || PipelineFactory.getDefaultPipelineFactory(this.device);
147
152
  this.shaderFactory = props.shaderFactory || ShaderFactory.getDefaultShaderFactory(this.device);
@@ -155,6 +160,14 @@ export class Computation {
155
160
  this.source = source;
156
161
  // @ts-ignore
157
162
  this._getModuleUniforms = getUniforms;
163
+ const inferredShaderLayout = (
164
+ device as Device & {getShaderLayout?: (source: string) => any}
165
+ ).getShaderLayout?.(this.source);
166
+ this.props.shaderLayout =
167
+ mergeShaderModuleBindingsIntoLayout(
168
+ this.props.shaderLayout || inferredShaderLayout || null,
169
+ modules
170
+ ) || null;
158
171
 
159
172
  // Create the pipeline
160
173
  // @note order is important
@@ -197,7 +210,7 @@ export class Computation {
197
210
  this.pipeline.setBindings(this.bindings);
198
211
  computePass.setPipeline(this.pipeline);
199
212
  // @ts-expect-error
200
- computePass.setBindings([]);
213
+ computePass.setBindings({});
201
214
 
202
215
  computePass.dispatch(x, y, z);
203
216
  } finally {
@@ -227,11 +240,13 @@ export class Computation {
227
240
 
228
241
  setShaderInputs(shaderInputs: ShaderInputs): void {
229
242
  this.shaderInputs = shaderInputs;
230
- this._uniformStore = new UniformStore(this.shaderInputs.modules);
243
+ this._uniformStore = new UniformStore(this.device, this.shaderInputs.modules);
231
244
  // Create uniform buffer bindings for all modules
232
- for (const moduleName of Object.keys(this.shaderInputs.modules)) {
233
- const uniformBuffer = this._uniformStore.getManagedUniformBuffer(this.device, moduleName);
234
- this.bindings[`${moduleName}Uniforms`] = uniformBuffer;
245
+ for (const [moduleName, module] of Object.entries(this.shaderInputs.modules)) {
246
+ if (shaderModuleHasUniforms(module)) {
247
+ const uniformBuffer = this._uniformStore.getManagedUniformBuffer(moduleName);
248
+ this.bindings[`${moduleName}Uniforms`] = uniformBuffer;
249
+ }
235
250
  }
236
251
  }
237
252
 
@@ -340,7 +355,7 @@ export class Computation {
340
355
 
341
356
  // TODO - fix typing of luma data types
342
357
  _getBufferOrConstantValues(attribute: Buffer | TypedArray, dataType: any): string {
343
- const TypedArrayConstructor = getTypedArrayConstructor(dataType);
358
+ const TypedArrayConstructor = dataTypeDecoder.getTypedArrayConstructor(dataType);
344
359
  const typedArray =
345
360
  attribute instanceof Buffer ? new TypedArrayConstructor(attribute.debugData) : attribute;
346
361
  return typedArray.toString();