@luma.gl/engine 9.0.0-beta.1 → 9.0.0-beta.10
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/key-frames.js +54 -54
- package/dist/animation/timeline.d.ts.map +1 -1
- package/dist/animation/timeline.js +95 -100
- package/dist/animation-loop/animation-loop-template.d.ts +1 -1
- package/dist/animation-loop/animation-loop-template.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop-template.js +19 -5
- package/dist/animation-loop/animation-loop.d.ts +2 -2
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +433 -356
- package/dist/animation-loop/animation-props.d.ts +2 -2
- package/dist/animation-loop/animation-props.d.ts.map +1 -1
- package/dist/animation-loop/animation-props.js +0 -1
- package/dist/animation-loop/make-animation-loop.d.ts +2 -2
- package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/make-animation-loop.js +28 -24
- package/dist/computation.d.ts +95 -0
- package/dist/computation.d.ts.map +1 -0
- package/dist/computation.js +248 -0
- package/dist/debug/copy-texture-to-image.d.ts.map +1 -1
- package/dist/debug/copy-texture-to-image.js +39 -42
- package/dist/debug/debug-framebuffer.d.ts.map +1 -1
- package/dist/debug/debug-framebuffer.js +43 -40
- package/dist/debug/debug-shader-layout.js +24 -25
- package/dist/debug/pixel-data-utils.d.ts.map +1 -1
- package/dist/debug/pixel-data-utils.js +34 -36
- package/dist/dist.dev.js +2538 -3027
- package/dist/dist.min.js +102 -0
- package/dist/geometries/cone-geometry.d.ts +1 -1
- package/dist/geometries/cone-geometry.d.ts.map +1 -1
- package/dist/geometries/cone-geometry.js +11 -17
- package/dist/geometries/cube-geometry.d.ts +1 -1
- package/dist/geometries/cube-geometry.d.ts.map +1 -1
- package/dist/geometries/cube-geometry.js +190 -61
- package/dist/geometries/cylinder-geometry.d.ts +1 -1
- package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
- package/dist/geometries/cylinder-geometry.js +9 -14
- package/dist/geometries/ico-sphere-geometry.d.ts +1 -1
- package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/ico-sphere-geometry.js +141 -160
- package/dist/geometries/plane-geometry.d.ts +1 -1
- package/dist/geometries/plane-geometry.d.ts.map +1 -1
- package/dist/geometries/plane-geometry.js +92 -110
- package/dist/geometries/sphere-geometry.d.ts +1 -1
- package/dist/geometries/sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/sphere-geometry.js +76 -95
- package/dist/geometries/truncated-cone-geometry.d.ts +1 -1
- package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
- package/dist/geometries/truncated-cone-geometry.js +99 -117
- package/dist/geometry/geometry-table.d.ts.map +1 -1
- package/dist/geometry/geometry-table.js +3 -1
- package/dist/geometry/geometry-utils.js +35 -32
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +80 -71
- package/dist/geometry/gpu-geometry.d.ts +1 -1
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-geometry.js +79 -99
- package/dist/geometry/gpu-table.js +41 -1
- package/dist/index.cjs +725 -409
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +43 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/lib/clip-space.d.ts +2 -2
- package/dist/lib/clip-space.d.ts.map +1 -1
- package/dist/lib/clip-space.js +28 -34
- package/dist/lib/pipeline-factory.d.ts +13 -14
- package/dist/lib/pipeline-factory.d.ts.map +1 -1
- package/dist/lib/pipeline-factory.js +86 -85
- package/dist/lib/shader-factory.d.ts +17 -0
- package/dist/lib/shader-factory.d.ts.map +1 -0
- package/dist/lib/shader-factory.js +46 -0
- package/dist/model/model.d.ts +59 -46
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +635 -411
- package/dist/scenegraph/group-node.d.ts +1 -1
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +73 -83
- package/dist/scenegraph/model-node.d.ts +3 -3
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/model-node.js +31 -24
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +136 -124
- package/dist/shader-inputs.d.ts.map +1 -1
- package/dist/shader-inputs.js +99 -58
- package/dist/transform/buffer-transform.d.ts +1 -1
- package/dist/transform/buffer-transform.d.ts.map +1 -1
- package/dist/transform/buffer-transform.js +65 -57
- package/dist/transform/texture-transform.d.ts +1 -1
- package/dist/transform/texture-transform.d.ts.map +1 -1
- package/dist/transform/texture-transform.js +109 -114
- package/dist.min.js +3 -271
- package/package.json +10 -9
- package/src/animation/timeline.ts +20 -20
- package/src/animation-loop/animation-loop-template.ts +10 -8
- package/src/animation-loop/animation-loop.ts +20 -10
- package/src/animation-loop/animation-props.ts +1 -1
- package/src/animation-loop/make-animation-loop.ts +17 -8
- package/src/computation.ts +346 -0
- package/src/debug/copy-texture-to-image.ts +9 -11
- package/src/debug/debug-framebuffer.ts +16 -3
- package/src/debug/debug-shader-layout.ts +1 -1
- package/src/debug/pixel-data-utils.ts +3 -6
- package/src/geometries/cube-geometry.ts +17 -13
- package/src/geometries/ico-sphere-geometry.ts +1 -1
- package/src/geometries/plane-geometry.ts +1 -1
- package/src/geometries/sphere-geometry.ts +1 -1
- package/src/geometries/truncated-cone-geometry.ts +2 -1
- package/src/geometry/geometry-table.ts +9 -6
- package/src/geometry/geometry-utils.ts +16 -0
- package/src/geometry/geometry.ts +9 -6
- package/src/geometry/gpu-geometry.ts +18 -11
- package/src/index.ts +4 -1
- package/src/lib/clip-space.ts +16 -19
- package/src/lib/pipeline-factory.ts +71 -64
- package/src/lib/shader-factory.ts +57 -0
- package/src/model/model.ts +255 -146
- package/src/scenegraph/group-node.ts +14 -10
- package/src/scenegraph/model-node.ts +2 -2
- package/src/scenegraph/scenegraph-node.ts +2 -2
- package/src/shader-inputs.ts +19 -12
- package/src/transform/buffer-transform.ts +16 -8
- package/src/transform/texture-transform.ts +14 -15
- package/dist/animation/key-frames.js.map +0 -1
- package/dist/animation/timeline.js.map +0 -1
- package/dist/animation-loop/animation-loop-template.js.map +0 -1
- package/dist/animation-loop/animation-loop.js.map +0 -1
- package/dist/animation-loop/animation-props.js.map +0 -1
- package/dist/animation-loop/make-animation-loop.js.map +0 -1
- package/dist/debug/copy-texture-to-image.js.map +0 -1
- package/dist/debug/debug-framebuffer.js.map +0 -1
- package/dist/debug/debug-shader-layout.js.map +0 -1
- package/dist/debug/pixel-data-utils.js.map +0 -1
- package/dist/geometries/cone-geometry.js.map +0 -1
- package/dist/geometries/cube-geometry.js.map +0 -1
- package/dist/geometries/cylinder-geometry.js.map +0 -1
- package/dist/geometries/ico-sphere-geometry.js.map +0 -1
- package/dist/geometries/plane-geometry.js.map +0 -1
- package/dist/geometries/sphere-geometry.js.map +0 -1
- package/dist/geometries/truncated-cone-geometry.js.map +0 -1
- package/dist/geometry/geometry-table.js.map +0 -1
- package/dist/geometry/geometry-utils.js.map +0 -1
- package/dist/geometry/geometry.js.map +0 -1
- package/dist/geometry/gpu-geometry.js.map +0 -1
- package/dist/geometry/gpu-table.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/clip-space.js.map +0 -1
- package/dist/lib/pipeline-factory.js.map +0 -1
- package/dist/model/model.js.map +0 -1
- package/dist/scenegraph/group-node.js.map +0 -1
- package/dist/scenegraph/model-node.js.map +0 -1
- package/dist/scenegraph/scenegraph-node.js.map +0 -1
- package/dist/shader-inputs.js.map +0 -1
- package/dist/transform/buffer-transform.js.map +0 -1
- package/dist/transform/texture-transform.js.map +0 -1
|
@@ -1,28 +1,27 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/**
|
|
5
|
+
* Extracts a table suitable for `console.table()` from a shader layout to assist in debugging.
|
|
6
|
+
* @param layout shader layout
|
|
7
|
+
* @param name app should provide the most meaningful name, usually the model or pipeline name / id.
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
1
10
|
export function getDebugTableForShaderLayout(layout, name) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
'No attributes or varyings': {
|
|
8
|
-
[header]: 'N/A'
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
for (const attributeDeclaration of layout.attributes) {
|
|
13
|
-
if (attributeDeclaration) {
|
|
14
|
-
const glslDeclaration = `${attributeDeclaration.location} ${attributeDeclaration.name}: ${attributeDeclaration.type}`;
|
|
15
|
-
table[`in ${glslDeclaration}`] = {
|
|
16
|
-
[header]: attributeDeclaration.stepMode || 'vertex'
|
|
17
|
-
};
|
|
11
|
+
const table = {};
|
|
12
|
+
const header = 'Values'; // '`Shader Layout for ${name}`;
|
|
13
|
+
if (layout.attributes.length === 0 && !layout.varyings?.length) {
|
|
14
|
+
return { 'No attributes or varyings': { [header]: 'N/A' } };
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
for (const attributeDeclaration of layout.attributes) {
|
|
17
|
+
if (attributeDeclaration) {
|
|
18
|
+
const glslDeclaration = `${attributeDeclaration.location} ${attributeDeclaration.name}: ${attributeDeclaration.type}`;
|
|
19
|
+
table[`in ${glslDeclaration}`] = { [header]: attributeDeclaration.stepMode || 'vertex' };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
for (const varyingDeclaration of layout.varyings || []) {
|
|
23
|
+
const glslDeclaration = `${varyingDeclaration.location} ${varyingDeclaration.name}`;
|
|
24
|
+
table[`out ${glslDeclaration}`] = { [header]: JSON.stringify(varyingDeclaration.accessor) };
|
|
25
|
+
}
|
|
26
|
+
return table;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=debug-shader-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixel-data-utils.d.ts","sourceRoot":"","sources":["../../src/debug/pixel-data-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pixel-data-utils.d.ts","sourceRoot":"","sources":["../../src/debug/pixel-data-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,GAAG,IAAI,CAgBP;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAAG;IACvF,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAaA"}
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/**
|
|
5
|
+
* Flip rows (can be used on arrays returned from `Framebuffer.readPixels`)
|
|
6
|
+
* https: *stackoverflow.com/questions/41969562/
|
|
7
|
+
* how-can-i-flip-the-result-of-webglrenderingcontext-readpixels
|
|
8
|
+
* @param param0
|
|
9
|
+
*/
|
|
1
10
|
export function flipRows(options) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
data.set(tempBuffer, bottomOffset);
|
|
17
|
-
}
|
|
11
|
+
const { data, width, height, bytesPerPixel = 4, temp } = options;
|
|
12
|
+
const bytesPerRow = width * bytesPerPixel;
|
|
13
|
+
// make a temp buffer to hold one row
|
|
14
|
+
const tempBuffer = temp || new Uint8Array(bytesPerRow);
|
|
15
|
+
for (let y = 0; y < height / 2; ++y) {
|
|
16
|
+
const topOffset = y * bytesPerRow;
|
|
17
|
+
const bottomOffset = (height - y - 1) * bytesPerRow;
|
|
18
|
+
// make copy of a row on the top half
|
|
19
|
+
tempBuffer.set(data.subarray(topOffset, topOffset + bytesPerRow));
|
|
20
|
+
// copy a row from the bottom half to the top
|
|
21
|
+
data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);
|
|
22
|
+
// copy the copy of the top half row to the bottom half
|
|
23
|
+
data.set(tempBuffer, bottomOffset);
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
export function scalePixels(options) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
for (let c = 0; c < 4; c++) {
|
|
31
|
-
newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];
|
|
32
|
-
}
|
|
27
|
+
const { data, width, height } = options;
|
|
28
|
+
const newWidth = Math.round(width / 2);
|
|
29
|
+
const newHeight = Math.round(height / 2);
|
|
30
|
+
const newData = new Uint8Array(newWidth * newHeight * 4);
|
|
31
|
+
for (let y = 0; y < newHeight; y++) {
|
|
32
|
+
for (let x = 0; x < newWidth; x++) {
|
|
33
|
+
for (let c = 0; c < 4; c++) {
|
|
34
|
+
newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
data: newData,
|
|
37
|
-
width: newWidth,
|
|
38
|
-
height: newHeight
|
|
39
|
-
};
|
|
38
|
+
return { data: newData, width: newWidth, height: newHeight };
|
|
40
39
|
}
|
|
41
|
-
//# sourceMappingURL=pixel-data-utils.js.map
|