Catch and report error when IBL map fails to load #8303
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.
This came up on the forum. If you take the
old_venetian_crossroads_2k_ibl
in this zip, and try to load it in the IBL Sandcastle it fails to load, and the only indication you get is that the models are just completely black.EnvironmentMap.zip
I eventually realized CesiumJS was failing to load that KTX file because it had an unsupported
glInternalFormat
ofR11F_G11F_B10F
. This PR getsOctahedralProjectedCubeMap
to reject its readyPromise when it fails to load the environment map, and getsModel.js
to listen on that andconsole.error
it out. I also added a test to make sure the promise is rejected when it tries to load an invalid URL.This KTX file was generated from cmgen 1.4.1, but it seems to have this unsupported format because of some recent change. I tested with cmgen 1.2.0 and it works in CesiumJS (included in the above zip).