-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
…This makes draw command management easier and reduces the memory for draw commands by half.
… picking and rebatching.
@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
Limitations all sound OK to me. Later I could see users wanting to classify with i3dm - it is is kind of in between |
I don't think So it only needs to have the API needed to support |
}, | ||
|
||
/** | ||
* Determines whether terrain, 3D Tiles or both will be classified by this tileset. |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Update CHANGES.md. |
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); |
There was a problem hiding this comment.
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.
Add unit tests. |
pickObject : pickObject | ||
}); | ||
} else { | ||
content._model = new ClassificationModel({ |
There was a problem hiding this comment.
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([ |
There was a problem hiding this comment.
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
?
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 |
The requirement for floating point positions and uint16 batch ids were removed as well.Different formats are required to support quantization. |
@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. |
Separate PR is OK, but let's do it right away to keep the code streamlined. |
Source/Scene/ClassificationModel.js
Outdated
}; | ||
} | ||
|
||
function computeBoundingSphere(model) { |
There was a problem hiding this comment.
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?
@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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Source/Scene/ClassificationModel.js
Outdated
} | ||
} | ||
|
||
function createCommand(model) { |
There was a problem hiding this comment.
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.
Tests and Sandcastle example look good. Just those trivial questions. |
@pjcozzi This should be ready. |
Thanks! |
This adds a
classificationType
option toCesium3DTileset
that will turn the glTF of a b3dm into a classification volume.ClassificationModel
has support for some of the same options thatModel
does (e.g. terrain clamping). Can this be removed or should we make this part of the public API?Limitations:
WEB3D_quantized_attributes
Note that this is a PR into the vector-tiles branch.