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

Use b3dm tilesets for classification #6033

Merged
merged 56 commits into from Dec 15, 2017
Merged

Use b3dm tilesets for classification #6033

merged 56 commits into from Dec 15, 2017

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Dec 6, 2017

This adds a classificationType option to Cesium3DTileset that will turn the glTF of a b3dm into a classification volume.

ClassificationModel has support for some of the same options that Model does (e.g. terrain clamping). Can this be removed or should we make this part of the public API?

Limitations:

  • only works for b3dm
  • all indices with the same batch id must be contiguous in memory
  • ignores all shaders and techniques
  • the only extension supported is WEB3D_quantized_attributes

Note that this is a PR into the vector-tiles branch.

@cesium-concierge
Copy link

Signed CLA is on file.

@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 6, 2017

Limitations all sound OK to me. Later I could see users wanting to classify with i3dm - it is is kind of in between b3dm and geom.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 6, 2017

ClassificationModel has support for some of the same options that Model does (e.g. terrain clamping). Can this be removed or should we make this part of the public API?

I don't think ClassificationModel needs to be exposed through the public API; Cesium API users will use the ClassificationPrimitive if they are not using 3D Tiles...I think.

So it only needs to have the API needed to support Cesium3DTileset, which does not have terrain clamping I believe.

},

/**
* Determines whether terrain, 3D Tiles or both will be classified by this tileset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Label as @readonly.

@@ -222,6 +222,8 @@ define([

this._readyPromise = when.defer();

this._classificationType = options.classificationType;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this in the reference doc?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also include the limitations in the reference doc. It might be easiest to add this once in the property getter and then reference it from the constructor function.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 6, 2017

Update CHANGES.md.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 6, 2017

Add a Sandcastle example.

@@ -153,8 +153,18 @@ define([
* @type {ClassificationType}
* @default ClassificationType.CESIUM_3D_TILE
*/
this.classificationType = ClassificationType.CESIUM_3D_TILE;
this._classificationType = this.classificationType;
this.classificationType = defaultValue(options.classificationType, ClassificationType.CESIUM_3D_TILE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add to reference doc even though the class is private.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 6, 2017

Add unit tests.

pickObject : pickObject
});
} else {
content._model = new ClassificationModel({
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a code comment about how this is a transcode - with limitations on the input glTF - so that we can use the geom rebatching rendering pipeline?

@@ -0,0 +1,2482 @@
define([
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it does more than it needs to given the limitations classification has. Are you sure there aren't other limitations we can add to make this even more simple, e.g., vertex formats, removing the cache (is it needed), etc.

Then perhaps factor out some common functions to share with Model?

@bagnell
Copy link
Contributor Author

bagnell commented Dec 11, 2017

Do you get test failures like this:

I don't see any test failure locally and the Travis tests pass. Also, running the tests from the link you posted give strange failures like:

Core/Cartesian3 renders with external gltf

@bagnell
Copy link
Contributor Author

bagnell commented Dec 11, 2017

The requirement for floating point positions and uint16 batch ids were removed as well.Different formats are required to support quantization.

@bagnell
Copy link
Contributor Author

bagnell commented Dec 11, 2017

@pjcozzi I think this is ready. The only thing missing would be only supporting one primitive per mesh, but I could do that in a separate PR.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 12, 2017

The only thing missing would be only supporting one primitive per mesh, but I could do that in a separate PR.

Separate PR is OK, but let's do it right away to keep the code streamlined.

};
}

function computeBoundingSphere(model) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you going to move some of these functions to a common file? Or do you want to do that in a separate PR?

@bagnell
Copy link
Contributor Author

bagnell commented Dec 13, 2017

@pjcozzi This is ready for another look. I added the restriction that only one primitive per mesh is supported, factored out some of the common code with Model, and added ClassificationModel tests.

var aMinScratch = new Cartesian3();
var aMaxScratch = new Cartesian3();

function computeBoundingSphere(model) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be a common function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is different enough from model that I didn't create a common function. The only part I could pull out is finding the min and max.

}
}

function createCommand(model) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename this since it no longer creates a command...directly.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 15, 2017

Tests and Sandcastle example look good. Just those trivial questions.

@bagnell
Copy link
Contributor Author

bagnell commented Dec 15, 2017

@pjcozzi This should be ready.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 15, 2017

Thanks!

@pjcozzi pjcozzi merged commit 7d27a23 into vector-tiles Dec 15, 2017
@pjcozzi pjcozzi deleted the b3dm-class branch December 15, 2017 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants