[Bf-blender-cvs] [a60c3c6] master: Cycles: Fix for SSS objects being black when combined with motion blur

Sergey Sharybin noreply at git.blender.org
Mon Jan 11 17:39:28 CET 2016


Commit: a60c3c6b21b835ab9160becd4bded0573e1b23a9
Author: Sergey Sharybin
Date:   Mon Jan 11 21:15:09 2016 +0500
Branches: master
https://developer.blender.org/rBa60c3c6b21b835ab9160becd4bded0573e1b23a9

Cycles: Fix for SSS objects being black when combined with motion blur

===================================================================

M	intern/cycles/kernel/kernel_subsurface.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index 1189f4c..2685cc0 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);




More information about the Bf-blender-cvs mailing list