Thank you, I think would be helpful to get to the bottom of this Maybe there can be some better outcome than needing the BC5/7 device specific KTX
Here is an article for ArcGIS that I got from a working group member:
Esri Collaborates with Binomial to Improve Basis Universal Supercompressed GPU Texture Codec Speed
That is for the encoding speed, not the decoding / transcoding speed. Anyway, this is all related – would you be interested in adding support for BC5 and BC7 to the KTX texture decoder? This would save us 450ms per texture, which is a pretty big win for our use case.
We can re-evaluate BasisU once it makes improvements to transcoding time, but our quality concerns still remain.
There is a demo at the end of the article that shows the loading, but it’s not working for some reason. The author was notified.
If you are capable, please contribute this support. The code for KTX1 is mostly from community members. If not, then file a GitHub issue and we will see if we can fit it in somewhere.
It looks like the GIS scenarios are all using BasisU with ETC1S (I checked with Bing also). I don’t see anyone using UASTC yet.
Discussing more with Alexey from the working group, it looks like transcoding from UASTC to BC1/3 is slow because it transcodes to uncompressed and then recompresses the textures.
3D-Formats-Guidelines/KTXDeveloperGuide.md at main · KhronosGroup/3D-Formats-Guidelines (github.com)
macOS with Intel chipset don’t support ASTC which is the ideal target for UASTC. For this case, Alexey is recommending that we decode to RGBA8, which will be much faster at the cost of the texture being uncompressed stored on the GPU. This will only affect Intel macOS. M1/M2 macOS supports ASTC.
It should be transcoding them to BPTC/BC7. Is that not what’s happening? I’m quite sure macOS with Intel should support BPTC/BC7.
Doesn’t look like it. WebGL needs to support EXT_texture_compression_bptc extension and these are the only compressed texture extensions supported according to webglreport:
EXT_texture_compression_rgtc
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
macOS Intel supports BC7, the question is whether the extension is correctly routed through WebGL. It’s possible that MacGL doesn’t support BPTC, but the coming ANGLE-on-Metal for Chrome and Safari should. I’m not sure which browsers you’re using, or which versions of them, and unfortunately everything is in flux right now and I don’t know the proper tables.
But yes, you’re correct that we have to support devices without BC7. Transcoding to RGBA8 will be a nicer fix.
ANGLE targetting Metal probably isn’t going to be supported by Chromium for older macs. I filled this issue some time ago: 1365598 - Rendering garbled when using Metal backend on old MBP - chromium and Ken indicated that it isn’t supposed to work.
I think I will probably add a flag for this. There are memory-constrained scenarios where it would be better to take the hit of recompressing the textures to BC1/3.
That said, the profile you showed earlier is for a newer MacBook right? Was it an M1 or Intel?
That was a 2020 intel macbook pro
Thanks a ton @Evgeni_Popov for KTX2 decoding: Add default KTX2 decoder configuration by Popov72 · Pull Request #13469 · BabylonJS/Babylon.js · GitHub !!!
Thank you will give this a whirl soon