@luma.gl/engine 9.1.0-beta.8 → 9.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +5 -0
  2. package/dist/animation-loop/animation-loop.d.ts +11 -11
  3. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  4. package/dist/animation-loop/animation-loop.js +25 -49
  5. package/dist/animation-loop/animation-loop.js.map +1 -1
  6. package/dist/animation-loop/animation-props.d.ts +3 -4
  7. package/dist/animation-loop/animation-props.d.ts.map +1 -1
  8. package/dist/async-texture/async-texture.d.ts +106 -2
  9. package/dist/async-texture/async-texture.d.ts.map +1 -1
  10. package/dist/async-texture/async-texture.js +278 -5
  11. package/dist/async-texture/async-texture.js.map +1 -1
  12. package/dist/compute/computation.d.ts +1 -1
  13. package/dist/compute/computation.d.ts.map +1 -1
  14. package/dist/compute/swap.d.ts.map +1 -1
  15. package/dist/compute/swap.js +6 -2
  16. package/dist/compute/swap.js.map +1 -1
  17. package/dist/compute/texture-transform.d.ts.map +1 -1
  18. package/dist/compute/texture-transform.js +1 -0
  19. package/dist/compute/texture-transform.js.map +1 -1
  20. package/dist/debug/copy-texture-to-image.d.ts +23 -1
  21. package/dist/debug/copy-texture-to-image.d.ts.map +1 -1
  22. package/dist/debug/copy-texture-to-image.js +37 -1
  23. package/dist/debug/copy-texture-to-image.js.map +1 -1
  24. package/dist/dist.dev.js +316 -153
  25. package/dist/dist.min.js +23 -23
  26. package/dist/index.cjs +334 -172
  27. package/dist/index.cjs.map +4 -4
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/model/model.d.ts +4 -19
  32. package/dist/model/model.d.ts.map +1 -1
  33. package/dist/model/model.js +1 -44
  34. package/dist/model/model.js.map +1 -1
  35. package/dist/models/billboard-texture-model.d.ts.map +1 -1
  36. package/dist/models/billboard-texture-model.js +6 -4
  37. package/dist/models/billboard-texture-model.js.map +1 -1
  38. package/dist/modules/picking/legacy-picking-manager.d.ts +1 -1
  39. package/dist/modules/picking/legacy-picking-manager.d.ts.map +1 -1
  40. package/dist/modules/picking/legacy-picking-manager.js +1 -1
  41. package/dist/modules/picking/legacy-picking-manager.js.map +1 -1
  42. package/dist/modules/picking/picking-manager.d.ts +1 -1
  43. package/dist/modules/picking/picking-manager.d.ts.map +1 -1
  44. package/dist/modules/picking/picking-manager.js +1 -1
  45. package/dist/modules/picking/picking-manager.js.map +1 -1
  46. package/dist/passes/get-fragment-shader.js +2 -2
  47. package/dist/passes/shader-pass-renderer.d.ts +4 -4
  48. package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
  49. package/dist/passes/shader-pass-renderer.js +15 -5
  50. package/dist/passes/shader-pass-renderer.js.map +1 -1
  51. package/dist/shader-inputs.js +1 -1
  52. package/dist/shader-inputs.js.map +1 -1
  53. package/package.json +4 -4
  54. package/src/animation-loop/animation-loop.ts +30 -58
  55. package/src/animation-loop/animation-props.ts +3 -5
  56. package/src/async-texture/async-texture.ts +382 -16
  57. package/src/async-texture/texture-setters.ts.disabled +296 -0
  58. package/src/compute/computation.ts +1 -1
  59. package/src/compute/swap.ts +7 -2
  60. package/src/compute/texture-transform.ts +1 -0
  61. package/src/debug/copy-texture-to-image.ts +52 -2
  62. package/src/index.ts +12 -0
  63. package/src/model/model.ts +4 -55
  64. package/src/models/billboard-texture-model.ts +6 -4
  65. package/src/modules/picking/legacy-picking-manager.ts +2 -2
  66. package/src/modules/picking/picking-manager.ts +2 -2
  67. package/src/passes/get-fragment-shader.ts +2 -2
  68. package/src/passes/shader-pass-renderer.ts +18 -8
  69. package/src/shader-inputs.ts +1 -1
