Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path.h
| Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | ccl_device_forceinline bool kernel_path_scene_intersect( | ||||
| uint visibility = path_state_ray_visibility(kg, state); | uint visibility = path_state_ray_visibility(kg, state); | ||||
| if(path_state_ao_bounce(kg, state)) { | if(path_state_ao_bounce(kg, state)) { | ||||
| visibility = PATH_RAY_SHADOW; | visibility = PATH_RAY_SHADOW; | ||||
| ray->t = kernel_data.background.ao_distance; | ray->t = kernel_data.background.ao_distance; | ||||
| } | } | ||||
| #ifdef __HAIR__ | bool hit = scene_intersect(kg, *ray, visibility, isect); | ||||
| float difl = 0.0f, extmax = 0.0f; | |||||
| uint lcg_state = 0; | |||||
| if(kernel_data.bvh.have_curves) { | |||||
| if((kernel_data.cam.resolution == 1) && (state->flag & PATH_RAY_CAMERA)) { | |||||
| float3 pixdiff = ray->dD.dx + ray->dD.dy; | |||||
| /*pixdiff = pixdiff - dot(pixdiff, ray.D)*ray.D;*/ | |||||
| difl = kernel_data.curve.minimum_width * len(pixdiff) * 0.5f; | |||||
| } | |||||
| extmax = kernel_data.curve.maximum_width; | |||||
| lcg_state = lcg_state_init_addrspace(state, 0x51633e2d); | |||||
| } | |||||
| 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); | |||||
| #endif /* __HAIR__ */ | |||||
| #ifdef __KERNEL_DEBUG__ | #ifdef __KERNEL_DEBUG__ | ||||
| if(state->flag & PATH_RAY_CAMERA) { | if(state->flag & PATH_RAY_CAMERA) { | ||||
| L->debug_data.num_bvh_traversed_nodes += isect->num_traversed_nodes; | L->debug_data.num_bvh_traversed_nodes += isect->num_traversed_nodes; | ||||
| L->debug_data.num_bvh_traversed_instances += isect->num_traversed_instances; | L->debug_data.num_bvh_traversed_instances += isect->num_traversed_instances; | ||||
| L->debug_data.num_bvh_intersections += isect->num_intersections; | L->debug_data.num_bvh_intersections += isect->num_intersections; | ||||
| } | } | ||||
| L->debug_data.num_ray_bounces++; | L->debug_data.num_ray_bounces++; | ||||
| ▲ Show 20 Lines • Show All 683 Lines • Show Last 20 Lines | |||||