-
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
Handle multiple feature ID sets in ModelExperimental
#10018
Conversation
Thanks for the pull request @ptrgags!
Reviewers, don't forget to make sure that:
|
Just a short note: I think that http://localhost:8080/Apps/Sandcastle/index.html?src=3D%20Tiles%20Next%20S2%20Globe.html&label=3D%20Tiles%20Next is still using the (now no longer working, internal) |
@lilleyse this PR is now ready for review. I do still want to add a sandcastle to show multiple feature Id sets once you finish updating the Ferry Building tileset and upload it to ion |
@lilleyse I updated the 3D Tiles Next Photogrammetry Sandcastle with new styling and custom shader examples |
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.
Seems to be in pretty good shape overall. Here's my first round of feedback, I plan to test some examples next.
@javagl just to confirm, have you tested all the samples in CesiumGS/3d-tiles-samples#40 on this branch? Here's the testing strategy I was going to go with. Are there any that can already be checked off?
|
Addressed the concrete feedback. Next step is investigating a bug @lilleyse pointed out to me where switching between a style and a custom shader leaves the tileset in a bad state: |
@lilleyse this is ready for review again. |
merging in the let/const changes didn't seem to work properly... I'm going to reset my branch and try again |
61394d3
to
f6df243
Compare
Pre let/const transition
Post let/const transition
The new sandcastle option |
Aside from that, the recent changes look good. @javagl once you're satisfied with your testing we can get this merged. |
@lilleyse I simplified the sandcastle like you suggested |
I did some tests, roughly based on the bullet points above, but with some disclaimers (summarized below)
Disclaimers:
General: I've been testing most of this based on the (sketchy) "Test Sandcastle" that may, at some point, be a "template" for the example sandcastles that will go into the READMEs for the samples. There are several issues with that: Right now, accessing the metadata generically is ... clumsy: It has to do many There is an experimental function for "Setting the active feature ID", but ... I have no idea how to know the actual number of available feature IDs in the first place. More generally: I assume that the concept of having an "active feature ID" is a tribute to having to transport this information through the rendering process into "the picking world". I could question the now 54 (fifty-four!) properties in the It might be that these issues are already resolved by more recent changes. So to put it that way: If somebody could improve (as in: simplify and generalize) this test code at https://github.com/javagl/3d-tiles-samples/blob/add-ext-mesh-features-samples/EXT_mesh_features/CommonSandcastleCode.txt , that would be great... |
@javagl a couple things to point out:
|
I finished up testing. All looks good.
|
Fixes #10007
Fixes #9894
This also partially addresses #9884, though picking is not currently supported for feature IDs without a property table, and the current picking system would need larger changes to address this (see #9884 (comment))
Summary of changes:
ModelComponents
, combinedfeatureIdAttributes
andfeatureIdTextures
into onefeatureIds
array. This is more consistent with the currentEXT_mesh_features
spec.ModelExperimental
, replacedfeatureIdAttributeIndex
andfeatureIdTextureIndex
withfeatureIdIndex
andinstanceFeatureIdIndex
, as the latter pair better match the glTF structureFeatureIdPipelineStage
now processes all the feature ID attributes instead of only the selected one. It populates aFeatureIds
struct that can be passed into both feature ID selection (next bullet) and custom shaders.SelectedFeatureIdStage
handles the shader details for taking the selected feature ID set and populating a struct used by styling and picking. This is significantly easier now with theFeatureIds
struct, it's simplyselectedFeature.id = featureIds.SELECTED_FEATURE_ID
(using a define to substitute in the right variable).fsInput.featureIds.featureId_N
orfsInput.featureIds.instanceFeatureId_N
fsInput.featureIds.featureId_N
syntax to avoid exposing private API.To Do:
featureIdIndex
andinstanceFeatureIdIndex
to Cesium3DTileset for easier configurationCHANGES.md
FEATURE_ID_n
is added to theProcessedAttributes
correctlyfeatureIdIndex
being set before the scene graph is constructed.