fix(composer): hdr url is sometimes wrong #352
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The uriModifier for GLTFLoader is applied to load hdr files unexpectedly and modifies the hdr file urls (if not an absolute url) to be from S3. The hdr files are not served from S3 so loading it will fail.
This issue is not always happening because the Environment component is rendered before GLTFComponent, so the set uriModifier code is often executed after hdr is loading already.
Steps to repro:
The fix is to create a separate loading manager for GLTTFLoader so that the uriModifier is not updated for all loaders.
Tested with GLTF model that has png as texture. the url for the png is correctly modified to be from S3.
Before fix:
before-url-fix.mov
After fix:
after-url-fix.mov
Legal
This project is available under the Apache 2.0 License.