Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_passes.h
| Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | for(int i = 0; i < sd->num_closure; i++) { | ||||
| ShaderClosure *sc = &sd->closure[i]; | ShaderClosure *sc = &sd->closure[i]; | ||||
| if(!CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) | if(!CLOSURE_IS_BSDF_OR_BSSRDF(sc->type)) | ||||
| continue; | continue; | ||||
| /* All closures contribute to the normal feature, but only diffuse-like ones to the albedo. */ | /* All closures contribute to the normal feature, but only diffuse-like ones to the albedo. */ | ||||
| normal += sc->N * sc->sample_weight; | normal += sc->N * sc->sample_weight; | ||||
| sum_weight += 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; | albedo += sc->weight; | ||||
| sum_nonspecular_weight += sc->sample_weight; | sum_nonspecular_weight += sc->sample_weight; | ||||
| } | } | ||||
| } | } | ||||
| /* Wait for next bounce if 75% or more sample weight belongs to specular-like closures. */ | /* Wait for next bounce if 75% or more sample weight belongs to specular-like closures. */ | ||||
| if((sum_weight == 0.0f) || (sum_nonspecular_weight*4.0f > sum_weight)) { | if((sum_weight == 0.0f) || (sum_nonspecular_weight*4.0f > sum_weight)) { | ||||
| if(sum_weight != 0.0f) { | if(sum_weight != 0.0f) { | ||||
| ▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines | |||||