Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path.h
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
| ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg, | ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg, | ||||
| ccl_addr_space PathState *state, | ccl_addr_space PathState *state, | ||||
| Ray *ray, | Ray *ray, | ||||
| Intersection *isect, | Intersection *isect, | ||||
| PathRadiance *L) | PathRadiance *L) | ||||
| { | { | ||||
| PROFILING_INIT(kg, PROFILING_SCENE_INTERSECT); | PROFILING_INIT(kg, PROFILING_SCENE_INTERSECT); | ||||
| uint visibility = path_state_ray_visibility(kg, state); | uint visibility = path_state_ray_visibility(kg, state->flag); | ||||
| 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; | ||||
| } | } | ||||
| bool hit = scene_intersect(kg, ray, visibility, isect); | bool hit = scene_intersect(kg, ray, visibility, isect); | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| PROFILING_INIT(kg, PROFILING_VOLUME); | PROFILING_INIT(kg, PROFILING_VOLUME); | ||||
| /* Sanitize volume stack. */ | /* Sanitize volume stack. */ | ||||
| if (!hit) { | if (!hit) { | ||||
| kernel_volume_clean_stack(kg, state->volume_stack); | kernel_volume_clean_stack(kg, state->volume_stack); | ||||
| } | } | ||||
| if (state->volume_stack[0].shader == SHADER_NONE) { | if (!kernel_volume_stack_is_visible(kg, state->volume_stack, state->flag)) { | ||||
| return VOLUME_PATH_ATTENUATED; | return VOLUME_PATH_ATTENUATED; | ||||
| } | } | ||||
| /* volume attenuation, emission, scatter */ | /* volume attenuation, emission, scatter */ | ||||
| Ray volume_ray = *ray; | Ray volume_ray = *ray; | ||||
| volume_ray.t = (hit) ? isect->t : FLT_MAX; | volume_ray.t = (hit) ? isect->t : FLT_MAX; | ||||
| float step_size = volume_stack_step_size(kg, state->volume_stack); | float step_size = volume_stack_step_size(kg, state->volume_stack); | ||||
| ▲ Show 20 Lines • Show All 535 Lines • Show Last 20 Lines | |||||