Cycles: Fix for SSS objects being black when combined with motion blur
This commit is contained in:
@@ -293,10 +293,29 @@ ccl_device int subsurface_scatter_multi_intersect(
|
|||||||
|
|
||||||
for(int hit = 0; hit < num_eval_hits; hit++) {
|
for(int hit = 0; hit < num_eval_hits; hit++) {
|
||||||
/* Quickly retrieve P and Ng without setting up ShaderData. */
|
/* Quickly retrieve P and Ng without setting up ShaderData. */
|
||||||
float3 hit_P = triangle_refine_subsurface(kg,
|
float3 hit_P;
|
||||||
sd,
|
if(ccl_fetch(sd, type) & PRIMITIVE_TRIANGLE) {
|
||||||
&ss_isect->hits[hit],
|
hit_P = triangle_refine_subsurface(kg,
|
||||||
ray);
|
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];
|
float3 hit_Ng = ss_isect->Ng[hit];
|
||||||
if(ss_isect->hits[hit].object != OBJECT_NONE) {
|
if(ss_isect->hits[hit].object != OBJECT_NONE) {
|
||||||
object_normal_transform(kg, sd, &hit_Ng);
|
object_normal_transform(kg, sd, &hit_Ng);
|
||||||
|
Reference in New Issue
Block a user