@luma.gl/engine 9.2.6 → 9.3.0-alpha.2
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/animation-loop/animation-loop.d.ts +3 -1
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +10 -4
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +3 -2
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/swap.d.ts +2 -0
- package/dist/compute/swap.d.ts.map +1 -1
- package/dist/compute/swap.js +10 -5
- package/dist/compute/swap.js.map +1 -1
- package/dist/dist.dev.js +554 -358
- package/dist/dist.min.js +59 -50
- package/dist/dynamic-texture/dynamic-texture.d.ts +95 -0
- package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -0
- package/dist/dynamic-texture/dynamic-texture.js +356 -0
- package/dist/dynamic-texture/dynamic-texture.js.map +1 -0
- package/dist/dynamic-texture/texture-data.d.ts +137 -0
- package/dist/dynamic-texture/texture-data.d.ts.map +1 -0
- package/dist/dynamic-texture/texture-data.js +183 -0
- package/dist/dynamic-texture/texture-data.js.map +1 -0
- package/dist/factories/pipeline-factory.d.ts.map +1 -1
- package/dist/factories/pipeline-factory.js +3 -3
- package/dist/factories/pipeline-factory.js.map +1 -1
- package/dist/factories/shader-factory.d.ts.map +1 -1
- package/dist/factories/shader-factory.js +3 -2
- package/dist/factories/shader-factory.js.map +1 -1
- package/dist/index.cjs +566 -370
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/model/model.d.ts +31 -10
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +34 -14
- package/dist/model/model.js.map +1 -1
- package/dist/models/billboard-texture-model.d.ts +8 -5
- package/dist/models/billboard-texture-model.d.ts.map +1 -1
- package/dist/models/billboard-texture-model.js +70 -18
- package/dist/models/billboard-texture-model.js.map +1 -1
- package/dist/passes/get-fragment-shader.js +15 -11
- package/dist/passes/get-fragment-shader.js.map +1 -1
- package/dist/passes/shader-pass-renderer.d.ts +5 -5
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +13 -12
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +4 -4
- package/src/animation-loop/animation-loop.ts +11 -4
- package/src/compute/computation.ts +3 -2
- package/src/compute/swap.ts +13 -7
- package/src/dynamic-texture/dynamic-texture.ts +451 -0
- package/src/dynamic-texture/texture-data.ts +301 -0
- package/src/factories/pipeline-factory.ts +4 -3
- package/src/factories/shader-factory.ts +4 -2
- package/src/index.ts +9 -4
- package/src/model/model.ts +37 -18
- package/src/models/billboard-texture-model.ts +81 -22
- package/src/passes/get-fragment-shader.ts +15 -11
- package/src/passes/shader-pass-renderer.ts +22 -16
- package/src/types.ts +11 -0
- package/dist/async-texture/async-texture.d.ts +0 -166
- package/dist/async-texture/async-texture.d.ts.map +0 -1
- package/dist/async-texture/async-texture.js +0 -386
- package/dist/async-texture/async-texture.js.map +0 -1
- package/src/async-texture/async-texture.ts +0 -551
- /package/src/{async-texture/texture-setters.ts.disabled → dynamic-texture/texture-data.ts.disabled} +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { TextureProps, SamplerProps, TextureView, Device } from '@luma.gl/core';
|
|
2
|
+
import { Texture, Sampler } from '@luma.gl/core';
|
|
3
|
+
import { type TextureCubeFace, type TextureDataAsyncProps, type Texture1DData, type Texture2DData, type Texture3DData, type TextureArrayData, type TextureCubeData } from "./texture-data.js";
|
|
4
|
+
/**
|
|
5
|
+
* Properties for a dynamic texture
|
|
6
|
+
*/
|
|
7
|
+
export type DynamicTextureProps = Omit<TextureProps, 'data' | 'mipLevels' | 'width' | 'height'> & TextureDataAsyncProps & {
|
|
8
|
+
/** Generate mipmaps after creating textures and setting data */
|
|
9
|
+
mipmaps?: boolean;
|
|
10
|
+
/** nipLevels can be set to 'auto' to generate max number of mipLevels */
|
|
11
|
+
mipLevels?: number | 'auto';
|
|
12
|
+
/** Width - can be auto-calculated when initializing from ExternalImage */
|
|
13
|
+
width?: number;
|
|
14
|
+
/** Height - can be auto-calculated when initializing from ExternalImage */
|
|
15
|
+
height?: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Dynamic Textures
|
|
19
|
+
*
|
|
20
|
+
* - Mipmaps - DynamicTexture can generate mipmaps for textures (WebGPU does not provide built-in mipmap generation).
|
|
21
|
+
*
|
|
22
|
+
* - Texture initialization and updates - complex textures (2d array textures, cube textures, 3d textures) need multiple images
|
|
23
|
+
* `DynamicTexture` provides an API that makes it easy to provide the required data.
|
|
24
|
+
*
|
|
25
|
+
* - Texture resizing - Textures are immutable in WebGPU, meaning that they cannot be resized after creation.
|
|
26
|
+
* DynamicTexture provides a `resize()` method that internally creates a new texture with the same parameters
|
|
27
|
+
* but a different size.
|
|
28
|
+
*
|
|
29
|
+
* - Async image data initialization - It is often very convenient to be able to initialize textures with promises
|
|
30
|
+
* returned by image or data loading functions, as it allows a callback-free linear style of programming.
|
|
31
|
+
*
|
|
32
|
+
* @note GPU Textures are quite complex objects, with many subresources and modes of usage.
|
|
33
|
+
* The `DynamicTexture` class allows luma.gl to provide some support for working with textures
|
|
34
|
+
* without accumulating excessive complexity in the core Texture class which is designed as an immutable nature of GPU resource.
|
|
35
|
+
*/
|
|
36
|
+
export declare class DynamicTexture {
|
|
37
|
+
readonly device: Device;
|
|
38
|
+
readonly id: string;
|
|
39
|
+
/** Props with defaults resolved (except `data` which is processed separately) */
|
|
40
|
+
props: Readonly<Required<DynamicTextureProps>>;
|
|
41
|
+
/** Created resources */
|
|
42
|
+
private _texture;
|
|
43
|
+
private _sampler;
|
|
44
|
+
private _view;
|
|
45
|
+
/** Ready when GPU texture has been created and data (if any) uploaded */
|
|
46
|
+
readonly ready: Promise<Texture>;
|
|
47
|
+
isReady: boolean;
|
|
48
|
+
destroyed: boolean;
|
|
49
|
+
private resolveReady;
|
|
50
|
+
private rejectReady;
|
|
51
|
+
get texture(): Texture;
|
|
52
|
+
get sampler(): Sampler;
|
|
53
|
+
get view(): TextureView;
|
|
54
|
+
get [Symbol.toStringTag](): string;
|
|
55
|
+
toString(): string;
|
|
56
|
+
constructor(device: Device, props: DynamicTextureProps);
|
|
57
|
+
/** @note Fire and forget; caller can await `ready` */
|
|
58
|
+
initAsync(originalPropsWithAsyncData: TextureDataAsyncProps): Promise<void>;
|
|
59
|
+
destroy(): void;
|
|
60
|
+
generateMipmaps(): void;
|
|
61
|
+
/** Set sampler or create one from props */
|
|
62
|
+
setSampler(sampler?: Sampler | SamplerProps): void;
|
|
63
|
+
/**
|
|
64
|
+
* Resize by cloning the underlying immutable texture.
|
|
65
|
+
* Does not copy contents; caller may need to re-upload and/or regenerate mips.
|
|
66
|
+
*/
|
|
67
|
+
resize(size: {
|
|
68
|
+
width: number;
|
|
69
|
+
height: number;
|
|
70
|
+
}): boolean;
|
|
71
|
+
/** Convert cube face label to texture slice index. Index can be used with `setTexture2DData()`. */
|
|
72
|
+
getCubeFaceIndex(face: TextureCubeFace): number;
|
|
73
|
+
/** Convert cube face label to texture slice index. Index can be used with `setTexture2DData()`. */
|
|
74
|
+
getCubeArrayFaceIndex(cubeIndex: number, face: TextureCubeFace): number;
|
|
75
|
+
/** @note experimental: Set multiple mip levels (1D) */
|
|
76
|
+
setTexture1DData(data: Texture1DData): void;
|
|
77
|
+
/** @note experimental: Set multiple mip levels (2D), optionally at `z`, slice (depth/array level) index */
|
|
78
|
+
setTexture2DData(lodData: Texture2DData, z?: number): void;
|
|
79
|
+
/** 3D: multiple depth slices, each may carry multiple mip levels */
|
|
80
|
+
setTexture3DData(data: Texture3DData): void;
|
|
81
|
+
/** 2D array: multiple layers, each may carry multiple mip levels */
|
|
82
|
+
setTextureArrayData(data: TextureArrayData): void;
|
|
83
|
+
/** Cube: 6 faces, each may carry multiple mip levels */
|
|
84
|
+
setTextureCubeData(data: TextureCubeData): void;
|
|
85
|
+
/** Cube array: multiple cubes (faces×layers), each face may carry multiple mips */
|
|
86
|
+
private setTextureCubeArrayData;
|
|
87
|
+
/** Sets multiple mip levels on different `z` slices (depth/array index) */
|
|
88
|
+
private _setTextureSubresources;
|
|
89
|
+
/** Recursively resolve all promises in data structures */
|
|
90
|
+
private _loadAllData;
|
|
91
|
+
private _checkNotDestroyed;
|
|
92
|
+
private _checkReady;
|
|
93
|
+
static defaultProps: Required<DynamicTextureProps>;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=dynamic-texture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-texture.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/dynamic-texture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAC,OAAO,EAAE,OAAO,EAAM,MAAM,eAAe,CAAC;AAIpD,OAAO,EAEL,KAAK,eAAe,EAQpB,KAAK,qBAAqB,EAG1B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAErB,KAAK,eAAe,EAUrB,0BAAuB;AAExB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC7F,qBAAqB,GAAG;IACtB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,0EAA0E;IAC1E,KAAK,CAAC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AAM;IAM/C,mGAAmG;IACnG,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM;IAIvE,uDAAuD;IACvD,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAS3C,2GAA2G;IAC3G,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC,GAAE,MAAU,GAAG,IAAI;IAU7D,oEAAoE;IACpE,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAQ3C,oEAAoE;IACpE,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAQjD,wDAAwD;IACxD,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAQ/C,mFAAmF;IACnF,OAAO,CAAC,uBAAuB;IAQ/B,2EAA2E;IAC3E,OAAO,CAAC,uBAAuB;IA6B/B,0DAA0D;YAC5C,YAAY;IAM1B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,WAAW;IAMnB,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAKhD;CACH"}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
// luma.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
import { Texture, Sampler, log } from '@luma.gl/core';
|
|
4
|
+
// import {loadImageBitmap} from '../application-utils/load-file';
|
|
5
|
+
import { uid } from "../utils/uid.js";
|
|
6
|
+
import { TEXTURE_CUBE_FACE_MAP,
|
|
7
|
+
// Helpers
|
|
8
|
+
getTextureSizeFromData, getTexture1DSubresources, getTexture2DSubresources, getTexture3DSubresources, getTextureCubeSubresources, getTextureArraySubresources, getTextureCubeArraySubresources } from "./texture-data.js";
|
|
9
|
+
/**
|
|
10
|
+
* Dynamic Textures
|
|
11
|
+
*
|
|
12
|
+
* - Mipmaps - DynamicTexture can generate mipmaps for textures (WebGPU does not provide built-in mipmap generation).
|
|
13
|
+
*
|
|
14
|
+
* - Texture initialization and updates - complex textures (2d array textures, cube textures, 3d textures) need multiple images
|
|
15
|
+
* `DynamicTexture` provides an API that makes it easy to provide the required data.
|
|
16
|
+
*
|
|
17
|
+
* - Texture resizing - Textures are immutable in WebGPU, meaning that they cannot be resized after creation.
|
|
18
|
+
* DynamicTexture provides a `resize()` method that internally creates a new texture with the same parameters
|
|
19
|
+
* but a different size.
|
|
20
|
+
*
|
|
21
|
+
* - Async image data initialization - It is often very convenient to be able to initialize textures with promises
|
|
22
|
+
* returned by image or data loading functions, as it allows a callback-free linear style of programming.
|
|
23
|
+
*
|
|
24
|
+
* @note GPU Textures are quite complex objects, with many subresources and modes of usage.
|
|
25
|
+
* The `DynamicTexture` class allows luma.gl to provide some support for working with textures
|
|
26
|
+
* without accumulating excessive complexity in the core Texture class which is designed as an immutable nature of GPU resource.
|
|
27
|
+
*/
|
|
28
|
+
export class DynamicTexture {
|
|
29
|
+
device;
|
|
30
|
+
id;
|
|
31
|
+
/** Props with defaults resolved (except `data` which is processed separately) */
|
|
32
|
+
props;
|
|
33
|
+
/** Created resources */
|
|
34
|
+
_texture = null;
|
|
35
|
+
_sampler = null;
|
|
36
|
+
_view = null;
|
|
37
|
+
/** Ready when GPU texture has been created and data (if any) uploaded */
|
|
38
|
+
ready;
|
|
39
|
+
isReady = false;
|
|
40
|
+
destroyed = false;
|
|
41
|
+
resolveReady = () => { };
|
|
42
|
+
rejectReady = () => { };
|
|
43
|
+
get texture() {
|
|
44
|
+
if (!this._texture)
|
|
45
|
+
throw new Error('Texture not initialized yet');
|
|
46
|
+
return this._texture;
|
|
47
|
+
}
|
|
48
|
+
get sampler() {
|
|
49
|
+
if (!this._sampler)
|
|
50
|
+
throw new Error('Sampler not initialized yet');
|
|
51
|
+
return this._sampler;
|
|
52
|
+
}
|
|
53
|
+
get view() {
|
|
54
|
+
if (!this._view)
|
|
55
|
+
throw new Error('View not initialized yet');
|
|
56
|
+
return this._view;
|
|
57
|
+
}
|
|
58
|
+
get [Symbol.toStringTag]() {
|
|
59
|
+
return 'DynamicTexture';
|
|
60
|
+
}
|
|
61
|
+
toString() {
|
|
62
|
+
return `DynamicTexture:"${this.id}":${this.texture.width}x${this.texture.height}px:(${this.isReady ? 'ready' : 'loading...'})`;
|
|
63
|
+
}
|
|
64
|
+
constructor(device, props) {
|
|
65
|
+
this.device = device;
|
|
66
|
+
const id = uid('dynamic-texture');
|
|
67
|
+
// NOTE: We avoid holding on to data to make sure it can be garbage collected.
|
|
68
|
+
const originalPropsWithAsyncData = props;
|
|
69
|
+
this.props = { ...DynamicTexture.defaultProps, id, ...props, data: null };
|
|
70
|
+
this.id = this.props.id;
|
|
71
|
+
this.ready = new Promise((resolve, reject) => {
|
|
72
|
+
this.resolveReady = resolve;
|
|
73
|
+
this.rejectReady = reject;
|
|
74
|
+
});
|
|
75
|
+
this.initAsync(originalPropsWithAsyncData);
|
|
76
|
+
}
|
|
77
|
+
/** @note Fire and forget; caller can await `ready` */
|
|
78
|
+
async initAsync(originalPropsWithAsyncData) {
|
|
79
|
+
try {
|
|
80
|
+
// TODO - Accept URL string for 2D: turn into ExternalImage promise
|
|
81
|
+
// const dataProps =
|
|
82
|
+
// typeof props.data === 'string' && (props.dimension ?? '2d') === '2d'
|
|
83
|
+
// ? ({dimension: '2d', data: loadImageBitmap(props.data)} as const)
|
|
84
|
+
// : {};
|
|
85
|
+
const propsWithSyncData = await this._loadAllData(originalPropsWithAsyncData);
|
|
86
|
+
this._checkNotDestroyed();
|
|
87
|
+
// Deduce size when not explicitly provided
|
|
88
|
+
// TODO - what about depth?
|
|
89
|
+
const deduceSize = () => {
|
|
90
|
+
if (this.props.width && this.props.height) {
|
|
91
|
+
return { width: this.props.width, height: this.props.height };
|
|
92
|
+
}
|
|
93
|
+
const size = getTextureSizeFromData(propsWithSyncData);
|
|
94
|
+
if (size) {
|
|
95
|
+
return size;
|
|
96
|
+
}
|
|
97
|
+
return { width: this.props.width || 1, height: this.props.height || 1 };
|
|
98
|
+
};
|
|
99
|
+
const size = deduceSize();
|
|
100
|
+
if (!size || size.width <= 0 || size.height <= 0) {
|
|
101
|
+
throw new Error(`${this} size could not be determined or was zero`);
|
|
102
|
+
}
|
|
103
|
+
// Create a minimal TextureProps and validate via `satisfies`
|
|
104
|
+
const baseTextureProps = {
|
|
105
|
+
...this.props,
|
|
106
|
+
...size,
|
|
107
|
+
mipLevels: 1, // temporary; updated below
|
|
108
|
+
data: undefined
|
|
109
|
+
};
|
|
110
|
+
// Compute mip levels (auto clamps to max)
|
|
111
|
+
const maxMips = this.device.getMipLevelCount(baseTextureProps.width, baseTextureProps.height);
|
|
112
|
+
const desired = this.props.mipLevels === 'auto'
|
|
113
|
+
? maxMips
|
|
114
|
+
: Math.max(1, Math.min(maxMips, this.props.mipLevels ?? 1));
|
|
115
|
+
const finalTextureProps = { ...baseTextureProps, mipLevels: desired };
|
|
116
|
+
this._texture = this.device.createTexture(finalTextureProps);
|
|
117
|
+
this._sampler = this.texture.sampler;
|
|
118
|
+
this._view = this.texture.view;
|
|
119
|
+
// Upload data if provided
|
|
120
|
+
if (propsWithSyncData.data) {
|
|
121
|
+
switch (propsWithSyncData.dimension) {
|
|
122
|
+
case '1d':
|
|
123
|
+
this.setTexture1DData(propsWithSyncData.data);
|
|
124
|
+
break;
|
|
125
|
+
case '2d':
|
|
126
|
+
this.setTexture2DData(propsWithSyncData.data);
|
|
127
|
+
break;
|
|
128
|
+
case '3d':
|
|
129
|
+
this.setTexture3DData(propsWithSyncData.data);
|
|
130
|
+
break;
|
|
131
|
+
case '2d-array':
|
|
132
|
+
this.setTextureArrayData(propsWithSyncData.data);
|
|
133
|
+
break;
|
|
134
|
+
case 'cube':
|
|
135
|
+
this.setTextureCubeData(propsWithSyncData.data);
|
|
136
|
+
break;
|
|
137
|
+
case 'cube-array':
|
|
138
|
+
this.setTextureCubeArrayData(propsWithSyncData.data);
|
|
139
|
+
break;
|
|
140
|
+
default: {
|
|
141
|
+
throw new Error(`Unhandled dimension ${propsWithSyncData.dimension}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (this.props.mipmaps) {
|
|
146
|
+
this.generateMipmaps();
|
|
147
|
+
}
|
|
148
|
+
this.isReady = true;
|
|
149
|
+
this.resolveReady(this.texture);
|
|
150
|
+
log.info(0, `${this} created`)();
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
const err = e instanceof Error ? e : new Error(String(e));
|
|
154
|
+
this.rejectReady(err);
|
|
155
|
+
throw err;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
destroy() {
|
|
159
|
+
if (this._texture) {
|
|
160
|
+
this._texture.destroy();
|
|
161
|
+
this._texture = null;
|
|
162
|
+
this._sampler = null;
|
|
163
|
+
this._view = null;
|
|
164
|
+
}
|
|
165
|
+
this.destroyed = true;
|
|
166
|
+
}
|
|
167
|
+
generateMipmaps() {
|
|
168
|
+
// Call the WebGL-style mipmap generation helper
|
|
169
|
+
// WebGL implementation generates mipmaps, WebGPU logs a warning
|
|
170
|
+
if (this.device.type === 'webgl') {
|
|
171
|
+
this.texture.generateMipmapsWebGL();
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
log.warn('Mipmap generation not yet implemented on WebGPU: your texture data will not be correctly initialized');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/** Set sampler or create one from props */
|
|
178
|
+
setSampler(sampler = {}) {
|
|
179
|
+
this._checkReady();
|
|
180
|
+
const s = sampler instanceof Sampler ? sampler : this.device.createSampler(sampler);
|
|
181
|
+
this.texture.setSampler(s);
|
|
182
|
+
this._sampler = s;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Resize by cloning the underlying immutable texture.
|
|
186
|
+
* Does not copy contents; caller may need to re-upload and/or regenerate mips.
|
|
187
|
+
*/
|
|
188
|
+
resize(size) {
|
|
189
|
+
this._checkReady();
|
|
190
|
+
if (size.width === this.texture.width && size.height === this.texture.height) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
const prev = this.texture;
|
|
194
|
+
this._texture = prev.clone(size);
|
|
195
|
+
this._sampler = this.texture.sampler;
|
|
196
|
+
this._view = this.texture.view;
|
|
197
|
+
prev.destroy();
|
|
198
|
+
log.info(`${this} resized`);
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
/** Convert cube face label to texture slice index. Index can be used with `setTexture2DData()`. */
|
|
202
|
+
getCubeFaceIndex(face) {
|
|
203
|
+
const index = TEXTURE_CUBE_FACE_MAP[face];
|
|
204
|
+
if (index === undefined)
|
|
205
|
+
throw new Error(`Invalid cube face: ${face}`);
|
|
206
|
+
return index;
|
|
207
|
+
}
|
|
208
|
+
/** Convert cube face label to texture slice index. Index can be used with `setTexture2DData()`. */
|
|
209
|
+
getCubeArrayFaceIndex(cubeIndex, face) {
|
|
210
|
+
return 6 * cubeIndex + this.getCubeFaceIndex(face);
|
|
211
|
+
}
|
|
212
|
+
/** @note experimental: Set multiple mip levels (1D) */
|
|
213
|
+
setTexture1DData(data) {
|
|
214
|
+
this._checkReady();
|
|
215
|
+
if (this.texture.props.dimension !== '1d') {
|
|
216
|
+
throw new Error(`${this} is not 1d`);
|
|
217
|
+
}
|
|
218
|
+
const subresources = getTexture1DSubresources(data);
|
|
219
|
+
this._setTextureSubresources(subresources);
|
|
220
|
+
}
|
|
221
|
+
/** @note experimental: Set multiple mip levels (2D), optionally at `z`, slice (depth/array level) index */
|
|
222
|
+
setTexture2DData(lodData, z = 0) {
|
|
223
|
+
this._checkReady();
|
|
224
|
+
if (this.texture.props.dimension !== '2d') {
|
|
225
|
+
throw new Error(`${this} is not 2d`);
|
|
226
|
+
}
|
|
227
|
+
const subresources = getTexture2DSubresources(z, lodData);
|
|
228
|
+
this._setTextureSubresources(subresources);
|
|
229
|
+
}
|
|
230
|
+
/** 3D: multiple depth slices, each may carry multiple mip levels */
|
|
231
|
+
setTexture3DData(data) {
|
|
232
|
+
if (this.texture.props.dimension !== '3d') {
|
|
233
|
+
throw new Error(`${this} is not 3d`);
|
|
234
|
+
}
|
|
235
|
+
const subresources = getTexture3DSubresources(data);
|
|
236
|
+
this._setTextureSubresources(subresources);
|
|
237
|
+
}
|
|
238
|
+
/** 2D array: multiple layers, each may carry multiple mip levels */
|
|
239
|
+
setTextureArrayData(data) {
|
|
240
|
+
if (this.texture.props.dimension !== '2d-array') {
|
|
241
|
+
throw new Error(`${this} is not 2d-array`);
|
|
242
|
+
}
|
|
243
|
+
const subresources = getTextureArraySubresources(data);
|
|
244
|
+
this._setTextureSubresources(subresources);
|
|
245
|
+
}
|
|
246
|
+
/** Cube: 6 faces, each may carry multiple mip levels */
|
|
247
|
+
setTextureCubeData(data) {
|
|
248
|
+
if (this.texture.props.dimension !== 'cube') {
|
|
249
|
+
throw new Error(`${this} is not cube`);
|
|
250
|
+
}
|
|
251
|
+
const subresources = getTextureCubeSubresources(data);
|
|
252
|
+
this._setTextureSubresources(subresources);
|
|
253
|
+
}
|
|
254
|
+
/** Cube array: multiple cubes (faces×layers), each face may carry multiple mips */
|
|
255
|
+
setTextureCubeArrayData(data) {
|
|
256
|
+
if (this.texture.props.dimension !== 'cube-array') {
|
|
257
|
+
throw new Error(`${this} is not cube-array`);
|
|
258
|
+
}
|
|
259
|
+
const subresources = getTextureCubeArraySubresources(data);
|
|
260
|
+
this._setTextureSubresources(subresources);
|
|
261
|
+
}
|
|
262
|
+
/** Sets multiple mip levels on different `z` slices (depth/array index) */
|
|
263
|
+
_setTextureSubresources(subresources) {
|
|
264
|
+
// If user supplied multiple mip levels, warn if auto-mips also requested
|
|
265
|
+
// if (lodArray.length > 1 && this.props.mipmaps !== false) {
|
|
266
|
+
// log.warn(
|
|
267
|
+
// `Texture ${this.id}: provided multiple LODs and also requested mipmap generation.`
|
|
268
|
+
// )();
|
|
269
|
+
// }
|
|
270
|
+
for (const subresource of subresources) {
|
|
271
|
+
const { z, mipLevel } = subresource;
|
|
272
|
+
switch (subresource.type) {
|
|
273
|
+
case 'external-image':
|
|
274
|
+
const { image, flipY } = subresource;
|
|
275
|
+
this.texture.copyExternalImage({ image, z, mipLevel, flipY });
|
|
276
|
+
break;
|
|
277
|
+
case 'texture-data':
|
|
278
|
+
const { data } = subresource;
|
|
279
|
+
// TODO - we are throwing away some of the info in data.
|
|
280
|
+
// Did we not need it in the first place? Can we use it to validate?
|
|
281
|
+
this.texture.copyImageData({ data: data.data, z, mipLevel });
|
|
282
|
+
break;
|
|
283
|
+
default:
|
|
284
|
+
throw new Error('Unsupported 2D mip-level payload');
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// ------------------ helpers ------------------
|
|
289
|
+
/** Recursively resolve all promises in data structures */
|
|
290
|
+
async _loadAllData(props) {
|
|
291
|
+
const syncData = await awaitAllPromises(props.data);
|
|
292
|
+
const dimension = (props.dimension ?? '2d');
|
|
293
|
+
return { dimension, data: syncData ?? null };
|
|
294
|
+
}
|
|
295
|
+
_checkNotDestroyed() {
|
|
296
|
+
if (this.destroyed) {
|
|
297
|
+
log.warn(`${this} already destroyed`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
_checkReady() {
|
|
301
|
+
if (!this.isReady) {
|
|
302
|
+
log.warn(`${this} Cannot perform this operation before ready`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
static defaultProps = {
|
|
306
|
+
...Texture.defaultProps,
|
|
307
|
+
dimension: '2d',
|
|
308
|
+
data: null,
|
|
309
|
+
mipmaps: false
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
// HELPERS
|
|
313
|
+
/** Resolve all promises in a nested data structure */
|
|
314
|
+
async function awaitAllPromises(x) {
|
|
315
|
+
x = await x;
|
|
316
|
+
if (Array.isArray(x)) {
|
|
317
|
+
return await Promise.all(x.map(awaitAllPromises));
|
|
318
|
+
}
|
|
319
|
+
if (x && typeof x === 'object' && x.constructor === Object) {
|
|
320
|
+
const object = x;
|
|
321
|
+
const values = await Promise.all(Object.values(object));
|
|
322
|
+
const keys = Object.keys(object);
|
|
323
|
+
const resolvedObject = {};
|
|
324
|
+
for (let i = 0; i < keys.length; i++) {
|
|
325
|
+
resolvedObject[keys[i]] = values[i];
|
|
326
|
+
}
|
|
327
|
+
return resolvedObject;
|
|
328
|
+
}
|
|
329
|
+
return x;
|
|
330
|
+
}
|
|
331
|
+
// /** @note experimental: Set multiple mip levels (2D), optionally at `z`, slice (depth/array level) index */
|
|
332
|
+
// setTexture2DData(lodData: Texture2DData, z: number = 0): void {
|
|
333
|
+
// this._checkReady();
|
|
334
|
+
// const lodArray = this._normalizeTexture2DData(lodData);
|
|
335
|
+
// // If user supplied multiple mip levels, warn if auto-mips also requested
|
|
336
|
+
// if (lodArray.length > 1 && this.props.mipmaps !== false) {
|
|
337
|
+
// log.warn(
|
|
338
|
+
// `Texture ${this.id}: provided multiple LODs and also requested mipmap generation.`
|
|
339
|
+
// )();
|
|
340
|
+
// }
|
|
341
|
+
// for (let mipLevel = 0; mipLevel < lodArray.length; mipLevel++) {
|
|
342
|
+
// const imageData = lodArray[mipLevel];
|
|
343
|
+
// if (this.device.isExternalImage(imageData)) {
|
|
344
|
+
// this.texture.copyExternalImage({image: imageData, z, mipLevel, flipY: true});
|
|
345
|
+
// } else if (this._isTextureImageData(imageData)) {
|
|
346
|
+
// this.texture.copyImageData({data: imageData.data, z, mipLevel});
|
|
347
|
+
// } else {
|
|
348
|
+
// throw new Error('Unsupported 2D mip-level payload');
|
|
349
|
+
// }
|
|
350
|
+
// }
|
|
351
|
+
// }
|
|
352
|
+
// /** Normalize 2D layer payload into an array of mip-level items */
|
|
353
|
+
// private _normalizeTexture2DData(data: Texture2DData): (TextureImageData | ExternalImage)[] {
|
|
354
|
+
// return Array.isArray(data) ? data : [data];
|
|
355
|
+
// }
|
|
356
|
+
//# sourceMappingURL=dynamic-texture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-texture.js","sourceRoot":"","sources":["../../src/dynamic-texture/d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,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;QAC3D,MAAM,MAAM,GAAwB,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,cAAc,GAAwB,EAAE,CAAC;QAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,8GAA8G;AAC9G,kEAAkE;AAClE,wBAAwB;AAExB,4DAA4D;AAE5D,8EAA8E;AAC9E,+DAA+D;AAC/D,gBAAgB;AAChB,2FAA2F;AAC3F,WAAW;AACX,MAAM;AAEN,qEAAqE;AACrE,4CAA4C;AAC5C,oDAAoD;AACpD,sFAAsF;AACtF,wDAAwD;AACxD,yEAAyE;AACzE,eAAe;AACf,6DAA6D;AAC7D,QAAQ;AACR,MAAM;AACN,IAAI;AAEJ,qEAAqE;AACrE,+FAA+F;AAC/F,gDAAgD;AAChD,IAAI"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { TypedArray, TextureFormat, ExternalImage } from '@luma.gl/core';
|
|
2
|
+
export type TextureImageSource = ExternalImage;
|
|
3
|
+
/**
|
|
4
|
+
* One mip level
|
|
5
|
+
* Basic data structure is similar to `ImageData`
|
|
6
|
+
* additional optional fields can describe compressed texture data.
|
|
7
|
+
*/
|
|
8
|
+
export type TextureImageData = {
|
|
9
|
+
/** WebGPU style format string. Defaults to 'rgba8unorm' */
|
|
10
|
+
format?: TextureFormat;
|
|
11
|
+
/** Typed Array with the bytes of the image. @note beware row byte alignment requirements */
|
|
12
|
+
data: TypedArray;
|
|
13
|
+
/** Width of the image, in pixels, @note beware row byte alignment requirements */
|
|
14
|
+
width: number;
|
|
15
|
+
/** Height of the image, in rows */
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A single mip-level can be initialized by data or an ImageBitmap etc
|
|
20
|
+
* @note in the WebGPU spec a mip-level is called a subresource
|
|
21
|
+
*/
|
|
22
|
+
export type TextureMipLevelData = TextureImageData | TextureImageSource;
|
|
23
|
+
/**
|
|
24
|
+
* Texture data for one image "slice" (which can consist of multiple miplevels)
|
|
25
|
+
* Thus data for one slice be a single mip level or an array of miplevels
|
|
26
|
+
* @note in the WebGPU spec each cross-section image in a 3D texture is called a "slice",
|
|
27
|
+
* in a array texture each image in the array is called an array "layer"
|
|
28
|
+
* luma.gl calls one image in a GPU texture a "slice" regardless of context.
|
|
29
|
+
*/
|
|
30
|
+
export type TextureSliceData = TextureMipLevelData | TextureMipLevelData[];
|
|
31
|
+
/** Names of cube texture faces */
|
|
32
|
+
export type TextureCubeFace = '+X' | '-X' | '+Y' | '-Y' | '+Z' | '-Z';
|
|
33
|
+
/** Array of cube texture faces. @note: index in array is the face index */
|
|
34
|
+
export declare const TEXTURE_CUBE_FACES: readonly ["+X", "-X", "+Y", "-Y", "+Z", "-Z"];
|
|
35
|
+
/** Map of cube texture face names to face indexes */
|
|
36
|
+
export declare const TEXTURE_CUBE_FACE_MAP: {
|
|
37
|
+
readonly '+X': 0;
|
|
38
|
+
readonly '-X': 1;
|
|
39
|
+
readonly '+Y': 2;
|
|
40
|
+
readonly '-Y': 3;
|
|
41
|
+
readonly '+Z': 4;
|
|
42
|
+
readonly '-Z': 5;
|
|
43
|
+
};
|
|
44
|
+
/** @todo - Define what data type is supported for 1D textures. TextureImageData with height = 1 */
|
|
45
|
+
export type Texture1DData = TextureSliceData;
|
|
46
|
+
/** Texture data can be one or more mip levels */
|
|
47
|
+
export type Texture2DData = TextureSliceData;
|
|
48
|
+
/** 6 face textures */
|
|
49
|
+
export type TextureCubeData = Record<TextureCubeFace, TextureSliceData>;
|
|
50
|
+
/** Array of textures */
|
|
51
|
+
export type Texture3DData = TextureSliceData[];
|
|
52
|
+
/** Array of textures */
|
|
53
|
+
export type TextureArrayData = TextureSliceData[];
|
|
54
|
+
/** Array of 6 face textures */
|
|
55
|
+
export type TextureCubeArrayData = Record<TextureCubeFace, TextureSliceData>[];
|
|
56
|
+
type TextureData = Texture1DData | Texture3DData | TextureArrayData | TextureCubeArrayData | TextureCubeData;
|
|
57
|
+
/** Sync data props */
|
|
58
|
+
export type TextureDataProps = {
|
|
59
|
+
dimension: '1d';
|
|
60
|
+
data: Texture1DData | null;
|
|
61
|
+
} | {
|
|
62
|
+
dimension?: '2d';
|
|
63
|
+
data: Texture2DData | null;
|
|
64
|
+
} | {
|
|
65
|
+
dimension: '3d';
|
|
66
|
+
data: Texture3DData | null;
|
|
67
|
+
} | {
|
|
68
|
+
dimension: '2d-array';
|
|
69
|
+
data: TextureArrayData | null;
|
|
70
|
+
} | {
|
|
71
|
+
dimension: 'cube';
|
|
72
|
+
data: TextureCubeData | null;
|
|
73
|
+
} | {
|
|
74
|
+
dimension: 'cube-array';
|
|
75
|
+
data: TextureCubeArrayData | null;
|
|
76
|
+
};
|
|
77
|
+
/** Async data props */
|
|
78
|
+
export type TextureDataAsyncProps = {
|
|
79
|
+
dimension: '1d';
|
|
80
|
+
data?: Promise<Texture1DData> | Texture1DData | null;
|
|
81
|
+
} | {
|
|
82
|
+
dimension?: '2d';
|
|
83
|
+
data?: Promise<Texture2DData> | Texture2DData | null;
|
|
84
|
+
} | {
|
|
85
|
+
dimension: '3d';
|
|
86
|
+
data?: Promise<Texture3DData> | Texture3DData | null;
|
|
87
|
+
} | {
|
|
88
|
+
dimension: '2d-array';
|
|
89
|
+
data?: Promise<TextureArrayData> | TextureArrayData | null;
|
|
90
|
+
} | {
|
|
91
|
+
dimension: 'cube';
|
|
92
|
+
data?: Promise<TextureCubeData> | TextureCubeData | null;
|
|
93
|
+
} | {
|
|
94
|
+
dimension: 'cube-array';
|
|
95
|
+
data?: Promise<TextureCubeArrayData> | TextureCubeArrayData | null;
|
|
96
|
+
};
|
|
97
|
+
/** Describes data for one sub resource (one mip level of one slice (depth or array layer)) */
|
|
98
|
+
export type TextureSubresource = {
|
|
99
|
+
/** slice (depth or array layer)) */
|
|
100
|
+
z: number;
|
|
101
|
+
/** mip level (0 - max mip levels) */
|
|
102
|
+
mipLevel: number;
|
|
103
|
+
} & ({
|
|
104
|
+
type: 'external-image';
|
|
105
|
+
image: ExternalImage;
|
|
106
|
+
/** @deprecated is this an appropriate place for this flag? */
|
|
107
|
+
flipY?: boolean;
|
|
108
|
+
} | {
|
|
109
|
+
type: 'texture-data';
|
|
110
|
+
data: TextureImageData;
|
|
111
|
+
});
|
|
112
|
+
/** Check if texture data is a typed array */
|
|
113
|
+
export declare function isTextureSliceData(data: TextureData): data is TextureImageData;
|
|
114
|
+
export declare function getFirstMipLevel(layer: TextureSliceData | null): TextureMipLevelData | null;
|
|
115
|
+
export declare function getTextureSizeFromData(props: TextureDataProps): {
|
|
116
|
+
width: number;
|
|
117
|
+
height: number;
|
|
118
|
+
} | null;
|
|
119
|
+
/** Resolve size for a single mip-level datum */
|
|
120
|
+
/** Convert cube face label to depth index */
|
|
121
|
+
export declare function getCubeFaceIndex(face: TextureCubeFace): number;
|
|
122
|
+
/** Convert cube face label to texture slice index. Index can be used with `setTexture2DData()`. */
|
|
123
|
+
export declare function getCubeArrayFaceIndex(cubeIndex: number, face: TextureCubeFace): number;
|
|
124
|
+
/** Experimental: Set multiple mip levels (1D) */
|
|
125
|
+
export declare function getTexture1DSubresources(data: Texture1DData): TextureSubresource[];
|
|
126
|
+
/** Experimental: Set multiple mip levels (2D), optionally at `z` (depth/array index) */
|
|
127
|
+
export declare function getTexture2DSubresources(slice: number, lodData: Texture2DData): TextureSubresource[];
|
|
128
|
+
/** 3D: multiple depth slices, each may carry multiple mip levels */
|
|
129
|
+
export declare function getTexture3DSubresources(data: Texture3DData): TextureSubresource[];
|
|
130
|
+
/** 2D array: multiple layers, each may carry multiple mip levels */
|
|
131
|
+
export declare function getTextureArraySubresources(data: TextureArrayData): TextureSubresource[];
|
|
132
|
+
/** Cube: 6 faces, each may carry multiple mip levels */
|
|
133
|
+
export declare function getTextureCubeSubresources(data: TextureCubeData): TextureSubresource[];
|
|
134
|
+
/** Cube array: multiple cubes (faces×layers), each face may carry multiple mips */
|
|
135
|
+
export declare function getTextureCubeArraySubresources(data: TextureCubeArrayData): TextureSubresource[];
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=texture-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-data.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/texture-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AAG5E,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,4FAA4F;IAC5F,IAAI,EAAE,UAAU,CAAC;IACjB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG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