diff --git a/Source/Shaders/CmSVGFTemporalAccumulation.comp b/Source/Shaders/CmSVGFTemporalAccumulation.comp index 74328fa7..6d7123c2 100644 --- a/Source/Shaders/CmSVGFTemporalAccumulation.comp +++ b/Source/Shaders/CmSVGFTemporalAccumulation.comp @@ -228,12 +228,12 @@ void main() // specular { - // const float roughness = texelFetch(framebufMetallicRoughness_Sampler, pix, 0).g; + const float roughness = texelFetch(framebufMetallicRoughness_Sampler, pix, 0).g; // antilagAlpha_Spec *= (1 - roughness) * 0.9 + 0.1; specHistoryLength *= pow(1.0 - antilagAlpha_Spec, 5); - specHistoryLength = clamp(specHistoryLength + 1.0, 1.0, 64.0); + specHistoryLength = clamp(specHistoryLength + 1.0, 1.0, mix(8.0, 64.0, roughness)); const float minAlpha = 0.01; float alphaColor = max(minAlpha, 1.0 / specHistoryLength);