-
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
I3dm updates #4101
I3dm updates #4101
Conversation
Sounds awesome, thanks @lasalvavida! @lilleyse can you please do the first review? |
@@ -192,15 +198,41 @@ define([ | |||
var batchTableByteLength = view.getUint32(byteOffset, true); | |||
byteOffset += sizeOfUint32; | |||
|
|||
//>>includeStart('debug', pragmas.debug); | |||
var gltfByteLength = view.getUint32(byteOffset, true); |
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 line should be outside the pragma.
You'll need to update the composite tilesets as well. |
That's all from me, I like the new instanced tileset! |
Just a note here... it also looks like another 3d tiles test is failing: But it's unrelated to this PR. |
Updated @lilleyse, I'm still working on the composite tilesets |
AttributeCompression.octDecode(normalTwoX, normalTwoY, normalRight); | ||
|
||
// Compute third normal | ||
Cartesian3.cross(normalRight, normalUp, normalOut); |
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.
"Out" here is confusing since, if I am following correctly, we would usually call it "Up" here, e.g., east/north/up; however, "Up" is already used, and perhaps rightfully so.
I don't have a better idea now; will let you know if I come up with something.
@lasalvavida very nice start here. This still needs:
|
@lasalvavida perhaps add a tasklist to the top of this PR with #4101 (comment), composite, and anything else that still needs to be done before merging. |
@pjcozzi, @lilleyse Can you take a look at the implementation changes from CesiumGS/3d-tiles#100? Particularly the |
Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, position); | ||
var modelMatrix = Transforms.eastNorthUpToFixedFrame(position); | ||
var featureTableResources = new Cesium3DTileFeatureTableResources(featureTableJSON, featureTableBinary); | ||
this.featureTableResources = featureTableResources; |
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 sure this.featureTableResources
is needed? Can't the feature table just be created at load time for parsing into the proper data structures, e.g., creating Cesium primitives, and then discarded? This is a very heavy object and the memory consumption is not palatable to keep it for the lifetime of a tile.
We might want to unit test |
/** | ||
* @private | ||
*/ | ||
function Cesium3DTileFeatureTableResources(featureTableJSON, featureTableBinary) { |
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.
Right now the approach of generating a JS array that holds onto the property's binary data just seems too expensive. I think it would be easier if this class stored a TypedArray view for each property, and then when getting an instance's property it just indexes into the typed array. To avoid allocations, the getter can take an optional results
array parameter.
This is also make it easier to work with Points3DTileContent
which wants TypedArrays for the color and position properties.
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.
Oh I see this comment: #4101 (comment) kind of alludes to that too.
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.
@lasalvavida can we write unit tests that test this file in isolation without an entire tile?
I went ahead and pushed some of these changes. Feel free to comment. I'm finishing up rewriting my tile generation code for the new spec, so we should have tests again shortly. |
return arrayBuffer; | ||
}; | ||
|
||
Cesium3DTileFeatureTableResources.prototype.getGlobalProperty = function(semantic, componentType, count) { |
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.
Would a global property ever need to be stored in binary? If not, this function could just return the JSON.
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.
Probably not; I think that's probably better for making the implementation more streamlined
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.
I don't think we should assume it will always be JSON. A global property could be a big array, even if it isn't per-feature data, so we shouldn't make the spec this limited unless there is a significant implementation reason, which I do not see here since we already need to handle binary for the other properties.
@lilleyse let me know when this is ready for me to review. |
Updated with some test models for semantics. Once I have #4121, I'll add a test model for oct-encoding, and a test model with all semantics and update the tests. |
var feature = featureTable.getProperty('TEST', 1, ComponentDatatype.UNSIGNED_BYTE, 2); | ||
expect(feature).toEqual([2, 3]); | ||
}); | ||
}); |
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.
For this file also test that the DeveloperErrors are hit.
Updated. The composite tile samples have been updated as well. Once there's a verdict on the FeatureTable array issue, this should be ready to go. |
@lasalvavida please merge in |
Does the Sandcastle example cover most i3dm use cases? If not, we can add another one or two small tilesets like we did in #4183? We don't need exhaustive testing in the Sandcastle example, but it is good to cover command use cases for manual testing. |
The Sandcastle example only does basic instancing, but I do have test models in specs for all semantics, so it would be trivial to add one or two of those. |
I have the following test failures:
|
Yes, please. Think representative, not exhaustive. |
There are a lot of Short-term, is it possible to change the git history in this branch and use smaller i3dm files? |
Just those comments. Overall nice work here. |
Yup, no problem. |
What's left before this can be merged? |
I have all of my sample tilesets regenerated except for gltfExternal. I will have this updated shortly. |
Okay, tests should be passing now; and this should be ready for final review. As far as not bloating the git history, I think if you |
@lasalvavida you can squash yourself very easily. (assuming origin is the name of the official cesium remote)
Let me know if you want me to stop by and walk you through it. |
c021627
to
99f6f38
Compare
Thanks @mramato. This is all squashed and ready for review. |
@lasalvavida @lilleyse is this ready to merge? |
@lasalvavida I think you forgot to add |
Missing files re-added this should be ready for a look for real this time. |
One minor suggestion - can you place the instanced models fully above the ground? The shadows look wrong at the moment. Other that that, everything looks good. |
Updated, sample tiles are now on the ground. |
@lilleyse please merge when ready. @lasalvavida nice work here! |
This is the first set of spec migrations from #33.
The i3dm header now has 6 double-precision fields for translating and scaling quantized coordinates.
Each instance is now composed of x, y, z 16-bit quantized coordinates along with 2 oct-encoded vectors that form an orthonormal basis for rotation.
Sample models updated to demonstrate all of these features.
@pjcozzi, @lilleyse, can you take a look at this when you get a chance?
Tasklist: