atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.24k stars 251 forks source link

Basis texture loading #169

Closed mariosgit closed 3 years ago

mariosgit commented 3 years ago

Hello, I needed to load a basis texture and found, that the code for this is missing.

So I did some copy&paste to get the BasisUniversalTexture.LoadBytesRoutine called just like the KTX does it. So far this works for my buffer based Gltf. For url's, there might be some loading needed with the image/x-basis mime type.

Feel free to use this: https://github.com/mariosgit/glTFast/tree/mb/basis-support

atteneder commented 3 years ago

Hi @mariosgit ,

Thanks for your contribution and sorry for the late response.

Do you mean loading of textures using the basis container ( .basis extension) ?

Since this is not part of the KHR_texture_basisu extension (and no other I know of) it is not implemented (anymore) deliberately. As far as I remember before this extension was ratified, some used to use the basis container as well as KTX2, but that's not conformant anymore.

What is your use case? Which tool produces glTFs like that?

If you have good reasoning for this, please comment and fee free to re-open the issue and/or make a PR.