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