Cycles: Refactor closure roughness detection to fix a potential bug with Denoising of specular shaders

This commit is contained in:
Lukas Stockner
2017-11-05 21:43:23 +01:00
parent f402638211
commit d8066fb0f1
4 changed files with 28 additions and 22 deletions

View File

@@ -140,7 +140,7 @@ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg,
/* All closures contribute to the normal feature, but only diffuse-like ones to the albedo. */
normal += sc->N * sc->sample_weight;
sum_weight += sc->sample_weight;
if(!bsdf_is_specular_like(sc)) {
if(bsdf_get_roughness_sqr(sc) > sqr(0.075f)) {
albedo += sc->weight;
sum_nonspecular_weight += sc->sample_weight;
}