Don't use BC1_UNORM_SRGB because it breaks YCoCg decoding

This commit is contained in:
Robert Beckebans 2022-02-21 23:08:31 +01:00
parent f9c9f9c65e
commit 4bdaca627f
2 changed files with 3 additions and 8 deletions

View file

@ -277,16 +277,11 @@ void idImage::AllocImage()
break;
case FMT_DXT1:
format = nvrhi::Format::BC1_UNORM_SRGB;
format = nvrhi::Format::BC1_UNORM;
break;
case FMT_DXT5:
// This is used for compressed normals
format = nvrhi::Format::BC3_UNORM_SRGB;
if( usage == TD_BUMP )
{
format = nvrhi::Format::BC3_UNORM;
}
format = nvrhi::Format::BC3_UNORM;
break;
case FMT_DEPTH:

View file

@ -157,7 +157,7 @@ void main( PS_IN fragment, out PS_OUT result )
half4 bumpMap = t_Normal.Sample( samp0, fragment.texcoord0.xy );
half4 YCoCG = t_BaseColor.Sample( samp2, fragment.texcoord1.xy );
half4 specMapSRGB = t_Specular.Sample( samp1, fragment.texcoord2.xy );
half4 specMap = specMapSRGB;//sRGBAToLinearRGBA( specMapSRGB );
half4 specMap = sRGBAToLinearRGBA( specMapSRGB );
half3 diffuseMap = sRGBToLinearRGB( ConvertYCoCgToRGB( YCoCG ) );