gltf icon indicating copy to clipboard operation
gltf copied to clipboard

Add an option to load R, RG, RGB images as RGBA.

Open KaminariOS opened this issue 1 year ago • 2 comments

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).

KaminariOS avatar Apr 26 '23 14:04 KaminariOS

+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.

stefnotch avatar Apr 26 '23 21:04 stefnotch

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.

Ithyx avatar Jun 17 '23 07:06 Ithyx