24 if (kfilm_convert->pass_sample_count ==
PASS_UNUSED) {
25 return kfilm_convert->scale;
28 if (kfilm_convert->pass_use_filter) {
29 const uint sample_count = *(
31 return 1.0f / sample_count;
41 if (kfilm_convert->pass_sample_count ==
PASS_UNUSED) {
42 return kfilm_convert->scale_exposure;
47 if (kfilm_convert->pass_use_exposure) {
48 return scale * kfilm_convert->exposure;
60 if (kfilm_convert->pass_sample_count ==
PASS_UNUSED) {
61 *scale = kfilm_convert->scale;
62 *scale_exposure = kfilm_convert->scale_exposure;
66 const uint sample_count = *(
70 *scale_exposure = 0.0f;
74 if (kfilm_convert->pass_use_filter) {
75 *scale = 1.0f / sample_count;
81 if (kfilm_convert->pass_use_exposure) {
82 *scale_exposure = *scale * kfilm_convert->exposure;
85 *scale_exposure = *scale;
108 pixel[0] = (f == 0.0f) ? 1e10f : f * scale_exposure;
126 pixel[0] =
saturatef(1.0f - f * scale_exposure);
161 pixel[0] = f * scale_exposure;
182 ccl_global const float *in_indirect =
buffer + kfilm_convert->pass_indirect;
183 const float3 f_indirect =
make_float3(in_indirect[0], in_indirect[1], in_indirect[2]);
194 f *= kfilm_convert->exposure;
206 if (kfilm_convert->num_components >= 4) {
208 float scale, scale_exposure;
211 ccl_global const float *in_combined =
buffer + kfilm_convert->pass_combined;
212 const float alpha = in_combined[3] * scale;
240 if (kfilm_convert->num_components >= 4) {
242 float scale, scale_exposure;
245 ccl_global const float *in_combined =
buffer + kfilm_convert->pass_combined;
246 const float alpha = in_combined[3] * scale;
269 ccl_global const float *in_weight =
buffer + kfilm_convert->pass_motion_weight;
271 const float weight = in_weight[0];
272 const float weight_inv = (weight > 0.0f) ? 1.0f / weight : 0.0f;
299 pixel[1] = f.y * scale;
301 pixel[3] = f.w * scale;
312 float scale, scale_exposure;
318 const float alpha = in[3] * scale;
338 float scale, scale_exposure;
350 const float alpha = in[3] * scale;
368 float scale, scale_exposure;
371 ccl_global const float *in_catcher =
buffer + kfilm_convert->pass_shadow_catcher;
373 const float3 pixel =
make_float3(in_catcher[0], in_catcher[1], in_catcher[2]) * scale_exposure;
382 x = (
b.x != 0.0f) ?
a.x /
b.x : 1.0f;
383 y = (
b.y != 0.0f) ?
a.y /
b.y : 1.0f;
384 z = (
b.z != 0.0f) ?
a.z /
b.z : 1.0f;
397 if (kfilm_convert->is_denoised) {
405 ccl_global const float *in_catcher_sample_count =
406 buffer + kfilm_convert->pass_shadow_catcher_sample_count;
407 const float num_samples = in_catcher_sample_count[0];
413 ccl_global const float *in_catcher =
buffer + kfilm_convert->pass_shadow_catcher;
423 ccl_global const float *in_combined =
buffer + kfilm_convert->pass_combined;
424 ccl_global const float *in_matte =
buffer + kfilm_convert->pass_shadow_catcher_matte;
428 const float3 color_catcher =
make_float3(in_catcher[0], in_catcher[1], in_catcher[2]);
429 const float3 color_combined =
make_float3(in_combined[0], in_combined[1], in_combined[2]);
436 const float3 combined_no_matte = color_combined - color_matte;
441 const float transparency = in_combined[3] * scale;
448 const float3 pixel = (1.0f - alpha) *
one_float3() + alpha * shadow_catcher;
467 float scale, scale_exposure;
472 ccl_global const float *in_matte =
buffer + kfilm_convert->pass_shadow_catcher_matte;
475 const float3 color_matte =
make_float3(in_matte[0], in_matte[1], in_matte[2]) * scale_exposure;
477 const float transparency = in_matte[3] * scale;
478 const float alpha =
saturatef(1.0f - transparency);
480 const float alpha_matte = (1.0f - alpha) * (1.0f -
saturatef(
average(shadow_catcher))) + alpha;
482 if (kfilm_convert->use_approximate_shadow_catcher_background) {
485 ccl_global const float *in_background =
buffer + kfilm_convert->pass_background;
487 in_background[0], in_background[1], in_background[2]) *
489 const float3 alpha_over = color_matte + color_background * (1.0f - alpha_matte);
490 return make_float4(alpha_over.
x, alpha_over.
y, alpha_over.
z, 1.0f);
493 return make_float4(color_matte.
x, color_matte.
y, color_matte.
z, alpha_matte);
505 pixel[0] = pixel_value.
x;
506 pixel[1] = pixel_value.
y;
507 pixel[2] = pixel_value.
z;
515 kernel_assert(kfilm_convert->num_components == 3 || kfilm_convert->num_components == 4);
520 pixel[0] = pixel_value.x;
521 pixel[1] = pixel_value.y;
522 pixel[2] = pixel_value.z;
523 if (kfilm_convert->num_components == 4) {
524 pixel[3] = pixel_value.w;
537 if (kfilm_convert->show_active_pixels &&
538 kfilm_convert->pass_adaptive_aux_buffer !=
PASS_UNUSED) {
539 if (
buffer[kfilm_convert->pass_adaptive_aux_buffer + 3] == 0.0f) {
542 pixel[0] = mix_rgb.
x;
543 pixel[1] = mix_rgb.
y;
544 pixel[2] = mix_rgb.
z;
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
#define kernel_assert(cond)
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_global float * buffer
ccl_gpu_kernel_postfix ccl_global float int int int int ccl_global const float int int int int int int int int int int int int num_samples
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
ccl_device_inline float average(const float2 &a)
ccl_device_inline float3 one_float3()
ccl_device_inline float4 zero_float4()
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
ccl_device_inline bool film_get_scale_and_scale_exposure(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict scale, ccl_private float *ccl_restrict scale_exposure)
ccl_device_inline void film_get_pass_pixel_combined(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
CCL_NAMESPACE_BEGIN ccl_device_forceinline float film_transparency_to_alpha(float transparency)
ccl_device_inline void film_get_pass_pixel_depth(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_get_pass_pixel_light_path(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_get_pass_pixel_float3(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_apply_pass_pixel_overlays_rgba(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline float4 film_calculate_shadow_catcher_matte_with_shadow(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer)
ccl_device_inline void film_get_pass_pixel_motion(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_get_pass_pixel_float4(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_get_pass_pixel_shadow_catcher_matte_with_shadow(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline float3 safe_divide_shadow_catcher(float3 a, float3 b)
ccl_device_inline float film_get_scale(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer)
ccl_device_inline void film_get_pass_pixel_float(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline float film_get_scale_exposure(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer)
ccl_device_inline float3 film_calculate_shadow_catcher_denoised(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer)
ccl_device_inline void film_get_pass_pixel_sample_count(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_get_pass_pixel_mist(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline float3 film_calculate_shadow_catcher(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer)
ccl_device_inline void film_get_pass_pixel_shadow_catcher(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline void film_get_pass_pixel_cryptomatte(ccl_global const KernelFilmConvert *ccl_restrict kfilm_convert, ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
ccl_device_inline uint __float_as_uint(float f)
ccl_device_inline float3 safe_divide_even_color(float3 a, float3 b)
ccl_device_inline float saturatef(float a)