Skip to content

[PointCloudShading] when eyeDomeLighting is turned on, the page will flicker and changes to black. #12535

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

Open
yangshub opened this issue Mar 24, 2025 · 3 comments
Labels
needs feedback On hold until additional info is supplied needs triage type - bug

Comments

@yangshub
Copy link

What happened?

When the point cloud data is initially loaded on the page, and eyeDomeLighting is turned on, the page will flicker and changes to black.
This issue didn't occur in version 120, but it appeared in both versions 124 and 125.

Image

Image

let tilesetPromise = Cesium.Cesium3DTileset.fromUrl('*****', {})
tilesetPromise .then(tileset => {
   tileset.pointCloudShading.eyeDomeLighting = true
    viewer.scene.primitives.add(tileset )
})

Reproduction steps

...

Sandcastle example

No response

Environment

Browser: Chrome
CesiumJS Version: 1.124, 1.25
Operating System: win 10 gtx3060 12g 11-i7

@yangshub
Copy link
Author

I loaded over 20 sets of point cloud data of transmission lines at one time.

@ggetz
Copy link
Contributor

ggetz commented Apr 7, 2025

@yangshub

  1. Does this still occur in the most recent releases of CesiumJS?
  2. Would you be able to include a Sandcastle example that replicates the issue? That would help us give us more context to determine the issue.

@ggetz ggetz added the needs feedback On hold until additional info is supplied label Apr 7, 2025
@yangshub
Copy link
Author

@ggetz
Here is all the test code. the Data on my local device. This issue still occurs in version 128.
When the point cloud is rendered for the first time, the screen will flicker briefly.

Image

Image

Cesium.Ion.defaultAccessToken =
       "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MWEyNWI4NS02ZWVmLTQyZTEtOTRjZi02NjljOWNhOWViNGEiLCJpZCI6MTQwNTg1LCJpYXQiOjE3MzYzNjg4OTR9.rIAEC387JLBYOPt3w1fliKTWZgTGCQYJlG8o5HJsTwY";
     const viewer = new Cesium.Viewer("cesiumContainer");

     const tiles = [
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
       "http://192.168.10.128:42225/distribution/model/klwsoeqnw5ot/tileset.json",
     ];

     function updateOffset(tileset, index) {
       let offset = new Cesium.Cartesian3(0, 280 * index, 0);
       let modelMatrix = tileset.root.transform;
       let worlOffset = Cesium.Matrix4.multiplyByPoint(
         modelMatrix,
         offset,
         new Cesium.Cartesian3(),
       );
       let newModelMatrix = new Cesium.Matrix4();
       Cesium.Matrix4.setTranslation(modelMatrix, worlOffset, newModelMatrix);
       tileset.root.transform = newModelMatrix;
     }

     function getStyle() {
       return new Cesium.Cesium3DTileStyle({
         show: "true",
         color: "color('#ffffff')",
         pointSize: 3,
       });
     }

     function setPointCloudShading(pointCloudShading) {
       pointCloudShading.eyeDomeLighting = true;
       pointCloudShading.geometricErrorScale = 0.1;
       pointCloudShading.eyeDomeLightingStrength = 2.5;
       pointCloudShading.eyeDomeLightingRadius = 2.2;
       pointCloudShading.attenuation = true;
       pointCloudShading.maximumAttenuation = 2;
       pointCloudShading.baseResolution = 0.05;
       pointCloudShading.usePointSize = true;
       pointCloudShading.circlePoint = true;
     }

     async function loadTileset() {
       for (let i = 0; i < 20; i++) {
         const tileset = await Cesium.Cesium3DTileset.fromUrl(tiles[i], {});
         viewer.scene.primitives.add(tileset);
         tileset.style = getStyle();
         const { pointCloudShading } = tileset;
         setPointCloudShading(pointCloudShading);
         console.log(tileset);
         if (i === 0) {
           viewer.flyTo(tileset);
         }

         setTimeout(() => {
           updateOffset(tileset, i);
         }, 2000);
       }
     }

     try {
       loadTileset();
     } catch (error) {
       console.log(`Error loading tileset: ${error}`);
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs feedback On hold until additional info is supplied needs triage type - bug
Projects
None yet
Development

No branches or pull requests

2 participants