Skip to content

Commit 0e4aab1

Browse files
Release (#1690)
* fix: support cameras array (#1688) * fix: support cameras array * chore: disable enableDirtyRectangleRenderingDebug by default * fix: set viewport * chore: commit changeset * chore(release): bump version (#1689) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 4c60621 commit 0e4aab1

File tree

17 files changed

+303
-218
lines changed

17 files changed

+303
-218
lines changed

__tests__/demos/3d/force.ts

+68-67
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,7 @@ export async function force(context) {
16421642
const material = new MeshPhongMaterial(device, {
16431643
shininess: 30,
16441644
});
1645+
// material.polygonOffset = true;
16451646

16461647
// @see https://antv.vision/en/docs/specification/language/palette#%E5%88%86%E7%B1%BB%E8%89%B2%E6%9D%BF
16471648
const colorPalette = [
@@ -1683,78 +1684,78 @@ export async function force(context) {
16831684
sphere.style.fill = fill;
16841685
});
16851686

1686-
const icon = new Image({
1687-
style: {
1688-
x: node.x + 310,
1689-
y: node.y + 250,
1690-
z: node.z - 1,
1691-
width: 10,
1692-
height: 10,
1693-
src: 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A*N4ZMS7gHsUIAAAAAAAAAAABkARQnAQ',
1694-
isBillboard: true,
1695-
},
1696-
});
1697-
canvas.appendChild(icon);
1687+
// const icon = new Image({
1688+
// style: {
1689+
// x: node.x + 310,
1690+
// y: node.y + 250,
1691+
// z: node.z - 1,
1692+
// width: 10,
1693+
// height: 10,
1694+
// src: 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A*N4ZMS7gHsUIAAAAAAAAAAABkARQnAQ',
1695+
// isBillboard: true,
1696+
// },
1697+
// });
1698+
// canvas.appendChild(icon);
16981699

1699-
const circle = new Circle({
1700-
style: {
1701-
cx: node.x + 310,
1702-
cy: node.y + 250,
1703-
cz: node.z - 2,
1704-
r: 2.5,
1705-
fill: 'red',
1706-
isBillboard: true,
1707-
},
1708-
});
1709-
canvas.appendChild(circle);
1700+
// const circle = new Circle({
1701+
// style: {
1702+
// cx: node.x + 310,
1703+
// cy: node.y + 250,
1704+
// cz: node.z - 2,
1705+
// r: 2.5,
1706+
// fill: 'red',
1707+
// isBillboard: true,
1708+
// },
1709+
// });
1710+
// canvas.appendChild(circle);
17101711

1711-
const label = new Text({
1712-
style: {
1713-
x: node.x + 310,
1714-
y: node.y + 250,
1715-
z: node.z + 1,
1716-
fontFamily: 'sans-serif',
1717-
text: node.id,
1718-
fontSize: 6,
1719-
fill: 'black',
1720-
isBillboard: true,
1721-
},
1722-
});
1712+
// const label = new Text({
1713+
// style: {
1714+
// x: node.x + 310,
1715+
// y: node.y + 250,
1716+
// z: node.z + 1,
1717+
// fontFamily: 'sans-serif',
1718+
// text: node.id,
1719+
// fontSize: 6,
1720+
// fill: 'black',
1721+
// isBillboard: true,
1722+
// },
1723+
// });
17231724

1724-
const rect = new Rect({
1725-
style: {
1726-
x: node.x + 310,
1727-
y: node.y + 250,
1728-
z: node.z,
1729-
width: label.getBBox().width,
1730-
height: 8,
1731-
fill: 'grey',
1732-
isBillboard: true,
1733-
fillOpacity: 0.6,
1734-
},
1735-
});
1736-
canvas.appendChild(rect);
1737-
canvas.appendChild(label);
1725+
// const rect = new Rect({
1726+
// style: {
1727+
// x: node.x + 310,
1728+
// y: node.y + 250,
1729+
// z: node.z,
1730+
// width: label.getBBox().width,
1731+
// height: 8,
1732+
// fill: 'grey',
1733+
// isBillboard: true,
1734+
// fillOpacity: 0.6,
1735+
// },
1736+
// });
1737+
// canvas.appendChild(rect);
1738+
// canvas.appendChild(label);
17381739
});
17391740

1740-
dataset.links.forEach((edge) => {
1741-
const { source, target } = edge;
1742-
const line = new Line({
1743-
style: {
1744-
x1: source.x + 300,
1745-
y1: source.y + 250,
1746-
z1: source.z,
1747-
x2: target.x + 300,
1748-
y2: target.y + 250,
1749-
z2: target.z,
1750-
stroke: 'black',
1751-
lineWidth: 2,
1752-
opacity: 0.5,
1753-
isBillboard: true, // 始终面向屏幕
1754-
},
1755-
});
1756-
canvas.appendChild(line);
1757-
});
1741+
// dataset.links.forEach((edge) => {
1742+
// const { source, target } = edge;
1743+
// const line = new Line({
1744+
// style: {
1745+
// x1: source.x + 300,
1746+
// y1: source.y + 250,
1747+
// z1: source.z,
1748+
// x2: target.x + 300,
1749+
// y2: target.y + 250,
1750+
// z2: target.z,
1751+
// stroke: 'black',
1752+
// lineWidth: 2,
1753+
// opacity: 0.5,
1754+
// isBillboard: true, // 始终面向屏幕
1755+
// },
1756+
// });
1757+
// canvas.appendChild(line);
1758+
// });
17581759

17591760
// add a directional light into scene
17601761
const light = new DirectionalLight({

__tests__/demos/3d/webar.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ export async function ar(context) {
4949
});
5050

5151
// cube.setOrigin(300, 250, 200);
52-
cube.setPosition(300, 250, 200);
52+
cube.setPosition(300, 250, -200);
5353

5454
canvas.appendChild(cube);
5555

56+
// Called every time a XRSession requests that a new frame be drawn.
57+
// @see https://github.com/immersive-web/webxr-samples/blob/main/immersive-ar-session.html#L173
5658
canvas.addEventListener(CanvasEvent.AFTER_RENDER, () => {
57-
cube.rotate(0, 0, 0);
59+
cube.rotate(0, 0.2, 0);
5860
});
5961

6062
canvas.getConfig().disableHitTesting = true;

__tests__/main.ts

-25
Original file line numberDiff line numberDiff line change
@@ -244,31 +244,6 @@ function createSpecRender(object) {
244244
});
245245
}
246246

