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

Fix REPLACE styling for glTF without pbrMetallicRoughness object #10424

Merged
merged 2 commits into from Jun 3, 2022

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Jun 2, 2022

We noticed that Cesium3DTileColorBlendMode.REPLACE wasn't working for certain tilesets. Specifically, if a glTF material omitted the pbrMetallicRoughness object then the style would not get applied.

Why....? The code uses a special _3DTILESDIFFUSE semantic to figure out which attribute or uniform should be replaced with the feature color. Usually it attaches itself to the vertex color attribute, base color texture, or base color factor, but in this case none of those could be found.

The fix was to add a uniform for the default baseColorFactor value. The semantic gets added to that and everything works again.

As a side note, this bug doesn't seem to affect ModelExperimental which handles things very differently.

@cesium-concierge
Copy link

Thanks for the pull request @lilleyse!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

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

@ptrgags
Copy link
Contributor

ptrgags commented Jun 3, 2022

Looks good, thanks @lilleyse!

@ptrgags ptrgags merged commit 4a3eacc into main Jun 3, 2022
@ptrgags ptrgags deleted the fix-replace-styling branch June 3, 2022 13:14
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.

None yet

3 participants