cesium-unreal
cesium-unreal copied to clipboard
Reduce texture copies, perhaps by uploading directly from ImageCesium to GPU?
Loading a texture in a tile involves the following copies:
- Compressed image data comes over the network and stored in a glTF Buffer, base64 string, or separate image buffer loaded from a URL.
- We decompress the image and store the raw pixels in
ImageCesium. (in the case of KTX2, the pixel data isn't full decompressed) - The pixel data is copied into Unreal's
FTexturePlatformData. - Unreal reportedly copies this again on the game thread into a buffer owned by the render thread.
- The buffer is uploaded to the GPU.
Steps 3 and 4, at least, seem unnecessary. There's no particular reason (to my knowledge) we can't keep the image in the ImageCesium alive as long as it's needed and upload it directly to the GPU. But it's unclear if it's possible to convince Unreal Engine to do such a thing.