Looking at the docs and source, im not seeing that WebP is supported by Babylon Native. Just want to confirm this and if so wondering if this is on the roadmap? @bghgary @thomlucc
Also, could ya’ll point me to where the textureLoader decodes the webp on the JS side in normal BJS?
This is correct. We don’t support any other formats other than jpg and png at the moment. Support for other texture loaders (ktx, webp, etc.) is definitely something we need to do. @thomlucc Let’s make sure it’s in the backlog.
WebP is directly supported by the browser, like PNG and JPG, so there is no code to decode it.
Babylon 8 being around the corner, it is now added to the Babylon 9 backlog: Add support for more texture formats · Issue #1479 · BabylonJS/BabylonNative · GitHub
Thanks all. Im curious on the Native side where does all the texture loading occur? We could possibly take a stab at implementing this and contributing. I guess I should take a look anyway. But seems we can use libwebp to do the decoding on the Native side and just need to figure out the correct entry point.
It’s all in NativeEngine.cpp right now. We don’t currently use texture loaders at all. It’s all bypassed at the moment. To do this right will require changes to Babylon.js and Babylon Native to make sure they are using texture loaders somehow. I don’t know how easy it would be to do this.
I would love to use EXT_texture_webp with babylon js because webp is able to compress the file size of textures massively..
That’d be great to have, I’ll be waiting it!
Since webp is mostly vp8-based, any change of hardware-accelerated decoding by reusing some of hw vp8 decoding api?
just wanted to follow up on my original request. We have been using WebP extensively in native now with no issues. We have seen significant improvements in load time and overall rendering speed on our back end due to the much smaller size. (on average almost 70% smaller than PNG) All this without sacrificing any noticeable quality. In the browser environment, we’re seeing an average of 20% faster time to first contentful paint. Thanks for getting this in quickly. If speed to first paint is important for you, I would highly recommend WEBP.