Export textures as WebP
See original GitHub issueIs your feature request related to a problem? Please describe. We’re working on virtual world software where we have many 3D models loading all around from different http servers. Features such as draco and brotli compression help improve file sizes significantly, but for textures we’ve been using webp. Using our own Blender addon, it tries to convert textures to webp and modify gltf files afterward. However it’s not intuitive and doesn’t work with glb files. Most people avoid it because it doesn’t import back in either.
Describe the solution you’d like When exporting gltf in Blender, under textures you can select webp. A new set of settings appears where you can toggle lossless mode, or otherwise select a quality between 0 to 100% (possible show this for jpeg as well). This should work with glb files too.
There’s an extension for webp here: https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Vendor/EXT_texture_webp/README.md Though we haven’t been using it since webp just works.
I’m not sure how we could compress/decompress with webp in Blender, however for my addon I’ve packaged the cwebp
executable into the addon for Linux, Windows and macOS.
Describe alternatives you’ve considered
Manually using cwebp
and modifying the gltf files to reference the correct texture. Then using a tool to package to glb.
I hope this can be looked into someday! I can help since I’ve touched the addon before and perhaps I might look into this myself.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Personally I’d be glad to see
EXT_texture_webp
supported here if Blender’s image APIs now allow it. I would advise against including fallback JPEG or PNG textures. As a practical matter I think that (while glTF allows this) including .webp alongside .jpeg or .png backups will mostly confuse people, and certainly has bad outcomes when the textures are all embedded in a .glb. For web developers, WebP is widely supported, and exporting two versions of the glTF is a simpler solution if PNG or JPEG is needed.Support for WebP compression has since been added to gltf-transform as well:
Now that Blender 3.2 is out with WEBP support, it would be great to integrate support for the EXT_texture_webp extension into the Blender exporter script, maybe with a choice if WEBP is an optional or required part of this exported GLTF (which decides if JPEGs are exported in addition). Support for WEBP-based GLTF benefits all applications where storage needs are critical, most often: web applications. 😃