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

Cesium3DTileset tests #3367

Merged
merged 9 commits into from
Dec 22, 2015
Merged

Cesium3DTileset tests #3367

merged 9 commits into from
Dec 22, 2015

Conversation

lilleyse
Copy link
Contributor

For #3177

  • Added tests for Cesium3DTileset and Tileset3DTileContentProvider
  • Changed the replacement refinement approach to work closer with the selectTiles function. I'm still not 100% happy with the approach. I was experimenting with other approaches but it wasn't any better.
  • Fixed issue where tile with content box is not culled. It was checking the CullingVolume mask instead of Intersect.
  • Changed up the addToProcessingQueue and removeFromProcessingQueue functions which weren't operating correctly in certain edge cases, like failed requests. This area in general will change again with the request scheduler.
  • Implemented Cesium3DTileset.destroy. In order to handle cases where the tileset is destroyed while content requests are still in progress, when the request completes I throw an error to reject the ready promise. However I'm open to different ideas.
  • For the test tileset files, they all use copies of the same b3dm files which is a bit wasteful. Maybe we could support creating a Cesium3DTileset with a url to an explicit tiles.json file, right now you can only give it a folder.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Fixed issue where tile with content box is not culled. It was checking the CullingVolume mask instead of Intersect.

Great, this fixes part of #3241:

Does culling with content.box still work? For example, the root tile for Canary Wharf is always rendered when just the tile's box is visible (even it the content box is not).

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Maybe we could support creating a Cesium3DTileset with a url to an explicit tiles.json file, right now you can only give it a folder.

Go for it. Perhaps assume the filename is tiles.json if one isn't provided.

@@ -122,6 +122,9 @@ define([
this.state = Cesium3DTileContentState.LOADING;

loadArrayBuffer(this._url).then(function(arrayBuffer) {
if (that.isDestroyed()) {
throw new Error('tileset is destroyed');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only throw DeveloperError or RuntimeError, not Error; see https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/CodingGuide/README.md#throwing-exceptions

In this case, there was an outstanding request after the tileset was destroyed, right? That is not an exceptional case. Can we instead just silently destroy the tile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it can be silent. I did it this way so that the request scheduler and stats would get updated correctly, but since that all is changing anyways I think it's fine not to throw the errors.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Do we have any test cases for both additive and replacement refinement in the same tileset?

@lilleyse
Copy link
Contributor Author

TileReplacement2 has a mix, but I do think I should add a more general case test.

return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function(tileset) {
tileset.debugShowStatistics = true;
scene.renderForSpecs();
// TODO : not sure how to test this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a spy for console log. Don't too tightly couple this test to the implementation though, just a coarse-grained test is plenty.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

The debug* options, such as debugShowBox need tests. As usual, coarse-grained checks are fine.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Can we add an explicit test for:

// Use parent's geometric error with child's box to see if we already meet the SSE

https://github.com/AnalyticalGraphicsInc/cesium/blob/tileset-tests/Source/Scene/Cesium3DTileset.js#L461

This is an important optimization for additive refinement.

Basically, from one view we should not need to request the farther away children, then move the view closer and the children are requested.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Can we add a test to make sure tiles are traversed (requested/rendered) in the a front-to-back order?

I think there is an issue here. From #3241:

Is the load order correct? For example, the buildings on the right should load sooner: http://cesiumjs.org/WashingtonDC/

We can also punt on this until the request scheduler if that makes more sense.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Let's test the case when the content url exists but it has an unknown extension, e.g.,

            "content": {
              "url": "2/0/0.unknown"
            },

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Do we need a test case for a traditional quadtree where all the interior tiles are empty and only the leafs have content? Or is TilesetEmptyRoot enough?

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Would some of these tests be better if we mocked out (or just spied on) Cesium3DTile and friends?

It would make the tests more precise and depend on fewer moving parts.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Would some of these tests be better if we mocked out (or just spied on) Cesium3DTile and friends?

It would make the tests more precise and depend on fewer moving parts.

Also, this is up to you if you think it is cleaner.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

Did coverage bump to 94%? :)

@lilleyse
Copy link
Contributor Author

Not yet...

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 21, 2015

That's all my comments. This looks really good.

@lilleyse
Copy link
Contributor Author

Let's test the case when the content url exists but it has an unknown extension, e.g.,

This will be easier to test in Cesium3DTileSpec

@lilleyse
Copy link
Contributor Author

This is ready for another look.

@pjcozzi pjcozzi mentioned this pull request Dec 22, 2015
@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 22, 2015

Coverage for Cesium3DTile is not great, but it sounds like you plan to handle that in a separate PR.

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

Successfully merging this pull request may close these issues.

None yet

2 participants