@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.
- package/dist/compute/texture-transform.d.ts.map +1 -1
- package/dist/compute/texture-transform.js +2 -3
- package/dist/compute/texture-transform.js.map +1 -1
- package/dist/dist.dev.js +54 -160
- package/dist/dist.min.js +24 -24
- package/dist/factories/pipeline-factory.d.ts +1 -11
- package/dist/factories/pipeline-factory.d.ts.map +1 -1
- package/dist/factories/pipeline-factory.js +22 -104
- package/dist/factories/pipeline-factory.js.map +1 -1
- package/dist/factories/shader-factory.d.ts +1 -5
- package/dist/factories/shader-factory.d.ts.map +1 -1
- package/dist/factories/shader-factory.js +4 -38
- package/dist/factories/shader-factory.js.map +1 -1
- package/dist/index.cjs +54 -158
- package/dist/index.cjs.map +2 -2
- package/dist/model/model.d.ts +6 -0
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +20 -16
- package/dist/model/model.js.map +1 -1
- package/dist/models/clip-space.js +10 -10
- package/dist/models/clip-space.js.map +1 -1
- package/package.json +4 -4
- package/src/compute/texture-transform.ts +2 -3
- package/src/factories/pipeline-factory.ts +23 -119
- package/src/factories/shader-factory.ts +5 -41
- package/src/model/model.ts +21 -17
- package/src/models/clip-space.ts +10 -10
package/src/model/model.ts
CHANGED
|
@@ -303,8 +303,7 @@ export class Model {
|
|
|
303
303
|
this.pipeline = this._updatePipeline();
|
|
304
304
|
|
|
305
305
|
this.vertexArray = device.createVertexArray({
|
|
306
|
-
|
|
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 (
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
this.shaderFactory.release(this.pipeline.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
-
|
|
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
|
package/src/models/clip-space.ts
CHANGED
|
@@ -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
|
|
39
|
-
in vec2
|
|
40
|
-
in vec2
|
|
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(
|
|
48
|
-
position =
|
|
49
|
-
coordinate =
|
|
50
|
-
uv =
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
});
|