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

Make ModelExperimental handle classification #10623

Merged
merged 24 commits into from
Aug 4, 2022

Conversation

j9liu
Copy link
Contributor

@j9liu j9liu commented Aug 2, 2022

This PR adds support for classification models in ModelExperimental. This was accomplished without needing to create an equivalent of ClassificationModel. Instead, a ClassificationModelDrawCommand is created to handle the special classification commands.

classification

Sandcastle for testing (updated for ModelExperimental -> Model). The tileset is clipped with a clipping plane so you can see the terrain underneath.

I also found #10160 while looking through issues related to classification, and I confirmed that the sandcastle (updated for ModelExperimental -> Model) doesn't crash with the changes in this PR.

Summary:

  • Added ClassificationModelDrawCommand. This is modeled after the commands in Vector3DTilePrimitive.
  • Added classificationType to ModelExperimental.
  • Model3DTileContent now passes the classification option to ModelExperimental.
  • Updated specs for various pipeline stages to accommodate the attribute / shader differences when rendering classification models.
  • Updated ModelExperimental specs for setting / changing classificationType.
  • Updated Model3DTileContent with the render specs from Batched3DModel3DTileContentClassificationSpec.

@cesium-concierge
Copy link

Thanks for the pull request @j9liu!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.

@j9liu j9liu requested a review from ptrgags August 2, 2022 20:44
Copy link
Contributor

@ptrgags ptrgags left a comment

Choose a reason for hiding this comment

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

@j9liu a couple initial comments for now, most notably that many tests are failing at least on Linux.

Source/Shaders/ModelExperimental/ModelExperimentalVS.glsl Outdated Show resolved Hide resolved
Specs/Scene/ModelExperimental/ModelExperimentalSpec.js Outdated Show resolved Hide resolved
@j9liu j9liu force-pushed the classification-model-update branch from d302692 to 679453d Compare August 4, 2022 19:36
@j9liu
Copy link
Contributor Author

j9liu commented Aug 4, 2022

@ptrgags updated with the ModelExperimental -> Model changes!

Copy link
Contributor

@ptrgags ptrgags left a comment

Choose a reason for hiding this comment

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

@j9liu The classification model is working nicely! And I can confirm that this Sandcastle is now working again.

I had a few comments/questions before we merge

@ptrgags
Copy link
Contributor

ptrgags commented Aug 4, 2022

Just for good measure, I tried swapping out the model in your Sandcastle example with other models. When I try it with the Microcosm example, I get a shader compilation error:

Sandcastle

RuntimeError: Fragment shader failed to compile.  Compile log: ERROR: 0:51: 'v_texCoord_0' : undeclared identifier
ERROR: 0:51: 'texture2D' : no matching overloaded function found
ERROR: 0:51: 'r' :  field selection requires structure or vector on left hand side
ERROR: 0:59: 'texCoord_0' :  no such field in structure
ERROR: 0:59: 'texture2D' : no matching overloaded function found
ERROR: 0:59: 'r' :  field selection requires structure or vector on left hand side

is this expected? I also tried BoxTextured and that worked fine

@j9liu
Copy link
Contributor Author

j9liu commented Aug 4, 2022

@ptrgags I pushed a fix -- I didn't realize that FeatureIdPipelineStage used texcoords, and those weren't being processed in GeometryPipelineStage for classification models.

@ptrgags
Copy link
Contributor

ptrgags commented Aug 4, 2022

I can confirm that the fix does fix things for Microcosm!

Updated Sandcastle

image

@j9liu
Copy link
Contributor Author

j9liu commented Aug 4, 2022

@ptrgags updated!

Copy link
Contributor

@ptrgags ptrgags left a comment

Choose a reason for hiding this comment

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

@j9liu just a couple quick things I noticed about the @experimental tags

(I also see you pushed some commits while I was reviewing, sorry if anything overlaps 😅)

Source/Scene/ModelExperimental/Model.js Outdated Show resolved Hide resolved
@j9liu
Copy link
Contributor Author

j9liu commented Aug 4, 2022

@ptrgags added the @experimental tags back in!

@ptrgags
Copy link
Contributor

ptrgags commented Aug 4, 2022

Looks good, thanks @j9liu!

@ptrgags ptrgags merged commit 106aa83 into replace-model Aug 4, 2022
@ptrgags ptrgags deleted the classification-model-update branch August 4, 2022 21:27
@ptrgags ptrgags mentioned this pull request Aug 5, 2022
4 tasks
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.

4 participants