@luma.gl/engine 9.0.0-beta.5 → 9.0.0-beta.7

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 (115) hide show
  1. package/dist/animation/timeline.d.ts.map +1 -1
  2. package/dist/animation/timeline.js +3 -3
  3. package/dist/animation-loop/animation-loop-template.d.ts +1 -1
  4. package/dist/animation-loop/animation-loop-template.d.ts.map +1 -1
  5. package/dist/animation-loop/animation-loop-template.js +3 -1
  6. package/dist/animation-loop/animation-loop.d.ts +2 -2
  7. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  8. package/dist/animation-loop/animation-loop.js +14 -6
  9. package/dist/animation-loop/animation-props.d.ts +2 -2
  10. package/dist/animation-loop/animation-props.d.ts.map +1 -1
  11. package/dist/animation-loop/make-animation-loop.d.ts +2 -2
  12. package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
  13. package/dist/animation-loop/make-animation-loop.js +4 -2
  14. package/dist/computation.d.ts +95 -0
  15. package/dist/computation.d.ts.map +1 -0
  16. package/dist/computation.js +248 -0
  17. package/dist/debug/copy-texture-to-image.d.ts.map +1 -1
  18. package/dist/debug/copy-texture-to-image.js +5 -2
  19. package/dist/debug/debug-framebuffer.d.ts.map +1 -1
  20. package/dist/debug/debug-framebuffer.js +0 -1
  21. package/dist/debug/pixel-data-utils.d.ts.map +1 -1
  22. package/dist/debug/pixel-data-utils.js +2 -1
  23. package/dist/dist.dev.js +713 -329
  24. package/dist/geometries/cone-geometry.d.ts +1 -1
  25. package/dist/geometries/cone-geometry.d.ts.map +1 -1
  26. package/dist/geometries/cone-geometry.js +1 -1
  27. package/dist/geometries/cube-geometry.d.ts +1 -1
  28. package/dist/geometries/cube-geometry.d.ts.map +1 -1
  29. package/dist/geometries/cube-geometry.js +16 -14
  30. package/dist/geometries/cylinder-geometry.d.ts +1 -1
  31. package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
  32. package/dist/geometries/cylinder-geometry.js +1 -1
  33. package/dist/geometries/ico-sphere-geometry.d.ts +1 -1
  34. package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
  35. package/dist/geometries/ico-sphere-geometry.js +1 -1
  36. package/dist/geometries/plane-geometry.d.ts +1 -1
  37. package/dist/geometries/plane-geometry.d.ts.map +1 -1
  38. package/dist/geometries/plane-geometry.js +2 -2
  39. package/dist/geometries/sphere-geometry.d.ts +1 -1
  40. package/dist/geometries/sphere-geometry.d.ts.map +1 -1
  41. package/dist/geometries/sphere-geometry.js +1 -1
  42. package/dist/geometries/truncated-cone-geometry.d.ts +1 -1
  43. package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
  44. package/dist/geometries/truncated-cone-geometry.js +1 -1
  45. package/dist/geometry/geometry-table.d.ts.map +1 -1
  46. package/dist/geometry/geometry-table.js +3 -0
  47. package/dist/geometry/geometry.d.ts.map +1 -1
  48. package/dist/geometry/geometry.js +3 -0
  49. package/dist/geometry/gpu-geometry.d.ts +1 -1
  50. package/dist/geometry/gpu-geometry.d.ts.map +1 -1
  51. package/dist/geometry/gpu-geometry.js +4 -5
  52. package/dist/index.cjs +661 -291
  53. package/dist/index.cjs.map +4 -4
  54. package/dist/index.d.ts +43 -40
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +25 -23
  57. package/dist/lib/clip-space.d.ts +1 -1
  58. package/dist/lib/clip-space.d.ts.map +1 -1
  59. package/dist/lib/clip-space.js +8 -10
  60. package/dist/lib/pipeline-factory.d.ts +10 -6
  61. package/dist/lib/pipeline-factory.d.ts.map +1 -1
  62. package/dist/lib/pipeline-factory.js +47 -22
  63. package/dist/lib/shader-factory.d.ts +17 -0
  64. package/dist/lib/shader-factory.d.ts.map +1 -0
  65. package/dist/lib/shader-factory.js +46 -0
  66. package/dist/model/model.d.ts +58 -45
  67. package/dist/model/model.d.ts.map +1 -1
  68. package/dist/model/model.js +213 -120
  69. package/dist/scenegraph/group-node.d.ts +1 -1
  70. package/dist/scenegraph/group-node.d.ts.map +1 -1
  71. package/dist/scenegraph/group-node.js +10 -5
  72. package/dist/scenegraph/model-node.d.ts +3 -3
  73. package/dist/scenegraph/model-node.d.ts.map +1 -1
  74. package/dist/scenegraph/model-node.js +2 -2
  75. package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
  76. package/dist/shader-inputs.d.ts.map +1 -1
  77. package/dist/shader-inputs.js +3 -0
  78. package/dist/transform/buffer-transform.d.ts +1 -1
  79. package/dist/transform/buffer-transform.d.ts.map +1 -1
  80. package/dist/transform/buffer-transform.js +7 -6
  81. package/dist/transform/texture-transform.d.ts +1 -1
  82. package/dist/transform/texture-transform.d.ts.map +1 -1
  83. package/dist/transform/texture-transform.js +10 -8
  84. package/dist.min.js +2 -2
  85. package/package.json +2 -2
  86. package/src/animation/timeline.ts +20 -20
  87. package/src/animation-loop/animation-loop-template.ts +10 -8
  88. package/src/animation-loop/animation-loop.ts +20 -10
  89. package/src/animation-loop/animation-props.ts +1 -1
  90. package/src/animation-loop/make-animation-loop.ts +17 -8
  91. package/src/computation.ts +346 -0
  92. package/src/debug/copy-texture-to-image.ts +8 -6
  93. package/src/debug/debug-framebuffer.ts +16 -3
  94. package/src/debug/debug-shader-layout.ts +1 -1
  95. package/src/debug/pixel-data-utils.ts +3 -6
  96. package/src/geometries/cube-geometry.ts +17 -13
  97. package/src/geometries/ico-sphere-geometry.ts +1 -1
  98. package/src/geometries/plane-geometry.ts +1 -1
  99. package/src/geometries/sphere-geometry.ts +1 -1
  100. package/src/geometries/truncated-cone-geometry.ts +2 -1
  101. package/src/geometry/geometry-table.ts +9 -6
  102. package/src/geometry/geometry-utils.ts +1 -1
  103. package/src/geometry/geometry.ts +9 -6
  104. package/src/geometry/gpu-geometry.ts +18 -11
  105. package/src/index.ts +3 -0
  106. package/src/lib/clip-space.ts +14 -18
  107. package/src/lib/pipeline-factory.ts +62 -28
  108. package/src/lib/shader-factory.ts +57 -0
  109. package/src/model/model.ts +249 -146
  110. package/src/scenegraph/group-node.ts +14 -10
  111. package/src/scenegraph/model-node.ts +2 -2
  112. package/src/scenegraph/scenegraph-node.ts +2 -2
  113. package/src/shader-inputs.ts +19 -12
  114. package/src/transform/buffer-transform.ts +15 -7
  115. package/src/transform/texture-transform.ts +14 -13
