Blender  V2.93
buffers.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <stdlib.h>
18 
19 #include "device/device.h"
20 #include "render/buffers.h"
21 
22 #include "util/util_foreach.h"
23 #include "util/util_hash.h"
24 #include "util/util_math.h"
25 #include "util/util_opengl.h"
26 #include "util/util_time.h"
27 #include "util/util_types.h"
28 
30 
31 /* Buffer Params */
32 
34 {
35  width = 0;
36  height = 0;
37 
38  full_x = 0;
39  full_y = 0;
40  full_width = 0;
41  full_height = 0;
42 
43  denoising_data_pass = false;
44  denoising_clean_pass = false;
46 
48 }
49 
50 void BufferParams::get_offset_stride(int &offset, int &stride)
51 {
52  offset = -(full_x + full_y * width);
53  stride = width;
54 }
55 
57 {
58  return !(full_x == params.full_x && full_y == params.full_y && width == params.width &&
59  height == params.height && full_width == params.full_width &&
60  full_height == params.full_height && Pass::equals(passes, params.passes) &&
61  denoising_data_pass == params.denoising_data_pass &&
62  denoising_clean_pass == params.denoising_clean_pass &&
63  denoising_prefiltered_pass == params.denoising_prefiltered_pass);
64 }
65 
67 {
68  int size = 0;
69 
70  for (size_t i = 0; i < passes.size(); i++)
71  size += passes[i].components;
72 
73  if (denoising_data_pass) {
79  }
80 
81  return align_up(size, 4);
82 }
83 
85 {
86  int offset = 0;
87 
88  for (size_t i = 0; i < passes.size(); i++)
89  offset += passes[i].components;
90 
91  return offset;
92 }
93 
95 {
97 
98  int offset = get_denoising_offset();
99 
100  offset += DENOISING_PASS_SIZE_BASE;
101  if (denoising_clean_pass) {
102  offset += DENOISING_PASS_SIZE_CLEAN;
103  }
104 
105  return offset;
106 }
107 
108 /* Render Buffer Task */
109 
111 {
112  x = 0;
113  y = 0;
114  w = 0;
115  h = 0;
116 
117  sample = 0;
118  start_sample = 0;
119  num_samples = 0;
120  resolution = 0;
121 
122  offset = 0;
123  stride = 0;
124 
125  buffer = 0;
126 
127  buffers = NULL;
129 }
130 
131 /* Render Buffers */
132 
134  : buffer(device, "RenderBuffers", MEM_READ_WRITE),
135  map_neighbor_copied(false),
136  render_time(0.0f)
137 {
138 }
139 
141 {
142  buffer.free();
143 }
144 
146 {
147  params = params_;
148 
149  /* re-allocate buffer */
152 }
153 
155 {
157 }
158 
160 {
161  if (!buffer.device_pointer)
162  return false;
163 
165 
166  return true;
167 }
168 
170  int type, float exposure, int sample, int components, float *pixels)
171 {
172  if (buffer.data() == NULL) {
173  return false;
174  }
175 
176  float scale = 1.0f;
177  float alpha_scale = 1.0f / sample;
180  scale *= exposure;
181  }
183  scale *= exposure * exposure * (sample - 1);
184  }
185 
186  int offset;
187  if (type == DENOISING_PASS_CLEAN) {
188  /* The clean pass isn't changed by prefiltering, so we use the original one there. */
189  offset = type + params.get_denoising_offset();
190  scale /= sample;
191  }
194  }
195  else {
196  switch (type) {
199  break;
202  break;
205  break;
207  /* If we're not saving the prefiltering result, return the original noisy pass. */
209  break;
210  default:
211  return false;
212  }
213  scale /= sample;
214  }
215 
216  int pass_stride = params.get_passes_size();
217  int size = params.width * params.height;
218 
219  float *in = buffer.data() + offset;
220 
221  if (components == 1) {
222  for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
223  pixels[0] = in[0] * scale;
224  }
225  }
226  else if (components == 3) {
227  for (int i = 0; i < size; i++, in += pass_stride, pixels += 3) {
228  pixels[0] = in[0] * scale;
229  pixels[1] = in[1] * scale;
230  pixels[2] = in[2] * scale;
231  }
232  }
233  else if (components == 4) {
234  /* Since the alpha channel is not involved in denoising, output the Combined alpha channel. */
235  assert(params.passes[0].type == PASS_COMBINED);
236  float *in_combined = buffer.data();
237 
238  for (int i = 0; i < size; i++, in += pass_stride, in_combined += pass_stride, pixels += 4) {
239  float3 val = make_float3(in[0], in[1], in[2]);
241  /* Remove highlight compression from the image. */
242  val = color_highlight_uncompress(val);
243  }
244  pixels[0] = val.x * scale;
245  pixels[1] = val.y * scale;
246  pixels[2] = val.z * scale;
247  pixels[3] = saturate(in_combined[3] * alpha_scale);
248  }
249  }
250  else {
251  return false;
252  }
253 
254  return true;
255 }
256 
258  const string &name, float exposure, int sample, int components, float *pixels)
259 {
260  if (buffer.data() == NULL) {
261  return false;
262  }
263 
264  float *sample_count = NULL;
265  if (name == "Combined") {
266  int sample_offset = 0;
267  for (size_t j = 0; j < params.passes.size(); j++) {
268  Pass &pass = params.passes[j];
269  if (pass.type != PASS_SAMPLE_COUNT) {
270  sample_offset += pass.components;
271  continue;
272  }
273  else {
274  sample_count = buffer.data() + sample_offset;
275  break;
276  }
277  }
278  }
279 
280  int pass_offset = 0;
281 
282  for (size_t j = 0; j < params.passes.size(); j++) {
283  Pass &pass = params.passes[j];
284 
285  /* Pass is identified by both type and name, multiple of the same type
286  * may exist with a different name. */
287  if (pass.name != name) {
288  pass_offset += pass.components;
289  continue;
290  }
291 
292  PassType type = pass.type;
293 
294  float *in = buffer.data() + pass_offset;
295  int pass_stride = params.get_passes_size();
296 
297  float scale = (pass.filter) ? 1.0f / (float)sample : 1.0f;
298  float scale_exposure = (pass.exposure) ? scale * exposure : scale;
299 
300  int size = params.width * params.height;
301 
302  if (components == 1 && type == PASS_RENDER_TIME) {
303  /* Render time is not stored by kernel, but measured per tile. */
304  float val = (float)(1000.0 * render_time / (params.width * params.height * sample));
305  for (int i = 0; i < size; i++, pixels++) {
306  pixels[0] = val;
307  }
308  }
309  else if (components == 1) {
310  assert(pass.components == components);
311 
312  /* Scalar */
313  if (type == PASS_DEPTH) {
314  for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
315  float f = *in;
316  pixels[0] = (f == 0.0f) ? 1e10f : f * scale_exposure;
317  }
318  }
319  else if (type == PASS_MIST) {
320  for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
321  float f = *in;
322  pixels[0] = saturate(f * scale_exposure);
323  }
324  }
325 #ifdef WITH_CYCLES_DEBUG
326  else if (type == PASS_BVH_TRAVERSED_NODES || type == PASS_BVH_TRAVERSED_INSTANCES ||
327  type == PASS_BVH_INTERSECTIONS || type == PASS_RAY_BOUNCES) {
328  for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
329  float f = *in;
330  pixels[0] = f * scale;
331  }
332  }
333 #endif
334  else {
335  for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
336  float f = *in;
337  pixels[0] = f * scale_exposure;
338  }
339  }
340  }
341  else if (components == 3) {
342  assert(pass.components == 4);
343 
344  /* RGBA */
345  if (type == PASS_SHADOW) {
346  for (int i = 0; i < size; i++, in += pass_stride, pixels += 3) {
347  float4 f = make_float4(in[0], in[1], in[2], in[3]);
348  float invw = (f.w > 0.0f) ? 1.0f / f.w : 1.0f;
349 
350  pixels[0] = f.x * invw;
351  pixels[1] = f.y * invw;
352  pixels[2] = f.z * invw;
353  }
354  }
355  else if (pass.divide_type != PASS_NONE) {
356  /* RGB lighting passes that need to divide out color */
357  pass_offset = 0;
358  for (size_t k = 0; k < params.passes.size(); k++) {
359  Pass &color_pass = params.passes[k];
360  if (color_pass.type == pass.divide_type)
361  break;
362  pass_offset += color_pass.components;
363  }
364 
365  float *in_divide = buffer.data() + pass_offset;
366 
367  for (int i = 0; i < size; i++, in += pass_stride, in_divide += pass_stride, pixels += 3) {
368  float3 f = make_float3(in[0], in[1], in[2]);
369  float3 f_divide = make_float3(in_divide[0], in_divide[1], in_divide[2]);
370 
371  f = safe_divide_even_color(f * exposure, f_divide);
372 
373  pixels[0] = f.x;
374  pixels[1] = f.y;
375  pixels[2] = f.z;
376  }
377  }
378  else {
379  /* RGB/vector */
380  for (int i = 0; i < size; i++, in += pass_stride, pixels += 3) {
381  float3 f = make_float3(in[0], in[1], in[2]);
382 
383  pixels[0] = f.x * scale_exposure;
384  pixels[1] = f.y * scale_exposure;
385  pixels[2] = f.z * scale_exposure;
386  }
387  }
388  }
389  else if (components == 4) {
390  assert(pass.components == components);
391 
392  /* RGBA */
393  if (type == PASS_SHADOW) {
394  for (int i = 0; i < size; i++, in += pass_stride, pixels += 4) {
395  float4 f = make_float4(in[0], in[1], in[2], in[3]);
396  float invw = (f.w > 0.0f) ? 1.0f / f.w : 1.0f;
397 
398  pixels[0] = f.x * invw;
399  pixels[1] = f.y * invw;
400  pixels[2] = f.z * invw;
401  pixels[3] = 1.0f;
402  }
403  }
404  else if (type == PASS_MOTION) {
405  /* need to normalize by number of samples accumulated for motion */
406  pass_offset = 0;
407  for (size_t k = 0; k < params.passes.size(); k++) {
408  Pass &color_pass = params.passes[k];
409  if (color_pass.type == PASS_MOTION_WEIGHT)
410  break;
411  pass_offset += color_pass.components;
412  }
413 
414  float *in_weight = buffer.data() + pass_offset;
415 
416  for (int i = 0; i < size; i++, in += pass_stride, in_weight += pass_stride, pixels += 4) {
417  float4 f = make_float4(in[0], in[1], in[2], in[3]);
418  float w = in_weight[0];
419  float invw = (w > 0.0f) ? 1.0f / w : 0.0f;
420 
421  pixels[0] = f.x * invw;
422  pixels[1] = f.y * invw;
423  pixels[2] = f.z * invw;
424  pixels[3] = f.w * invw;
425  }
426  }
427  else if (type == PASS_CRYPTOMATTE) {
428  for (int i = 0; i < size; i++, in += pass_stride, pixels += 4) {
429  float4 f = make_float4(in[0], in[1], in[2], in[3]);
430  /* x and z contain integer IDs, don't rescale them.
431  y and w contain matte weights, they get scaled. */
432  pixels[0] = f.x;
433  pixels[1] = f.y * scale;
434  pixels[2] = f.z;
435  pixels[3] = f.w * scale;
436  }
437  }
438  else {
439  for (int i = 0; i < size; i++, in += pass_stride, pixels += 4) {
440  if (sample_count && sample_count[i * pass_stride] < 0.0f) {
441  scale = (pass.filter) ? -1.0f / (sample_count[i * pass_stride]) : 1.0f;
442  scale_exposure = (pass.exposure) ? scale * exposure : scale;
443  }
444 
445  float4 f = make_float4(in[0], in[1], in[2], in[3]);
446 
447  pixels[0] = f.x * scale_exposure;
448  pixels[1] = f.y * scale_exposure;
449  pixels[2] = f.z * scale_exposure;
450 
451  /* Clamp since alpha might be > 1.0 due to Russian roulette. */
452  pixels[3] = saturate(f.w * scale);
453  }
454  }
455  }
456 
457  return true;
458  }
459 
460  return false;
461 }
462 
463 bool RenderBuffers::set_pass_rect(PassType type, int components, float *pixels, int samples)
464 {
465  if (buffer.data() == NULL) {
466  return false;
467  }
468 
469  int pass_offset = 0;
470 
471  for (size_t j = 0; j < params.passes.size(); j++) {
472  Pass &pass = params.passes[j];
473 
474  if (pass.type != type) {
475  pass_offset += pass.components;
476  continue;
477  }
478 
479  float *out = buffer.data() + pass_offset;
480  int pass_stride = params.get_passes_size();
481  int size = params.width * params.height;
482 
483  assert(pass.components == components);
484 
485  for (int i = 0; i < size; i++, out += pass_stride, pixels += components) {
486  if (pass.filter) {
487  /* Scale by the number of samples, inverse of what we do in get_pass_rect.
488  * A better solution would be to remove the need for set_pass_rect entirely,
489  * and change baking to bake multiple objects in a tile at once. */
490  for (int j = 0; j < components; j++) {
491  out[j] = pixels[j] * samples;
492  }
493  }
494  else {
495  /* For non-filtered passes just straight copy, these may contain non-float data. */
496  memcpy(out, pixels, sizeof(float) * components);
497  }
498  }
499 
500  return true;
501  }
502 
503  return false;
504 }
505 
506 /* Display Buffer */
507 
509  : draw_width(0),
510  draw_height(0),
511  transparent(true), /* todo: determine from background */
512  half_float(linear),
513  rgba_byte(device, "display buffer byte"),
514  rgba_half(device, "display buffer half")
515 {
516 }
517 
519 {
520  rgba_byte.free();
521  rgba_half.free();
522 }
523 
525 {
526  draw_width = 0;
527  draw_height = 0;
528 
529  params = params_;
530 
531  /* allocate display pixels */
532  if (half_float) {
534  }
535  else {
537  }
538 }
539 
541 {
542  assert(width <= params.width && height <= params.height);
543 
544  draw_width = width;
546 }
547 
548 void DisplayBuffer::draw(Device *device, const DeviceDrawParams &draw_params)
549 {
550  if (draw_width != 0 && draw_height != 0) {
552 
553  device->draw_pixels(rgba,
554  0,
555  draw_width,
556  draw_height,
557  params.width,
558  params.height,
559  params.full_x,
560  params.full_y,
563  transparent,
564  draw_params);
565  }
566 }
567 
569 {
570  return (draw_width != 0 && draw_height != 0);
571 }
572 
typedef float(TangentPoint)[2]
_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 width
_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 type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 stride
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
int width
Definition: buffers.h:43
int full_x
Definition: buffers.h:47
vector< Pass > passes
Definition: buffers.h:53
int full_width
Definition: buffers.h:49
int height
Definition: buffers.h:44
bool modified(const BufferParams &params)
Definition: buffers.cpp:56
int get_denoising_prefiltered_offset()
Definition: buffers.cpp:94
void get_offset_stride(int &offset, int &stride)
Definition: buffers.cpp:50
int get_denoising_offset()
Definition: buffers.cpp:84
int get_passes_size()
Definition: buffers.cpp:66
bool denoising_prefiltered_pass
Definition: buffers.h:60
int full_height
Definition: buffers.h:50
bool denoising_clean_pass
Definition: buffers.h:56
int full_y
Definition: buffers.h:48
bool denoising_data_pass
Definition: buffers.h:54
Definition: device.h:293
virtual void draw_pixels(device_memory &mem, int y, int w, int h, int width, int height, int dx, int dy, int dw, int dh, bool transparent, const DeviceDrawParams &draw_params)
Definition: device.cpp:234
int draw_width
Definition: buffers.h:110
bool half_float
Definition: buffers.h:114
bool transparent
Definition: buffers.h:112
bool draw_ready()
Definition: buffers.cpp:568
device_pixels< uchar4 > rgba_byte
Definition: buffers.h:116
BufferParams params
Definition: buffers.h:106
DisplayBuffer(Device *device, bool linear=false)
Definition: buffers.cpp:508
void draw_set(int width, int height)
Definition: buffers.cpp:540
void reset(BufferParams &params)
Definition: buffers.cpp:524
void draw(Device *device, const DeviceDrawParams &draw_params)
Definition: buffers.cpp:548
int draw_height
Definition: buffers.h:110
device_pixels< half4 > rgba_half
Definition: buffers.h:117
Definition: film.h:41
PassType divide_type
Definition: film.h:51
ustring name
Definition: film.h:52
PassType type
Definition: film.h:47
bool filter
Definition: film.h:49
int components
Definition: film.h:48
static bool equals(const vector< Pass > &A, const vector< Pass > &B)
Definition: film.cpp:283
bool exposure
Definition: film.h:50
static void add(PassType type, vector< Pass > &passes, const char *name=NULL)
Definition: film.cpp:103
bool get_pass_rect(const string &name, float exposure, int sample, int components, float *pixels)
Definition: buffers.cpp:257
bool set_pass_rect(PassType type, int components, float *pixels, int samples)
Definition: buffers.cpp:463
bool get_denoising_pass_rect(int offset, float exposure, int sample, int components, float *pixels)
Definition: buffers.cpp:169
device_vector< float > buffer
Definition: buffers.h:80
void reset(BufferParams &params)
Definition: buffers.cpp:145
void zero()
Definition: buffers.cpp:154
BufferParams params
Definition: buffers.h:77
double render_time
Definition: buffers.h:82
bool copy_from_device()
Definition: buffers.cpp:159
RenderBuffers(Device *device)
Definition: buffers.cpp:133
int stride
Definition: buffers.h:143
int sample
Definition: buffers.h:140
@ NO_STEALING
Definition: buffers.h:149
RenderBuffers * buffers
Definition: buffers.h:152
int num_samples
Definition: buffers.h:139
device_ptr buffer
Definition: buffers.h:146
StealingState stealing_state
Definition: buffers.h:150
int offset
Definition: buffers.h:142
int resolution
Definition: buffers.h:141
int start_sample
Definition: buffers.h:138
device_ptr device_pointer
void alloc_to_device(size_t width, size_t height, size_t depth=0)
T * alloc(size_t width, size_t height=0, size_t depth=0)
void copy_from_device()
void zero_to_device()
@ MEM_READ_WRITE
Definition: device_memory.h:37
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
PassType
Definition: kernel_types.h:347
@ PASS_DEPTH
Definition: kernel_types.h:352
@ PASS_MIST
Definition: kernel_types.h:373
@ PASS_MOTION
Definition: kernel_types.h:357
@ PASS_COMBINED
Definition: kernel_types.h:351
@ PASS_RENDER_TIME
Definition: kernel_types.h:365
@ PASS_NONE
Definition: kernel_types.h:348
@ PASS_CRYPTOMATTE
Definition: kernel_types.h:366
@ PASS_SAMPLE_COUNT
Definition: kernel_types.h:370
@ PASS_MOTION_WEIGHT
Definition: kernel_types.h:358
@ PASS_SHADOW
Definition: kernel_types.h:377
@ DENOISING_PASS_ALBEDO
Definition: kernel_types.h:411
@ DENOISING_PASS_PREFILTERED_VARIANCE
Definition: kernel_types.h:426
@ DENOISING_PASS_DEPTH
Definition: kernel_types.h:413
@ DENOISING_PASS_PREFILTERED_NORMAL
Definition: kernel_types.h:422
@ DENOISING_PASS_SIZE_CLEAN
Definition: kernel_types.h:430
@ DENOISING_PASS_SIZE_BASE
Definition: kernel_types.h:429
@ DENOISING_PASS_PREFILTERED_DEPTH
Definition: kernel_types.h:421
@ DENOISING_PASS_SIZE_PREFILTERED
Definition: kernel_types.h:431
@ DENOISING_PASS_PREFILTERED_ALBEDO
Definition: kernel_types.h:424
@ DENOISING_PASS_CLEAN
Definition: kernel_types.h:419
@ DENOISING_PASS_COLOR
Definition: kernel_types.h:417
@ DENOISING_PASS_NORMAL
Definition: kernel_types.h:409
@ DENOISING_PASS_PREFILTERED_COLOR
Definition: kernel_types.h:425
@ DENOISING_PASS_PREFILTERED_INTENSITY
Definition: kernel_types.h:427
static void sample(SocketReader *reader, int x, int y, float color[4])
float z
Definition: sky_float3.h:35
float y
Definition: sky_float3.h:35
float x
Definition: sky_float3.h:35
ccl_device float3 color_highlight_uncompress(float3 color)
Definition: util_color.h:287
ccl_device_inline float saturate(float a)
Definition: util_math.h:315
ccl_device_inline float3 safe_divide_even_color(float3 a, float3 b)
Definition: util_math.h:525
ccl_device_inline size_t align_up(size_t offset, size_t alignment)
Definition: util_types.h:65