diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-11-18 19:58:26 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-11-18 19:58:26 +0300 |
commit | ada6742601a715ee0d078cd693ba303a8286e1bd (patch) | |
tree | 1027d79363821162f50ef4948552119f7491c738 /intern/cycles/kernel/integrator | |
parent | 701f2dfd5bc61c0f37603880fa21abfe8b1d9620 (diff) | |
parent | 7c4e4d605c5f7390292586131e126e412e443029 (diff) |
Merge remote-tracking branch 'origin/blender-v3.0-release'
Diffstat (limited to 'intern/cycles/kernel/integrator')
-rw-r--r-- | intern/cycles/kernel/integrator/init_from_bake.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/integrator/shader_eval.h | 29 |
2 files changed, 18 insertions, 19 deletions
diff --git a/intern/cycles/kernel/integrator/init_from_bake.h b/intern/cycles/kernel/integrator/init_from_bake.h index df1c7fd07e7..f4a2fbea405 100644 --- a/intern/cycles/kernel/integrator/init_from_bake.h +++ b/intern/cycles/kernel/integrator/init_from_bake.h @@ -71,14 +71,16 @@ ccl_device bool integrator_init_from_bake(KernelGlobals kg, /* Setup render buffers. */ const int index = INTEGRATOR_STATE(state, path, render_pixel_index); const int pass_stride = kernel_data.film.pass_stride; - render_buffer += index * pass_stride; + ccl_global float *buffer = render_buffer + index * pass_stride; - ccl_global float *primitive = render_buffer + kernel_data.film.pass_bake_primitive; - ccl_global float *differential = render_buffer + kernel_data.film.pass_bake_differential; + ccl_global float *primitive = buffer + kernel_data.film.pass_bake_primitive; + ccl_global float *differential = buffer + kernel_data.film.pass_bake_differential; const int seed = __float_as_uint(primitive[0]); int prim = __float_as_uint(primitive[1]); if (prim == -1) { + /* Accumulate transparency for empty pixels. */ + kernel_accum_transparent(kg, state, 0, 1.0f, buffer); return false; } diff --git a/intern/cycles/kernel/integrator/shader_eval.h b/intern/cycles/kernel/integrator/shader_eval.h index 169a01d0797..2dcba73561d 100644 --- a/intern/cycles/kernel/integrator/shader_eval.h +++ b/intern/cycles/kernel/integrator/shader_eval.h @@ -122,23 +122,20 @@ ccl_device_inline void shader_prepare_surface_closures(KernelGlobals kg, for (int i = 0; i < sd->num_closure; i++) { ccl_private ShaderClosure *sc = &sd->closure[i]; - if (CLOSURE_IS_BSDF_DIFFUSE(sc->type)) { - if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_DIFFUSE) { - sc->type = CLOSURE_NONE_ID; - sc->sample_weight = 0.0f; - } + if ((CLOSURE_IS_BSDF_DIFFUSE(sc->type) && + (kernel_data.integrator.filter_closures & FILTER_CLOSURE_DIFFUSE)) || + (CLOSURE_IS_BSDF_GLOSSY(sc->type) && + (kernel_data.integrator.filter_closures & FILTER_CLOSURE_GLOSSY)) || + (CLOSURE_IS_BSDF_TRANSMISSION(sc->type) && + (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSMISSION))) { + sc->type = CLOSURE_NONE_ID; + sc->sample_weight = 0.0f; } - else if (CLOSURE_IS_BSDF_GLOSSY(sc->type)) { - if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_GLOSSY) { - sc->type = CLOSURE_NONE_ID; - sc->sample_weight = 0.0f; - } - } - else if (CLOSURE_IS_BSDF_TRANSMISSION(sc->type)) { - if (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSMISSION) { - sc->type = CLOSURE_NONE_ID; - sc->sample_weight = 0.0f; - } + else if ((CLOSURE_IS_BSDF_TRANSPARENT(sc->type) && + (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSPARENT))) { + sc->type = CLOSURE_HOLDOUT_ID; + sc->sample_weight = 0.0f; + sd->flag |= SD_HOLDOUT; } } } |