package/dist/index.d.ts CHANGED
@@ -1,41 +1,44 @@
1
- export { Timeline } from './animation/timeline';
2
- export { KeyFrames } from './animation/key-frames';
3
- export type { AnimationProps } from './animation-loop/animation-props';
4
- export { AnimationLoopTemplate } from './animation-loop/animation-loop-template';
5
- export type { AnimationLoopProps } from './animation-loop/animation-loop';
6
- export { AnimationLoop } from './animation-loop/animation-loop';
7
- export type { MakeAnimationLoopProps } from './animation-loop/make-animation-loop';
8
- export { makeAnimationLoop } from './animation-loop/make-animation-loop';
9
- export type { ModelProps } from './model/model';
10
- export { Model } from './model/model';
11
- export type { BufferTransformProps } from './transform/buffer-transform';
12
- export { BufferTransform } from './transform/buffer-transform';
13
- export type { TextureTransformProps } from './transform/texture-transform';
14
- export { TextureTransform } from './transform/texture-transform';
15
- export { PipelineFactory } from './lib/pipeline-factory';
16
- export { ClipSpace } from './lib/clip-space';
17
- export { ScenegraphNode } from './scenegraph/scenegraph-node';
18
- export { GroupNode } from './scenegraph/group-node';
19
- export type { ModelNodeProps } from './scenegraph/model-node';
20
- export { ModelNode } from './scenegraph/model-node';
21
- export type { GeometryProps } from './geometry/geometry';
22
- export { Geometry } from './geometry/geometry';
23
- export type { GPUGeometryProps } from './geometry/gpu-geometry';
24
- export { GPUGeometry } from './geometry/gpu-geometry';
25
- export type { ConeGeometryProps } from './geometries/cone-geometry';
26
- export { ConeGeometry } from './geometries/cone-geometry';
27
- export type { CubeGeometryProps } from './geometries/cube-geometry';
28
- export { CubeGeometry } from './geometries/cube-geometry';
29
- export type { CylinderGeometryProps } from './geometries/cylinder-geometry';
30
- export { CylinderGeometry } from './geometries/cylinder-geometry';
31
- export type { IcoSphereGeometryProps } from './geometries/ico-sphere-geometry';
32
- export { IcoSphereGeometry } from './geometries/ico-sphere-geometry';
33
- export type { PlaneGeometryProps } from './geometries/plane-geometry';
34
- export { PlaneGeometry } from './geometries/plane-geometry';
35
- export type { SphereGeometryProps } from './geometries/sphere-geometry';
36
- export { SphereGeometry } from './geometries/sphere-geometry';
37
- export type { TruncatedConeGeometryProps } from './geometries/truncated-cone-geometry';
38
- export { TruncatedConeGeometry } from './geometries/truncated-cone-geometry';
39
- export type { ShaderModuleInputs } from './shader-inputs';
40
- export { ShaderInputs as _ShaderInputs } from './shader-inputs';
1
+ export { Timeline } from "./animation/timeline.js";
2
+ export { KeyFrames } from "./animation/key-frames.js";
3
+ export type { AnimationProps } from "./animation-loop/animation-props.js";
4
+ export { AnimationLoopTemplate } from "./animation-loop/animation-loop-template.js";
5
+ export type { AnimationLoopProps } from "./animation-loop/animation-loop.js";
6
+ export { AnimationLoop } from "./animation-loop/animation-loop.js";
7
+ export type { MakeAnimationLoopProps } from "./animation-loop/make-animation-loop.js";
8
+ export { makeAnimationLoop } from "./animation-loop/make-animation-loop.js";
9
+ export type { ModelProps } from "./model/model.js";
10
+ export { Model } from "./model/model.js";
11
+ export type { BufferTransformProps } from "./transform/buffer-transform.js";
12
+ export { BufferTransform } from "./transform/buffer-transform.js";
13
+ export type { TextureTransformProps } from "./transform/texture-transform.js";
14
+ export { TextureTransform } from "./transform/texture-transform.js";
15
+ export { PipelineFactory } from "./lib/pipeline-factory.js";
16
+ export { ShaderFactory } from "./lib/shader-factory.js";
17
+ export { ClipSpace } from "./lib/clip-space.js";
18
+ export { ScenegraphNode } from "./scenegraph/scenegraph-node.js";
19
+ export { GroupNode } from "./scenegraph/group-node.js";
20
+ export type { ModelNodeProps } from "./scenegraph/model-node.js";
21
+ export { ModelNode } from "./scenegraph/model-node.js";
22
+ export type { GeometryProps } from "./geometry/geometry.js";
23
+ export { Geometry } from "./geometry/geometry.js";
24
+ export type { GPUGeometryProps } from "./geometry/gpu-geometry.js";
25
+ export { GPUGeometry } from "./geometry/gpu-geometry.js";
26
+ export type { ConeGeometryProps } from "./geometries/cone-geometry.js";
27
+ export { ConeGeometry } from "./geometries/cone-geometry.js";
28
+ export type { CubeGeometryProps } from "./geometries/cube-geometry.js";
29
+ export { CubeGeometry } from "./geometries/cube-geometry.js";
30
+ export type { CylinderGeometryProps } from "./geometries/cylinder-geometry.js";
31
+ export { CylinderGeometry } from "./geometries/cylinder-geometry.js";
32
+ export type { IcoSphereGeometryProps } from "./geometries/ico-sphere-geometry.js";
33
+ export { IcoSphereGeometry } from "./geometries/ico-sphere-geometry.js";
34
+ export type { PlaneGeometryProps } from "./geometries/plane-geometry.js";
35
+ export { PlaneGeometry } from "./geometries/plane-geometry.js";
36
+ export type { SphereGeometryProps } from "./geometries/sphere-geometry.js";
37
+ export { SphereGeometry } from "./geometries/sphere-geometry.js";
38
+ export type { TruncatedConeGeometryProps } from "./geometries/truncated-cone-geometry.js";
39
+ export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
40
+ export type { ShaderModuleInputs } from "./shader-inputs.js";
41
+ export { ShaderInputs as _ShaderInputs } from "./shader-inputs.js";
42
+ export type { ComputationProps } from "./computation.js";
43
+ export { Computation } from "./computation.js";
41
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAC,qBAAqB,EAAC,MAAM,0CAA0C,CAAC;AAE/E,YAAY,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,YAAY,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAC,iBAAiB,EAAC,MAAM,sCAAsC,CAAC;AAEvE,YAAY,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAGpC,YAAY,EAAC,oBAAoB,EAAC,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAGlD,YAAY,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAGpD,YAAY,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAC,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAC,sBAAsB,EAAC,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACnE,YAAY,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,YAAY,EAAC,0BAA0B,EAAC,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAC,qBAAqB,EAAC,MAAM,sCAAsC,CAAC;AAG3E,YAAY,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAC9C,OAAO,EAAC,SAAS,EAAC,kCAA+B;AACjD,YAAY,EAAC,cAAc,EAAC,4CAAyC;AAErE,OAAO,EAAC,qBAAqB,EAAC,oDAAiD;AAE/E,YAAY,EAAC,kBAAkB,EAAC,2CAAwC;AACxE,OAAO,EAAC,aAAa,EAAC,2CAAwC;AAE9D,YAAY,EAAC,sBAAsB,EAAC,gDAA6C;AACjF,OAAO,EAAC,iBAAiB,EAAC,gDAA6C;AAEvE,YAAY,EAAC,UAAU,EAAC,yBAAsB;AAC9C,OAAO,EAAC,KAAK,EAAC,yBAAsB;AAGpC,YAAY,EAAC,oBAAoB,EAAC,wCAAqC;AACvE,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAC7D,YAAY,EAAC,qBAAqB,EAAC,yCAAsC;AACzE,OAAO,EAAC,gBAAgB,EAAC,yCAAsC;AAE/D,OAAO,EAAC,eAAe,EAAC,kCAA+B;AACvD,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAGnD,OAAO,EAAC,SAAS,EAAC,4BAAyB;AAG3C,OAAO,EAAC,cAAc,EAAC,wCAAqC;AAC5D,OAAO,EAAC,SAAS,EAAC,mCAAgC;AAClD,YAAY,EAAC,cAAc,EAAC,mCAAgC;AAC5D,OAAO,EAAC,SAAS,EAAC,mCAAgC;AAGlD,YAAY,EAAC,aAAa,EAAC,+BAA4B;AACvD,OAAO,EAAC,QAAQ,EAAC,+BAA4B;AAC7C,YAAY,EAAC,gBAAgB,EAAC,mCAAgC;AAC9D,OAAO,EAAC,WAAW,EAAC,mCAAgC;AAGpD,YAAY,EAAC,iBAAiB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,sCAAmC;AACxD,YAAY,EAAC,iBAAiB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,sCAAmC;AACxD,YAAY,EAAC,qBAAqB,EAAC,0CAAuC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,0CAAuC;AAChE,YAAY,EAAC,sBAAsB,EAAC,4CAAyC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AACnE,YAAY,EAAC,kBAAkB,EAAC,uCAAoC;AACpE,OAAO,EAAC,aAAa,EAAC,uCAAoC;AAC1D,YAAY,EAAC,mBAAmB,EAAC,wCAAqC;AACtE,OAAO,EAAC,cAAc,EAAC,wCAAqC;AAC5D,YAAY,EAAC,0BAA0B,EAAC,gDAA6C;AACrF,OAAO,EAAC,qBAAqB,EAAC,gDAA6C;AAG3E,YAAY,EAAC,kBAAkB,EAAC,2BAAwB;AACxD,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,2BAAwB;AAC9D,YAAY,EAAC,gBAAgB,EAAC,yBAAsB;AACpD,OAAO,EAAC,WAAW,EAAC,yBAAsB"}
package/dist/index.js CHANGED
@@ -1,27 +1,29 @@
1
1
  // luma.gl Engine API
