Cycles: Fix wrong termination criteria in intersect_all functions
It was possible to miss bounces termination criteria in this functions, mainly when max_hits was set to 0. Made the check more robust in traversal functions (which should not affect performance, it's an operation of same complexity AFAIK). Also avoid doing ray-scene intersection from shadow_blocked when limit of transparent bounces was already reached.
This commit is contained in:
@@ -75,7 +75,12 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, ShaderData *shadow_sd,
|
||||
}
|
||||
|
||||
uint num_hits;
|
||||
blocked = scene_intersect_shadow_all(kg, ray, hits, max_hits, &num_hits);
|
||||
if(max_hits == 0) {
|
||||
blocked = true;
|
||||
num_hits = 0;
|
||||
} else {
|
||||
blocked = scene_intersect_shadow_all(kg, ray, hits, max_hits, &num_hits);
|
||||
}
|
||||
|
||||
/* if no opaque surface found but we did find transparent hits, shade them */
|
||||
if(!blocked && num_hits > 0) {
|
||||
|
Reference in New Issue
Block a user