Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Werner <stefan@keindesign.de>2020-03-10 18:50:51 +0300
committerStefan Werner <stefan@keindesign.de>2020-03-10 18:50:51 +0300
commit7c027f9480a9dfa4e9a478a27300cff89a7f000a (patch)
treee0e971e0df534fb0ab5077a1c7649a9dc998b918 /intern/cycles/kernel
parentbe20bf2fc0704fa5894dbce5e3dbb0b7784eb3eb (diff)
Cycles: Fixed Shadow and Mist passes with adaptive sampling.
This also fixes a side-effect where turning on UV pass but leaving Shadow pass turned off destroyed the Combined pass.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_adaptive_sampling.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_adaptive_sampling.h b/intern/cycles/kernel/kernel_adaptive_sampling.h
index 502b69e4f7f..047fe8c92ec 100644
--- a/intern/cycles/kernel/kernel_adaptive_sampling.h
+++ b/intern/cycles/kernel/kernel_adaptive_sampling.h
@@ -54,12 +54,6 @@ ccl_device void kernel_adaptive_post_adjust(KernelGlobals *kg,
#ifdef __PASSES__
int flag = kernel_data.film.pass_flag;
- if (flag & PASSMASK(SHADOW))
- *(ccl_global float3 *)(buffer + kernel_data.film.pass_shadow) *= sample_multiplier;
-
- if (flag & PASSMASK(MIST))
- *(ccl_global float *)(buffer + kernel_data.film.pass_mist) *= sample_multiplier;
-
if (flag & PASSMASK(NORMAL))
*(ccl_global float3 *)(buffer + kernel_data.film.pass_normal) *= sample_multiplier;
@@ -74,6 +68,11 @@ ccl_device void kernel_adaptive_post_adjust(KernelGlobals *kg,
if (kernel_data.film.use_light_pass) {
int light_flag = kernel_data.film.light_pass_flag;
+ if (light_flag & PASSMASK(MIST))
+ *(ccl_global float *)(buffer + kernel_data.film.pass_mist) *= sample_multiplier;
+
+ /* Shadow pass omitted on purpose. It has its own scale parameter. */
+
if (light_flag & PASSMASK(DIFFUSE_INDIRECT))
*(ccl_global float3 *)(buffer + kernel_data.film.pass_diffuse_indirect) *= sample_multiplier;
if (light_flag & PASSMASK(GLOSSY_INDIRECT))