2
2
  // Animation
3
- export { Timeline } from './animation/timeline';
4
- export { KeyFrames } from './animation/key-frames';
5
- export { AnimationLoopTemplate } from './animation-loop/animation-loop-template';
6
- export { AnimationLoop } from './animation-loop/animation-loop';
7
- export { makeAnimationLoop } from './animation-loop/make-animation-loop';
8
- export { Model } from './model/model';
9
- export { BufferTransform } from './transform/buffer-transform';
10
- export { TextureTransform } from './transform/texture-transform';
11
- export { PipelineFactory } from './lib/pipeline-factory';
3
+ export { Timeline } from "./animation/timeline.js";
4
+ export { KeyFrames } from "./animation/key-frames.js";
5
+ export { AnimationLoopTemplate } from "./animation-loop/animation-loop-template.js";
6
+ export { AnimationLoop } from "./animation-loop/animation-loop.js";
7
+ export { makeAnimationLoop } from "./animation-loop/make-animation-loop.js";
8
+ export { Model } from "./model/model.js";
9
+ export { BufferTransform } from "./transform/buffer-transform.js";
10
+ export { TextureTransform } from "./transform/texture-transform.js";
11
+ export { PipelineFactory } from "./lib/pipeline-factory.js";
12
+ export { ShaderFactory } from "./lib/shader-factory.js";
12
13
  // Utils
