Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/film/passes.h
| Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | ccl_device_forceinline void kernel_write_denoising_features_volume(KernelGlobals kg, | ||||
| if (kernel_data.film.pass_denoising_albedo != PASS_UNUSED) { | if (kernel_data.film.pass_denoising_albedo != PASS_UNUSED) { | ||||
| /* Write albedo. */ | /* Write albedo. */ | ||||
| const float3 denoising_albedo = ensure_finite3(denoising_feature_throughput * albedo); | const float3 denoising_albedo = ensure_finite3(denoising_feature_throughput * albedo); | ||||
| kernel_write_pass_float3(buffer + kernel_data.film.pass_denoising_albedo, denoising_albedo); | kernel_write_pass_float3(buffer + kernel_data.film.pass_denoising_albedo, denoising_albedo); | ||||
| } | } | ||||
| } | } | ||||
| #endif /* __DENOISING_FEATURES__ */ | #endif /* __DENOISING_FEATURES__ */ | ||||
| #ifdef __SHADOW_CATCHER__ | |||||
| /* Write shadow catcher passes on a bounce from the shadow catcher object. */ | |||||
| ccl_device_forceinline void kernel_write_shadow_catcher_bounce_data( | |||||
| KernelGlobals kg, | |||||
| IntegratorState state, | |||||
| ccl_private const ShaderData *sd, | |||||
| ccl_global float *ccl_restrict render_buffer) | |||||
| { | |||||
| if (!kernel_data.integrator.has_shadow_catcher) { | |||||
| return; | |||||
| } | |||||
| kernel_assert(kernel_data.film.pass_shadow_catcher_sample_count != PASS_UNUSED); | |||||
| kernel_assert(kernel_data.film.pass_shadow_catcher_matte != PASS_UNUSED); | |||||
| if (!kernel_shadow_catcher_is_path_split_bounce(kg, state, sd->object_flag)) { | |||||
| return; | |||||
| } | |||||
| ccl_global float *buffer = kernel_pass_pixel_render_buffer(kg, state, render_buffer); | |||||
| /* Count sample for the shadow catcher object. */ | |||||
| kernel_write_pass_float(buffer + kernel_data.film.pass_shadow_catcher_sample_count, 1.0f); | |||||
| /* Since the split is done, the sample does not contribute to the matte, so accumulate it as | |||||
| * transparency to the matte. */ | |||||
| const float3 throughput = INTEGRATOR_STATE(state, path, throughput); | |||||
| kernel_write_pass_float(buffer + kernel_data.film.pass_shadow_catcher_matte + 3, | |||||
| average(throughput)); | |||||
| } | |||||
| #endif /* __SHADOW_CATCHER__ */ | |||||
| ccl_device_inline size_t kernel_write_id_pass(ccl_global float *ccl_restrict buffer, | ccl_device_inline size_t kernel_write_id_pass(ccl_global float *ccl_restrict buffer, | ||||
| size_t depth, | size_t depth, | ||||
| float id, | float id, | ||||
| float matte_weight) | float matte_weight) | ||||
| { | { | ||||
| kernel_write_id_slots(buffer, depth * 2, id, matte_weight); | kernel_write_id_slots(buffer, depth * 2, id, matte_weight); | ||||
| return depth * 4; | return depth * 4; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines | |||||