question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export textures as WebP

See original GitHub issue

Is 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:open
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
donmccurdycommented, Aug 3, 2022

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:

gltf-transform webp input.glb output.glb
3reactions
gernotzieglercommented, Jul 4, 2022

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. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Thoughts on webp texture format? - jMonkeyEngine Hub
Hi In some of my 3d assets, I noticed instead of PNG they use a JPG texture for diffuse map and one for...
Read more >
Support WEBP images ⁠— Right-Click Select
WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web...
Read more >
How do I export WebP images from Photoshop? - Quora
Open and export assets > Double click on a single layer or select multiple layers whit the shift key and press “Export” >...
Read more >
Using WebP Image Format Today - Smashing Magazine
WebP does a nice job of maintaining crisp edges in a photo – but, of course, it loses detail and texture, as you...
Read more >
WebP Support - Spine
WebP formatted texture files. only .png, .apng .jpeg and .gif. Texture packer can easily export .WebP images and Spine seems to use it,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found