From 4bdaca627ffabfa6cb79600b200b790f03efc741 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Mon, 21 Feb 2022 23:08:31 +0100 Subject: [PATCH] Don't use BC1_UNORM_SRGB because it breaks YCoCg decoding --- neo/renderer/NVRHI/Image_NVRHI.cpp | 9 ++------- .../builtin/lighting/ambient_lighting_IBL.ps.hlsl | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/neo/renderer/NVRHI/Image_NVRHI.cpp b/neo/renderer/NVRHI/Image_NVRHI.cpp index 1ab84c0a..c5f334d0 100644 --- a/neo/renderer/NVRHI/Image_NVRHI.cpp +++ b/neo/renderer/NVRHI/Image_NVRHI.cpp @@ -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: diff --git a/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl b/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl index 43688468..73d6f4ba 100644 --- a/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl +++ b/neo/shaders/builtin/lighting/ambient_lighting_IBL.ps.hlsl @@ -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 ) );