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

Model caching fix #7796

Merged
merged 2 commits into from
May 1, 2019
Merged

Model caching fix #7796

merged 2 commits into from
May 1, 2019

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Apr 30, 2019

Fixes #7688

This fixes both Sandcastle examples in #7688 by not removing the pipeline extras since it contains buffer data which models on different contexts need to access. This does increase memory usage since now the buffer needs to stay in memory, but it's the right thing to do. It doesn't affect 3D Tiles which avoids caching altogether and releases the glTF json.

The last version that worked, 1.49, also does not remove pipeline extras.

Also includes a fix where models on different contexts would have different lighting because gltf.extras.sourceKHRTechniquesWebGL would be true for the second model and cause it to apply gamma correction unnecessarily.

The comments in #7688 are good and I think we need to rethink caching to make it simpler once we can get around to it.

@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

@OmarShehata OmarShehata left a comment

Choose a reason for hiding this comment

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

Can confirm this fixes the issues in the Sandcastle, all tests are passing locally, and the code looks good! Thanks for getting in a fix so quickly Sean!

I would say this is safe to merge.

@@ -4438,7 +4437,7 @@ define([
ModelUtility.updateForwardAxis(this);

// glTF pipeline updates, not needed if loading from cache
if (!this._loadRendererResourcesFromCache) {
if (!defined(this.gltf.extras.sourceVersion)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this the lighting issue fix? Are you using sourceVersion as a way to know if this gltf object has already gone through this code-path so it doesn't go through when it's loaded in other viewers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, exactly.

@OmarShehata
Copy link
Contributor

@lilleyse reminder that I don't have commit access here.

@mramato
Copy link
Contributor

mramato commented May 1, 2019

I think we need to rethink caching to make it simpler once we can get around to it.

@lilleyse please write up a new issue for this with any ideas you think are relevant and details of the problems with the current approach. Thanks and thanks for the fix!

@mramato mramato merged commit 4c75b0a into master May 1, 2019
@mramato mramato deleted the model-caching-fix branch May 1, 2019 12:58
@lilleyse
Copy link
Contributor Author

lilleyse commented May 1, 2019

Opened #7801

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash in GltfPipeline when loading two viewers with models
4 participants