Remix.run Logo
jms55 3 days ago

I've been evaluating texture compression options for including in Bevy https://bevy.org, and there's just, not really any good options?

Requirements:

* Generate mipmaps

* Convert to BC and ASTC

* Convert to ktx2 with zstd super-compression

* Handle color, normal maps, alpha masks, HDR textures, etc

* Open source

* (Nice to have) runs on the GPU to be fast

I unfortunately haven't found any option that cover all of these points. Some tools only write DDS, or don't handle ASTC, or want to use basis universal, or don't generate mipmaps, etc.

xyzsparetimexyz 3 days ago | parent | next [-]

Why not just use BC7 (BC6H for HDR) textures on desktop and ASTC on mobile? There's no need to ship an format like basisu that converts to both. There are rust bindings for both the Intel ispc BC(n) compressor and ASTCenc.

Oh but if you care about GPU support then I'm pretty sure https://github.com/GPUOpen-Tools/Compressonator has GPU support for BC(n) compression at least. Could rip those shaders out.

flohofwoe 3 days ago | parent [-]

Basis Universal also gives you much smaller size over the wire than hardware compressed formats (closer to jpg), which is important at least for web games (or any game that streams asset data over the net).

raincole 3 days ago | parent | prev | next [-]

What did bevy end up using?

jms55 3 days ago | parent [-]

Nothing, I haven't found a good option yet.

We do have the existing bindings to a 2-year old version of basis universal, but I've been looking to replace it.

pornel 3 days ago | parent | next [-]

I don't think you'll find anything much better than basis universal, assuming you want textures compressed on the GPU and the simplicity of shipping one file that decodes quickly enough. I've followed development of the encoder, and its authors know what they're doing.

You might beat basisu if you encode for one texture format at a time, and use perceptual RDO for albedo textures.

Another alternative would be to use JPEG XL for distribution and transcode to GPU texture formats on install, but you'd have to ship a decent GPU texture compressor (fast ones leave quality on the table, and it's really hard to make a good one that isn't exponentially slower).

raincole 3 days ago | parent | prev [-]

Is basis universal that bad? I thought it's more or less invented for this purpose.

BriggyDwiggs42 3 days ago | parent | prev [-]

Oh cool I used bevy for something. Really good shit