Cycles: better path termination for transparency.
[blender.git] / intern / cycles / kernel / kernel_bake.h
index 8788e89c40e14bb753251a50245b421b760b1b89..b3c2450d10e13848ad28943c0da9bbdf5577dfeb 100644 (file)
@@ -51,7 +51,7 @@ ccl_device_inline void compute_light_pass(KernelGlobals *kg,
        path_state_init(kg, &emission_sd, &state, rng_hash, sample, NULL);
 
        /* evaluate surface shader */
-       shader_eval_surface(kg, sd, &state, state.flag, kernel_data.integrator.max_closures);
+       shader_eval_surface(kg, sd, &state, state.flag);
 
        /* TODO, disable more closures we don't need besides transparent */
        shader_bsdf_disable_transparency(kg, sd);
@@ -228,12 +228,12 @@ ccl_device float3 kernel_bake_evaluate_direct_indirect(KernelGlobals *kg,
                }
                else {
                        /* surface color of the pass only */
-                       shader_eval_surface(kg, sd, state, 0, kernel_data.integrator.max_closures);
+                       shader_eval_surface(kg, sd, state, 0);
                        return kernel_bake_shader_bsdf(kg, sd, type);
                }
        }
        else {
-               shader_eval_surface(kg, sd, state, 0, kernel_data.integrator.max_closures);
+               shader_eval_surface(kg, sd, state, 0);
                color = kernel_bake_shader_bsdf(kg, sd, type);
        }
 
@@ -333,7 +333,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
                {
                        float3 N = sd.N;
                        if((sd.flag & SD_HAS_BUMP)) {
-                               shader_eval_surface(kg, &sd, &state, 0, kernel_data.integrator.max_closures);
+                               shader_eval_surface(kg, &sd, &state, 0);
                                N = shader_bsdf_average_normal(kg, &sd);
                        }
 
@@ -348,7 +348,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
                }
                case SHADER_EVAL_EMISSION:
                {
-                       shader_eval_surface(kg, &sd, &state, 0, 0);
+                       shader_eval_surface(kg, &sd, &state, PATH_RAY_EMISSION);
                        out = shader_emissive_eval(kg, &sd);
                        break;
                }