Cycles: don't count volume boundaries as transparent bounces.
[blender-staging.git] / intern / cycles / kernel / split / kernel_shader_setup.h
index 9d428ee813990a4421e43da6fb07d4015f489cd4..ea3ec2ec83fe82a2f86dc480b813e7223fbae007 100644 (file)
@@ -59,12 +59,20 @@ ccl_device void kernel_shader_setup(KernelGlobals *kg,
        if(IS_STATE(kernel_split_state.ray_state, ray_index, RAY_ACTIVE)) {
                Intersection isect = kernel_split_state.isect[ray_index];
                Ray ray = kernel_split_state.ray[ray_index];
+               ShaderData *sd = kernel_split_sd(sd, ray_index);
 
                shader_setup_from_ray(kg,
-                                     kernel_split_sd(sd, ray_index),
+                                     sd,
                                      &isect,
                                      &ray);
+
+#ifdef __VOLUME__
+               if(sd->flag & SD_HAS_ONLY_VOLUME) {
+                       ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_HAS_ONLY_VOLUME);
+               }
+#endif
        }
+
 }
 
 CCL_NAMESPACE_END