Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/integrator/shader_eval.h
| Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | if (kernel_data.integrator.filter_closures) { | ||||
| if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_DIRECT_LIGHT) { | if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_DIRECT_LIGHT) { | ||||
| sd->flag &= ~SD_BSDF_HAS_EVAL; | sd->flag &= ~SD_BSDF_HAS_EVAL; | ||||
| } | } | ||||
| if (path_flag & PATH_RAY_CAMERA) { | if (path_flag & PATH_RAY_CAMERA) { | ||||
| for (int i = 0; i < sd->num_closure; i++) { | for (int i = 0; i < sd->num_closure; i++) { | ||||
| ccl_private ShaderClosure *sc = &sd->closure[i]; | ccl_private ShaderClosure *sc = &sd->closure[i]; | ||||
| if (CLOSURE_IS_BSDF_DIFFUSE(sc->type)) { | if ((CLOSURE_IS_BSDF_DIFFUSE(sc->type) && | ||||
| if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_DIFFUSE) { | (kernel_data.integrator.filter_closures & FILTER_CLOSURE_DIFFUSE)) || | ||||
| sc->type = CLOSURE_NONE_ID; | (CLOSURE_IS_BSDF_GLOSSY(sc->type) && | ||||
| sc->sample_weight = 0.0f; | (kernel_data.integrator.filter_closures & FILTER_CLOSURE_GLOSSY)) || | ||||
| } | (CLOSURE_IS_BSDF_TRANSMISSION(sc->type) && | ||||
| } | (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSMISSION))) { | ||||
| else if (CLOSURE_IS_BSDF_GLOSSY(sc->type)) { | |||||
| if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_GLOSSY) { | |||||
| sc->type = CLOSURE_NONE_ID; | sc->type = CLOSURE_NONE_ID; | ||||
| sc->sample_weight = 0.0f; | sc->sample_weight = 0.0f; | ||||
| } | } | ||||
| } | else if ((CLOSURE_IS_BSDF_TRANSPARENT(sc->type) && | ||||
| else if (CLOSURE_IS_BSDF_TRANSMISSION(sc->type)) { | (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSPARENT))) { | ||||
| if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSMISSION) { | sc->type = CLOSURE_HOLDOUT_ID; | ||||
| sc->type = CLOSURE_NONE_ID; | |||||
| sc->sample_weight = 0.0f; | sc->sample_weight = 0.0f; | ||||
| } | sd->flag |= SD_HOLDOUT; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Defensive sampling. | /* Defensive sampling. | ||||
| * | * | ||||
| * We can likely also do defensive sampling at deeper bounces, particularly | * We can likely also do defensive sampling at deeper bounces, particularly | ||||
| ▲ Show 20 Lines • Show All 755 Lines • Show Last 20 Lines | |||||