@luma.gl/engine 9.3.0-alpha.4 → 9.3.0-alpha.6
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 +8 -4
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +70 -43
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/animation-loop/make-animation-loop.js +7 -1
- package/dist/animation-loop/make-animation-loop.js.map +1 -1
- package/dist/animation-loop/request-animation-frame.d.ts.map +1 -1
- package/dist/animation-loop/request-animation-frame.js +23 -6
- package/dist/animation-loop/request-animation-frame.js.map +1 -1
- package/dist/dist.dev.js +679 -927
- package/dist/dist.min.js +39 -240
- package/dist/dynamic-texture/dynamic-texture.d.ts +3 -3
- package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/dynamic-texture.js +170 -52
- package/dist/dynamic-texture/dynamic-texture.js.map +1 -1
- package/dist/dynamic-texture/texture-data.d.ts +4 -0
- package/dist/dynamic-texture/texture-data.d.ts.map +1 -1
- package/dist/dynamic-texture/texture-data.js +8 -0
- package/dist/dynamic-texture/texture-data.js.map +1 -1
- package/dist/factories/pipeline-factory.d.ts +7 -5
- package/dist/factories/pipeline-factory.d.ts.map +1 -1
- package/dist/factories/pipeline-factory.js +71 -36
- package/dist/factories/pipeline-factory.js.map +1 -1
- package/dist/factories/shader-factory.d.ts +0 -3
- package/dist/factories/shader-factory.d.ts.map +1 -1
- package/dist/factories/shader-factory.js +13 -19
- package/dist/factories/shader-factory.js.map +1 -1
- package/dist/geometries/cone-geometry.d.ts +3 -1
- package/dist/geometries/cone-geometry.d.ts.map +1 -1
- package/dist/geometries/cone-geometry.js.map +1 -1
- package/dist/geometries/cylinder-geometry.d.ts +2 -1
- package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
- package/dist/geometries/cylinder-geometry.js.map +1 -1
- package/dist/index.cjs +683 -922
- package/dist/index.cjs.map +4 -4
- package/dist/model/model.d.ts +3 -1
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +11 -9
- package/dist/model/model.js.map +1 -1
- package/dist/models/billboard-texture-model.d.ts.map +1 -1
- package/dist/models/billboard-texture-model.js +10 -8
- package/dist/models/billboard-texture-model.js.map +1 -1
- package/dist/models/clip-space.js +7 -7
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.d.ts.map +1 -1
- package/dist/modules/picking/index-picking.js +0 -6
- package/dist/modules/picking/index-picking.js.map +1 -1
- package/dist/passes/get-fragment-shader.js +11 -30
- package/dist/passes/get-fragment-shader.js.map +1 -1
- package/dist/passes/shader-pass-renderer.d.ts +0 -2
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +4 -31
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/scenegraph/group-node.d.ts +5 -0
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +12 -0
- package/dist/scenegraph/group-node.js.map +1 -1
- package/dist/scenegraph/model-node.d.ts +2 -2
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/model-node.js.map +1 -1
- package/dist/scenegraph/scenegraph-node.d.ts +1 -1
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +23 -15
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/package.json +2 -2
- package/src/animation-loop/animation-loop.ts +75 -46
- package/src/animation-loop/make-animation-loop.ts +13 -5
- package/src/animation-loop/request-animation-frame.ts +32 -6
- package/src/dynamic-texture/dynamic-texture.ts +226 -65
- package/src/dynamic-texture/texture-data.ts +14 -0
- package/src/factories/pipeline-factory.ts +87 -46
- package/src/factories/shader-factory.ts +16 -20
- package/src/geometries/cone-geometry.ts +6 -1
- package/src/geometries/cylinder-geometry.ts +5 -1
- package/src/model/model.ts +14 -10
- package/src/models/billboard-texture-model.ts +10 -8
- package/src/models/clip-space.ts +7 -7
- package/src/modules/picking/index-picking.ts +0 -6
- package/src/passes/get-fragment-shader.ts +11 -30
- package/src/passes/shader-pass-renderer.ts +4 -33
- package/src/scenegraph/group-node.ts +16 -0
- package/src/scenegraph/model-node.ts +2 -2
- package/src/scenegraph/scenegraph-node.ts +27 -16
- package/dist/dynamic-texture/mipmaps.d.ts +0 -6
- package/dist/dynamic-texture/mipmaps.d.ts.map +0 -1
- package/dist/dynamic-texture/mipmaps.js +0 -441
- package/dist/dynamic-texture/mipmaps.js.map +0 -1
- package/src/dynamic-texture/mipmaps.ts +0 -517
|
@@ -29,8 +29,6 @@ export class ShaderPassRenderer {
|
|
|
29
29
|
shaderInputs: ShaderInputs;
|
|
30
30
|
passRenderers: PassRenderer[];
|
|
31
31
|
swapFramebuffers: SwapFramebuffers;
|
|
32
|
-
/** For rendering to the screen */
|
|
33
|
-
clipSpace: ClipSpace;
|
|
34
32
|
textureModel: BackgroundTextureModel;
|
|
35
33
|
|
|
36
34
|
constructor(device: Device, props: ShaderPassRendererProps) {
|
|
@@ -55,31 +53,6 @@ export class ShaderPassRenderer {
|
|
|
55
53
|
backgroundTexture: this.swapFramebuffers.current.colorAttachments[0].texture
|
|
56
54
|
});
|
|
57
55
|
|
|
58
|
-
this.clipSpace = new ClipSpace(device, {
|
|
59
|
-
source: /* wgsl */ `\
|
|
60
|
-
@group(0) @binding(0) var sourceTexture: texture_2d<f32>;
|
|
61
|
-
@group(0) @binding(1) var sourceTextureSampler: sampler;
|
|
62
|
-
|
|
63
|
-
@fragment
|
|
64
|
-
fn fragmentMain(inputs: FragmentInputs) -> @location(0) vec4<f32> {
|
|
65
|
-
let texCoord: vec2<f32> = inputs.coordinate;
|
|
66
|
-
return textureSample(sourceTexture, sourceTextureSampler, texCoord);
|
|
67
|
-
}
|
|
68
|
-
`,
|
|
69
|
-
|
|
70
|
-
fs: /* glsl */ `\
|
|
71
|
-
#version 300 es
|
|
72
|
-
|
|
73
|
-
uniform sampler2D sourceTexture;
|
|
74
|
-
in vec2 uv;
|
|
75
|
-
out vec4 fragColor;
|
|
76
|
-
|
|
77
|
-
void main() {
|
|
78
|
-
fragColor = texture(sourceTexture, uv);
|
|
79
|
-
}
|
|
80
|
-
`
|
|
81
|
-
});
|
|
82
|
-
|
|
83
56
|
this.passRenderers = props.shaderPasses.map(shaderPass => new PassRenderer(device, shaderPass));
|
|
84
57
|
}
|
|
85
58
|
|
|
@@ -89,7 +62,6 @@ void main() {
|
|
|
89
62
|
subPassRenderer.destroy();
|
|
90
63
|
}
|
|
91
64
|
this.swapFramebuffers.destroy();
|
|
92
|
-
this.clipSpace.destroy();
|
|
93
65
|
this.textureModel.destroy();
|
|
94
66
|
}
|
|
95
67
|
|
|
@@ -112,16 +84,15 @@ void main() {
|
|
|
112
84
|
|
|
113
85
|
const framebuffer = this.device
|
|
114
86
|
.getDefaultCanvasContext()
|
|
115
|
-
|
|
116
|
-
.getCurrentFramebuffer({depthStencilAttachment: false});
|
|
87
|
+
.getCurrentFramebuffer({depthStencilFormat: false});
|
|
117
88
|
const renderPass = this.device.beginRenderPass({
|
|
118
89
|
id: 'shader-pass-renderer-to-screen',
|
|
119
90
|
framebuffer,
|
|
120
91
|
// clearColor: [1, 1, 0, 1],
|
|
121
|
-
clearDepth:
|
|
92
|
+
clearDepth: false
|
|
122
93
|
});
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
94
|
+
this.textureModel.setProps({backgroundTexture: outputTexture});
|
|
95
|
+
this.textureModel.draw(renderPass);
|
|
125
96
|
renderPass.end();
|
|
126
97
|
return true;
|
|
127
98
|
}
|
|
@@ -108,4 +108,20 @@ export class GroupNode extends ScenegraphNode {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
|
|
112
|
+
preorderTraversal(
|
|
113
|
+
visitor: (node: ScenegraphNode, context: {worldMatrix: Matrix4}) => void,
|
|
114
|
+
{worldMatrix = new Matrix4()} = {}
|
|
115
|
+
) {
|
|
116
|
+
const modelMatrix = new Matrix4(worldMatrix).multiplyRight(this.matrix);
|
|
117
|
+
visitor(this, {worldMatrix: modelMatrix});
|
|
118
|
+
|
|
119
|
+
for (const child of this.children) {
|
|
120
|
+
if (child instanceof GroupNode) {
|
|
121
|
+
child.preorderTraversal(visitor, {worldMatrix: modelMatrix});
|
|
122
|
+
} else {
|
|
123
|
+
visitor(child, {worldMatrix: modelMatrix});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
111
127
|
}
|
|
@@ -9,12 +9,12 @@ import {Model} from '../model/model';
|
|
|
9
9
|
export type ModelNodeProps = ScenegraphNodeProps & {
|
|
10
10
|
model: Model;
|
|
11
11
|
managedResources?: any[];
|
|
12
|
-
bounds?: [number
|
|
12
|
+
bounds?: [[number, number, number], [number, number, number]];
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export class ModelNode extends ScenegraphNode {
|
|
16
16
|
readonly model: Model;
|
|
17
|
-
bounds: [number
|
|
17
|
+
bounds: [[number, number, number], [number, number, number]] | null = null;
|
|
18
18
|
managedResources: any[];
|
|
19
19
|
|
|
20
20
|
// TODO - is this used? override callbacks to make sure we call them with this
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
import {Vector3, Matrix4, NumericArray} from '@math.gl/core';
|
|
6
6
|
import {uid} from '../utils/uid';
|
|
7
7
|
|
|
8
|
+
function assert(condition: boolean, message?: string): asserts condition {
|
|
9
|
+
if (!condition) {
|
|
10
|
+
throw new Error(message);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
/** Properties for creating a new Scenegraph */
|
|
9
15
|
export type ScenegraphNodeProps = {
|
|
10
16
|
id?: string;
|
|
@@ -57,19 +63,19 @@ export class ScenegraphNode {
|
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
setPosition(position: any): this {
|
|
60
|
-
|
|
66
|
+
assert(position.length === 3, 'setPosition requires vector argument');
|
|
61
67
|
this.position = position;
|
|
62
68
|
return this;
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
setRotation(rotation: any): this {
|
|
66
|
-
|
|
72
|
+
assert(rotation.length === 3 || rotation.length === 4, 'setRotation requires vector argument');
|
|
67
73
|
this.rotation = rotation;
|
|
68
74
|
return this;
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
setScale(scale: any): this {
|
|
72
|
-
|
|
78
|
+
assert(scale.length === 3, 'setScale requires vector argument');
|
|
73
79
|
this.scale = scale;
|
|
74
80
|
return this;
|
|
75
81
|
}
|
|
@@ -105,19 +111,20 @@ export class ScenegraphNode {
|
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
updateMatrix(): this {
|
|
108
|
-
const pos = this.position;
|
|
109
|
-
const rot = this.rotation;
|
|
110
|
-
const scale = this.scale;
|
|
111
|
-
|
|
112
114
|
this.matrix.identity();
|
|
113
|
-
this.matrix.translate(
|
|
114
|
-
this.
|
|
115
|
-
|
|
115
|
+
this.matrix.translate(this.position);
|
|
116
|
+
if (this.rotation.length === 4) {
|
|
117
|
+
const rotationMatrix = new Matrix4().fromQuaternion(this.rotation);
|
|
118
|
+
this.matrix.multiplyRight(rotationMatrix);
|
|
119
|
+
} else {
|
|
120
|
+
this.matrix.rotateXYZ(this.rotation);
|
|
121
|
+
}
|
|
122
|
+
this.matrix.scale(this.scale);
|
|
123
|
+
|
|
116
124
|
return this;
|
|
117
125
|
}
|
|
118
126
|
|
|
119
|
-
update(
|
|
120
|
-
const {position, rotation, scale} = options;
|
|
127
|
+
update({position, rotation, scale}: {position?: any; rotation?: any; scale?: any} = {}): this {
|
|
121
128
|
if (position) {
|
|
122
129
|
this.setPosition(position);
|
|
123
130
|
}
|
|
@@ -127,7 +134,9 @@ export class ScenegraphNode {
|
|
|
127
134
|
if (scale) {
|
|
128
135
|
this.setScale(scale);
|
|
129
136
|
}
|
|
137
|
+
|
|
130
138
|
this.updateMatrix();
|
|
139
|
+
|
|
131
140
|
return this;
|
|
132
141
|
}
|
|
133
142
|
|
|
@@ -188,18 +197,20 @@ export class ScenegraphNode {
|
|
|
188
197
|
// this.display = props.display;
|
|
189
198
|
// }
|
|
190
199
|
|
|
191
|
-
if (
|
|
200
|
+
if (props?.position) {
|
|
192
201
|
this.setPosition(props.position);
|
|
193
202
|
}
|
|
194
|
-
if (
|
|
203
|
+
if (props?.rotation) {
|
|
195
204
|
this.setRotation(props.rotation);
|
|
196
205
|
}
|
|
197
|
-
if (
|
|
206
|
+
if (props?.scale) {
|
|
198
207
|
this.setScale(props.scale);
|
|
199
208
|
}
|
|
200
209
|
|
|
210
|
+
this.updateMatrix();
|
|
211
|
+
|
|
201
212
|
// Matrix overwrites other props
|
|
202
|
-
if (
|
|
213
|
+
if (props?.matrix) {
|
|
203
214
|
this.setMatrix(props.matrix);
|
|
204
215
|
}
|
|
205
216
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mipmaps.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/mipmaps.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,MAAM,EAAE,OAAO,EAAoC,MAAM,eAAe,CAAC;AAsBtF;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAwBrE"}
|
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
// luma.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Buffer, textureFormatDecoder } from '@luma.gl/core';
|
|
5
|
-
import { Model } from "../model/model.js";
|
|
6
|
-
import { Computation } from "../compute/computation.js";
|
|
7
|
-
const RENDER_DIMENSIONS = [
|
|
8
|
-
'2d',
|
|
9
|
-
'2d-array',
|
|
10
|
-
'cube',
|
|
11
|
-
'cube-array'
|
|
12
|
-
];
|
|
13
|
-
const WORKGROUP_SIZE = {
|
|
14
|
-
x: 4,
|
|
15
|
-
y: 4,
|
|
16
|
-
z: 4
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Generates mip levels from level 0 to the last mip for an existing texture.
|
|
20
|
-
*/
|
|
21
|
-
export function generateMipmap(device, texture) {
|
|
22
|
-
if (texture.mipLevels <= 1) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (device.type !== 'webgpu') {
|
|
26
|
-
throw new Error(`Cannot generate mipmaps on device type "${device.type}". Use generateMipmapsWebGL for WebGL devices.`);
|
|
27
|
-
}
|
|
28
|
-
if (texture.dimension === '3d') {
|
|
29
|
-
generateMipmaps3D(device, texture);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (RENDER_DIMENSIONS.includes(texture.dimension)) {
|
|
33
|
-
generateMipmapsRender(device, texture);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
throw new Error(`Cannot generate mipmaps for texture dimension "${texture.dimension}" with WebGPU.`);
|
|
37
|
-
}
|
|
38
|
-
function generateMipmapsRender(device, texture) {
|
|
39
|
-
validateFormatCapabilities(device, texture, ['render', 'filter'], 'render');
|
|
40
|
-
const colorAttachmentFormat = getColorAttachmentFormat(texture.format, 'render', texture.dimension);
|
|
41
|
-
const viewDimension = texture.dimension;
|
|
42
|
-
const shader = getRenderMipmapWGSL(viewDimension);
|
|
43
|
-
const sampler = device.createSampler({ minFilter: 'linear', magFilter: 'linear' });
|
|
44
|
-
const uniformValues = new Uint32Array(1);
|
|
45
|
-
const uniformsBuffer = device.createBuffer({
|
|
46
|
-
byteLength: 16,
|
|
47
|
-
usage: Buffer.UNIFORM | Buffer.COPY_DST
|
|
48
|
-
});
|
|
49
|
-
const model = new Model(device, {
|
|
50
|
-
source: shader,
|
|
51
|
-
colorAttachmentFormats: [colorAttachmentFormat],
|
|
52
|
-
topology: 'triangle-list',
|
|
53
|
-
vertexCount: 3,
|
|
54
|
-
shaderLayout: {
|
|
55
|
-
attributes: [],
|
|
56
|
-
bindings: [
|
|
57
|
-
{ type: 'sampler', name: 'sourceSampler', group: 0, location: 0 },
|
|
58
|
-
{
|
|
59
|
-
type: 'texture',
|
|
60
|
-
name: 'sourceTexture',
|
|
61
|
-
group: 0,
|
|
62
|
-
location: 1,
|
|
63
|
-
viewDimension,
|
|
64
|
-
sampleType: 'float'
|
|
65
|
-
},
|
|
66
|
-
{ type: 'uniform', name: 'uniforms', group: 0, location: 2 }
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
bindings: {
|
|
70
|
-
sourceSampler: sampler,
|
|
71
|
-
sourceTexture: texture,
|
|
72
|
-
uniforms: uniformsBuffer
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
let sourceWidth = texture.width;
|
|
76
|
-
let sourceHeight = texture.height;
|
|
77
|
-
const layerCount = texture.dimension === '2d' ? 1 : texture.depth;
|
|
78
|
-
try {
|
|
79
|
-
for (let baseMipLevel = 1; baseMipLevel < texture.mipLevels; ++baseMipLevel) {
|
|
80
|
-
validateFormatCapabilities(device, texture, ['render', 'filter'], 'render');
|
|
81
|
-
const sourceMipLevel = baseMipLevel - 1;
|
|
82
|
-
const destinationWidth = Math.max(1, sourceWidth >> 1);
|
|
83
|
-
const destinationHeight = Math.max(1, sourceHeight >> 1);
|
|
84
|
-
const sourceView = texture.createView({
|
|
85
|
-
dimension: viewDimension,
|
|
86
|
-
baseMipLevel: sourceMipLevel,
|
|
87
|
-
mipLevelCount: 1,
|
|
88
|
-
baseArrayLayer: 0,
|
|
89
|
-
arrayLayerCount: texture.depth
|
|
90
|
-
});
|
|
91
|
-
model.setBindings({ sourceTexture: sourceView });
|
|
92
|
-
for (let baseArrayLayer = 0; baseArrayLayer < layerCount; ++baseArrayLayer) {
|
|
93
|
-
uniformValues[0] = baseArrayLayer;
|
|
94
|
-
uniformsBuffer.write(uniformValues);
|
|
95
|
-
const destinationView = texture.createView({
|
|
96
|
-
dimension: '2d',
|
|
97
|
-
baseMipLevel,
|
|
98
|
-
mipLevelCount: 1,
|
|
99
|
-
baseArrayLayer,
|
|
100
|
-
arrayLayerCount: 1
|
|
101
|
-
});
|
|
102
|
-
const framebuffer = device.createFramebuffer({
|
|
103
|
-
colorAttachments: [destinationView]
|
|
104
|
-
});
|
|
105
|
-
const renderPass = device.beginRenderPass({
|
|
106
|
-
id: `mipmap-generation:${texture.format}:${baseMipLevel}:${baseArrayLayer}`,
|
|
107
|
-
framebuffer
|
|
108
|
-
});
|
|
109
|
-
renderPass.setParameters({
|
|
110
|
-
viewport: [0, 0, destinationWidth, destinationHeight, 0, 1],
|
|
111
|
-
scissorRect: [0, 0, destinationWidth, destinationHeight]
|
|
112
|
-
});
|
|
113
|
-
model.draw(renderPass);
|
|
114
|
-
renderPass.end();
|
|
115
|
-
device.submit();
|
|
116
|
-
destinationView.destroy();
|
|
117
|
-
framebuffer.destroy();
|
|
118
|
-
}
|
|
119
|
-
sourceView.destroy();
|
|
120
|
-
sourceWidth = destinationWidth;
|
|
121
|
-
sourceHeight = destinationHeight;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
model.destroy();
|
|
126
|
-
sampler.destroy();
|
|
127
|
-
uniformsBuffer.destroy();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function getColorAttachmentFormat(format, path, dimension) {
|
|
131
|
-
if (textureFormatDecoder.isColor(format)) {
|
|
132
|
-
return format;
|
|
133
|
-
}
|
|
134
|
-
throw new Error(`Cannot run ${path} mipmap generation for ${dimension} texture with format "${format}". ` +
|
|
135
|
-
`Only color textures can be used for this operation. ` +
|
|
136
|
-
`Required capabilities: color. ` +
|
|
137
|
-
`Actual capabilities: color=false.`);
|
|
138
|
-
}
|
|
139
|
-
function generateMipmaps3D(device, texture) {
|
|
140
|
-
validateFormatCapabilities(device, texture, ['filter', 'store'], 'compute');
|
|
141
|
-
const format = getColorAttachmentFormat(texture.format, 'compute', texture.dimension);
|
|
142
|
-
const shaderSource = get3DComputeMipmapWGSL(format);
|
|
143
|
-
const uniformsBuffer = device.createBuffer({
|
|
144
|
-
byteLength: 32,
|
|
145
|
-
usage: Buffer.UNIFORM | Buffer.COPY_DST
|
|
146
|
-
});
|
|
147
|
-
const uniformValues = new Uint32Array(8);
|
|
148
|
-
let sourceWidth = texture.width;
|
|
149
|
-
let sourceHeight = texture.height;
|
|
150
|
-
let sourceDepth = texture.depth;
|
|
151
|
-
try {
|
|
152
|
-
for (let destinationMipLevel = 1; destinationMipLevel < texture.mipLevels; ++destinationMipLevel) {
|
|
153
|
-
validateFormatCapabilities(device, texture, ['filter', 'store'], 'compute');
|
|
154
|
-
const destinationWidth = Math.max(1, sourceWidth >> 1);
|
|
155
|
-
const destinationHeight = Math.max(1, sourceHeight >> 1);
|
|
156
|
-
const destinationDepth = Math.max(1, sourceDepth >> 1);
|
|
157
|
-
uniformValues[0] = sourceWidth;
|
|
158
|
-
uniformValues[1] = sourceHeight;
|
|
159
|
-
uniformValues[2] = sourceDepth;
|
|
160
|
-
uniformValues[3] = destinationWidth;
|
|
161
|
-
uniformValues[4] = destinationHeight;
|
|
162
|
-
uniformValues[5] = destinationDepth;
|
|
163
|
-
uniformValues[6] = 0;
|
|
164
|
-
uniformsBuffer.write(uniformValues);
|
|
165
|
-
const sourceView = texture.createView({
|
|
166
|
-
dimension: '3d',
|
|
167
|
-
baseMipLevel: destinationMipLevel - 1,
|
|
168
|
-
mipLevelCount: 1,
|
|
169
|
-
baseArrayLayer: 0,
|
|
170
|
-
arrayLayerCount: 1
|
|
171
|
-
});
|
|
172
|
-
const destinationView = texture.createView({
|
|
173
|
-
dimension: '3d',
|
|
174
|
-
baseMipLevel: destinationMipLevel,
|
|
175
|
-
mipLevelCount: 1,
|
|
176
|
-
baseArrayLayer: 0,
|
|
177
|
-
arrayLayerCount: 1
|
|
178
|
-
});
|
|
179
|
-
const computation = new Computation(device, {
|
|
180
|
-
source: shaderSource,
|
|
181
|
-
shaderLayout: {
|
|
182
|
-
bindings: [
|
|
183
|
-
{
|
|
184
|
-
type: 'texture',
|
|
185
|
-
name: 'sourceTexture',
|
|
186
|
-
group: 0,
|
|
187
|
-
location: 0,
|
|
188
|
-
viewDimension: '3d',
|
|
189
|
-
sampleType: 'float'
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: 'storage',
|
|
193
|
-
name: 'destinationTexture',
|
|
194
|
-
group: 0,
|
|
195
|
-
location: 1,
|
|
196
|
-
format,
|
|
197
|
-
viewDimension: '3d',
|
|
198
|
-
access: 'write-only'
|
|
199
|
-
},
|
|
200
|
-
{ type: 'uniform', name: 'uniforms', group: 0, location: 2 }
|
|
201
|
-
]
|
|
202
|
-
},
|
|
203
|
-
bindings: {
|
|
204
|
-
sourceTexture: sourceView,
|
|
205
|
-
destinationTexture: destinationView,
|
|
206
|
-
uniforms: uniformsBuffer
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
const workgroupsX = Math.ceil(destinationWidth / WORKGROUP_SIZE.x);
|
|
210
|
-
const workgroupsY = Math.ceil(destinationHeight / WORKGROUP_SIZE.y);
|
|
211
|
-
const workgroupsZ = Math.ceil(destinationDepth / WORKGROUP_SIZE.z);
|
|
212
|
-
const computePass = device.beginComputePass({});
|
|
213
|
-
computation.dispatch(computePass, workgroupsX, workgroupsY, workgroupsZ);
|
|
214
|
-
computePass.end();
|
|
215
|
-
device.submit();
|
|
216
|
-
computation.destroy();
|
|
217
|
-
sourceView.destroy();
|
|
218
|
-
destinationView.destroy();
|
|
219
|
-
sourceWidth = destinationWidth;
|
|
220
|
-
sourceHeight = destinationHeight;
|
|
221
|
-
sourceDepth = destinationDepth;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
finally {
|
|
225
|
-
uniformsBuffer.destroy();
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function validateFormatCapabilities(device, texture, requiredCapabilities, path) {
|
|
229
|
-
const { format, dimension } = texture;
|
|
230
|
-
const capabilities = device.getTextureFormatCapabilities(format);
|
|
231
|
-
const missingCapabilities = requiredCapabilities.filter(capability => !capabilities[capability]);
|
|
232
|
-
if (missingCapabilities.length > 0) {
|
|
233
|
-
const required = requiredCapabilities.join(' + ');
|
|
234
|
-
const actual = requiredCapabilities
|
|
235
|
-
.map(capability => `${capability}=${capabilities[capability]}`)
|
|
236
|
-
.join(', ');
|
|
237
|
-
throw new Error(`Cannot run ${path} mipmap generation for ${dimension} texture with format "${format}". ` +
|
|
238
|
-
`Required capabilities: ${required}. ` +
|
|
239
|
-
`Actual capabilities: ${actual}.`);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function getSourceTextureType(dimension) {
|
|
243
|
-
switch (dimension) {
|
|
244
|
-
case '2d':
|
|
245
|
-
return 'texture_2d<f32>';
|
|
246
|
-
case '2d-array':
|
|
247
|
-
return 'texture_2d_array<f32>';
|
|
248
|
-
case 'cube':
|
|
249
|
-
return 'texture_cube<f32>';
|
|
250
|
-
case 'cube-array':
|
|
251
|
-
return 'texture_cube_array<f32>';
|
|
252
|
-
default:
|
|
253
|
-
throw new Error(`Unsupported render dimension "${dimension}" for mipmap generation.`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
function getRenderMipmapWGSL(dimension) {
|
|
257
|
-
const sourceSnippet = getRenderMipmapSampleSnippet(dimension);
|
|
258
|
-
return `
|
|
259
|
-
struct MipmapUniforms {
|
|
260
|
-
sourceLayer: u32,
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
fn _touchUniform(uniforms: MipmapUniforms) {
|
|
264
|
-
let unusedSourceLayer = uniforms.sourceLayer;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
const faceMat = array(
|
|
268
|
-
mat3x3f(
|
|
269
|
-
0.0, 0.0, -2.0,
|
|
270
|
-
0.0, -2.0, 0.0,
|
|
271
|
-
1.0, 1.0, 1.0
|
|
272
|
-
), // pos-x
|
|
273
|
-
mat3x3f(
|
|
274
|
-
0.0, 0.0, 2.0,
|
|
275
|
-
0.0, -2.0, 0.0,
|
|
276
|
-
-1.0, 1.0, -1.0
|
|
277
|
-
), // neg-x
|
|
278
|
-
mat3x3f(
|
|
279
|
-
2.0, 0.0, 0.0,
|
|
280
|
-
0.0, 0.0, 2.0,
|
|
281
|
-
-1.0, 1.0, -1.0
|
|
282
|
-
), // pos-y
|
|
283
|
-
mat3x3f(
|
|
284
|
-
2.0, 0.0, 0.0,
|
|
285
|
-
0.0, 0.0, -2.0,
|
|
286
|
-
-1.0, -1.0, 1.0
|
|
287
|
-
), // neg-y
|
|
288
|
-
mat3x3f(
|
|
289
|
-
2.0, 0.0, 0.0,
|
|
290
|
-
0.0, -2.0, 0.0,
|
|
291
|
-
-1.0, 1.0, 1.0
|
|
292
|
-
), // pos-z
|
|
293
|
-
mat3x3f(
|
|
294
|
-
-2.0, 0.0, 0.0,
|
|
295
|
-
0.0, -2.0, 0.0,
|
|
296
|
-
1.0, 1.0, -1.0
|
|
297
|
-
) // neg-z
|
|
298
|
-
);
|
|
299
|
-
|
|
300
|
-
struct FragmentInputs {
|
|
301
|
-
@builtin(position) position: vec4f,
|
|
302
|
-
@location(0) texcoord: vec2f
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
struct VertexOutput {
|
|
306
|
-
@builtin(position) position: vec4f,
|
|
307
|
-
@location(0) texcoord: vec2f
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
@group(0) @binding(0) var sourceSampler: sampler;
|
|
311
|
-
@group(0) @binding(1) var sourceTexture: ${getSourceTextureType(dimension)};
|
|
312
|
-
@group(0) @binding(2) var<uniform> uniforms: MipmapUniforms;
|
|
313
|
-
|
|
314
|
-
@vertex
|
|
315
|
-
fn vertexMain(
|
|
316
|
-
@builtin(vertex_index) vertexIndex: u32
|
|
317
|
-
) -> VertexOutput {
|
|
318
|
-
const positions = array(
|
|
319
|
-
vec2f(-1.0, -1.0),
|
|
320
|
-
vec2f(-1.0, 3.0),
|
|
321
|
-
vec2f( 3.0, -1.0)
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
let xy = positions[vertexIndex];
|
|
325
|
-
return VertexOutput(
|
|
326
|
-
vec4f(xy, 0.0, 1.0),
|
|
327
|
-
xy * vec2f(0.5, -0.5) + vec2f(0.5)
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
@fragment
|
|
332
|
-
fn fragmentMain(fsInput: VertexOutput) -> @location(0) vec4f {
|
|
333
|
-
_touchUniform(uniforms);
|
|
334
|
-
return ${sourceSnippet};
|
|
335
|
-
}
|
|
336
|
-
`;
|
|
337
|
-
}
|
|
338
|
-
function getRenderMipmapSampleSnippet(dimension) {
|
|
339
|
-
const layer = 'uniforms.sourceLayer';
|
|
340
|
-
switch (dimension) {
|
|
341
|
-
case '2d':
|
|
342
|
-
return 'textureSampleLevel(sourceTexture, sourceSampler, fsInput.texcoord, 0.0)';
|
|
343
|
-
case '2d-array':
|
|
344
|
-
return ('textureSampleLevel(sourceTexture, sourceSampler, fsInput.texcoord, ' +
|
|
345
|
-
`i32(${layer}), 0.0)`);
|
|
346
|
-
case 'cube':
|
|
347
|
-
return ('textureSampleLevel(sourceTexture, sourceSampler, ' +
|
|
348
|
-
`faceMat[i32(${layer})] * vec3f(fract(fsInput.texcoord), 1.0), 0.0)`);
|
|
349
|
-
case 'cube-array':
|
|
350
|
-
return ('textureSampleLevel(sourceTexture, sourceSampler, ' +
|
|
351
|
-
`faceMat[i32(${layer} % 6u)] * vec3f(fract(fsInput.texcoord), 1.0), ` +
|
|
352
|
-
`i32(${layer} / 6u), 0.0)`);
|
|
353
|
-
default:
|
|
354
|
-
throw new Error(`Unsupported render dimension "${dimension}" for mipmap generation.`);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function get3DComputeMipmapWGSL(format) {
|
|
358
|
-
return `
|
|
359
|
-
struct MipmapUniforms {
|
|
360
|
-
sourceWidth: u32,
|
|
361
|
-
sourceHeight: u32,
|
|
362
|
-
sourceDepth: u32,
|
|
363
|
-
destinationWidth: u32,
|
|
364
|
-
destinationHeight: u32,
|
|
365
|
-
destinationDepth: u32,
|
|
366
|
-
padding: u32,
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
@group(0) @binding(0) var sourceTexture: texture_3d<f32>;
|
|
370
|
-
@group(0) @binding(1) var destinationTexture: texture_storage_3d<${format}, write>;
|
|
371
|
-
@group(0) @binding(2) var<uniform> uniforms: MipmapUniforms;
|
|
372
|
-
|
|
373
|
-
@compute @workgroup_size(${WORKGROUP_SIZE.x}, ${WORKGROUP_SIZE.y}, ${WORKGROUP_SIZE.z})
|
|
374
|
-
fn main(@builtin(global_invocation_id) id: vec3<u32>) {
|
|
375
|
-
if (
|
|
376
|
-
id.x >= uniforms.destinationWidth ||
|
|
377
|
-
id.y >= uniforms.destinationHeight ||
|
|
378
|
-
id.z >= uniforms.destinationDepth
|
|
379
|
-
) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
let sourceBase = id * 2u;
|
|
384
|
-
let sourceX0 = min(sourceBase.x, uniforms.sourceWidth - 1u);
|
|
385
|
-
let sourceY0 = min(sourceBase.y, uniforms.sourceHeight - 1u);
|
|
386
|
-
let sourceZ0 = min(sourceBase.z, uniforms.sourceDepth - 1u);
|
|
387
|
-
|
|
388
|
-
let sourceX1 = min(sourceBase.x + 1u, uniforms.sourceWidth - 1u);
|
|
389
|
-
let sourceY1 = min(sourceBase.y + 1u, uniforms.sourceHeight - 1u);
|
|
390
|
-
let sourceZ1 = min(sourceBase.z + 1u, uniforms.sourceDepth - 1u);
|
|
391
|
-
|
|
392
|
-
var sum = textureLoad(
|
|
393
|
-
sourceTexture,
|
|
394
|
-
vec3<i32>(i32(sourceX0), i32(sourceY0), i32(sourceZ0)),
|
|
395
|
-
0
|
|
396
|
-
);
|
|
397
|
-
sum += textureLoad(
|
|
398
|
-
sourceTexture,
|
|
399
|
-
vec3<i32>(i32(sourceX1), i32(sourceY0), i32(sourceZ0)),
|
|
400
|
-
0
|
|
401
|
-
);
|
|
402
|
-
sum += textureLoad(
|
|
403
|
-
sourceTexture,
|
|
404
|
-
vec3<i32>(i32(sourceX0), i32(sourceY1), i32(sourceZ0)),
|
|
405
|
-
0
|
|
406
|
-
);
|
|
407
|
-
sum += textureLoad(
|
|
408
|
-
sourceTexture,
|
|
409
|
-
vec3<i32>(i32(sourceX1), i32(sourceY1), i32(sourceZ0)),
|
|
410
|
-
0
|
|
411
|
-
);
|
|
412
|
-
sum += textureLoad(
|
|
413
|
-
sourceTexture,
|
|
414
|
-
vec3<i32>(i32(sourceX0), i32(sourceY0), i32(sourceZ1)),
|
|
415
|
-
0
|
|
416
|
-
);
|
|
417
|
-
sum += textureLoad(
|
|
418
|
-
sourceTexture,
|
|
419
|
-
vec3<i32>(i32(sourceX1), i32(sourceY0), i32(sourceZ1)),
|
|
420
|
-
0
|
|
421
|
-
);
|
|
422
|
-
sum += textureLoad(
|
|
423
|
-
sourceTexture,
|
|
424
|
-
vec3<i32>(i32(sourceX0), i32(sourceY1), i32(sourceZ1)),
|
|
425
|
-
0
|
|
426
|
-
);
|
|
427
|
-
sum += textureLoad(
|
|
428
|
-
sourceTexture,
|
|
429
|
-
vec3<i32>(i32(sourceX1), i32(sourceY1), i32(sourceZ1)),
|
|
430
|
-
0
|
|
431
|
-
);
|
|
432
|
-
|
|
433
|
-
textureStore(
|
|
434
|
-
destinationTexture,
|
|
435
|
-
vec3<i32>(i32(id.x), i32(id.y), i32(id.z)),
|
|
436
|
-
vec4<f32>(sum.xyz / 8.0, sum.w / 8.0)
|
|
437
|
-
);
|
|
438
|
-
}
|
|
439
|
-
`;
|
|
440
|
-
}
|
|
441
|
-
//# sourceMappingURL=mipmaps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mipmaps.js","sourceRoot":"","sources":["../../src/dynamic-texture/mipmaps.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAMpC,OAAO,EAAC,MAAM,EAA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