Skip to content

Commit 881ef60

Browse files
committed
Enable ImageBitmap for external textures in Model
1 parent 3ca010a commit 881ef60

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- Fixed broken image URL in the KML Sandcastle. [#9579](https://github.com/CesiumGS/cesium/pull/9579)
2121
- Fixed an error where the `positionToEyeEC` and `tangentToEyeMatrix` properties for custom materials were not set in `GlobeFS`. [#9597](https://github.com/CesiumGS/cesium/pull/9597)
2222
- Fixed misleading documentation in `Matrix4.inverse` and `Matrix4.inverseTransformation` that used "affine transformation" instead of "rotation and translation" specifically. [#9608](https://github.com/CesiumGS/cesium/pull/9608)
23+
- Fixed a regression where external images in glTF models were not being loaded with `preferImageBitmap`, which caused them to decode on the main thread and cause frame rate stuttering.
2324

2425
##### Deprecated :hourglass_flowing_sand:
2526

Source/Scene/GltfImageLoader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ function loadImageFromUri(resource) {
275275
return loadCRN(resource);
276276
}
277277
// Resolves to an ImageBitmap or Image
278-
return resource.fetchImage();
278+
return resource.fetchImage({
279+
preferImageBitmap: true,
280+
});
279281
}
280282

281283
/**

Source/Scene/Model.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,9 @@ function parseTextures(model, context, supportsWebP) {
20322032
} else if (crnRegex.test(uri)) {
20332033
promise = loadCRN(imageResource);
20342034
} else {
2035-
promise = imageResource.fetchImage();
2035+
promise = imageResource.fetchImage({
2036+
preferImageBitmap: true,
2037+
});
20362038
}
20372039
promise
20382040
.then(imageLoad(model, id, imageId))

0 commit comments

Comments
 (0)