Description
Is your feature request related to a problem? Please describe.
When loading large scenes into Meshcat, a common bottleneck appears to involve textures. As of today, we typically use *.png
images for textures in our glTF models.
Meshcat fetches the pngs in compressed form (i.e., our http server just serves the png file, still compressed), which is as expected and fairly fast. (Our new CAS cache helps here.) However, after fetching the data the client side decodes the image into full bitmaps (e.g., 4096x4096x3 byte array) and then uploads that bitmap to the GPU. In most cases the decoding is done in webworker, but the upload needs to happen on the main thread.
Uploading that bitmap is actually really, really slow (on the order of tenths of a second). A glTF with PBR materials will typically have several texture images (color, normal, roughness...). When loading a scene with multiple glTFs and their multiple textures, it can take tens of seconds before the threejs objects are fully loaded and show up on the screen.
That's too slow. We'd like to load the textures much, much faster.
Describe the solution you'd like
The glTF format offers an extension named KHR_texture_basisu. This uses the KTX2
texture format, typically stored in files named *.ktx2
with content type image/ktx2
.
This format is optimized for speedy transmission (compression) and speedy upload to GPUs (they can consume it directly). In experiments so far, it substantially mitigates texture loading delays.
We'd like Drake's Meshcat to offer support for this extension. When it is part of extensionsUsed
, Meshcat should load the KTX2 image instead of the PNG image.
Note that we would advise keeping the *.png
images intact alongside the *.ktx2
images. For now, only Meshcat would know about the different texture encoding. Other gltf consumers (VTK, Blender, etc.) don't yet support that texture format, so they would still load the *.png
images.
Describe alternatives you've considered
Use less realistic PNG textures with reduced pixel size.
Metadata
Metadata
Assignees
Type
Projects
Status