diff --git a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli index 98dd43d41..718485f2e 100644 --- a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli +++ b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli @@ -135,9 +135,10 @@ sh2 fauxSpecularLobeSH(float3 N, float3 V, float roughness) float3 D = lerp(N, R, f); float3 dominantDir = normalize(D); + float lerpFactor = pow(f, 0.5); sh2 directional = shEvaluate(dominantDir); sh2 cosineLobe = shEvaluateCosineLobe(dominantDir); - sh2 result = shAdd(shScale(directional, f), shScale(cosineLobe, 1 - f)); + sh2 result = shAdd(shScale(directional, lerpFactor), shScale(cosineLobe, 1 - lerpFactor)); return result; } diff --git a/package/Shaders/DeferredCompositeCS.hlsl b/package/Shaders/DeferredCompositeCS.hlsl index fda36db46..d0743fe72 100644 --- a/package/Shaders/DeferredCompositeCS.hlsl +++ b/package/Shaders/DeferredCompositeCS.hlsl @@ -120,7 +120,7 @@ Texture3D SkylightingProbeArray : register(t9); specularIrradianceReflections = EnvReflectionsTexture.SampleLevel(LinearSampler, R, level).xyz; specularIrradianceReflections = sRGB2Lin(specularIrradianceReflections); } - finalIrradiance += lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular); + finalIrradiance = finalIrradiance * skylightingSpecular + lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular); # else half3 specularIrradianceReflections = EnvReflectionsTexture.SampleLevel(LinearSampler, R, level).xyz; specularIrradianceReflections = sRGB2Lin(specularIrradianceReflections);