@luma.gl/engine 9.1.0-alpha.13 → 9.1.0-alpha.14
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/async-texture/async-texture.d.ts +10 -0
- package/dist/async-texture/async-texture.d.ts.map +1 -1
- package/dist/async-texture/async-texture.js +14 -0
- package/dist/dist.dev.js +14 -17
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +14 -12
- package/dist/index.cjs.map +2 -2
- package/dist/transform/buffer-transform.d.ts +4 -6
- package/dist/transform/buffer-transform.d.ts.map +1 -1
- package/dist/transform/buffer-transform.js +2 -10
- package/dist/transform/texture-transform.d.ts +0 -6
- package/dist/transform/texture-transform.d.ts.map +1 -1
- package/dist/transform/texture-transform.js +0 -12
- package/package.json +2 -2
- package/src/async-texture/async-texture.ts +14 -5
- package/src/transform/buffer-transform.ts +4 -12
- package/src/transform/texture-transform.ts +0 -15
|
@@ -3,21 +3,21 @@ import { Model } from "../model/model.js";
|
|
|
3
3
|
import type { ModelProps } from "../model/model.js";
|
|
4
4
|
/**
|
|
5
5
|
* Properties for creating a {@link BufferTransform}
|
|
6
|
-
* @
|
|
6
|
+
* @note Only works under WebGL2.
|
|
7
7
|
*/
|
|
8
8
|
export type BufferTransformProps = Omit<ModelProps, 'fs'> & {
|
|
9
9
|
fs?: ModelProps['fs'];
|
|
10
|
+
/** Map of output buffers that the shaders will write results of computations to */
|
|
10
11
|
feedbackBuffers?: Record<string, Buffer | BufferRange>;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
14
|
+
* Manages a WebGL program (pipeline) for buffer→buffer transforms.
|
|
15
|
+
* @note Only works under WebGL2.
|
|
15
16
|
*/
|
|
16
17
|
export declare class BufferTransform {
|
|
17
18
|
readonly device: Device;
|
|
18
19
|
readonly model: Model;
|
|
19
20
|
readonly transformFeedback: TransformFeedback;
|
|
20
|
-
/** @deprecated Use device feature test. */
|
|
21
21
|
static isSupported(device: Device): boolean;
|
|
22
22
|
constructor(device: Device, props?: BufferTransformProps);
|
|
23
23
|
/** Destroy owned resources. */
|
|
@@ -26,8 +26,6 @@ export declare class BufferTransform {
|
|
|
26
26
|
delete(): void;
|
|
27
27
|
/** Run one transform loop. */
|
|
28
28
|
run(options?: RenderPassProps): void;
|
|
29
|
-
/** @deprecated */
|
|
30
|
-
update(...args: any[]): void;
|
|
31
29
|
/** Returns the {@link Buffer} or {@link BufferRange} for given varying name. */
|
|
32
30
|
getBuffer(varyingName: string): Buffer | BufferRange | null;
|
|
33
31
|
readAsync(varyingName: string): Promise<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-transform.d.ts","sourceRoot":"","sources":["../../src/transform/buffer-transform.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9F,OAAO,EAAC,KAAK,EAAC,0BAAuB;AACrC,OAAO,KAAK,EAAC,UAAU,EAAC,0BAAuB;AAE/C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAC1D,EAAE,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC;CACxD,CAAC;AAEF;;;GAGG;AACH,qBAAa,eAAe;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE9C,
|
|
1
|
+
{"version":3,"file":"buffer-transform.d.ts","sourceRoot":"","sources":["../../src/transform/buffer-transform.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9F,OAAO,EAAC,KAAK,EAAC,0BAAuB;AACrC,OAAO,KAAK,EAAC,UAAU,EAAC,0BAAuB;AAE/C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAC1D,EAAE,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtB,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC;CACxD,CAAC;AAEF;;;GAGG;AACH,qBAAa,eAAe;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE9C,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;gBAI/B,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,oBAAyC;IAyB5E,+BAA+B;IAC/B,OAAO,IAAI,IAAI;IAMf,uCAAuC;IACvC,MAAM,IAAI,IAAI;IAId,8BAA8B;IAC9B,GAAG,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI;IAMpC,gFAAgF;IAChF,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI;IAI3D,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAWpD"}
|
|
@@ -5,14 +5,13 @@ import { Buffer } from '@luma.gl/core';
|
|
|
5
5
|
import { getPassthroughFS } from '@luma.gl/shadertools';
|
|
6
6
|
import { Model } from "../model/model.js";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
8
|
+
* Manages a WebGL program (pipeline) for buffer→buffer transforms.
|
|
9
|
+
* @note Only works under WebGL2.
|
|
10
10
|
*/
|
|
11
11
|
export class BufferTransform {
|
|
12
12
|
device;
|
|
13
13
|
model;
|
|
14
14
|
transformFeedback;
|
|
15
|
-
/** @deprecated Use device feature test. */
|
|
16
15
|
static isSupported(device) {
|
|
17
16
|
return device?.info?.type === 'webgl';
|
|
18
17
|
}
|
|
@@ -51,13 +50,6 @@ export class BufferTransform {
|
|
|
51
50
|
this.model.draw(renderPass);
|
|
52
51
|
renderPass.end();
|
|
53
52
|
}
|
|
54
|
-
/** @deprecated */
|
|
55
|
-
update(...args) {
|
|
56
|
-
// TODO(v9): Method should likely be removed for v9. Keeping a method stub
|
|
57
|
-
// to assist with migrating DeckGL usage.
|
|
58
|
-
// eslint-disable-next-line no-console
|
|
59
|
-
console.warn('TextureTransform#update() not implemented');
|
|
60
|
-
}
|
|
61
53
|
/** Returns the {@link Buffer} or {@link BufferRange} for given varying name. */
|
|
62
54
|
getBuffer(varyingName) {
|
|
63
55
|
return this.transformFeedback.getBuffer(varyingName);
|
|
@@ -2,7 +2,6 @@ import { Buffer, Device, Framebuffer, RenderPassProps, Sampler, Texture } from '
|
|
|
2
2
|
import { Model, ModelProps } from "../model/model.js";
|
|
3
3
|
/**
|
|
4
4
|
* Properties for creating a {@link TextureTransform}
|
|
5
|
-
* @deprecated
|
|
6
5
|
*/
|
|
7
6
|
export type TextureTransformProps = Omit<ModelProps, 'fs'> & {
|
|
8
7
|
fs?: ModelProps['fs'];
|
|
@@ -41,11 +40,6 @@ export declare class TextureTransform {
|
|
|
41
40
|
/** @deprecated Use {@link destroy}. */
|
|
42
41
|
delete(): void;
|
|
43
42
|
run(options?: RenderPassProps): void;
|
|
44
|
-
/** @deprecated */
|
|
45
|
-
update(...args: any[]): void;
|
|
46
|
-
getData({ packed }?: {
|
|
47
|
-
packed?: boolean | undefined;
|
|
48
|
-
}): void;
|
|
49
43
|
getTargetTexture(): Texture;
|
|
50
44
|
getFramebuffer(): Framebuffer | undefined;
|
|
51
45
|
_initialize(props: TextureTransformProps): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"texture-transform.d.ts","sourceRoot":"","sources":["../../src/transform/texture-transform.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,0BAAuB;AAGjD
|
|
1
|
+
{"version":3,"file":"texture-transform.d.ts","sourceRoot":"","sources":["../../src/transform/texture-transform.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,0BAAuB;AAGjD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAC3D,EAAE,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,4CAA4C;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAIF;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,YAAY,SAAK;IACjB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAQ;IACrD,QAAQ,EAAE,cAAc,EAAE,CAAM;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;gBAExB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;IA8BxD,OAAO,IAAI,IAAI;IAEf,uCAAuC;IACvC,MAAM,IAAI,IAAI;IAId,GAAG,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI;IAOpC,gBAAgB,IAAI,OAAO;IAK3B,cAAc,IAAI,WAAW,GAAG,SAAS;IAOzC,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI;IAI/C,eAAe,CAAC,KAAK,EAAE,qBAAqB;IAI5C,cAAc,CACZ,OAAO,EAAE,cAAc,EACvB,EAAC,aAAa,EAAE,cAAc,EAAE,aAAa,EAAC,EAAE,qBAAqB,GACpE,cAAc;IA8BjB,2BAA2B,IAAI,IAAI;CAOpC"}
|
|
@@ -52,18 +52,6 @@ export class TextureTransform {
|
|
|
52
52
|
this.model.draw(renderPass);
|
|
53
53
|
renderPass.end();
|
|
54
54
|
}
|
|
55
|
-
/** @deprecated */
|
|
56
|
-
update(...args) {
|
|
57
|
-
// TODO(v9): Method should likely be removed for v9. Keeping a method stub
|
|
58
|
-
// to assist with migrating DeckGL usage.
|
|
59
|
-
// eslint-disable-next-line no-console
|
|
60
|
-
console.warn('TextureTransform#update() not implemented');
|
|
61
|
-
}
|
|
62
|
-
getData({ packed = false } = {}) {
|
|
63
|
-
// TODO(v9): Method should likely be removed for v9. Keeping a method stub
|
|
64
|
-
// to assist with migrating DeckGL usage.
|
|
65
|
-
throw new Error('getData() not implemented');
|
|
66
|
-
}
|
|
67
55
|
getTargetTexture() {
|
|
68
56
|
const { targetTexture } = this.bindings[this.currentIndex];
|
|
69
57
|
return targetTexture;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/engine",
|
|
3
|
-
"version": "9.1.0-alpha.
|
|
3
|
+
"version": "9.1.0-alpha.14",
|
|
4
4
|
"description": "3D Engine Components for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@probe.gl/log": "^4.0.8",
|
|
50
50
|
"@probe.gl/stats": "^4.0.8"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "e6e014efa323dbcd7d3774e982e442b1bf2c93be"
|
|
53
53
|
}
|
|
@@ -120,11 +120,20 @@ export class AsyncTexture {
|
|
|
120
120
|
this.destroyed = true;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Textures are immutable and cannot be resized after creation,
|
|
125
|
+
* but we can create a similar texture with the same parameters but a new size.
|
|
126
|
+
* @note Does not copy contents of the texture
|
|
127
|
+
* @todo Abort pending promise and create a texture with the new size?
|
|
128
|
+
*/
|
|
129
|
+
resize(size: {width: number; height: number}): void {
|
|
130
|
+
if (!this.isReady) {
|
|
131
|
+
throw new Error('Cannot resize texture before it is ready');
|
|
132
|
+
}
|
|
133
|
+
if (this.texture) {
|
|
134
|
+
this.texture = this.texture.createResizedTexture(size);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
128
137
|
}
|
|
129
138
|
|
|
130
139
|
// HELPERS
|
|
@@ -9,23 +9,23 @@ import type {ModelProps} from '../model/model';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Properties for creating a {@link BufferTransform}
|
|
12
|
-
* @
|
|
12
|
+
* @note Only works under WebGL2.
|
|
13
13
|
*/
|
|
14
14
|
export type BufferTransformProps = Omit<ModelProps, 'fs'> & {
|
|
15
15
|
fs?: ModelProps['fs']; // override as optional
|
|
16
|
+
/** Map of output buffers that the shaders will write results of computations to */
|
|
16
17
|
feedbackBuffers?: Record<string, Buffer | BufferRange>;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
21
|
+
* Manages a WebGL program (pipeline) for buffer→buffer transforms.
|
|
22
|
+
* @note Only works under WebGL2.
|
|
22
23
|
*/
|
|
23
24
|
export class BufferTransform {
|
|
24
25
|
readonly device: Device;
|
|
25
26
|
readonly model: Model;
|
|
26
27
|
readonly transformFeedback: TransformFeedback;
|
|
27
28
|
|
|
28
|
-
/** @deprecated Use device feature test. */
|
|
29
29
|
static isSupported(device: Device): boolean {
|
|
30
30
|
return device?.info?.type === 'webgl';
|
|
31
31
|
}
|
|
@@ -74,14 +74,6 @@ export class BufferTransform {
|
|
|
74
74
|
renderPass.end();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
/** @deprecated */
|
|
78
|
-
update(...args: any[]): void {
|
|
79
|
-
// TODO(v9): Method should likely be removed for v9. Keeping a method stub
|
|
80
|
-
// to assist with migrating DeckGL usage.
|
|
81
|
-
// eslint-disable-next-line no-console
|
|
82
|
-
console.warn('TextureTransform#update() not implemented');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
77
|
/** Returns the {@link Buffer} or {@link BufferRange} for given varying name. */
|
|
86
78
|
getBuffer(varyingName: string): Buffer | BufferRange | null {
|
|
87
79
|
return this.transformFeedback.getBuffer(varyingName);
|
|
@@ -8,7 +8,6 @@ import {getPassthroughFS} from '@luma.gl/shadertools';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Properties for creating a {@link TextureTransform}
|
|
11
|
-
* @deprecated
|
|
12
11
|
*/
|
|
13
12
|
export type TextureTransformProps = Omit<ModelProps, 'fs'> & {
|
|
14
13
|
fs?: ModelProps['fs']; // override as optional
|
|
@@ -92,20 +91,6 @@ export class TextureTransform {
|
|
|
92
91
|
renderPass.end();
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
/** @deprecated */
|
|
96
|
-
update(...args: any[]): void {
|
|
97
|
-
// TODO(v9): Method should likely be removed for v9. Keeping a method stub
|
|
98
|
-
// to assist with migrating DeckGL usage.
|
|
99
|
-
// eslint-disable-next-line no-console
|
|
100
|
-
console.warn('TextureTransform#update() not implemented');
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
getData({packed = false} = {}) {
|
|
104
|
-
// TODO(v9): Method should likely be removed for v9. Keeping a method stub
|
|
105
|
-
// to assist with migrating DeckGL usage.
|
|
106
|
-
throw new Error('getData() not implemented');
|
|
107
|
-
}
|
|
108
|
-
|
|
109
94
|
getTargetTexture(): Texture {
|
|
110
95
|
const {targetTexture} = this.bindings[this.currentIndex];
|
|
111
96
|
return targetTexture;
|