Cycles: Fix the AO replacement option in the split kernel

Currently the code for it was inside the hair-specific part, so it wouldn't be enabled in hairless renders.
This commit is contained in:
Lukas Stockner 2017-04-11 00:53:31 +02:00
parent 8b0fbb909b
commit ef816f9cff
Notes: blender-bot 2023-02-14 11:07:28 +01:00
Referenced by issue #51169, Push/pull doesn't take object transformations into account
1 changed files with 5 additions and 5 deletions

View File

@ -59,6 +59,11 @@ ccl_device void kernel_scene_intersect(KernelGlobals *kg)
/* intersect scene */
uint visibility = path_state_ray_visibility(kg, &state);
if(state.bounce > kernel_data.integrator.ao_bounces) {
visibility = PATH_RAY_SHADOW;
ray.t = kernel_data.background.ao_distance;
}
#ifdef __HAIR__
float difl = 0.0f, extmax = 0.0f;
uint lcg_state = 0;
@ -75,11 +80,6 @@ ccl_device void kernel_scene_intersect(KernelGlobals *kg)
lcg_state = lcg_state_init(&rng, state.rng_offset, state.sample, 0x51633e2d);
}
if(state.bounce > kernel_data.integrator.ao_bounces) {
visibility = PATH_RAY_SHADOW;
ray.t = kernel_data.background.ao_distance;
}
bool hit = scene_intersect(kg, ray, visibility, &isect, &lcg_state, difl, extmax);
#else
bool hit = scene_intersect(kg, ray, visibility, &isect, NULL, 0.0f, 0.0f);