gltf
gltf copied to clipboard
Add an option to load R, RG, RGB images as RGBA.
I tried to use R8G8B8_SRGB format in Vulkan but got an error.
Since most graphics card does not support RGB only image, it would be convenient and faster to load them as RGBA images (using the image crate).
+1 from my side, as I ran into the same issue. I'm closing https://github.com/gltf-rs/gltf/issues/370 in favour of this better phrased issue.
If that can help someone, I've tried to make a solution to this over on this fork: https://github.com/Ithyx/gltf/commit/875c134bb7a6f35d27d88d9d49997f66269fec5e
It doesn't work with any format that isn't 8 bits per channel (although it could work with a bit more work), and isn't especially efficient, but it gets the job done for my use case. However it is very much a hack, it doesn't ensure that the texture is loaded using the desired format, only that there is a way to convert that texture when accessing it.