Blender V5.0
read.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5/* Functions to retrieving render passes for display or output. Reading from
6 * the raw render buffer and normalizing based on the number of samples,
7 * computing alpha, compositing shadow catchers, etc. */
8
9#pragma once
10
11#include "kernel/types.h"
12
13#include "util/color.h"
14
16
17/* --------------------------------------------------------------------
18 * Common utilities.
19 */
20
21/* The input buffer contains transparency = 1 - alpha, this converts it to
22 * alpha. Also clamp since alpha might end up outside of 0..1 due to Russian
23 * roulette. */
25{
26 return saturatef(1.0f - transparency);
27}
28
30 kfilm_convert,
31 const ccl_global float *ccl_restrict buffer)
32{
33 if (kfilm_convert->pass_sample_count == PASS_UNUSED) {
34 return kfilm_convert->scale;
35 }
36
37 if (kfilm_convert->pass_use_filter) {
38 const uint sample_count = *(
39 (const ccl_global uint *)(buffer + kfilm_convert->pass_sample_count));
40 return kfilm_convert->scale / sample_count;
41 }
42
43 return kfilm_convert->scale;
44}
45
47 kfilm_convert,
48 const ccl_global float *ccl_restrict buffer)
49{
50 if (kfilm_convert->pass_sample_count == PASS_UNUSED) {
51 return kfilm_convert->scale_exposure;
52 }
53
54 const float scale = film_get_scale(kfilm_convert, buffer);
55
56 if (kfilm_convert->pass_use_exposure) {
57 return scale * kfilm_convert->exposure;
58 }
59
60 return scale;
61}
62
64 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
65 const ccl_global float *ccl_restrict buffer,
66 ccl_private float *ccl_restrict scale,
67 ccl_private float *ccl_restrict scale_exposure)
68{
69 if (kfilm_convert->pass_sample_count == PASS_UNUSED) {
70 *scale = kfilm_convert->scale;
71 *scale_exposure = kfilm_convert->scale_exposure;
72 return true;
73 }
74
75 const uint sample_count = *(
76 (const ccl_global uint *)(buffer + kfilm_convert->pass_sample_count));
77 if (!sample_count) {
78 *scale = 0.0f;
79 *scale_exposure = 0.0f;
80 return false;
81 }
82
83 if (kfilm_convert->pass_use_filter) {
84 *scale = kfilm_convert->scale / sample_count;
85 }
86 else {
87 *scale = kfilm_convert->scale;
88 }
89
90 if (kfilm_convert->pass_use_exposure) {
91 *scale_exposure = *scale * kfilm_convert->exposure;
92 }
93 else {
94 *scale_exposure = *scale;
95 }
96
97 return true;
98}
99
100/* --------------------------------------------------------------------
101 * Float (scalar) passes.
102 */
103
105 kfilm_convert,
106 const ccl_global float *ccl_restrict buffer,
107 ccl_private float *ccl_restrict pixel)
108{
109 kernel_assert(kfilm_convert->num_components >= 1);
110 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
111
112 const float scale_exposure = film_get_scale_exposure(kfilm_convert, buffer);
113
114 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
115 const float f = *in;
116
117 pixel[0] = (f == 0.0f) ? 1e10f : f * scale_exposure;
118}
119
121 kfilm_convert,
122 const ccl_global float *ccl_restrict buffer,
123 ccl_private float *ccl_restrict pixel)
124{
125 kernel_assert(kfilm_convert->num_components >= 1);
126 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
127
128 const float scale_exposure = film_get_scale_exposure(kfilm_convert, buffer);
129
130 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
131 const float f = *in;
132
133 /* Note that we accumulate 1 - mist in the kernel to avoid having to
134 * track the mist values in the integrator state. */
135 pixel[0] = saturatef(1.0f - f * scale_exposure);
136}
137
139 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
140 const ccl_global float *ccl_restrict buffer,
141 ccl_private float *ccl_restrict pixel)
142{
143 /* TODO(sergey): Consider normalizing into the [0..1] range, so that it is possible to see
144 * meaningful value when adaptive sampler stopped rendering image way before the maximum
145 * number of samples was reached (for examples when number of samples is set to 0 in
146 * viewport). */
147
148 kernel_assert(kfilm_convert->num_components >= 1);
149 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
150
151 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
152 const float f = *in;
153
154 pixel[0] = __float_as_uint(f) * kfilm_convert->scale;
155}
156
158 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
159 const ccl_global float *ccl_restrict buffer,
160 ccl_private float *ccl_restrict pixel)
161{
162 kernel_assert(kfilm_convert->num_components >= 1);
163 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
164
165 const float scale_exposure = film_get_scale_exposure(kfilm_convert, buffer);
166
167 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
168 const ccl_global float *count = buffer + kfilm_convert->pass_divide;
169 const float f = *in;
170
171 pixel[0] = (*count != 0.0f) ? expf(-(f * scale_exposure) / *count) : 0.0f;
172}
173
175 kfilm_convert,
176 const ccl_global float *ccl_restrict buffer,
177 ccl_private float *ccl_restrict pixel)
178{
179 kernel_assert(kfilm_convert->num_components >= 1);
180 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
181
182 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
183 const float3 f = rgbe_to_rgb(RGBE(*in));
184
185 pixel[0] = f.x;
186 pixel[1] = f.y;
187 pixel[2] = f.z;
188}
189
191 kfilm_convert,
192 const ccl_global float *ccl_restrict buffer,
193 ccl_private float *ccl_restrict pixel)
194{
195 kernel_assert(kfilm_convert->num_components >= 1);
196 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
197
198 const float scale_exposure = film_get_scale_exposure(kfilm_convert, buffer);
199
200 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
201 const float f = *in;
202
203 pixel[0] = f * scale_exposure;
204}
205
206/* --------------------------------------------------------------------
207 * Float 3 passes.
208 */
209
211 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
212 const ccl_global float *ccl_restrict buffer,
213 ccl_private float *ccl_restrict pixel)
214{
215 kernel_assert(kfilm_convert->num_components >= 3);
216 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
217
218 /* Read light pass. */
219 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
220 float3 f = make_float3(in[0], in[1], in[2]);
221
222 /* Optionally add indirect light pass. */
223 if (kfilm_convert->pass_indirect != PASS_UNUSED) {
224 const ccl_global float *in_indirect = buffer + kfilm_convert->pass_indirect;
225 const float3 f_indirect = make_float3(in_indirect[0], in_indirect[1], in_indirect[2]);
226 f += f_indirect;
227 }
228
229 /* Optionally divide out color. */
230 if (kfilm_convert->pass_divide != PASS_UNUSED) {
231 const ccl_global float *in_divide = buffer + kfilm_convert->pass_divide;
232 const float3 f_divide = make_float3(in_divide[0], in_divide[1], in_divide[2]);
233 f = safe_divide_even_color(f, f_divide);
234
235 /* Exposure only, sample scale cancels out. */
236 f *= kfilm_convert->exposure;
237 }
238 else {
239 /* Sample scale and exposure. */
240 f *= film_get_scale_exposure(kfilm_convert, buffer);
241 }
242
243 pixel[0] = f.x;
244 pixel[1] = f.y;
245 pixel[2] = f.z;
246
247 /* Optional alpha channel. */
248 if (kfilm_convert->num_components >= 4) {
249 if (kfilm_convert->pass_combined != PASS_UNUSED) {
250 float scale;
251 float scale_exposure;
252 film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure);
253
254 const ccl_global float *in_combined = buffer + kfilm_convert->pass_combined;
255 const float alpha = in_combined[3] * scale;
256 pixel[3] = film_transparency_to_alpha(alpha);
257 }
258 else {
259 pixel[3] = 1.0f;
260 }
261 }
262}
263
265 kfilm_convert,
266 const ccl_global float *ccl_restrict buffer,
267 ccl_private float *ccl_restrict pixel)
268{
269 kernel_assert(kfilm_convert->num_components >= 3);
270 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
271
272 const float scale_exposure = film_get_scale_exposure(kfilm_convert, buffer);
273
274 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
275
276 const float3 f = make_float3(in[0], in[1], in[2]) * scale_exposure;
277
278 pixel[0] = f.x;
279 pixel[1] = f.y;
280 pixel[2] = f.z;
281
282 /* Optional alpha channel. */
283 if (kfilm_convert->num_components >= 4) {
284 if (kfilm_convert->pass_combined != PASS_UNUSED) {
285 float scale;
286 float scale_exposure;
287 film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure);
288
289 const ccl_global float *in_combined = buffer + kfilm_convert->pass_combined;
290 const float alpha = in_combined[3] * scale;
291 pixel[3] = film_transparency_to_alpha(alpha);
292 }
293 else {
294 pixel[3] = 1.0f;
295 }
296 }
297}
298
299/* --------------------------------------------------------------------
300 * Float4 passes.
301 */
302
304 kfilm_convert,
305 const ccl_global float *ccl_restrict buffer,
306 ccl_private float *ccl_restrict pixel)
307{
308 kernel_assert(kfilm_convert->num_components == 4);
309 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
310 kernel_assert(kfilm_convert->pass_motion_weight != PASS_UNUSED);
311
312 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
313 const ccl_global float *in_weight = buffer + kfilm_convert->pass_motion_weight;
314
315 const float weight = in_weight[0];
316 const float weight_inv = (weight > 0.0f) ? 1.0f / weight : 0.0f;
317
318 const float4 motion = make_float4(in[0], in[1], in[2], in[3]) * weight_inv;
319
320 pixel[0] = motion.x;
321 pixel[1] = motion.y;
322 pixel[2] = motion.z;
323 pixel[3] = motion.w;
324}
325
327 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
328 const ccl_global float *ccl_restrict buffer,
329 ccl_private float *ccl_restrict pixel)
330{
331 kernel_assert(kfilm_convert->num_components == 4);
332 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
333
334 const float scale = film_get_scale(kfilm_convert, buffer);
335
336 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
337
338 const float4 f = make_float4(in[0], in[1], in[2], in[3]);
339
340 /* x and z contain integer IDs, don't rescale them.
341 * y and w contain matte weights, they get scaled. */
342 pixel[0] = f.x;
343 pixel[1] = f.y * scale;
344 pixel[2] = f.z;
345 pixel[3] = f.w * scale;
346}
347
349 kfilm_convert,
350 const ccl_global float *ccl_restrict buffer,
351 ccl_private float *ccl_restrict pixel)
352{
353 kernel_assert(kfilm_convert->num_components == 4);
354 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
355
356 float scale;
357 float scale_exposure;
358 film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure);
359
360 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
361
362 const float3 color = make_float3(in[0], in[1], in[2]) * scale_exposure;
363 const float alpha = in[3] * scale;
364
365 pixel[0] = color.x;
366 pixel[1] = color.y;
367 pixel[2] = color.z;
368 pixel[3] = alpha;
369}
370
372 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
373 const ccl_global float *ccl_restrict buffer,
374 ccl_private float *ccl_restrict pixel)
375{
376 kernel_assert(kfilm_convert->num_components == 4);
377
378 /* 3rd channel contains transparency = 1 - alpha for the combined pass. */
379
380 kernel_assert(kfilm_convert->num_components == 4);
381 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
382
383 float scale;
384 float scale_exposure;
385 if (!film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure)) {
386 pixel[0] = 0.0f;
387 pixel[1] = 0.0f;
388 pixel[2] = 0.0f;
389 pixel[3] = 0.0f;
390 return;
391 }
392
393 const ccl_global float *in = buffer + kfilm_convert->pass_offset;
394
395 const float3 color = make_float3(in[0], in[1], in[2]) * scale_exposure;
396 const float alpha = in[3] * scale;
397
398 pixel[0] = color.x;
399 pixel[1] = color.y;
400 pixel[2] = color.z;
401 pixel[3] = film_transparency_to_alpha(alpha);
402}
403
404/* --------------------------------------------------------------------
405 * Shadow catcher.
406 */
407
409 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
410 const ccl_global float *ccl_restrict buffer)
411{
412 kernel_assert(kfilm_convert->pass_shadow_catcher != PASS_UNUSED);
413
414 float scale;
415 float scale_exposure;
416 film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure);
417
418 const ccl_global float *in_catcher = buffer + kfilm_convert->pass_shadow_catcher;
419
420 const float3 pixel = make_float3(in_catcher[0], in_catcher[1], in_catcher[2]) * scale_exposure;
421
422 return pixel;
423}
424
426{
427 float x;
428 float y;
429 float z;
430
431 x = (b.x != 0.0f) ? a.x / b.x : 1.0f;
432 y = (b.y != 0.0f) ? a.y / b.y : 1.0f;
433 z = (b.z != 0.0f) ? a.z / b.z : 1.0f;
434
435 return make_float3(x, y, z);
436}
437
440 const ccl_global float *ccl_restrict buffer)
441{
442 /* For the shadow catcher pass we divide combined pass by the shadow catcher.
443 * Note that denoised shadow catcher pass contains value which only needs ot be scaled (but not
444 * to be calculated as division). */
445
446 if (kfilm_convert->is_denoised) {
447 return film_calculate_shadow_catcher_denoised(kfilm_convert, buffer);
448 }
449
450 kernel_assert(kfilm_convert->pass_shadow_catcher_sample_count != PASS_UNUSED);
451
452 /* If there is no shadow catcher object in this pixel, there is no modification of the light
453 * needed, so return one. */
454 const ccl_global float *in_catcher_sample_count =
455 buffer + kfilm_convert->pass_shadow_catcher_sample_count;
456 const float num_samples = in_catcher_sample_count[0];
457 if (num_samples == 0.0f) {
458 return one_float3();
459 }
460
461 kernel_assert(kfilm_convert->pass_shadow_catcher != PASS_UNUSED);
462 const ccl_global float *in_catcher = buffer + kfilm_convert->pass_shadow_catcher;
463
464 /* NOTE: It is possible that the Shadow Catcher pass is requested as an output without actual
465 * shadow catcher objects in the scene. In this case there will be no auxiliary passes required
466 * for the decision (to save up memory). So delay the asserts to this point so that the number of
467 * samples check handles such configuration. */
468 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
469 kernel_assert(kfilm_convert->pass_combined != PASS_UNUSED);
470 kernel_assert(kfilm_convert->pass_shadow_catcher_matte != PASS_UNUSED);
471
472 const ccl_global float *in_combined = buffer + kfilm_convert->pass_combined;
473 const ccl_global float *in_matte = buffer + kfilm_convert->pass_shadow_catcher_matte;
474
475 /* No scaling needed. The integration works in way that number of samples in the combined and
476 * shadow catcher passes are the same, and exposure is canceled during the division. */
477 const float3 color_catcher = make_float3(in_catcher[0], in_catcher[1], in_catcher[2]);
478 const float3 color_combined = make_float3(in_combined[0], in_combined[1], in_combined[2]);
479 const float3 color_matte = make_float3(in_matte[0], in_matte[1], in_matte[2]);
480
481 /* Need to ignore contribution of the matte object when doing division (otherwise there will be
482 * artifacts caused by anti-aliasing). Since combined pass is used for adaptive sampling and need
483 * to contain matte objects, we subtract matte objects contribution here. This is the same as if
484 * the matte objects were not accumulated to the combined pass. */
485 const float3 combined_no_matte = color_combined - color_matte;
486
487 const float3 shadow_catcher = safe_divide_shadow_catcher(combined_no_matte, color_catcher);
488
489 const float scale = film_get_scale(kfilm_convert, buffer);
490 const float transparency = in_combined[3] * scale;
491 const float alpha = film_transparency_to_alpha(transparency);
492
493 /* Alpha-over on white using transparency of the combined pass. This allows to eliminate
494 * artifacts which are happening on an edge of a shadow catcher when using transparent film.
495 * Note that we treat shadow catcher as straight alpha here because alpha got canceled out
496 * during the division. */
497 const float3 pixel = (1.0f - alpha) * one_float3() + alpha * shadow_catcher;
498
499 return pixel;
500}
501
503 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
504 const ccl_global float *ccl_restrict buffer)
505{
506 /* The approximation of the shadow is 1 - average(shadow_catcher_pass). A better approximation
507 * is possible.
508 *
509 * The matte is alpha-overed onto the shadow (which is kind of alpha-overing shadow onto footage,
510 * and then alpha-overing synthetic objects on top). */
511
512 kernel_assert(kfilm_convert->pass_offset != PASS_UNUSED);
513 kernel_assert(kfilm_convert->pass_shadow_catcher != PASS_UNUSED);
514 kernel_assert(kfilm_convert->pass_shadow_catcher_matte != PASS_UNUSED);
515
516 float scale;
517 float scale_exposure;
518 if (!film_get_scale_and_scale_exposure(kfilm_convert, buffer, &scale, &scale_exposure)) {
519 return zero_float4();
520 }
521
522 const ccl_global float *in_matte = buffer + kfilm_convert->pass_shadow_catcher_matte;
523
524 const float3 shadow_catcher = film_calculate_shadow_catcher(kfilm_convert, buffer);
525 const float3 color_matte = make_float3(in_matte[0], in_matte[1], in_matte[2]) * scale_exposure;
526
527 const float transparency = in_matte[3] * scale;
528 const float alpha = saturatef(1.0f - transparency);
529
530 const float alpha_matte = (1.0f - alpha) * (1.0f - saturatef(average(shadow_catcher))) + alpha;
531
532 if (kfilm_convert->use_approximate_shadow_catcher_background) {
533 kernel_assert(kfilm_convert->pass_background != PASS_UNUSED);
534
535 const ccl_global float *in_background = buffer + kfilm_convert->pass_background;
536 const float3 color_background = make_float3(
537 in_background[0], in_background[1], in_background[2]) *
538 scale_exposure;
539 const float3 alpha_over = color_matte + color_background * (1.0f - alpha_matte);
540 return make_float4(alpha_over, 1.0f);
541 }
542
543 return make_float4(color_matte, alpha_matte);
544}
545
547 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
548 const ccl_global float *ccl_restrict buffer,
549 ccl_private float *ccl_restrict pixel)
550{
551 kernel_assert(kfilm_convert->num_components >= 3);
552
553 const float3 pixel_value = film_calculate_shadow_catcher(kfilm_convert, buffer);
554
555 pixel[0] = pixel_value.x;
556 pixel[1] = pixel_value.y;
557 pixel[2] = pixel_value.z;
558}
559
561 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
562 const ccl_global float *ccl_restrict buffer,
563 ccl_private float *ccl_restrict pixel)
564{
565 kernel_assert(kfilm_convert->num_components == 3 || kfilm_convert->num_components == 4);
566
567 const float4 pixel_value = film_calculate_shadow_catcher_matte_with_shadow(kfilm_convert,
568 buffer);
569
570 pixel[0] = pixel_value.x;
571 pixel[1] = pixel_value.y;
572 pixel[2] = pixel_value.z;
573 if (kfilm_convert->num_components == 4) {
574 pixel[3] = pixel_value.w;
575 }
576}
577
578/* --------------------------------------------------------------------
579 * Compositing and overlays.
580 */
581
583 const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert,
584 const ccl_global float *ccl_restrict buffer,
585 ccl_private float *ccl_restrict pixel)
586{
587 if (kfilm_convert->show_active_pixels && kfilm_convert->pass_adaptive_aux_buffer != PASS_UNUSED)
588 {
589 if (buffer[kfilm_convert->pass_adaptive_aux_buffer + 3] == 0.0f) {
590 const float3 active_rgb = make_float3(1.0f, 0.0f, 0.0f);
591 const float3 mix_rgb = interp(make_float3(pixel[0], pixel[1], pixel[2]), active_rgb, 0.5f);
592 pixel[0] = mix_rgb.x;
593 pixel[1] = mix_rgb.y;
594 pixel[2] = mix_rgb.z;
595 }
596 }
597}
598
unsigned int uint
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
ccl_device_inline float3 safe_divide_even_color(const float3 a, const float3 b)
Definition color.h:399
#define kernel_assert(cond)
#define PASS_UNUSED
#define ccl_restrict
#define ccl_device_forceinline
#define ccl_private
#define ccl_device_inline
#define ccl_global
#define expf(x)
#define CCL_NAMESPACE_END
#define saturatef(x)
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
#define __float_as_uint(x)
#define in
int count
ccl_device_inline float interp(const float a, const float b, const float t)
Definition math_base.h:502
ccl_device_inline float3 one_float3()
Definition math_float3.h:26
CCL_NAMESPACE_BEGIN ccl_device_inline float4 zero_float4()
Definition math_float4.h:13
float average(point a)
Definition node_math.h:144
#define make_float4
ccl_device_inline float3 film_calculate_shadow_catcher(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer)
Definition read.h:439
ccl_device_inline void film_get_pass_pixel_sample_count(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:138
ccl_device_inline void film_get_pass_pixel_depth(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:104
ccl_device_inline void film_get_pass_pixel_light_path(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:210
ccl_device_inline void film_get_pass_pixel_cryptomatte(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:326
ccl_device_inline float4 film_calculate_shadow_catcher_matte_with_shadow(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer)
Definition read.h:502
ccl_device_inline void film_get_pass_pixel_shadow_catcher(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:546
ccl_device_inline void film_get_pass_pixel_rgbe(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:174
ccl_device_inline void film_get_pass_pixel_mist(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:120
ccl_device_inline void film_get_pass_pixel_float3(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:264
ccl_device_inline bool film_get_scale_and_scale_exposure(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict scale, ccl_private float *ccl_restrict scale_exposure)
Definition read.h:63
ccl_device_inline void film_get_pass_pixel_float(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:190
CCL_NAMESPACE_BEGIN ccl_device_forceinline float film_transparency_to_alpha(const float transparency)
Definition read.h:24
ccl_device_inline void film_get_pass_pixel_shadow_catcher_matte_with_shadow(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:560
ccl_device_inline void film_get_pass_pixel_motion(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:303
ccl_device_inline float3 film_calculate_shadow_catcher_denoised(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer)
Definition read.h:408
ccl_device_inline float3 safe_divide_shadow_catcher(const float3 a, const float3 b)
Definition read.h:425
ccl_device_inline void film_get_pass_pixel_volume_majorant(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:157
ccl_device_inline float film_get_scale(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer)
Definition read.h:29
ccl_device_inline void film_get_pass_pixel_float4(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:348
ccl_device_inline void film_apply_pass_pixel_overlays_rgba(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:582
ccl_device_inline void film_get_pass_pixel_combined(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel)
Definition read.h:371
ccl_device_inline float film_get_scale_exposure(const ccl_global KernelFilmConvert *ccl_restrict kfilm_convert, const ccl_global float *ccl_restrict buffer)
Definition read.h:46
float z
Definition sky_math.h:136
float y
Definition sky_math.h:136
float x
Definition sky_math.h:136
float y
Definition sky_math.h:225
float z
Definition sky_math.h:225
float x
Definition sky_math.h:225
float w
Definition sky_math.h:225
ccl_device_inline float3 rgbe_to_rgb(const RGBE rgbe)
Definition types_rgbe.h:92