RGB/RGBA format export option

Hello! We’re starting to adapt the NVTT exporter with its support for KTX2 output. So far, it has been phenomenal! It seems like the best tool for what we’ve needed in our game asset pipeline.

I see that the tool supports BGR8, BGRA8, and RGBA16F outputs and confirmed that they export correctly in KTX2. However, our asset pipeline and runtime expect RGBA8 inputs for most color images. I couldn’t find RGBA8 in the list of export formats in the NVTT Exporter CLI or GUI.

Are RGB8 and RGBA8 supported already? If not, I’d like to request support for those formats.

Additionally, is there an option to specify the image color space, like sRGB gamma encoded (VK_FORMAT_R8G8B8A8_SRGB) vs linear (VK_FORMAT_R8G8B8A8_UNORM)? KTX2 supports both of these formats and the distinction is important for our content pipeline. The BGRA format description in the UI says that it’s sRGB and I can confirm that it exports as VK_FORMAT_B8G8R8_SRGB.

Even when passing --to-normal-ts, which should yield linear color output, the output format is still VK_FORMAT_B8G8R8_SRGB.

The Khronos Texture Tools like toktx have an --assign_oetf flag that can be given srgb or linear. It works very well in our pipeline!

Thank you!

Hi @lpghatguy1, thank you for the feedback!

BGRA8 is the closest thing we have to RGBA8 (the red and blue channels are swapped); it’s not too much trouble for us to add that and I’ll take that as a feature request.

For the output color space setting, I may have an update regarding that in the future. All I’ll say for now is that you’re asking at a good time!

Thank you,

–Neil

Hi @lpghatguy1!

Quick update on this: We just released NVTT Exporter 2024.1.0 today, which adds support for assigning a transfer function to the output image instead of using the Exporter’s default! It’s “Export Transfer Function” in the GUI, and --export-transfer-function (default, linear, or srgb) in the command line.

RGB8 and RGBA8 instead of BGR8 and BGRA8 are still to-do items; I hope to have updates on them later.

Thank you again for these feature requests!

–Neil

1 Like