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

Allow normals to be used when model material is unlit #9173

Merged
merged 3 commits into from
Nov 1, 2020

Conversation

lilleyse
Copy link
Contributor

When a model uses the KHR_materials_unlit extension its normal shader attribute is disabled which could be a problem if normals are used for purposes other than lighting. This PR has two fixes:

  • Allow normals to still be used but disable lighting code when the material is unlit
  • Prevent attributes from being optimized out of the vertex array in case subsequent shader compiles use the normal attribute

Thanks @ErixenCruz and @jtorresfabra for looking into this

@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.
  • Works (or fails gracefully) in IE11.

Copy link
Contributor

@jtorresfabra jtorresfabra left a comment

Choose a reason for hiding this comment

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

👍 Approved, changes look sensible.
As a proposal maybe in the future we can revisit this part to try to avoid extra shader compilation.

@cesium-concierge
Copy link

Thanks again for your contribution @lilleyse!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@OmarShehata
Copy link
Contributor

I'm going to merge since this was approved by Jordi and I can confirm it fixes the issue with a non-public test case.

@OmarShehata OmarShehata merged commit e3acb52 into master Nov 1, 2020
@OmarShehata OmarShehata deleted the unlit-model-normals branch November 1, 2020 19:16
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