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

Merged point cloud disappears when viewing from certain angles #9

Open
iannesbitt opened this issue Apr 13, 2023 · 6 comments
Open

Comments

@iannesbitt
Copy link
Contributor

Appeared after solution to #8, so perhaps related to force_universal_merger=True

@iannesbitt
Copy link
Contributor Author

Interesting that this does not happen with test dataset (see image in #10)

@iannesbitt
Copy link
Contributor Author

iannesbitt commented May 5, 2023

This looks like it may be similar to CesiumGS/cesium#5524 but it appears that the video describing the issue has been taken down.

The issue appears to occur when the camera enters the bounding box of a child tileset. As soon as the camera enters the bounding box, the tileset becomes invisible. Rotating the camera ~180º to look roughly south (dataset is in Nome, AK) and changing the viewing angle to more horizontal makes the tileset reappear and begin loading at the appropriate zoom level. So in effect, there is only a narrow slice of angles at which the tileset can be viewed up close, otherwise it must be viewed from far away.

Running the 3d-tiles-validator on the tilesets involved yields no errors:

% npx 3d-tiles-validator --tilesetsDirectory 3dtiles/
...
Validated 248 files
    0 files with errors
    0 files with warnings
    0 files with infos

Stranger still, this effect does not appear when pointing cesiumjs at the subdirectory tilesets (e.g. 3dtiles/Site7/tileset.json), only the merged root directory tileset (e.g. 3dtiles/tileset.json). Changing the root "refine": properties in the root tileset.json file does not alleviate the error. I suspect the issue is related to the merger process somehow, but have not yet been able to confirm.

Will be writing up an issue and/or forum post for Cesium and/or Oslandia soon.

@iannesbitt
Copy link
Contributor Author

A temporary solution is to add tilesets individually rather than merge, then add and zoom to the master merged tileset with show: false like so:

  const sites = [
    "3dtiles/Site1/tileset.json",
    "3dtiles/Site3/tileset.json",
    "3dtiles/Site4/tileset.json",
    "3dtiles/Site5/tileset.json",
    "3dtiles/Site6/tileset.json",
    "3dtiles/Site7/tileset.json",
    "3dtiles/Site8/tileset.json",
    "3dtiles/Site8_2/tileset.json",
    "3dtiles/SiteV_1/tileset.json",
    "3dtiles/SiteV_2/tileset.json",
    "3dtiles/Site_9/tileset.json",
  ]; // could also be generated programatically
  try {
    for (const site of sites) {
      var tileset = new Cesium.Cesium3DTileset({
        url: site,
      });
      tileset.style = new Cesium.Cesium3DTileStyle({
          pointSize: 2,
          show: true,
          scaleByDistance: 'vec4(1.5e2, 2.0, 1.5e7, 0.5)',
        });
      scene.primitives.add(tileset);
    }
    var master = new Cesium.Cesium3DTileset({
      url: '3dtiles/tileset.json',
    });
    master.style = new Cesium.Cesium3DTileStyle({
        show: false,
      });
    scene.primitives.add(master);
    await viewer.zoomTo(master);

@iannesbitt
Copy link
Contributor Author

iannesbitt commented May 11, 2023

I have a hunch (untested) that this has to do with erroneous values introduced in the tiling process that make Cesium think it should be loading/unloading certain things when it should not. Not sure how this might be resolved except to try to understand and modify the merge process.

@iannesbitt
Copy link
Contributor Author

The reason for this hunch is best shown here:
image

@iannesbitt
Copy link
Contributor Author

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

No branches or pull requests

1 participant