[Bf-blender-cvs] [d0a9ec5] master: Cycles: Fix SSS object not properly reflected in glossy object with indirect clamping
Sergey Sharybin
noreply at git.blender.org
Wed Dec 2 12:00:05 CET 2015
Commit: d0a9ec5efcebd66896b75010ee6093b505e99ad2
Author: Sergey Sharybin
Date: Wed Dec 2 15:59:12 2015 +0500
Branches: master
https://developer.blender.org/rBd0a9ec5efcebd66896b75010ee6093b505e99ad2
Cycles: Fix SSS object not properly reflected in glossy object with indirect clamping
This fixes remained issues reported in T46908.
===================================================================
M intern/cycles/kernel/kernel_accumulate.h
M intern/cycles/kernel/kernel_path.h
===================================================================
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h
index 2dc87ff..29eca86 100644
--- a/intern/cycles/kernel/kernel_accumulate.h
+++ b/intern/cycles/kernel/kernel_accumulate.h
@@ -339,6 +339,23 @@ ccl_device_inline void path_radiance_reset_indirect(PathRadiance *L)
#endif
}
+ccl_device_inline void path_radiance_copy_indirect(PathRadiance *L,
+ const PathRadiance *L_src)
+{
+#ifdef __PASSES__
+ if(L->use_light_pass) {
+ L->path_diffuse = L_src->path_diffuse;
+ L->path_glossy = L_src->path_glossy;
+ L->path_transmission = L_src->path_transmission;
+ L->path_subsurface = L_src->path_subsurface;
+ L->path_scatter = L_src->path_scatter;
+
+ L->direct_emission = L_src->direct_emission;
+ L->indirect = L_src->indirect;
+ }
+#endif
+}
+
ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadiance *L)
{
float3 L_sum;
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h
index 72c0f7a..82cad78 100644
--- a/intern/cycles/kernel/kernel_path.h
+++ b/intern/cycles/kernel/kernel_path.h
@@ -497,6 +497,9 @@ ccl_device bool kernel_path_subsurface_scatter(
hit_state->rng_offset += PRNG_BOUNCE_NUM;
path_radiance_init(hit_L, kernel_data.film.use_light_pass);
+ hit_L->direct_throughput = L->direct_throughput;
+ path_radiance_copy_indirect(hit_L, L);
+
kernel_path_surface_connect_light(kg, rng, sd, *hit_tp, state, hit_L);
if(kernel_path_surface_bounce(kg,
@@ -524,7 +527,7 @@ ccl_device bool kernel_path_subsurface_scatter(
hit_state->volume_stack);
}
#endif
-
+ path_radiance_reset_indirect(L);
ss_indirect->num_rays++;
}
else {
More information about the Bf-blender-cvs
mailing list