@luma.gl/engine 9.1.0-beta.1 → 9.1.0-beta.12

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.
@@ -303,8 +303,7 @@ export class Model {
303
303
  this.pipeline = this._updatePipeline();
304
304
 
305
305
  this.vertexArray = device.createVertexArray({
306
- shaderLayout: this.pipeline.shaderLayout,
307
- bufferLayout: this.pipeline.bufferLayout
306
+ renderPipeline: this.pipeline
308
307
  });
309
308
 
310
309
  // Now we can apply geometry attributes
@@ -351,19 +350,16 @@ export class Model {
351
350
  }
352
351
 
353
352
  destroy(): void {
354
- if (!this._destroyed) {
355
- // Release pipeline before we destroy the shaders used by the pipeline
356
- this.pipelineFactory.release(this.pipeline);
357
- // Release the shaders
358
- this.shaderFactory.release(this.pipeline.vs);
359
- if (this.pipeline.fs) {
360
- this.shaderFactory.release(this.pipeline.fs);
361
- }
362
- this._uniformStore.destroy();
363
- // TODO - mark resource as managed and destroyIfManaged() ?
364
- this._gpuGeometry?.destroy();
365
- this._destroyed = true;
366
- }
353
+ if (this._destroyed) return;
354
+ this.pipelineFactory.release(this.pipeline);
355
+ this.shaderFactory.release(this.pipeline.vs);
356
+ if (this.pipeline.fs) {
357
+ this.shaderFactory.release(this.pipeline.fs);
358
+ }
359
+ this._uniformStore.destroy();
360
+ // TODO - mark resource as managed and destroyIfManaged() ?
361
+ this._gpuGeometry?.destroy();
362
+ this._destroyed = true;
367
363
  }
368
364
 
369
365
  // Draw call
@@ -514,8 +510,7 @@ export class Model {
514
510
  // vertex array needs to be updated if we update buffer layout,
515
511
  // but not if we update parameters
516
512
  this.vertexArray = this.device.createVertexArray({
517
- shaderLayout: this.pipeline.shaderLayout,
518
- bufferLayout: this.pipeline.bufferLayout
513
+ renderPipeline: this.pipeline
519
514
  });
520
515
 
521
516
  // Reapply geometry attributes to the new vertex array
@@ -678,6 +673,15 @@ export class Model {
678
673
 
679
674
  // DEPRECATED METHODS
680
675
 
676
+ /**
677
+ * Sets individual uniforms
678
+ * @deprecated WebGL only, use uniform buffers for portability
679
+ * @param uniforms
680
+ */
681
+ setUniforms(uniforms: Record<string, UniformValue>): void {
682
+ this.setUniformsWebGL(uniforms);
683
+ }
684
+
681
685
  /**
682
686
  * Sets individual uniforms
683
687
  * @deprecated WebGL only, use uniform buffers for portability
@@ -35,19 +35,19 @@ fn vertexMain(inputs: VertexInputs) -> FragmentInputs {
35
35
 
36
36
  const CLIPSPACE_VERTEX_SHADER = /* glsl */ `\
37
37
  #version 300 es
38
- in vec2 clipSpacePosition;
39
- in vec2 texCoord;
40
- in vec2 coordinate;
38
+ in vec2 clipSpacePositions;
39
+ in vec2 texCoords;
40
+ in vec2 coordinates;
41
41
 
42
42
  out vec2 position;
43
43
  out vec2 coordinate;
44
44
  out vec2 uv;
45
45
 
46
46
  void main(void) {
47
- gl_Position = vec4(clipSpacePosition, 0., 1.);
48
- position = clipSpacePosition;
49
- coordinate = coordinate;
50
- uv = texCoord;
47
+ gl_Position = vec4(clipSpacePositions, 0., 1.);
48
+ position = clipSpacePositions;
49
+ coordinate = coordinates;
50
+ uv = texCoords;
51
51
  }
52
52
  `;
53
53
 
@@ -78,9 +78,9 @@ export class ClipSpace extends Model {
78
78
  topology: 'triangle-strip',
79
79
  vertexCount: 4,
80
80
  attributes: {
81
- clipSpacePosition: {size: 2, value: new Float32Array(POSITIONS)},
82
- texCoord: {size: 2, value: new Float32Array(TEX_COORDS)},
83
- coordinate: {size: 2, value: new Float32Array(TEX_COORDS)}
81
+ clipSpacePositions: {size: 2, value: new Float32Array(POSITIONS)},
82
+ texCoords: {size: 2, value: new Float32Array(TEX_COORDS)},
83
+ coordinates: {size: 2, value: new Float32Array(TEX_COORDS)}
84
84
  }
85
85
  })
86
86
  });