Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/film/read.h
| Show First 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | ccl_device_inline float4 film_calculate_shadow_catcher_matte_with_shadow( | ||||
| ccl_global const float *in_matte = buffer + kfilm_convert->pass_shadow_catcher_matte; | ccl_global const float *in_matte = buffer + kfilm_convert->pass_shadow_catcher_matte; | ||||
| const float3 shadow_catcher = film_calculate_shadow_catcher(kfilm_convert, buffer); | const float3 shadow_catcher = film_calculate_shadow_catcher(kfilm_convert, buffer); | ||||
| const float3 color_matte = make_float3(in_matte[0], in_matte[1], in_matte[2]) * scale_exposure; | const float3 color_matte = make_float3(in_matte[0], in_matte[1], in_matte[2]) * scale_exposure; | ||||
| const float transparency = in_matte[3] * scale; | const float transparency = in_matte[3] * scale; | ||||
| const float alpha = saturatef(1.0f - transparency); | const float alpha = saturatef(1.0f - transparency); | ||||
| const float alpha_matte = (1.0f - alpha) * (1.0f - average(shadow_catcher)) + alpha; | const float alpha_matte = (1.0f - alpha) * (1.0f - saturatef(average(shadow_catcher))) + alpha; | ||||
| if (kfilm_convert->use_approximate_shadow_catcher_background) { | if (kfilm_convert->use_approximate_shadow_catcher_background) { | ||||
| kernel_assert(kfilm_convert->pass_background != PASS_UNUSED); | kernel_assert(kfilm_convert->pass_background != PASS_UNUSED); | ||||
| ccl_global const float *in_background = buffer + kfilm_convert->pass_background; | ccl_global const float *in_background = buffer + kfilm_convert->pass_background; | ||||
| const float3 color_background = make_float3( | const float3 color_background = make_float3( | ||||
| in_background[0], in_background[1], in_background[2]) * | in_background[0], in_background[1], in_background[2]) * | ||||
| scale_exposure; | scale_exposure; | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||