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
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-01-11 19:15:09 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-01-11 19:39:24 +0300
commita60c3c6b21b835ab9160becd4bded0573e1b23a9 (patch)
tree88f6eb9f60fc1e0250973eec2898516baeca81e0 /intern
parent16f8444d9d64967331e1a386ecc676b464869428 (diff)
Cycles: Fix for SSS objects being black when combined with motion blur
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/kernel_subsurface.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index 1189f4ce406..2685cc009df 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -293,10 +293,29 @@ ccl_device int subsurface_scatter_multi_intersect(
for(int hit = 0; hit < num_eval_hits; hit++) {
/* Quickly retrieve P and Ng without setting up ShaderData. */
- float3 hit_P = triangle_refine_subsurface(kg,
- sd,
- &ss_isect->hits[hit],
- ray);
+ float3 hit_P;
+ if(ccl_fetch(sd, type) & PRIMITIVE_TRIANGLE) {
+ hit_P = triangle_refine_subsurface(kg,
+ sd,
+ &ss_isect->hits[hit],
+ ray);
+ }
+#ifdef __OBJECT_MOTION__
+ else if(ccl_fetch(sd, type) & PRIMITIVE_MOTION_TRIANGLE) {
+ float3 verts[3];
+ motion_triangle_vertices(kg,
+ ccl_fetch(sd, object),
+ ccl_fetch(sd, prim),
+ ccl_fetch(sd, time),
+ verts);
+ hit_P = motion_triangle_refine_subsurface(kg,
+ sd,
+ &ss_isect->hits[hit],
+ ray,
+ verts);
+ }
+#endif /* __OBJECT_MOTION__ */
+
float3 hit_Ng = ss_isect->Ng[hit];
if(ss_isect->hits[hit].object != OBJECT_NONE) {
object_normal_transform(kg, sd, &hit_Ng);