13
- export { ClipSpace } from './lib/clip-space';
14
+ export { ClipSpace } from "./lib/clip-space.js";
14
15
  // Scenegraph Core nodes
15
- export { ScenegraphNode } from './scenegraph/scenegraph-node';
16
- export { GroupNode } from './scenegraph/group-node';
17
- export { ModelNode } from './scenegraph/model-node';
18
- export { Geometry } from './geometry/geometry';
19
- export { GPUGeometry } from './geometry/gpu-geometry';
20
- export { ConeGeometry } from './geometries/cone-geometry';
21
- export { CubeGeometry } from './geometries/cube-geometry';
22
- export { CylinderGeometry } from './geometries/cylinder-geometry';
23
- export { IcoSphereGeometry } from './geometries/ico-sphere-geometry';
24
- export { PlaneGeometry } from './geometries/plane-geometry';
25
- export { SphereGeometry } from './geometries/sphere-geometry';
26
- export { TruncatedConeGeometry } from './geometries/truncated-cone-geometry';
27
- export { ShaderInputs as _ShaderInputs } from './shader-inputs';
16
+ export { ScenegraphNode } from "./scenegraph/scenegraph-node.js";
17
+ export { GroupNode } from "./scenegraph/group-node.js";
18
+ export { ModelNode } from "./scenegraph/model-node.js";
19
+ export { Geometry } from "./geometry/geometry.js";
20
+ export { GPUGeometry } from "./geometry/gpu-geometry.js";
21
+ export { ConeGeometry } from "./geometries/cone-geometry.js";
22
+ export { CubeGeometry } from "./geometries/cube-geometry.js";
23
+ export { CylinderGeometry } from "./geometries/cylinder-geometry.js";
24
+ export { IcoSphereGeometry } from "./geometries/ico-sphere-geometry.js";
25
+ export { PlaneGeometry } from "./geometries/plane-geometry.js";
26
+ export { SphereGeometry } from "./geometries/sphere-geometry.js";
27
+ export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
28
+ export { ShaderInputs as _ShaderInputs } from "./shader-inputs.js";
29
+ export { Computation } from "./computation.js";
@@ -1,5 +1,5 @@
1
1
  import { Device } from '@luma.gl/core';
2
- import { Model, ModelProps } from '../model/model';
2
+ import { Model, ModelProps } from "../model/model.js";
3
3
  /**
4
4
  * A flat geometry that covers the "visible area" that the GPU renders.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"clip-space.d.ts","sourceRoot":"","sources":["../../src/lib/clip-space.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAO,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAwBjD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,CAAC;CAqBtF"}
1
+ {"version":3,"file":"clip-space.d.ts","sourceRoot":"","sources":["../../src/lib/clip-space.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAO,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,0BAAuB;AAwBjD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,CAAC;CAkBtF"}
@@ -1,22 +1,20 @@
1
1
  // ClipSpace
2
2
  import { glsl } from '@luma.gl/core';
3
- import { Model } from '../model/model';
4
- import { Geometry } from '../geometry/geometry';
5
- const CLIPSPACE_VERTEX_SHADER = glsl `\
3
+ import { Model } from "../model/model.js";
4
+ import { Geometry } from "../geometry/geometry.js";
5
+ const CLIPSPACE_VERTEX_SHADER = `\
6
6
  #version 300 es
7
7
  in vec2 aClipSpacePosition;
8
8
  in vec2 aTexCoord;
9
9
  in vec2 aCoordinate;
10
-
11
10
  out vec2 position;
12
11
  out vec2 coordinate;
13
12
  out vec2 uv;
14
-
15
13
  void main(void) {
16
- gl_Position = vec4(aClipSpacePosition, 0., 1.);
17
- position = aClipSpacePosition;
18
- coordinate = aCoordinate;
19
- uv = aTexCoord;
14
+ gl_Position = vec4(aClipSpacePosition, 0., 1.);
15
+ position = aClipSpacePosition;
16
+ coordinate = aCoordinate;
17
+ uv = aTexCoord;
20
18
  }
21
19
  `;
22
20
  /* eslint-disable indent, no-multi-spaces */
