-
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
Model caching fix #7796
Model caching fix #7796
Conversation
Thanks for the pull request @lilleyse!
Reviewers, don't forget to make sure that:
|
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.
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)) { |
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.
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?
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.
Yeah, exactly.
@lilleyse reminder that I don't have commit access here. |
@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! |
Opened #7801 |
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 betrue
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.