@@ -44,9 +44,9 @@ export class ShaderPassRenderer {
44
44
  );
45
45
  this.shaderInputs = props.shaderInputs || new ShaderInputs(modules);
46
46
 
47
- const size = device.getCanvasContext().getPixelSize();
47
+ const size = device.getCanvasContext().getDrawingBufferSize();
48
48
  this.swapFramebuffers = new SwapFramebuffers(device, {
49
- colorAttachments: ['rgba8unorm'],
49
+ colorAttachments: [device.preferredColorFormat],
50
50
  width: size[0],
51
51
  height: size[1]
52
52
  });
@@ -99,7 +99,7 @@ void main() {
99
99
  // this.props.passes.forEach(pass => pass.resize(width, height));
100
100
  }
101
101
 
102
- renderToScreen(options: {sourceTexture: AsyncTexture; uniforms: any; bindings: any}): boolean {
102
+ renderToScreen(options: {sourceTexture: AsyncTexture; uniforms?: any; bindings?: any}): boolean {
103
103
  // Run the shader passes and generate an output texture
104
104
  const outputTexture = this.renderToTexture(options);
105
105
  if (!outputTexture) {
@@ -107,7 +107,16 @@ void main() {
107
107
  return false;
108
108
  }
109
109
 
110
- const renderPass = this.device.beginRenderPass({clearColor: [0, 0, 0, 1], clearDepth: 1});
110
+ const framebuffer = this.device
111
+ .getDefaultCanvasContext()
112
+ // @ts-expect-error TODO - remove after republish
113
+ .getCurrentFramebuffer({depthStencilAttachment: false});
114
+ const renderPass = this.device.beginRenderPass({
115
+ id: 'shader-pass-renderer-to-screen',
116
+ framebuffer,
117
+ clearColor: [0, 0, 0, 1],
118
+ clearDepth: 1
119
+ });
111
120
  this.clipSpace.setBindings({sourceTexture: outputTexture});
112
121
  this.clipSpace.draw(renderPass);
113
122
  renderPass.end();
@@ -119,8 +128,8 @@ void main() {
119
128
  */
120
129
  renderToTexture(options: {
121
130
  sourceTexture: AsyncTexture;
122
- uniforms: any;
123
- bindings: any;
131
+ uniforms?: any;
132
+ bindings?: any;
124
133
  }): Texture | null {
125
134
  const {sourceTexture} = options;
126
135
  if (!sourceTexture.isReady) {
@@ -134,6 +143,7 @@ void main() {
134
143
 
135
144
  // Clear the current texture before we begin
136
145
  const clearTexturePass = this.device.beginRenderPass({
146
+ id: 'shader-pass-renderer-clear-texture',
137
147
  framebuffer: this.swapFramebuffers.current,
138
148
  clearColor: [0, 0, 0, 1]
139
149
  });
@@ -163,6 +173,7 @@ void main() {
163
173
  };
164
174
 
165
175
  const renderPass = this.device.beginRenderPass({
176
+ id: 'shader-pass-renderer-run-pass',
166
177
  framebuffer: this.swapFramebuffers.next,
167
178
  clearColor: [0, 0, 0, 1],
168
179
  clearDepth: 1
@@ -226,8 +237,7 @@ class SubPassRenderer {
226
237
  fs,
227
238
  modules: [shaderPass],
228
239
  parameters: {
229
- depthWriteEnabled: false,
230
- depthCompare: 'always'
240
+ depthWriteEnabled: false
231
241
  }
232
242
  });
233
243
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type {Binding, UniformValue} from '@luma.gl/core';
6
6
  import {log} from '@luma.gl/core';
7
- // import type {ShaderUniformType, UniformValue, UniformFormat, UniformInfoDevice, Texture, Sampler} from '@luma.gl/core';
7
+ // import type {VariableShaderType, UniformValue, UniformFormat, UniformInfoDevice, Texture, Sampler} from '@luma.gl/core';
8
8
  import {getShaderModuleDependencies, ShaderModule} from '@luma.gl/shadertools';
9
9
  import {splitUniformsAndBindings} from './model/split-uniforms-and-bindings';
10
10