Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/bake/bake.h
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | ccl_device void kernel_background_evaluate(KernelGlobals kg, | ||||
| const float3 ray_D = equirectangular_to_direction(in.u, in.v); | const float3 ray_D = equirectangular_to_direction(in.u, in.v); | ||||
| const float ray_time = 0.5f; | const float ray_time = 0.5f; | ||||
| /* Setup shader data. */ | /* Setup shader data. */ | ||||
| ShaderData sd; | ShaderData sd; | ||||
| shader_setup_from_background(kg, &sd, ray_P, ray_D, ray_time); | shader_setup_from_background(kg, &sd, ray_P, ray_D, ray_time); | ||||
| /* Evaluate shader. | /* Evaluate shader. | ||||
| * This is being evaluated for all BSDFs, so path flag does not contain a specific type. */ | * This is being evaluated for all BSDFs, so path flag does not contain a specific type. | ||||
| const uint32_t path_flag = PATH_RAY_EMISSION; | * However, we want to flag the ray visibility to ignore the sun in the background map. */ | ||||
| const uint32_t path_flag = PATH_RAY_EMISSION | PATH_RAY_IMPORTANCE_BAKE; | |||||
brecht: Suggest to rename `PATH_RAY_BACKGROUND_CDF` to `PATH_RAY_IMPORTANCE_BAKE` as a more general… | |||||
| surface_shader_eval<KERNEL_FEATURE_NODE_MASK_SURFACE_LIGHT & | surface_shader_eval<KERNEL_FEATURE_NODE_MASK_SURFACE_LIGHT & | ||||
| ~(KERNEL_FEATURE_NODE_RAYTRACE | KERNEL_FEATURE_NODE_LIGHT_PATH)>( | ~(KERNEL_FEATURE_NODE_RAYTRACE | KERNEL_FEATURE_NODE_LIGHT_PATH)>( | ||||
| kg, INTEGRATOR_STATE_NULL, &sd, NULL, path_flag); | kg, INTEGRATOR_STATE_NULL, &sd, NULL, path_flag); | ||||
| Spectrum color = surface_shader_background(&sd); | Spectrum color = surface_shader_background(&sd); | ||||
| #ifdef __KERNEL_DEBUG_NAN__ | #ifdef __KERNEL_DEBUG_NAN__ | ||||
| if (!isfinite_safe(color)) { | if (!isfinite_safe(color)) { | ||||
| kernel_assert(!"Cycles background with non-finite value detected"); | kernel_assert(!"Cycles background with non-finite value detected"); | ||||
| Show All 36 Lines | |||||
Suggest to rename PATH_RAY_BACKGROUND_CDF to PATH_RAY_IMPORTANCE_BAKE as a more general term, that we might later also use for surface and volume emission.