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

Tiles disappearing while zooming #5524

Closed
Prior99 opened this issue Jun 22, 2017 · 11 comments
Closed

Tiles disappearing while zooming #5524

Prior99 opened this issue Jun 22, 2017 · 11 comments

Comments

@Prior99
Copy link

Prior99 commented Jun 22, 2017

When zooming in and out of pointclouds the tiles seem to be requested in a very
strange manner. Instead of loading them step-by-step, layer-by-layer, at some
points it skips from the huge tiles right down to the detailed view, without
even requesting the intermediate tiles. We have developed a minimal example
with a checkered field, where you can clearly see the described issue. This issue
has already been posted on the Cesium mailing list
here.

I created a video showing the problem on a minimal example.

Here's the site.

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Minimal Example</title>
        <script src="/3rdparty/cesium-3d-tiles/Build/Cesium/Cesium.js"></script>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <link rel="stylesheet" href="/static/style.css">
        <link rel="stylesheet" href="/static/cesium_viewer.css">
        <link rel="stylesheet" href="/3rdparty/cesium-3d-tiles/Build/Cesium/Widgets/widgets.css">
    </head>
    <body>
        <div id="cesiumContainer"></div>
        <script src="/static/cesium_viewer.js"></script>
    </body>
</html>

Here's the JavaScript code.

const imageryProviders = Cesium.createDefaultImageryProviderViewModels();
const terrainProviders = Cesium.createDefaultTerrainProviderViewModels();

const viewer = new Cesium.Viewer("cesiumContainer", {
    imageryProviderViewModels: imageryProviders,
    selectedImageryProviderViewModel: imageryProviders[6],
    terrainProviderViewModels: terrainProviders,
    selectedTerrainProviderViewModel: terrainProviders[1],
    animation: false,
    timeline: false
});

viewer.extend(Cesium.viewerCesiumInspectorMixin);
viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);

const createTileset = (options) => {
    options = options || {};
    let url = `http://${location.hostname}:8000`;
    let tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url }));
    tileset.style = new Cesium.Cesium3DTileStyle({
        pointSize: 2
    });
    return tileset;
};

let tileset = createTileset();

window.viewer = viewer;  // For debugging.
window.tileset = tileset;

tileset.readyPromise.then(function() {
    const bounding = tileset._root._boundingVolume;
    const center = bounding.boundingSphere.center;
    const cart = Cesium.Ellipsoid.WGS84.cartesianToCartographic(center);

    const dest = Cesium.Cartesian3.fromDegrees(
        cart.longitude * (180 / Math.PI),
        cart.latitude * (180 / Math.PI),
        bounding._boundingSphere.radius * 2.2
    );

    viewer.camera.setView({ destination: dest });
});

That's out tileset.json

