Cycles: take into account diffuse roughness for roughness baking.

Roughness baking previously defaulted to 1.0 for all diffuse materials,
now we also bake roughness values of Oren-Nayer and Principled Diffuse.

Differential Revision: https://developer.blender.org/D3115
This commit is contained in:
Matt Heimlich
2018-03-28 23:18:46 +02:00
committed by Brecht Van Lommel
parent 1953de335e
commit e3f1d98098
2 changed files with 26 additions and 4 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_get_roughness_squared(sc) > sqr(0.075f)) {
if(bsdf_get_specular_roughness_squared(sc) > sqr(0.075f)) {
albedo += sc->weight;
sum_nonspecular_weight += sc->sample_weight;
}