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:
Diffstat (limited to 'intern/cycles/kernel/kernel_path_subsurface.h')
-rw-r--r--intern/cycles/kernel/kernel_path_subsurface.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_path_subsurface.h b/intern/cycles/kernel/kernel_path_subsurface.h
index 962776f21c1..b5a92c74ed5 100644
--- a/intern/cycles/kernel/kernel_path_subsurface.h
+++ b/intern/cycles/kernel/kernel_path_subsurface.h
@@ -64,6 +64,11 @@ bool kernel_path_subsurface_scatter(
sd->object_flag & SD_OBJECT_INTERSECTS_VOLUME;
# endif /* __VOLUME__ */
+ /* Closure memory will be overwritten, so read required variables now. */
+ Bssrdf *bssrdf = (Bssrdf *)sc;
+ ClosureType bssrdf_type = sc->type;
+ float bssrdf_roughness = bssrdf->roughness;
+
/* compute lighting with the BSDF closure */
for(int hit = 0; hit < num_hits; hit++) {
/* NOTE: We reuse the existing ShaderData, we assume the path
@@ -74,7 +79,8 @@ bool kernel_path_subsurface_scatter(
hit,
sd,
state,
- sc);
+ bssrdf_type,
+ bssrdf_roughness);
kernel_path_surface_connect_light(kg, sd, emission_sd, *throughput, state, L);