{
  "asset": {
    "version": "0.0"
  },
  "geometricError": 430.8869380063768,
  "refine": "ADD",
  "root": {
    "boundingVolume": {
      "region": [
        -2.1203785848946817,
        0,
        -2.120065856904983,
        0.00031484337491542773,
        0,
        20
      ]
    },
    "children": [
      {
        "boundingVolume": {
          "region": [
            -2.1202222199393623,
            0,
            -2.1200658540178345,
            0.00015742168750865242,
            0,
            20
          ]
        },
        "content": {
          "url": "1.pnts"
        },
        "geometricError": 215.4434690031884
      },
      {
        "boundingVolume": {
          "region": [
            -2.12037858586089,
            0.00015741780433129065,
            -2.1202222237965445,
            0.0003148394955892518,
            0,
            20
          ]
        },
        "children": [
          {
            "boundingVolume": {
              "region": [
                -2.120300403623587,
                0.00015741877656984507,
                -2.120222222109027,
                0.00023612962173654985,
                0,
                20
              ]
            },
            "children": [
              {
                "boundingVolume": {
                  "region": [
                    -2.120261312866606,
                    0.0001967740778981455,
                    -2.120222222109027,
                    0.00023612962173654985,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "54.pnts"
                },
                "geometricError": 53.8608672507971
              },
              {
                "boundingVolume": {
                  "region": [
                    -2.120300403623587,
                    0.00015741877656984507,
                    -2.120261312866606,
                    0.0001967740778981455,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "56.pnts"
                },
                "geometricError": 53.8608672507971
              }
            ],
            "content": {
              "url": "13.pnts"
            },
            "geometricError": 107.7217345015942
          },
          {
            "boundingVolume": {
              "region": [
                -2.120300404830152,
                0.0002361281648228883,
                -2.1202222237965445,
                0.0003148394955892518,
                0,
                20
              ]
            },
            "children": [
              {
                "boundingVolume": {
                  "region": [
                    -2.1202613143137667,
                    0.00027548370901278265,
                    -2.1202222237965445,
                    0.0003148394955892518,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "58.pnts"
                },
                "geometricError": 53.8608672507971
              },
              {
                "boundingVolume": {
                  "region": [
                    -2.120300404830152,
                    0.0002361281648228883,
                    -2.1202613143137667,
                    0.00027548370901278265,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "60.pnts"
                },
                "geometricError": 53.8608672507971
              }
            ],
            "content": {
              "url": "14.pnts"
            },
            "geometricError": 107.7217345015942
          },
          {
            "boundingVolume": {
              "region": [
                -2.1203785870686502,
                0.00023612670646504236,
                -2.1203004065193425,
                0.0003148375530376764,
                0,
                20
              ]
            },
            "children": [
              {
                "boundingVolume": {
                  "region": [
                    -2.120339496794415,
                    0.00027548200843771934,
                    -2.1203004065193425,
                    0.0003148375530376764,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "62.pnts"
                },
                "geometricError": 53.8608672507971
              },
              {
                "boundingVolume": {
                  "region": [
                    -2.1203785870686502,
                    0.00023612670646504236,
                    -2.120339496794415,
                    0.00027548200843771934,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "64.pnts"
                },
                "geometricError": 53.8608672507971
              }
            ],
            "content": {
              "url": "15.pnts"
            },
            "geometricError": 107.7217345015942
          },
          {
            "boundingVolume": {
              "region": [
                -2.12037858586089,
                0.00015741780433129065,
                -2.120300404830152,
                0.0002361281648228883,
                0,
                20
              ]
            },
            "children": [
              {
                "boundingVolume": {
                  "region": [
                    -2.12033949534582,
                    0.00019677286320168592,
                    -2.120300404830152,
                    0.0002361281648228883,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "66.pnts"
                },
                "geometricError": 53.8608672507971
              },
              {
                "boundingVolume": {
                  "region": [
                    -2.12037858586089,
                    0.00015741780433129065,
                    -2.12033949534582,
                    0.00019677286320168592,
                    0,
                    20
                  ]
                },
                "content": {
                  "url": "68.pnts"
                },
                "geometricError": 53.8608672507971
              }
            ],
            "content": {
              "url": "16.pnts"
            },
            "geometricError": 107.7217345015942
          }
        ],
        "content": {
          "url": "3.pnts"
        },
        "geometricError": 215.4434690031884
      }
    ],
    "content": {
      "url": "0.pnts"
    },
    "geometricError": 430.8869380063768
  }
}

And is the tile request log:

127.0.0.1 - - [22/Jun/2017 12:54:06] "GET /tileset.json HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /0.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /1.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /54.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /56.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /60.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /58.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /66.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /68.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /62.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:07] "GET /64.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:23] "GET /13.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:23] "GET /16.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:23] "GET /14.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:23] "GET /15.pnts?v=0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2017 12:54:34] "GET /3.pnts?v=0.0 HTTP/1.1" 200 -

Please let me know if you need any further information.

@lilleyse
Copy link
Contributor

I think the problem is that "refine": "ADD" is at the top level but should actually be a property of the root tile. By default Cesium will use replacement refinement if it doesn't see a refine property in the root tile.

@Prior99
Copy link
Author

Prior99 commented Jun 22, 2017

@lilleyse

Thanks for you reply, I changed the tileset.json to look like this:

{
  "asset": {
    "version": "0.0"
  },
  "geometricError": 430.8869380063768,
  "root": {
    "refine": "ADD",
    "boundingVolume": {
      "region": [
        -2.1203785848946817,
        0,
        -2.120065856904983,
        0.00031484337491542773,
        0,
        20
      ]
    },
    "children": [

Sadly, this didn't change Cesiums behaviour in any way.

Would it help you if I provide you with the .pnts files so you can reproduce the problem locally?

@lilleyse
Copy link
Contributor

Strange...

Yes you can send them to me at [email protected].

@Prior99
Copy link
Author

Prior99 commented Jun 22, 2017

Thanks for your time @lilleyse. I sent them to you via email as a tarball. Please let me know if you need something else.

@Prior99
Copy link
Author

Prior99 commented Jun 22, 2017

For some reason your mailserver at microsoft doesn't accept mails from my google account. Please find the archive attached to this issue.

cloud.zip

@lilleyse
Copy link
Contributor

This is what I see when running, it looks like the expected behavior. Is your cesium build up-to-date?

points

@alexd2580
Copy link

alexd2580 commented Jun 23, 2017

@lilleyse, Thank you for your reply!
In your gif, you see that the top left tile has one subtile at the bottom left (marked black), which is visible from afar. When zooming in you also see that there are no more tiles of the same LOD as the black one. Instead, the red ones are loaded. However, the tileset.json contains those three missing black tiles (13,14,15,16, with one of them being the one that is loaded).
screenshot_2017-06-23_02-29-47

Is this also expected behavior, where an LOD is skipped? How do you compute whether a tile should be loaded or not? Also, is there a way to prevent the PC from disappearing when zooming out too far (happens in the gif as well)?

@lilleyse
Copy link
Contributor

I finally tracked down what was happening here. The traversal seems to be okay, the problem is that the missing tiles are invalid and are never drawn. Specifically the problem is the batch table binary is not 4-byte aligned. There is an implementation note in the spec that gives some background about this: https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/BatchTable/README.md#implementation-notes

Error reporting for 3D Tiles could be better right now, but we plan on tackling it soon: #5158.

Also we plan on updating the spec to be more explicit about the padding requirements: CesiumGS/3d-tiles#225

Sorry about the confusion here.

@lilleyse
Copy link
Contributor

lilleyse commented Jun 23, 2017

Slight correction, it is the feature table binary that is misaligned. But the same rules apply.

@Prior99
Copy link
Author

Prior99 commented Jun 23, 2017

Thank you. That fixed it.

@Prior99 Prior99 closed this as completed Jun 23, 2017
@pjcozzi
Copy link
Contributor

pjcozzi commented Jun 23, 2017

Also note that runtime validation of 3D Tiles will not do a full validation. There will be a separate offline validator here: https://github.com/AnalyticalGraphicsInc/3d-tiles-tools/tree/master/validator. Keep an eye on it.

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

4 participants