Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_path.h
| Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | ccl_device_forceinline void kernel_path_background( | ||||
| KernelGlobals *kg, | KernelGlobals *kg, | ||||
| ccl_addr_space PathState *state, | ccl_addr_space PathState *state, | ||||
| ccl_addr_space Ray *ray, | ccl_addr_space Ray *ray, | ||||
| float3 throughput, | float3 throughput, | ||||
| ShaderData *emission_sd, | ShaderData *emission_sd, | ||||
| PathRadiance *L) | PathRadiance *L) | ||||
| { | { | ||||
| /* eval background shader if nothing hit */ | /* eval background shader if nothing hit */ | ||||
| if(kernel_data.background.transparent && (state->flag & PATH_RAY_CAMERA)) { | bool direct_hit = (state->flag & PATH_RAY_CAMERA); | ||||
| bool indirect_hit = (state->flag & PATH_RAY_TRANSMIT) && (state->flag & PATH_RAY_TRANSPARENT_GLASS); | |||||
| if(kernel_data.background.transparent && (direct_hit || indirect_hit)) { | |||||
| L->transparent += average(throughput); | L->transparent += average(throughput); | ||||
| #ifdef __PASSES__ | #ifdef __PASSES__ | ||||
| if(!(kernel_data.film.pass_flag & PASS_BACKGROUND)) | if(!(kernel_data.film.pass_flag & PASS_BACKGROUND)) | ||||
| #endif /* __PASSES__ */ | #endif /* __PASSES__ */ | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 581 Lines • Show Last 20 Lines | |||||