@@ -26,7 +24,7 @@ const POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];
26
24
  */
27
25
  export class ClipSpace extends Model {
28
26
  constructor(device, opts) {
29
- const TEX_COORDS = POSITIONS.map((coord) => (coord === -1 ? 0 : coord));
27
+ const TEX_COORDS = POSITIONS.map(coord => (coord === -1 ? 0 : coord));
30
28
  super(device, {
31
29
  ...opts,
32
30
  vs: CLIPSPACE_VERTEX_SHADER,
@@ -1,5 +1,5 @@
1
- import type { RenderPipelineProps } from '@luma.gl/core';
2
- import { Device, RenderPipeline } from '@luma.gl/core';
1
+ import type { RenderPipelineProps, ComputePipelineProps } from '@luma.gl/core';
2
+ import { Device, RenderPipeline, ComputePipeline } from '@luma.gl/core';
3
3
  export type PipelineFactoryProps = RenderPipelineProps;
4
4
  /**
5
5
  * Efficiently creates / caches pipelines
@@ -9,12 +9,16 @@ export declare class PipelineFactory {
9
9
  readonly device: Device;
10
10
  private _hashCounter;
11
11
  private readonly _hashes;
12
- private readonly _useCounts;
13
- private readonly _pipelineCache;
12
+ private readonly _renderPipelineCache;
13
+ private readonly _computePipelineCache;
14
+ /** Get the singleton default pipeline factory for the specified device */
14
15
  static getDefaultPipelineFactory(device: Device): PipelineFactory;
15
16
  constructor(device: Device);
16
- createRenderPipeline(options: PipelineFactoryProps): RenderPipeline;
17
- release(pipeline: RenderPipeline): void;
17
+ /** Return a RenderPipeline matching props. Reuses a similar pipeline if already created. */
18
+ createRenderPipeline(props: RenderPipelineProps): RenderPipeline;
19
+ createComputePipeline(props: ComputePipelineProps): ComputePipeline;
20
+ release(pipeline: RenderPipeline | ComputePipeline): void;
21
+ private _hashComputePipeline;
18
22
  /** Calculate a hash based on all the inputs for a render pipeline */
19
23
  private _hashRenderPipeline;
20
24
  private _getHash;
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline-factory.d.ts","sourceRoot":"","sources":["../../src/lib/pipeline-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AACvD,OAAO,EAAC,MAAM,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEvD;;GAEG;AACH,qBAAa,eAAe;IAC1B,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAoC;IAEvF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IACzD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsC;IAErE,MAAM,CAAC,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe;gBAMrD,MAAM,EAAE,MAAM;IAI1B,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,GAAG,cAAc;IAkBnE,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAYvC,qEAAqE;IACrE,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,QAAQ;CAMjB"}
1
+ {"version":3,"file":"pipeline-factory.d.ts","sourceRoot":"","sources":["../../src/lib/pipeline-factory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,MAAM,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEvD;;GAEG;AACH,qBAAa,eAAe;IAC1B,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAoC;IAEvF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAG9B;IACP,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAG/B;IAEP,0EAA0E;IAC1E,MAAM,CAAC,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe;gBAMrD,MAAM,EAAE,MAAM;IAI1B,4FAA4F;IAC5F,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc;IAkBhE,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;IAkBnE,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe,GAAG,IAAI;IAYzD,OAAO,CAAC,oBAAoB;IAK5B,qEAAqE;IACrE,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,QAAQ;CAMjB"}
@@ -1,4 +1,7 @@
1
- import { RenderPipeline } from '@luma.gl/core';
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { RenderPipeline, ComputePipeline } from '@luma.gl/core';
2
5
  /**
3
6
  * Efficiently creates / caches pipelines
4
7
  */
@@ -7,8 +10,9 @@ export class PipelineFactory {
7
10
  device;
8
11
  _hashCounter = 0;
9
12
  _hashes = {};
10
- _useCounts = {};
11
- _pipelineCache = {};
13
+ _renderPipelineCache = {};
14
+ _computePipelineCache = {};
15
+ /** Get the singleton default pipeline factory for the specified device */
12
16
  static getDefaultPipelineFactory(device) {
13
17
  device._lumaData.defaultPipelineFactory =
14
18
  device._lumaData.defaultPipelineFactory || new PipelineFactory(device);
@@ -17,28 +21,49 @@ export class PipelineFactory {
17
21
  constructor(device) {
18
22
  this.device = device;
19
23
  }
20
- createRenderPipeline(options) {
21
- const props = { ...PipelineFactory.defaultProps, ...options };
22
- const hash = this._hashRenderPipeline({ ...props });
23
- if (!this._pipelineCache[hash]) {
24
- const pipeline = this.device.createRenderPipeline({ ...props });
24
+ /** Return a RenderPipeline matching props. Reuses a similar pipeline if already created. */
25
+ createRenderPipeline(props) {
26
+ const allProps = { ...RenderPipeline.defaultProps, ...props };
27
+ const hash = this._hashRenderPipeline(allProps);
28
+ if (!this._renderPipelineCache[hash]) {
29
+ const pipeline = this.device.createRenderPipeline({
30
+ ...allProps,
31
+ id: allProps.id ? `${allProps.id}-cached` : undefined
32
+ });
25
33
  pipeline.hash = hash;
26
- this._pipelineCache[hash] = pipeline;
27
- this._useCounts[hash] = 0;
34
+ this._renderPipelineCache[hash] = { pipeline, useCount: 0 };
28
35
  }
29
- this._useCounts[hash]++;
30
- return this._pipelineCache[hash];
36
+ this._renderPipelineCache[hash].useCount++;
37
+ return this._renderPipelineCache[hash].pipeline;
38
+ }
39
+ createComputePipeline(props) {
40
+ const allProps = { ...ComputePipeline.defaultProps, ...props };
41
+ const hash = this._hashComputePipeline(allProps);
42
+ if (!this._computePipelineCache[hash]) {
43
+ const pipeline = this.device.createComputePipeline({
44
+ ...allProps,
45
+ id: allProps.id ? `${allProps.id}-cached` : undefined
46
+ });
47
+ pipeline.hash = hash;
48
+ this._computePipelineCache[hash] = { pipeline, useCount: 0 };
49
+ }
50
+ this._computePipelineCache[hash].useCount++;
51
+ return this._computePipelineCache[hash].pipeline;
31
52
  }
32
53
  release(pipeline) {
33
54
  const hash = pipeline.hash;
34
- this._useCounts[hash]--;
35
- if (this._useCounts[hash] === 0) {
36
- this._pipelineCache[hash].destroy();
37
- delete this._pipelineCache[hash];
38
- delete this._useCounts[hash];
55
+ const cache = pipeline instanceof ComputePipeline ? this._computePipelineCache : this._renderPipelineCache;
56
+ cache[hash].useCount--;
57
+ if (cache[hash].useCount === 0) {
58
+ cache[hash].pipeline.destroy();
59
+ delete cache[hash];
39
60
  }
40
61
  }
41
62
  // PRIVATE
63
+ _hashComputePipeline(props) {
64
+ const shaderHash = this._getHash(props.shader.source);
65
+ return `${shaderHash}`;
66
+ }
42
67
  /** Calculate a hash based on all the inputs for a render pipeline */
43
68
  _hashRenderPipeline(props) {
44
69
  const vsHash = this._getHash(props.vs.source);
@@ -48,16 +73,16 @@ export class PipelineFactory {
48
73
  // const varyingHashes = varyings.map((v) => this._getHash(v));
49
74
  const varyingHash = '-'; // `${varyingHashes.join('/')}B${bufferMode}`
50
75
  const bufferLayoutHash = this._getHash(JSON.stringify(props.bufferLayout));
51
- switch (this.device.info.type) {
52
- case 'webgpu':
76
+ switch (this.device.type) {
77
+ // case 'webgl':
78
+ // WebGL is more dynamic
79
+ // return `${vsHash}/${fsHash}V${varyingHash}BL${bufferLayoutHash}`;
80
+ default:
53
81
  // On WebGPU we need to rebuild the pipeline if topology, parameters or bufferLayout change
54
82
  const parameterHash = this._getHash(JSON.stringify(props.parameters));
55
83
  // TODO - Can json.stringify() generate different strings for equivalent objects if order of params is different?
56
84
  // create a deepHash() to deduplicate?
57
85
  return `${vsHash}/${fsHash}V${varyingHash}T${props.topology}P${parameterHash}BL${bufferLayoutHash}`;
58
- default:
59
- // WebGL is more dynamic
60
- return `${vsHash}/${fsHash}V${varyingHash}BL${bufferLayoutHash}`;
61
86
  }
62
87
  }
63
88
  _getHash(key) {
@@ -0,0 +1,17 @@
1
+ import { Device, Shader, ShaderProps } from '@luma.gl/core';
2
+ /** Manages a cached pool of Shaders for reuse. */
3
+ export declare class ShaderFactory {
4
+ static readonly defaultProps: Required<ShaderProps>;
5
+ readonly device: Device;
6
+ private readonly _cache;
7
+ /** Returns the default ShaderFactory for the given {@link Device}, creating one if necessary. */
8
+ static getDefaultShaderFactory(device: Device): ShaderFactory;
9
+ /** @internal */
10
+ constructor(device: Device);
11
+ /** Requests a {@link Shader} from the cache, creating a new Shader only if necessary. */
12
+ createShader(props: ShaderProps): Shader;
13
+ /** Releases a previously-requested {@link Shader}, destroying it if no users remain. */
14
+ release(shader: Shader): void;
15
+ private _hashShader;
16
+ }
17
+ //# sourceMappingURL=shader-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader-factory.d.ts","sourceRoot":"","sources":["../../src/lib/shader-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1D,kDAAkD;AAClD,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,CAA4B;IAE/E,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0D;IAEjF,iGAAiG;IACjG,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa;IAK7D,gBAAgB;gBACJ,MAAM,EAAE,MAAM;IAI1B,yFAAyF;IACzF,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAgBxC,wFAAwF;IACxF,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAc7B,OAAO,CAAC,WAAW;CAGpB"}
@@ -0,0 +1,46 @@
1
+ import { Shader } from '@luma.gl/core';
2
+ /** Manages a cached pool of Shaders for reuse. */
3
+ export class ShaderFactory {
4
+ static defaultProps = { ...Shader.defaultProps };
5
+ device;
6
+ _cache = {};
7
+ /** Returns the default ShaderFactory for the given {@link Device}, creating one if necessary. */
8
+ static getDefaultShaderFactory(device) {
9
+ device._lumaData.defaultShaderFactory ||= new ShaderFactory(device);
10
+ return device._lumaData.defaultShaderFactory;
11
+ }
12
+ /** @internal */
13
+ constructor(device) {
14
+ this.device = device;
15
+ }
16
+ /** Requests a {@link Shader} from the cache, creating a new Shader only if necessary. */
17
+ createShader(props) {
18
+ const key = this._hashShader(props);
19
+ let cacheEntry = this._cache[key];
20
+ if (!cacheEntry) {
21
+ const shader = this.device.createShader({
22
+ ...props,
23
+ id: props.id ? `${props.id}-cached` : undefined
24
+ });
25
+ this._cache[key] = cacheEntry = { shader, useCount: 0 };
26
+ }
27
+ cacheEntry.useCount++;
28
+ return cacheEntry.shader;
29
+ }
30
+ /** Releases a previously-requested {@link Shader}, destroying it if no users remain. */
31
+ release(shader) {
32
+ const key = this._hashShader(shader);
33
+ const cacheEntry = this._cache[key];
34
+ if (cacheEntry) {
35
+ cacheEntry.useCount--;
36
+ if (cacheEntry.useCount === 0) {
37
+ delete this._cache[key];
38
+ cacheEntry.shader.destroy();
39
+ }
40
+ }
41
+ }
42
+ // PRIVATE
43
+ _hashShader(value) {
44
+ return `${value.stage}:${value.source}`;
45
+ }
46
+ }
@@ -1,33 +1,25 @@
1
1
  import type { TypedArray, RenderPipelineProps, RenderPipelineParameters } from '@luma.gl/core';
2
2
  import type { BufferLayout, VertexArray, TransformFeedback } from '@luma.gl/core';
3
3
  import type { AttributeInfo, Binding, UniformValue, PrimitiveTopology } from '@luma.gl/core';
4
- import { Device, Buffer, RenderPipeline, RenderPass, UniformStore } from '@luma.gl/core';
4
+ import { Device, Buffer } from '@luma.gl/core';
5
+ import { RenderPipeline, RenderPass, UniformStore } from '@luma.gl/core';
5
6
  import type { ShaderModule, PlatformInfo } from '@luma.gl/shadertools';
6
7
  import { ShaderAssembler } from '@luma.gl/shadertools';
7
- import { ShaderInputs } from '../shader-inputs';
8
- import type { Geometry } from '../geometry/geometry';
9
- import { GPUGeometry } from '../geometry/gpu-geometry';
10
- import { PipelineFactory } from '../lib/pipeline-factory';
8
+ import type { Geometry } from "../geometry/geometry.js";
9
+ import { GPUGeometry } from "../geometry/gpu-geometry.js";
10
+ import { ShaderInputs } from "../shader-inputs.js";
11
+ import { PipelineFactory } from "../lib/pipeline-factory.js";
12
+ import { ShaderFactory } from "../lib/shader-factory.js";
11
13
  export type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {
12
14
  source?: string;
13
- vs: {
14
- glsl?: string;
15
- wgsl?: string;
16
- } | string | null;
17
- fs: {
18
- glsl?: string;
19
- wgsl?: string;
20
- } | string | null;
15
+ vs: string | null;
16
+ fs: string | null;
21
17
  /** shadertool shader modules (added to shader code) */
22
18
  modules?: ShaderModule[];
23
19
  /** Shadertool module defines (configures shader code)*/
24
20
  defines?: Record<string, string | number | boolean>;
25
21
  /** Shader inputs, used to generated uniform buffers and bindings */
26
22
  shaderInputs?: ShaderInputs;
27
- /** pipeline factory to use to create render pipelines. Defaults to default factory for the device */
28
- pipelineFactory?: PipelineFactory;
29
- /** Shader assembler. Defaults to the ShaderAssembler.getShaderAssembler() */
30
- shaderAssembler?: ShaderAssembler;
31
23
  /** Parameters that are built into the pipeline */
32
24
  parameters?: RenderPipelineParameters;
33
25
  /** Geometry */
@@ -41,11 +33,21 @@ export type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {
41
33
  attributes?: Record<string, Buffer>;
42
34
  /** */
43
35
  constantAttributes?: Record<string, TypedArray>;
36
+ /** Some applications intentionally supply unused attributes */
37
+ ignoreUnknownAttributes?: boolean;
44
38
  /** @internal For use with {@link TransformFeedback}, WebGL only. */
45
39
  varyings?: string[];
46
40
  transformFeedback?: TransformFeedback;
47
41
  /** Mapped uniforms for shadertool modules */
48
42
  moduleSettings?: Record<string, Record<string, any>>;
43
+ /** Show shader source in browser? */
44
+ debugShaders?: 'never' | 'errors' | 'warnings' | 'always';
45
+ /** Factory used to create a {@link RenderPipeline}. Defaults to {@link Device} default factory. */
46
+ pipelineFactory?: PipelineFactory;
47
+ /** Factory used to create a {@link Shader}. Defaults to {@link Device} default factory. */
48
+ shaderFactory?: ShaderFactory;
49
+ /** Shader assembler. Defaults to the ShaderAssembler.getShaderAssembler() */
50
+ shaderAssembler?: ShaderAssembler;
49
51
  };
50
52
  /**
51
53
  * v9 Model API
@@ -59,9 +61,11 @@ export declare class Model {
59
61
  static defaultProps: Required<ModelProps>;
60
62
  readonly device: Device;
61
63
  readonly id: string;
64
+ readonly source: string;
62
65
  readonly vs: string;
63
66
  readonly fs: string;
64
67
  readonly pipelineFactory: PipelineFactory;
68
+ readonly shaderFactory: ShaderFactory;
65
69
  userData: {
66
70
  [key: string]: any;
67
71
  };
@@ -98,27 +102,29 @@ export declare class Model {
98
102
  /** ShaderInputs instance */
99
103
  shaderInputs: ShaderInputs;
100
104
  _uniformStore: UniformStore;
101
- _pipelineNeedsUpdate: string | false;
102
105
  _attributeInfos: Record<string, AttributeInfo>;
103
106
  _gpuGeometry: GPUGeometry | null;
104
107
  private _getModuleUniforms;
105
108
  private props;
109
+ _pipelineNeedsUpdate: string | false;
110
+ private _needsRedraw;
111
+ private _destroyed;
112
+ /** "Time" of last draw. Monotonically increasing timestamp */
113
+ _lastDrawTimestamp: number;
106
114
  constructor(device: Device, props: ModelProps);
107
115
  destroy(): void;
116
+ /** Query redraw status. Clears the status. */
117
+ needsRedraw(): false | string;
118
+ /** Mark the model as needing a redraw */
119
+ setNeedsRedraw(reason: string): void;
108
120
  predraw(): void;
109
- draw(renderPass: RenderPass): void;
121
+ draw(renderPass: RenderPass): boolean;
110
122
  /**
111
123
  * Updates the optional geometry
112
124
  * Geometry, set topology and bufferLayout
113
125
  * @note Can trigger a pipeline rebuild / pipeline cache fetch on WebGPU
114
126
  */
115
- setGeometry(geometry: GPUGeometry | Geometry): GPUGeometry;
116
- /**
117
- * Updates the optional geometry attributes
118
- * Geometry, sets several attributes, indexBuffer, and also vertex count
119
- * @note Can trigger a pipeline rebuild / pipeline cache fetch on WebGPU
120
- */
121
- _setGeometryAttributes(gpuGeometry: GPUGeometry): void;
127
+ setGeometry(geometry: GPUGeometry | Geometry | null): void;
122
128
  /**
123
129
  * Updates the primitive topology ('triangle-list', 'triangle-strip' etc).
124
130
  * @note Triggers a pipeline rebuild / pipeline cache fetch on WebGPU
@@ -126,7 +132,7 @@ export declare class Model {
126
132
  setTopology(topology: PrimitiveTopology): void;
127
133
  /**
128
134
  * Updates the buffer layout.
129
- * @note Triggers a pipeline rebuild / pipeline cache fetch on WebGPU
135
+ * @note Triggers a pipeline rebuild / pipeline cache fetch
130
136
  */
131
137
  setBufferLayout(bufferLayout: BufferLayout[]): void;
132
138
  /**
@@ -146,40 +152,27 @@ export declare class Model {
146
152
  */
147
153
  setInstanceCount(instanceCount: number): void;
148
154
  setShaderInputs(shaderInputs: ShaderInputs): void;
149
- /**
150
- * Updates shader module settings (which results in uniforms being set)
151
- */
152
- setShaderModuleProps(props: Record<string, any>): void;
153
155
  updateShaderInputs(): void;
154
- /**
155
- * @deprecated Updates shader module settings (which results in uniforms being set)
156
- */
157
- updateModuleSettings(props: Record<string, any>): void;
158
156
  /**
159
157
  * Sets bindings (textures, samplers, uniform buffers)
160
158
  */
161
159
  setBindings(bindings: Record<string, Binding>): void;
162
160
  /**
163
- * Sets individual uniforms
164
- * @deprecated WebGL only, use uniform buffers for portability
165
- * @param uniforms
166
- * @returns self for chaining
161
+ * Updates optional transform feedback. WebGL only.
167
162
  */
168
- setUniforms(uniforms: Record<string, UniformValue>): void;
163
+ setTransformFeedback(transformFeedback: TransformFeedback | null): void;
169
164
  /**
170
165
  * Sets the index buffer
171
166
  * @todo - how to unset it if we change geometry?
172
167
  */
173
168
  setIndexBuffer(indexBuffer: Buffer | null): void;
174
- /**
175
- * Updates optional transform feedback. WebGL only.
176
- */
177
- setTransformFeedback(transformFeedback: TransformFeedback | null): void;
178
169
  /**
179
170
  * Sets attributes (buffers)
180
171
  * @note Overrides any attributes previously set with the same name
181
172
  */
182
- setAttributes(buffers: Record<string, Buffer>, _option?: 'ignore-unknown'): void;
173
+ setAttributes(buffers: Record<string, Buffer>, options?: {
174
+ ignoreUnknownAttributes?: boolean;
175
+ }): void;
183
176
  /**
184
177
  * Sets constant attributes
185
178
  * @note Overrides any attributes previously set with the same name
@@ -189,7 +182,27 @@ export declare class Model {
189
182
  * @param constantAttributes
190
183
  */
191
184
  setConstantAttributes(attributes: Record<string, TypedArray>): void;
185
+ /**
186
+ * Sets individual uniforms
187
+ * @deprecated WebGL only, use uniform buffers for portability
188
+ * @param uniforms
189
+ */
190
+ setUniforms(uniforms: Record<string, UniformValue>): void;
191
+ /**
192
+ * @deprecated Updates shader module settings (which results in uniforms being set)
193
+ */
194
+ updateModuleSettings(props: Record<string, any>): void;
195
+ /** Get the timestamp of the latest updated bound GPU memory resource (buffer/texture). */
196
+ _getBindingsUpdateTimestamp(): number;
197
+ /**
198
+ * Updates the optional geometry attributes
199
+ * Geometry, sets several attributes, indexBuffer, and also vertex count
200
+ * @note Can trigger a pipeline rebuild / pipeline cache fetch on WebGPU
201
+ */
202
+ _setGeometryAttributes(gpuGeometry: GPUGeometry): void;
203
+ /** Mark pipeline as needing update */
192
204
  _setPipelineNeedsUpdate(reason: string): void;
205
+ /** Update pipeline if needed */
193
206
  _updatePipeline(): RenderPipeline;
194
207
  /** Throttle draw call logging */
195
208
  _lastLogTime: number;