Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_emission.h
| Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | |||||
| # endif | # endif | ||||
| path_state_modify_bounce(state, true); | path_state_modify_bounce(state, true); | ||||
| float3 L = shader_eval_background(kg, emission_sd, state, state->flag); | float3 L = shader_eval_background(kg, emission_sd, state, state->flag); | ||||
| path_state_modify_bounce(state, false); | path_state_modify_bounce(state, false); | ||||
| #ifdef __BACKGROUND_MIS__ | #ifdef __BACKGROUND_MIS__ | ||||
| /* check if background light exists or if we should skip pdf */ | /* check if background light exists or if we should skip pdf */ | ||||
| int res = kernel_data.integrator.pdf_background_res; | int res_x = kernel_data.integrator.pdf_background_res_x; | ||||
| if(!(state->flag & PATH_RAY_MIS_SKIP) && res) { | if(!(state->flag & PATH_RAY_MIS_SKIP) && res_x) { | ||||
| /* multiple importance sampling, get background light pdf for ray | /* multiple importance sampling, get background light pdf for ray | ||||
| * direction, and compute weight with respect to BSDF pdf */ | * direction, and compute weight with respect to BSDF pdf */ | ||||
| float pdf = background_light_pdf(kg, ray->P, ray->D); | float pdf = background_light_pdf(kg, ray->P, ray->D); | ||||
| float mis_weight = power_heuristic(state->ray_pdf, pdf); | float mis_weight = power_heuristic(state->ray_pdf, pdf); | ||||
| return L*mis_weight; | return L*mis_weight; | ||||
| } | } | ||||
| #endif | #endif | ||||
| Show All 9 Lines | |||||