WebP - png/jpg fallback for 3D Tiles

Is it possible to add a png / jpg as a texture format fallback to 3d tiles, for unsupported browsers such as Safari?

If so, this should only effect the overall file size of the tileset as a whole, not streaming in CesiumJS, correct?


I think this should be possible, the 3D Tiles spec allows b3dm tiles to point to external image sources:

The binary glTF immediately follows the Feature Table and Batch Table. It may embed all of its geometry, texture, and animations, or it may refer to external sources for some or all of these data.

From: https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Batched3DModel/README.md#binary-gltf

And the WebP extension explains how to set up a WebP image with a fallback:

As long as the images are not embedded in the b3dm, then the client will only request the image it needs, so you are correct in that it would not load both when streaming into CesiumJS.

With that said, there are a few alternatives that do not require storing a fallback version of all the images. One is to use a WebP decoder in WebAssembly for browsers that don’t support WebP to do this decoding in the browser (I’m not sure how big of a performance impact this would have though). Another option is that once the Basis format is part of the glTF specification, 3D Tiles could use that as an image format that’s compressed on the GPU as well. This will have more of a significant impact for GPU memory use, but it should produce compression that’s comparable to or smaller than JPEG. See current progress on this here: