Blender  V3.3
scene/pointcloud.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #include "bvh/bvh.h"
5 
6 #include "scene/pointcloud.h"
7 #include "scene/scene.h"
8 
10 
11 /* PointCloud Point */
12 
14  const float *radius,
15  BoundBox &bounds) const
16 {
17  bounds.grow(points[index], radius[index]);
18 }
19 
21  const float *radius,
22  const Transform &aligned_space,
23  BoundBox &bounds) const
24 {
25  float3 P = transform_point(&aligned_space, points[index]);
26  bounds.grow(P, radius[index]);
27 }
28 
30 {
32 }
33 
35  const float *radius,
36  const float3 *point_steps,
37  size_t num_points,
38  size_t num_steps,
39  float time,
40  size_t p) const
41 {
42  /* Figure out which steps we need to fetch and their
43  * interpolation factor. */
44  const size_t max_step = num_steps - 1;
45  const size_t step = min((size_t)(time * max_step), max_step - 1);
46  const float t = time * max_step - step;
47  /* Fetch vertex coordinates. */
48  const float4 curr_key = point_for_step(
49  points, radius, point_steps, num_points, num_steps, step, p);
50  const float4 next_key = point_for_step(
51  points, radius, point_steps, num_points, num_steps, step + 1, p);
52  /* Interpolate between steps. */
53  return (1.0f - t) * curr_key + t * next_key;
54 }
55 
57  const float *radius,
58  const float3 *point_steps,
59  size_t num_points,
60  size_t num_steps,
61  size_t step,
62  size_t p) const
63 {
64  const size_t center_step = ((num_steps - 1) / 2);
65  if (step == center_step) {
66  /* Center step: regular key location. */
67  return make_float4(points[p].x, points[p].y, points[p].z, radius[p]);
68  }
69  else {
70  /* Center step is not stored in this array. */
71  if (step > center_step) {
72  step--;
73  }
74  const size_t offset = step * num_points;
75  return make_float4(point_steps[offset + p].x,
76  point_steps[offset + p].y,
77  point_steps[offset + p].z,
78  radius[offset + p]);
79  }
80 }
81 
82 /* PointCloud */
83 
85 {
87  "pointcloud", create, NodeType::NONE, Geometry::get_node_base_type());
88 
89  SOCKET_POINT_ARRAY(points, "Points", array<float3>());
90  SOCKET_FLOAT_ARRAY(radius, "Radius", array<float>());
91  SOCKET_INT_ARRAY(shader, "Shader", array<int>());
92 
93  return type;
94 }
95 
97 {
98 }
99 
101 {
102 }
103 
104 void PointCloud::resize(int numpoints)
105 {
106  points.resize(numpoints);
107  radius.resize(numpoints);
108  shader.resize(numpoints);
109  attributes.resize();
110 
111  tag_points_modified();
112  tag_radius_modified();
113  tag_shader_modified();
114 }
115 
116 void PointCloud::reserve(int numpoints)
117 {
118  points.reserve(numpoints);
119  radius.reserve(numpoints);
120  shader.reserve(numpoints);
121  attributes.resize(true);
122 }
123 
124 void PointCloud::clear(const bool preserve_shaders)
125 {
126  Geometry::clear(preserve_shaders);
127 
128  points.clear();
129  radius.clear();
130  shader.clear();
131  attributes.clear();
132 
133  tag_points_modified();
134  tag_radius_modified();
135  tag_shader_modified();
136 }
137 
138 void PointCloud::add_point(float3 co, float r, int shader_index)
139 {
140  points.push_back_reserved(co);
141  radius.push_back_reserved(r);
142  shader.push_back_reserved(shader_index);
143 
144  tag_points_modified();
145  tag_radius_modified();
146  tag_shader_modified();
147 }
148 
149 void PointCloud::copy_center_to_motion_step(const int motion_step)
150 {
152  if (attr_mP) {
153  float3 *points_data = points.data();
154  size_t numpoints = points.size();
155  memcpy(
156  attr_mP->data_float3() + motion_step * numpoints, points_data, sizeof(float3) * numpoints);
157  }
158 }
159 
160 void PointCloud::get_uv_tiles(ustring map, unordered_set<int> &tiles)
161 {
162  Attribute *attr;
163 
164  if (map.empty()) {
165  attr = attributes.find(ATTR_STD_UV);
166  }
167  else {
168  attr = attributes.find(map);
169  }
170 
171  if (attr) {
172  attr->get_uv_tiles(this, ATTR_PRIM_GEOMETRY, tiles);
173  }
174 }
175 
177 {
178  BoundBox bnds = BoundBox::empty;
179  size_t numpoints = points.size();
180 
181  if (numpoints > 0) {
182  for (size_t i = 0; i < numpoints; i++) {
183  bnds.grow(points[i], radius[i]);
184  }
185 
187  if (use_motion_blur && attr) {
188  size_t steps_size = points.size() * (motion_steps - 1);
189  float3 *point_steps = attr->data_float3();
190 
191  for (size_t i = 0; i < steps_size; i++)
192  bnds.grow(point_steps[i]);
193  }
194 
195  if (!bnds.valid()) {
196  bnds = BoundBox::empty;
197 
198  /* skip nan or inf coordinates */
199  for (size_t i = 0; i < numpoints; i++)
200  bnds.grow_safe(points[i], radius[i]);
201 
202  if (use_motion_blur && attr) {
203  size_t steps_size = points.size() * (motion_steps - 1);
204  float3 *point_steps = attr->data_float3();
205 
206  for (size_t i = 0; i < steps_size; i++)
207  bnds.grow_safe(point_steps[i]);
208  }
209  }
210  }
211 
212  if (!bnds.valid()) {
213  /* empty mesh */
214  bnds.grow(make_float3(0.0f, 0.0f, 0.0f));
215  }
216 
217  bounds = bnds;
218 }
219 
220 void PointCloud::apply_transform(const Transform &tfm, const bool apply_to_motion)
221 {
222  /* compute uniform scale */
223  float3 c0 = transform_get_column(&tfm, 0);
224  float3 c1 = transform_get_column(&tfm, 1);
225  float3 c2 = transform_get_column(&tfm, 2);
226  float scalar = powf(fabsf(dot(cross(c0, c1), c2)), 1.0f / 3.0f);
227 
228  /* apply transform to curve keys */
229  for (size_t i = 0; i < points.size(); i++) {
230  float3 co = transform_point(&tfm, points[i]);
231  float r = radius[i] * scalar;
232 
233  /* scale for curve radius is only correct for uniform scale
234  */
235  points[i] = co;
236  radius[i] = r;
237  }
238 
239  if (apply_to_motion) {
241 
242  if (attr) {
243  /* apply transform to motion curve keys */
244  size_t steps_size = points.size() * (motion_steps - 1);
245  float4 *point_steps = attr->data_float4();
246 
247  for (size_t i = 0; i < steps_size; i++) {
248  float3 co = transform_point(&tfm, float4_to_float3(point_steps[i]));
249  float radius = point_steps[i].w * scalar;
250 
251  /* scale for curve radius is only correct for uniform
252  * scale */
253  point_steps[i] = float3_to_float4(co);
254  point_steps[i].w = radius;
255  }
256  }
257  }
258 }
259 
260 void PointCloud::pack(Scene *scene, float4 *packed_points, uint *packed_shader)
261 {
262  size_t numpoints = points.size();
263  float3 *points_data = points.data();
264  float *radius_data = radius.data();
265  int *shader_data = shader.data();
266 
267  for (size_t i = 0; i < numpoints; i++) {
268  packed_points[i] = make_float4(
269  points_data[i].x, points_data[i].y, points_data[i].z, radius_data[i]);
270  }
271 
272  uint shader_id = 0;
273  uint last_shader = -1;
274  for (size_t i = 0; i < numpoints; i++) {
275  if (last_shader != shader_data[i]) {
276  last_shader = shader_data[i];
277  Shader *shader = (last_shader < used_shaders.size()) ?
278  static_cast<Shader *>(used_shaders[last_shader]) :
280  shader_id = scene->shader_manager->get_shader_id(shader);
281  }
282  packed_shader[i] = shader_id;
283  }
284 }
285 
287 {
289 }
290 
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 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 GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 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 GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
float float4[4]
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 point
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
Attribute * find(ustring name) const
void resize(bool reserve_only=false)
void clear(bool preserve_voxel_data=false)
float4 * data_float4()
void get_uv_tiles(Geometry *geom, AttributePrimitive prim, unordered_set< int > &tiles) const
float3 * data_float3()
BoundBox bounds
int motion_step(float time) const
bool has_motion_blur() const
AttributeSet attributes
virtual void clear(bool preserve_shaders=false)
int get_shader_id(Shader *shader, bool smooth=false)
#define powf(x, y)
Definition: cuda/compat.h:103
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
double time
Scene scene
ccl_device_inline float3 transform_get_column(const Transform *t, int column)
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN ccl_device_inline float3 transform_point(ccl_private const Transform *t, const float3 a)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
PrimitiveType
Definition: kernel/types.h:549
@ PRIMITIVE_MOTION_POINT
Definition: kernel/types.h:562
@ PRIMITIVE_POINT
Definition: kernel/types.h:554
@ ATTR_STD_UV
Definition: kernel/types.h:616
@ ATTR_STD_MOTION_VERTEX_POSITION
Definition: kernel/types.h:624
@ ATTR_PRIM_GEOMETRY
Definition: kernel/types.h:591
static float P(float k)
Definition: math_interp.c:25
#define make_float4(x, y, z, w)
Definition: metal/compat.h:205
#define fabsf(x)
Definition: metal/compat.h:219
#define make_float3(x, y, z)
Definition: metal/compat.h:204
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRefNull prop_name, int32_t value)
Allocate a new IDProperty of type IDP_INT, set its name and value.
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
SocketIndexByIdentifierMap * map
#define SOCKET_POINT_ARRAY(name, ui_name, default_value,...)
Definition: node_type.h:248
#define SOCKET_FLOAT_ARRAY(name, ui_name, default_value,...)
Definition: node_type.h:239
#define SOCKET_INT_ARRAY(name, ui_name, default_value,...)
Definition: node_type.h:237
NODE_DEFINE(PointCloud)
#define min(a, b)
Definition: sort.c:35
@ empty
Definition: boundbox.h:35
__forceinline bool valid() const
Definition: boundbox.h:129
__forceinline void grow_safe(const float3 &pt)
Definition: boundbox.h:63
__forceinline void grow(const float3 &pt)
Definition: boundbox.h:42
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=NULL)
const NodeType * type
Definition: graph/node.h:175
float4 motion_key(const float3 *points, const float *radius, const float3 *point_steps, size_t num_points, size_t num_steps, float time, size_t p) const
float4 point_for_step(const float3 *points, const float *radius, const float3 *point_steps, size_t num_points, size_t num_steps, size_t step, size_t p) const
void bounds_grow(const float3 *points, const float *radius, BoundBox &bounds) const
void pack(Scene *scene, float4 *packed_points, uint *packed_shader)
void reserve(int numpoints)
void clear(const bool preserver_shaders=false) override
void apply_transform(const Transform &tfm, const bool apply_to_motion) override
void get_uv_tiles(ustring map, unordered_set< int > &tiles) override
size_t num_points() const
void resize(int numpoints)
void copy_center_to_motion_step(const int motion_step)
void compute_bounds() override
PrimitiveType primitive_type() const override
void add_point(float3 loc, float radius, int shader=0)
Shader * default_surface
Definition: scene.h:232
ShaderManager * shader_manager
Definition: scene.h:224
ccl_device_inline float4 float3_to_float4(const float3 a)
Definition: util/math.h:505
ccl_device_inline float3 float4_to_float3(const float4 a)
Definition: util/math.h:500