Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_do_volume.h
| Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | if (IS_STATE(ray_state, ray_index, RAY_ACTIVE) || | ||||
| ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); | ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]); | ||||
| bool hit = !IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND); | bool hit = !IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND); | ||||
| /* 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); | ||||
| } | } | ||||
| bool volume_visible = kernel_volume_stack_is_visible(kg, state->volume_stack, state->flag); | |||||
| /* volume attenuation, emission, scatter */ | /* volume attenuation, emission, scatter */ | ||||
| if (state->volume_stack[0].shader != SHADER_NONE) { | if (volume_visible) { | ||||
| Ray volume_ray = *ray; | Ray volume_ray = *ray; | ||||
| volume_ray.t = (hit) ? isect->t : FLT_MAX; | volume_ray.t = (hit) ? isect->t : FLT_MAX; | ||||
| # ifdef __BRANCHED_PATH__ | # ifdef __BRANCHED_PATH__ | ||||
| if (!kernel_data.integrator.branched || | if (!kernel_data.integrator.branched || | ||||
| IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { | IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) { | ||||
| # endif /* __BRANCHED_PATH__ */ | # endif /* __BRANCHED_PATH__ */ | ||||
| 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 60 Lines • Show Last 20 Lines | |||||