Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/bvh/bvh_shadow_all.h
| Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | #endif | ||||
| default: { | default: { | ||||
| hit = false; | hit = false; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* shadow ray early termination */ | /* shadow ray early termination */ | ||||
| if(hit) { | if(hit) { | ||||
| /* detect if this surface has a shader with transparent shadows */ | /* Detect if this surface has a shader with transparent shadows. | ||||
| * if no transparent shadows, all light is blocked. | |||||
| /* todo: optimize so primitive visibility flag indicates if | */ | ||||
| * the primitive has a transparent shadow shader? */ | if((kernel_tex_fetch(__prim_visibility, prim_addr) & PATH_RAY_HAS_TRANSPARENT_SURFACE) == 0) { | ||||
| int prim = kernel_tex_fetch(__prim_index, isect_array->prim); | |||||
| int shader = 0; | |||||
| #ifdef __HAIR__ | |||||
| if(kernel_tex_fetch(__prim_type, isect_array->prim) & PRIMITIVE_ALL_TRIANGLE) | |||||
| #endif | |||||
| { | |||||
| shader = kernel_tex_fetch(__tri_shader, prim); | |||||
| } | |||||
| #ifdef __HAIR__ | |||||
| else { | |||||
| float4 str = kernel_tex_fetch(__curves, prim); | |||||
| shader = __float_as_int(str.z); | |||||
| } | |||||
| #endif | |||||
| int flag = kernel_tex_fetch(__shader_flag, (shader & SHADER_MASK)*SHADER_SIZE); | |||||
| /* if no transparent shadows, all light is blocked */ | |||||
| if(!(flag & SD_HAS_TRANSPARENT_SHADOW)) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| /* if maximum number of hits reached, block all light */ | /* if maximum number of hits reached, block all light */ | ||||
| else if(*num_hits == max_hits) { | else if(*num_hits == max_hits) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| /* move on to next entry in intersections array */ | /* move on to next entry in intersections array */ | ||||
| ▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines | |||||