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

This commit is contained in:
Sergey Sharybin 2016-01-11 21:15:09 +05:00
parent 16f8444d9d
commit a60c3c6b21

@ -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);