• Create Account

#ActualChris_F

Posted 03 March 2012 - 08:03 PM

I'm a bit confused about how to properly handle sRGB textures, specifically diffuse textures that are DXT1 encoded.

I'm not 100% sure how the DDS files should be generated. I'm using the texconv tool that comes with the SDK. Since my source image is a sRGB image created in photoshop, I think I should use both the -srgbi and -srgbo flags when encoding the texture.

Next I tried to load the texture like so:

D3DX11CreateShaderResourceViewFromFile(pDevice, "diffuse.dds", NULL, NULL, &pTextureRV1, NULL);


I have a DXGI_FORMAT_R8G8B8A8_UNORM_SRGB framebuffer format and the diffuse texture is not being displayed correctly (it's too dark). I can only guess that D3DX11CreateShaderResourceViewFromFile is not automatically detecting that the image is sRGB.

So next I tried this:

D3DX11_IMAGE_LOAD_INFO loadInfo;

loadInfo.Filter = D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT | D3DX11_FILTER_NONE;



This seems to work, but I notice that is take a much longer to load the texture. Before it loaded almost instantly, but now it takes a second or two to load.

#1Chris_F

Posted 03 March 2012 - 07:48 PM

I'm a bit confused about how to properly handle sRGB textures, specifically diffuse textures that are DXT1 encoded.

I'm not 100% sure how the DDS files should be generated. I'm using the texconv tool that comes with the SDK. Since my source image is a sRGB image created in photoshop, I think I should use both the -srgbi and -srgbo flags when encoding the texture.

Next I tried to load the texture like so:

D3DX11CreateShaderResourceViewFromFile(pDevice, "diffuse.dds", NULL, NULL, &pTextureRV1, NULL);


I have a DXGI_FORMAT_R8G8B8A8_UNORM_SRGB framebuffer format and the diffuse texture is not being displayed correctly (it's too dark). I can only guess that D3DX11CreateShaderResourceViewFromFile is not automatically detecting that the image is sRGB.

So next I tried this:

D3DX11_IMAGE_LOAD_INFO loadInfo;