How to generate a. Basis file

Is there any tool that can generate this. Basis file? I want to use a lot of textures on mobile devices, but the occupancy rate of cup is very high, so I want to improve it by compressing textures?
https://playground.babylonjs.com/#4RN0VF#26

I’m not aware of a prebuilt version, but you can build a tool called basisu from here: GitHub - BinomialLLC/basis_universal: Basis Universal GPU Texture Codec.

That said, you might want to try .ktx2 instead of .basis. The software is here: GitHub - KhronosGroup/KTX-Software: KTX (Khronos Texture) Library and Tools with prebuilt binaries in releases. You can use toktx to compress images to BasisU and load them in Babylon. Note that this code path is still experimental, but it should be fairly stable.

Where exactly do i find the prebuilt binaries? Searching through the releases page, i cannot find any but the KTX-Software.exe installer. I am particularly interested in a prebuilt toktx.exe!

This installer will install toktx.exe to your system.

We would like to use a portable version of toktx.exe (like basisu.exe). In my tests, the toktx.exe did only work on the machine it was compiled on.

Are you working with Windows? If yes, the prebuilt binary does work (that’s what I’m using), no need to recompile from the sources.

1 Like

What prebuilt binary do you refer to? The only binary i can find is KTX-Software.exe which does install the toktx.exe (which does not work on the other machine when being copy pasted).

It’s the " KTX-Software-4.0.0-beta5-win64.exe" package in this page: Release v4.0.0-beta5 · KhronosGroup/KTX-Software · GitHub

Make sure you copy the ktx.dll file along with the .exe

2 Likes

@Evgeni_Popov thank you that worked. I was not copying the .dll along :slight_smile:
@xiaohuangyu btw. i am using toktx.exe to create .ktx2 files with the same compression as .basis files by calling
toktx.exe --t2 --bcmp image_out.ktx2 image_in.png

1 Like