microsoft/DirectXTex

sRGB to linear color space conversion not working

W4RH4WK opened this issue · 1 comments

If I understand texconv's commandline flags correctly, one should be able to convert an input image from sRGB color space to linear color space by using -srgbi and a format without the _SRGB suffix.

However, this does not seem to work for me.

texconv.exe -y -srgbi -f BC7_UNORM assets/models/Default_albedo.jpg

texdiag.exe info assets/models/Default_albedo.dds
Microsoft (R) DirectX Texture Diagnostic Tool [DirectXTex] Version 2023.1.31.1
Copyright (C) Microsoft Corp.

assets/models/Default_albedo.dds
        width = 2048
       height = 2048
        depth = 1
    mipLevels = 12
    arraySize = 1
       format = BC7_UNORM
    dimension = 2D
   alpha mode = Unknown
       images = 12
   pixel size = 5461 (KB)

Viewing the resulting DDS texture in a texture viewer, or in-engine shows the texture to be too bright.
I've also tried R8G8B8A8_UNORM as format, but the result does not change.

If I use BC7_UNORM_SRGB or R8G8B8A8_UNORM_SRGB as target format the texture looks normal in the viewer and in-engine.

texconv Version 2023.1.31.1

Texture Viewer:

image

In-Engine:

image

Source Image:

Default_albedo

Looks like there's a bug in the GPU compress handling here for this case.