Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting depthTestAgainstTerrain=false and viewer.resolutionScale=window.devicePixelRatio; can lead to severe performance issues #12392

Open
catnuko opened this issue Dec 25, 2024 · 2 comments

Comments

@catnuko
Copy link

catnuko commented Dec 25, 2024

What happened?

When loading any Cesium3DTileset, setting viewer.scene.globe.depthTestAgainstTerrain = false; can cause the GPU to run at full load. If you also set if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) { viewer.resolutionScale = window.devicePixelRatio; }, you may experience Serious performance issues.This issue started with version 1.121.

Reproduction steps

const viewer = new Cesium.Viewer("cesiumContainer");
viewer.scene.debugShowFramesPerSecond = true;

viewer.scene.globe.depthTestAgainstTerrain = false;
if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
    viewer.resolutionScale = window.devicePixelRatio;
}

// Set the initial camera view to look at Manhattan
const initialPosition = Cesium.Cartesian3.fromDegrees(
    -74.01881302800248,
    40.69114333714821,
    753,
);
const initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees(
    21.27879878293835,
    -21.34390550872461,
    0.0716951918898415,
);
viewer.scene.camera.setView({
    destination: initialPosition,
    orientation: initialOrientation,
    endTransform: Cesium.Matrix4.IDENTITY,
});

// Load the NYC buildings tileset
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(75343);
viewer.scene.primitives.add(tileset);
Snipaste_2024-12-25_16-19-23 open the sandcastle example and click "open in new window" button Snipaste_2024-12-25_16-33-30

Sandcastle example

https://sandcastle.cesium.com/#c=bVPbbuIwEP0Vi6cgtc4VkrQUbQVbLVJvKmilSryYZACrjo1sB9qu+u87SdzdXuAFj2fOnDNznEJJY8mewwE0uSASDmQChtcV/d3eecte0cYTJS3jEvSy1z9fyg5BTQESaAmrejPfqsOVZhWYe9BzKJQssaHVNWD5F8BGqFUD29ntAoy93GBnYxegNR4QtWbCNDC+Jp6TcwXM1hqmYKGwXElq6t1OaWtmFdvAA8gSNJebe/4MglkovX6f/FlKgj9HrcEoUTfYecEEIM2By1IdUMeeF9AiHxjmkfitkez7ZA6W2C0QLrnlTJAC59Os7UisIkKpJ8IsuWFyy6xlCCrahbr6e2V4Q4hcbowJ0xZPTMZ0rVU1hY0GMF4n9DRNaBBmWRgHURYEUZKddIkkoMM8DJM4jtMwyaLQ3aeDGE+NH59o7zQHdMsxf/D0F7CyXZIttg9KiCMaopBGaZbmWZpFeZzFA0d1iok4ifNgMAiyNEqG7xoCGqThMB+EOSrPsyQcOEmfHO8WRw3Y5l15zpkSzeeyFXr2dWeuvfo/y9mR+VwV2r/QTJq10tXZ+7Q3zGr+nNDZ9OftYrZ4xNq3/rlz9lqxsrX29nFCVjUXzWIMsVwAinxfqAtxi+zAuP3nYvsXTxddul3jTMlLg8Gs9NCWJP62gp3mFcrfg6GsLD3Xun/eO+mNjH0RMO5mIeQHr5qnTWotPEp9C9WuedPGX9XFE9IVxjTdm9KR/xE6Kvme8PLiyEdLCsGMwcy6FmLOX2HZG498rP8GFap9JHd70IK9NGXbcHzdXVJKRz6Gx5FWKbFi+kvnvw

Environment

Browser:Edge
CesiumJS Version:1.124
Operating System:window 10

@wewindy
Copy link
Contributor

wewindy commented Jan 1, 2025

不妨贴一下你的硬件配置,也许是高分屏本身就比较吃资源

@catnuko
Copy link
Author

catnuko commented Jan 2, 2025

不妨贴一下你的硬件配置,也许是高分屏本身就比较吃资源

Snipaste_2025-01-02_15-32-31

我的显示器分辨率是4K,不过我觉得这可能是新版本引入的Bug,因为

  1. 1.120版的Cesium没这个问题
  2. 我换了两台电脑还会出现这个问题

你按步骤能复现吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants