Blender  V3.3
COM_GaussianBokehBlurOperation.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
5 
6 #include "RE_pipeline.h"
7 
8 namespace blender::compositor {
9 
11 {
12  gausstab_ = nullptr;
13 }
14 
16 {
17  lock_mutex();
18  if (!sizeavailable_) {
19  update_gauss();
20  }
21  void *buffer = get_input_operation(0)->initialize_tile_data(nullptr);
22  unlock_mutex();
23  return buffer;
24 }
25 
27 {
29  const float width = this->get_width();
30  const float height = this->get_height();
31 
33  if (!sizeavailable_) {
34  update_size();
35  }
36  }
37 
38  radxf_ = size_ * (float)data_.sizex;
39  CLAMP(radxf_, 0.0f, width / 2.0f);
40 
41  /* Vertical. */
42  radyf_ = size_ * (float)data_.sizey;
43  CLAMP(radyf_, 0.0f, height / 2.0f);
44 
45  radx_ = ceil(radxf_);
46  rady_ = ceil(radyf_);
47 }
48 
50 {
52 
53  init_mutex();
54 
55  if (sizeavailable_) {
56  update_gauss();
57  }
58 }
59 
60 void GaussianBokehBlurOperation::update_gauss()
61 {
62  if (gausstab_ == nullptr) {
63  int ddwidth = 2 * radx_ + 1;
64  int ddheight = 2 * rady_ + 1;
65  int n = ddwidth * ddheight;
66  /* create a full filter image */
67  float *ddgauss = (float *)MEM_mallocN(sizeof(float) * n, __func__);
68  float *dgauss = ddgauss;
69  float sum = 0.0f;
70  float facx = (radxf_ > 0.0f ? 1.0f / radxf_ : 0.0f);
71  float facy = (radyf_ > 0.0f ? 1.0f / radyf_ : 0.0f);
72  for (int j = -rady_; j <= rady_; j++) {
73  for (int i = -radx_; i <= radx_; i++, dgauss++) {
74  float fj = (float)j * facy;
75  float fi = (float)i * facx;
76  float dist = sqrt(fj * fj + fi * fi);
77  *dgauss = RE_filter_value(data_.filtertype, dist);
78 
79  sum += *dgauss;
80  }
81  }
82 
83  if (sum > 0.0f) {
84  /* normalize */
85  float norm = 1.0f / sum;
86  for (int j = n - 1; j >= 0; j--) {
87  ddgauss[j] *= norm;
88  }
89  }
90  else {
91  int center = rady_ * ddwidth + radx_;
92  ddgauss[center] = 1.0f;
93  }
94 
95  gausstab_ = ddgauss;
96  }
97 }
98 
99 void GaussianBokehBlurOperation::execute_pixel(float output[4], int x, int y, void *data)
100 {
101  float result[4];
103  size_ = result[0];
104 
105  const float width = this->get_width();
106  const float height = this->get_height();
107 
108  radxf_ = size_ * (float)data_.sizex;
109  CLAMP(radxf_, 0.0f, width / 2.0f);
110 
111  radyf_ = size_ * (float)data_.sizey;
112  CLAMP(radyf_, 0.0f, height / 2.0f);
113 
114  radx_ = ceil(radxf_);
115  rady_ = ceil(radyf_);
116 
117  float temp_color[4];
118  temp_color[0] = 0;
119  temp_color[1] = 0;
120  temp_color[2] = 0;
121  temp_color[3] = 0;
122  float multiplier_accum = 0;
123  MemoryBuffer *input_buffer = (MemoryBuffer *)data;
124  float *buffer = input_buffer->get_buffer();
125  int bufferwidth = input_buffer->get_width();
126  const rcti &input_rect = input_buffer->get_rect();
127  int bufferstartx = input_rect.xmin;
128  int bufferstarty = input_rect.ymin;
129 
130  int ymin = max_ii(y - rady_, input_rect.ymin);
131  int ymax = min_ii(y + rady_ + 1, input_rect.ymax);
132  int xmin = max_ii(x - radx_, input_rect.xmin);
133  int xmax = min_ii(x + radx_ + 1, input_rect.xmax);
134 
135  int index;
136  int step = QualityStepHelper::get_step();
137  int offsetadd = QualityStepHelper::get_offset_add();
138  const int add_const = (xmin - x + radx_);
139  const int mul_const = (radx_ * 2 + 1);
140  for (int ny = ymin; ny < ymax; ny += step) {
141  index = ((ny - y) + rady_) * mul_const + add_const;
142  int bufferindex = ((xmin - bufferstartx) * 4) + ((ny - bufferstarty) * 4 * bufferwidth);
143  for (int nx = xmin; nx < xmax; nx += step) {
144  const float multiplier = gausstab_[index];
145  madd_v4_v4fl(temp_color, &buffer[bufferindex], multiplier);
146  multiplier_accum += multiplier;
147  index += step;
148  bufferindex += offsetadd;
149  }
150  }
151 
152  mul_v4_v4fl(output, temp_color, 1.0f / multiplier_accum);
153 }
154 
156 {
158 
159  if (gausstab_) {
160  MEM_freeN(gausstab_);
161  gausstab_ = nullptr;
162  }
163 
164  deinit_mutex();
165 }
166 
168  rcti *input, ReadBufferOperation *read_operation, rcti *output)
169 {
170  rcti new_input;
171  rcti size_input;
172  size_input.xmin = 0;
173  size_input.ymin = 0;
174  size_input.xmax = 5;
175  size_input.ymax = 5;
176  NodeOperation *operation = this->get_input_operation(1);
177 
178  if (operation->determine_depending_area_of_interest(&size_input, read_operation, output)) {
179  return true;
180  }
181 
182  if (sizeavailable_ && gausstab_ != nullptr) {
183  new_input.xmin = 0;
184  new_input.ymin = 0;
185  new_input.xmax = this->get_width();
186  new_input.ymax = this->get_height();
187  }
188  else {
189  int addx = radx_;
190  int addy = rady_;
191  new_input.xmax = input->xmax + addx;
192  new_input.xmin = input->xmin - addx;
193  new_input.ymax = input->ymax + addy;
194  new_input.ymin = input->ymin - addy;
195  }
197  &new_input, read_operation, output);
198 }
199 
201  const rcti &output_area,
202  rcti &r_input_area)
203 {
204  if (input_idx != IMAGE_INPUT_INDEX) {
205  BlurBaseOperation::get_area_of_interest(input_idx, output_area, r_input_area);
206  return;
207  }
208 
209  r_input_area.xmax = output_area.xmax + radx_;
210  r_input_area.xmin = output_area.xmin - radx_;
211  r_input_area.ymax = output_area.ymax + rady_;
212  r_input_area.ymin = output_area.ymin - rady_;
213 }
214 
216  const rcti &area,
218 {
220  BuffersIterator<float> it = output->iterate_with({}, area);
221  const rcti &input_rect = input->get_rect();
222  for (; !it.is_end(); ++it) {
223  const int x = it.x;
224  const int y = it.y;
225 
226  const int ymin = max_ii(y - rady_, input_rect.ymin);
227  const int ymax = min_ii(y + rady_ + 1, input_rect.ymax);
228  const int xmin = max_ii(x - radx_, input_rect.xmin);
229  const int xmax = min_ii(x + radx_ + 1, input_rect.xmax);
230 
231  float temp_color[4] = {0};
232  float multiplier_accum = 0;
233  const int step = QualityStepHelper::get_step();
234  const int elem_step = step * input->elem_stride;
235  const int add_const = (xmin - x + radx_);
236  const int mul_const = (radx_ * 2 + 1);
237  for (int ny = ymin; ny < ymax; ny += step) {
238  const float *color = input->get_elem(xmin, ny);
239  int gauss_index = ((ny - y) + rady_) * mul_const + add_const;
240  const int gauss_end = gauss_index + (xmax - xmin);
241  for (; gauss_index < gauss_end; gauss_index += step, color += elem_step) {
242  const float multiplier = gausstab_[gauss_index];
243  madd_v4_v4fl(temp_color, color, multiplier);
244  multiplier_accum += multiplier;
245  }
246  }
247 
248  mul_v4_v4fl(it.out, temp_color, 1.0f / multiplier_accum);
249  }
250 }
251 
252 // reference image
255 {
256  maintabs_ = nullptr;
257  use_variable_size_ = true;
258 }
259 
261 {
262  /* Setup variables for gausstab and area of interest. */
263  data_.image_in_width = this->get_width();
264  data_.image_in_height = this->get_height();
265  if (data_.relative) {
266  switch (data_.aspect) {
268  data_.sizex = (int)(data_.percentx * 0.01f * data_.image_in_width);
269  data_.sizey = (int)(data_.percenty * 0.01f * data_.image_in_height);
270  break;
272  data_.sizex = (int)(data_.percentx * 0.01f * data_.image_in_width);
273  data_.sizey = (int)(data_.percenty * 0.01f * data_.image_in_width);
274  break;
276  data_.sizex = (int)(data_.percentx * 0.01f * data_.image_in_height);
277  data_.sizey = (int)(data_.percenty * 0.01f * data_.image_in_height);
278  break;
279  }
280  }
281 
282  /* Horizontal. */
283  filtersizex_ = (float)data_.sizex;
284  int imgx = get_width() / 2;
285  if (filtersizex_ > imgx) {
286  filtersizex_ = imgx;
287  }
288  else if (filtersizex_ < 1) {
289  filtersizex_ = 1;
290  }
291  radx_ = (float)filtersizex_;
292 
293  /* Vertical. */
294  filtersizey_ = (float)data_.sizey;
295  int imgy = get_height() / 2;
296  if (filtersizey_ > imgy) {
297  filtersizey_ = imgy;
298  }
299  else if (filtersizey_ < 1) {
300  filtersizey_ = 1;
301  }
302  rady_ = (float)filtersizey_;
303 }
304 
306 {
307  void *buffer = get_input_operation(0)->initialize_tile_data(nullptr);
308  return buffer;
309 }
310 
312 {
314 
315  update_gauss();
316 }
317 
318 void GaussianBlurReferenceOperation::update_gauss()
319 {
320  int i;
321  int x = MAX2(filtersizex_, filtersizey_);
322  maintabs_ = (float **)MEM_mallocN(x * sizeof(float *), "gauss array");
323  for (i = 0; i < x; i++) {
324  maintabs_[i] = make_gausstab(i + 1, i + 1);
325  }
326 }
327 
329 {
330  MemoryBuffer *memorybuffer = (MemoryBuffer *)data;
331  float *buffer = memorybuffer->get_buffer();
332  float *gausstabx, *gausstabcenty;
333  float *gausstaby, *gausstabcentx;
334  int i, j;
335  float *src;
336  float sum, val;
337  float rval, gval, bval, aval;
338  int imgx = get_width();
339  int imgy = get_height();
340  float temp_size[4];
341  input_size_->read(temp_size, x, y, data);
342  float ref_size = temp_size[0];
343  int refradx = (int)(ref_size * radx_);
344  int refrady = (int)(ref_size * rady_);
345  if (refradx > filtersizex_) {
346  refradx = filtersizex_;
347  }
348  else if (refradx < 1) {
349  refradx = 1;
350  }
351  if (refrady > filtersizey_) {
352  refrady = filtersizey_;
353  }
354  else if (refrady < 1) {
355  refrady = 1;
356  }
357 
358  if (refradx == 1 && refrady == 1) {
359  memorybuffer->read_no_check(output, x, y);
360  }
361  else {
362  int minxr = x - refradx < 0 ? -x : -refradx;
363  int maxxr = x + refradx > imgx ? imgx - x : refradx;
364  int minyr = y - refrady < 0 ? -y : -refrady;
365  int maxyr = y + refrady > imgy ? imgy - y : refrady;
366 
367  float *srcd = buffer + COM_DATA_TYPE_COLOR_CHANNELS * ((y + minyr) * imgx + x + minxr);
368 
369  gausstabx = maintabs_[refradx - 1];
370  gausstabcentx = gausstabx + refradx;
371  gausstaby = maintabs_[refrady - 1];
372  gausstabcenty = gausstaby + refrady;
373 
374  sum = gval = rval = bval = aval = 0.0f;
375  for (i = minyr; i < maxyr; i++, srcd += COM_DATA_TYPE_COLOR_CHANNELS * imgx) {
376  src = srcd;
377  for (j = minxr; j < maxxr; j++, src += COM_DATA_TYPE_COLOR_CHANNELS) {
378 
379  val = gausstabcenty[i] * gausstabcentx[j];
380  sum += val;
381  rval += val * src[0];
382  gval += val * src[1];
383  bval += val * src[2];
384  aval += val * src[3];
385  }
386  }
387  sum = 1.0f / sum;
388  output[0] = rval * sum;
389  output[1] = gval * sum;
390  output[2] = bval * sum;
391  output[3] = aval * sum;
392  }
393 }
394 
396 {
397  int x, i;
398  x = MAX2(filtersizex_, filtersizey_);
399  for (i = 0; i < x; i++) {
400  MEM_freeN(maintabs_[i]);
401  }
402  MEM_freeN(maintabs_);
404 }
405 
407  rcti *input, ReadBufferOperation *read_operation, rcti *output)
408 {
409  rcti new_input;
410  NodeOperation *operation = this->get_input_operation(1);
411 
412  if (operation->determine_depending_area_of_interest(input, read_operation, output)) {
413  return true;
414  }
415 
416  int addx = data_.sizex + 2;
417  int addy = data_.sizey + 2;
418  new_input.xmax = input->xmax + addx;
419  new_input.xmin = input->xmin - addx;
420  new_input.ymax = input->ymax + addy;
421  new_input.ymin = input->ymin - addy;
422  return NodeOperation::determine_depending_area_of_interest(&new_input, read_operation, output);
423 }
424 
426  const rcti &output_area,
427  rcti &r_input_area)
428 {
429  if (input_idx != IMAGE_INPUT_INDEX) {
430  BlurBaseOperation::get_area_of_interest(input_idx, output_area, r_input_area);
431  return;
432  }
433 
434  const int add_x = data_.sizex + 2;
435  const int add_y = data_.sizey + 2;
436  r_input_area.xmax = output_area.xmax + add_x;
437  r_input_area.xmin = output_area.xmin - add_x;
438  r_input_area.ymax = output_area.ymax + add_y;
439  r_input_area.ymin = output_area.ymin - add_y;
440 }
441 
443  const rcti &area,
445 {
446  const MemoryBuffer *image_input = inputs[IMAGE_INPUT_INDEX];
447  MemoryBuffer *size_input = inputs[SIZE_INPUT_INDEX];
448  for (BuffersIterator<float> it = output->iterate_with({size_input}, area); !it.is_end(); ++it) {
449  const float ref_size = *it.in(0);
450  int ref_radx = (int)(ref_size * radx_);
451  int ref_rady = (int)(ref_size * rady_);
452  if (ref_radx > filtersizex_) {
453  ref_radx = filtersizex_;
454  }
455  else if (ref_radx < 1) {
456  ref_radx = 1;
457  }
458  if (ref_rady > filtersizey_) {
459  ref_rady = filtersizey_;
460  }
461  else if (ref_rady < 1) {
462  ref_rady = 1;
463  }
464 
465  const int x = it.x;
466  const int y = it.y;
467  if (ref_radx == 1 && ref_rady == 1) {
468  image_input->read_elem(x, y, it.out);
469  continue;
470  }
471 
472  const int w = get_width();
473  const int height = get_height();
474  const int minxr = x - ref_radx < 0 ? -x : -ref_radx;
475  const int maxxr = x + ref_radx > w ? w - x : ref_radx;
476  const int minyr = y - ref_rady < 0 ? -y : -ref_rady;
477  const int maxyr = y + ref_rady > height ? height - y : ref_rady;
478 
479  const float *gausstabx = maintabs_[ref_radx - 1];
480  const float *gausstabcentx = gausstabx + ref_radx;
481  const float *gausstaby = maintabs_[ref_rady - 1];
482  const float *gausstabcenty = gausstaby + ref_rady;
483 
484  float gauss_sum = 0.0f;
485  float color_sum[4] = {0};
486  const float *row_color = image_input->get_elem(x + minxr, y + minyr);
487  for (int i = minyr; i < maxyr; i++, row_color += image_input->row_stride) {
488  const float *color = row_color;
489  for (int j = minxr; j < maxxr; j++, color += image_input->elem_stride) {
490  const float val = gausstabcenty[i] * gausstabcentx[j];
491  gauss_sum += val;
492  madd_v4_v4fl(color_sum, color, val);
493  }
494  }
495  mul_v4_v4fl(it.out, color_sum, 1.0f / gauss_sum);
496  }
497 }
498 
499 } // namespace blender::compositor
typedef float(TangentPoint)[2]
sqrt(x)+1/max(0
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
#define MAX2(a, b)
#define CMP_NODE_BLUR_ASPECT_X
#define CMP_NODE_BLUR_ASPECT_Y
#define CMP_NODE_BLUR_ASPECT_NONE
NSNotificationCenter * center
_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 ny
_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 y
_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
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its and Z components Generates normals with round corners and may slow down renders Vector Displace the surface along an arbitrary direction White Return a random value or color based on an input seed Float Map an input float to a curve and outputs a float value Separate Color
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
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
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
static T sum(const btAlignedObjectArray< T > &items)
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Definition: btVector3.h:263
float * make_gausstab(float rad, int size)
virtual void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void execute_pixel(float output[4], int x, int y, void *data) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
void execute_pixel(float output[4], int x, int y, void *data) override
a MemoryBuffer contains access to the data of a chunk
const rcti & get_rect() const
get the rect of this MemoryBuffer
const int get_width() const
get the width of this MemoryBuffer
float * get_buffer()
get the data of this MemoryBuffer
void read_elem(int x, int y, float *out) const
void read_no_check(float *result, int x, int y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
NodeOperation contains calculation logic.
NodeOperation * get_input_operation(int index)
void read(float result[4], int x, int y, void *chunk_data)
virtual bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
virtual void * initialize_tile_data(rcti *)
SyclQueue void void * src
DataType
possible data types for sockets
Definition: COM_defines.h:30
float RE_filter_value(int type, float x)
Definition: initrender.c:108
ccl_global float * buffer
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
ccl_device_inline float3 ceil(const float3 &a)
Definition: math_float3.h:363
static void area(int d1, int d2, int e1, int e2, float weights[2])
constexpr int COM_DATA_TYPE_COLOR_CHANNELS
Definition: COM_defines.h:62
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
static bNodeSocketTemplate inputs[]
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63