247-
if (
248-
selectRenderer.value === 'canvas' &&
249-
renderer.getConfig().enableDirtyRectangleRendering &&
250-
renderer.getConfig().enableDirtyRectangleRenderingDebug
251-
) {
252-
// display dirty rectangle
253-
const $dirtyRectangle = document.createElement('div');
254-
$dirtyRectangle.style.cssText = `
255-
position: absolute;
256-
pointer-events: none;
257-
background: rgba(255, 0, 0, 0.5);
258-
`;
259-
$div.appendChild($dirtyRectangle);
260-
canvas.addEventListener(CanvasEvent.DIRTY_RECTANGLE, (e) => {
261-
const { dirtyRect } = e.detail;
262-
const { x, y, width, height } = dirtyRect;
263-
const dpr = window.devicePixelRatio;
264-
// convert from canvas coords to viewport
265-
$dirtyRectangle.style.left = `${x / dpr}px`;
266-
$dirtyRectangle.style.top = `${y / dpr}px`;
267-
$dirtyRectangle.style.width = `${width / dpr}px`;
268-
$dirtyRectangle.style.height = `${height / dpr}px`;
269-
});
270-
}
271-
272247
container.append($div);
273248
};
274249
};

packages/g-mobile-webgl/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @antv/g-mobile-webgl
22

3+
## 1.0.7
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [6dd79bc4]
8+
- @antv/g-plugin-device-renderer@2.0.7
9+
310
## 1.0.6
411

512
### Patch Changes

packages/g-mobile-webgl/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-mobile-webgl",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "A renderer implemented by WebGL1/2 in mobile environment",
55
"keywords": [
66
"antv",
@@ -45,7 +45,7 @@
4545
"@antv/g-plugin-html-renderer": "workspace:*",
4646
"@antv/g-plugin-image-loader": "workspace:*",
4747
"@antv/g-plugin-mobile-interaction": "workspace:*",
48-
"@antv/g-device-api": "^1.3.6",
48+
"@antv/g-device-api": "^1.6.10",
4949
"@antv/util": "^3.3.5",
5050
"tslib": "^2.5.3"
5151
},

packages/g-plugin-3d/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @antv/g-plugin-3d
22

3+
## 2.0.7
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [6dd79bc4]
8+
- @antv/g-plugin-device-renderer@2.0.7
9+
310
## 2.0.6
411

512
### Patch Changes

packages/g-plugin-3d/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-plugin-3d",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"description": "Provide 3D extension for G",
55
"keywords": [
66
"antv",
@@ -41,7 +41,7 @@
4141
"@antv/g-lite": "workspace:*",
4242
"@antv/g-plugin-device-renderer": "workspace:*",
4343
"@antv/g-shader-components": "workspace:*",
44-
"@antv/g-device-api": "^1.3.6",
44+
"@antv/g-device-api": "^1.6.10",
4545
"gl-matrix": "^3.4.3",
4646
"tslib": "^2.5.3"
4747
},

packages/g-plugin-device-renderer/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @antv/g-plugin-device-renderer
22

3+
## 2.0.7
4+
5+
### Patch Changes
6+
7+
- 6dd79bc4: Support multiple viewport.
8+
39
## 2.0.6
410

511
### Patch Changes

packages/g-plugin-device-renderer/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g-plugin-device-renderer",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"description": "A G plugin of renderer implementation with GPUDevice",
55
"keywords": [
66
"antv",
@@ -43,7 +43,7 @@
4343
"@antv/g-plugin-image-loader": "workspace:*",
4444
"@antv/g-shader-components": "workspace:*",
4545
"@antv/util": "^3.3.5",
46-
"@antv/g-device-api": "^1.3.6",
46+
"@antv/g-device-api": "^1.6.10",
4747
"@webgpu/types": "^0.1.6",
4848
"earcut": "^2.2.3",
4949
"eventemitter3": "^5.0.1",

0 commit comments

Comments
 (0)