From 0b7d8491aee2801ffcdc51a3c44f4e59cd096b0e Mon Sep 17 00:00:00 2001 From: Pentalimbed Date: Sat, 17 Aug 2024 14:08:36 +0100 Subject: [PATCH] chore: 1.5 for everything --- package/Shaders/Common/Color.hlsli | 4 ++-- package/Shaders/Common/PBR.hlsli | 6 +++--- package/Shaders/Lighting.hlsl | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package/Shaders/Common/Color.hlsli b/package/Shaders/Common/Color.hlsli index 216bd39e6..070aaeee7 100644 --- a/package/Shaders/Common/Color.hlsli +++ b/package/Shaders/Common/Color.hlsli @@ -17,10 +17,10 @@ float RGBToLuminance2(float3 color) float3 sRGB2Lin(float3 color) { - return pow(abs(color), 2.2); + return pow(abs(color), 1.5); } float3 Lin2sRGB(float3 color) { - return pow(abs(color), 1.0 / 2.2); + return pow(abs(color), 1.0 / 1.5); } \ No newline at end of file diff --git a/package/Shaders/Common/PBR.hlsli b/package/Shaders/Common/PBR.hlsli index f52e8295e..0a20d0db0 100644 --- a/package/Shaders/Common/PBR.hlsli +++ b/package/Shaders/Common/PBR.hlsli @@ -87,17 +87,17 @@ namespace PBR float3 AdjustDirectionalLightColor(float3 lightColor) { - return pbrSettings.DirectionalLightColorMultiplier * sRGB2Lin(lightColor); + return pbrSettings.DirectionalLightColorMultiplier * lightColor; } float3 AdjustPointLightColor(float3 lightColor) { - return pbrSettings.PointLightColorMultiplier * sRGB2Lin(lightColor); + return pbrSettings.PointLightColorMultiplier * lightColor; } float3 AdjustAmbientLightColor(float3 lightColor) { - return pbrSettings.AmbientLightColorMultiplier * sRGB2Lin(lightColor); + return pbrSettings.AmbientLightColorMultiplier * lightColor; } // [Jimenez et al. 2016, "Practical Realtime Strategies for Accurate Indirect Occlusion"] diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index 787f1ba7b..393ea878d 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1614,6 +1614,8 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float3 screenSpaceNormal = normalize(WorldToView(worldSpaceNormal, false, eyeIndex)); # if defined(TRUE_PBR) + baseColor.xyz = pow(baseColor.xyz, 1 / 1.5); + PBR::SurfaceProperties pbrSurfaceProperties = PBR::InitSurfaceProperties(); pbrSurfaceProperties.Roughness = saturate(rawRMAOS.x);