Blender V5.3
hair.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#include <algorithm>
6
7#include "bvh/bvh.h"
8
9#include "scene/curves.h"
10#include "scene/hair.h"
11#include "scene/object.h"
12#include "scene/scene.h"
13
15
16#include "util/progress.h"
17#include "util/tbb.h"
18
20
21/* Hair Curve */
22void Hair::Curve::bounds_grow(const int k, const float4 *keys, BoundBox &bounds) const
23{
24 float3 P[4];
25
26 P[0] = make_float3(keys[max(first_key + k - 1, first_key)]);
27 P[1] = make_float3(keys[first_key + k]);
28 P[2] = make_float3(keys[first_key + k + 1]);
29 P[3] = make_float3(keys[min(first_key + k + 2, first_key + num_keys - 1)]);
30
31 float3 lower;
32 float3 upper;
33
34 curvebounds(&lower.x, &upper.x, P, 0);
35 curvebounds(&lower.y, &upper.y, P, 1);
36 curvebounds(&lower.z, &upper.z, P, 2);
37
38 const float mr = max(keys[1].w, keys[2].w);
39
40 bounds.grow(lower, mr);
41 bounds.grow(upper, mr);
42}
43
44void Hair::Curve::bounds_grow(const int k,
45 const packed_float3 *curve_keys,
46 const float *curve_radius,
47 BoundBox &bounds) const
48{
49 float3 P[4];
50
51 P[0] = curve_keys[max(first_key + k - 1, first_key)];
52 P[1] = curve_keys[first_key + k];
53 P[2] = curve_keys[first_key + k + 1];
54 P[3] = curve_keys[min(first_key + k + 2, first_key + num_keys - 1)];
55
56 float3 lower;
57 float3 upper;
58
59 curvebounds(&lower.x, &upper.x, P, 0);
60 curvebounds(&lower.y, &upper.y, P, 1);
61 curvebounds(&lower.z, &upper.z, P, 2);
62
63 const float mr = max(curve_radius[first_key + k], curve_radius[first_key + k + 1]);
64
65 bounds.grow(lower, mr);
66 bounds.grow(upper, mr);
67}
68
69void Hair::Curve::bounds_grow(const int k,
70 const packed_float3 *curve_keys,
71 const float *curve_radius,
72 const Transform &aligned_space,
73 BoundBox &bounds) const
74{
75 float3 P[4];
76
77 P[0] = curve_keys[max(first_key + k - 1, first_key)];
78 P[1] = curve_keys[first_key + k];
79 P[2] = curve_keys[first_key + k + 1];
80 P[3] = curve_keys[min(first_key + k + 2, first_key + num_keys - 1)];
81
82 P[0] = transform_point(&aligned_space, P[0]);
83 P[1] = transform_point(&aligned_space, P[1]);
84 P[2] = transform_point(&aligned_space, P[2]);
85 P[3] = transform_point(&aligned_space, P[3]);
86
87 float3 lower;
88 float3 upper;
89
90 curvebounds(&lower.x, &upper.x, P, 0);
91 curvebounds(&lower.y, &upper.y, P, 1);
92 curvebounds(&lower.z, &upper.z, P, 2);
93
94 const float mr = max(curve_radius[first_key + k], curve_radius[first_key + k + 1]);
95
96 bounds.grow(lower, mr);
97 bounds.grow(upper, mr);
98}
99
101{
102 float3 P[4] = {
103 make_float3(keys[0]),
104 make_float3(keys[1]),
105 make_float3(keys[2]),
106 make_float3(keys[3]),
107 };
108
109 float3 lower;
110 float3 upper;
111
112 curvebounds(&lower.x, &upper.x, P, 0);
113 curvebounds(&lower.y, &upper.y, P, 1);
114 curvebounds(&lower.z, &upper.z, P, 2);
115
116 const float mr = max(keys[1].w, keys[2].w);
117
118 bounds.grow(lower, mr);
119 bounds.grow(upper, mr);
120}
121
122/* Get position and radius arrays for a given time-ordered motion step. */
123static void hair_step_buffers(const Attribute *attr_P,
124 const Attribute *attr_R,
125 const size_t step,
126 const packed_float3 *&P,
127 const float *&R)
128{
129 /* Radius motion follows the position motion steps, if it has fewer steps the
130 * read falls back to the center radius. */
131 const int num_steps = attr_P->num_motion_steps();
132 P = attr_P->data_at_time_step<packed_float3>(step, num_steps);
133 R = attr_R->data_at_time_step<float>(step, num_steps);
134}
135
137 const Attribute *attr_R,
138 const size_t num_steps,
139 const float time,
140 size_t k0,
141 size_t k1,
142 float4 r_keys[2]) const
143{
144 /* Figure out which steps we need to fetch and their interpolation factor. */
145 const size_t max_step = num_steps - 1;
146 const size_t step = std::min((size_t)(time * max_step), max_step - 1);
147 const float t = time * max_step - step;
148 /* Fetch vertex coordinates. */
149 float4 curr_keys[2];
150 float4 next_keys[2];
151 keys_for_step(attr_P, attr_R, step, k0, k1, curr_keys);
152 keys_for_step(attr_P, attr_R, step + 1, k0, k1, next_keys);
153 /* Interpolate between steps. */
154 r_keys[0] = (1.0f - t) * curr_keys[0] + t * next_keys[0];
155 r_keys[1] = (1.0f - t) * curr_keys[1] + t * next_keys[1];
156}
157
159 const Attribute *attr_R,
160 const size_t num_steps,
161 const float time,
162 size_t k0,
163 size_t k1,
164 size_t k2,
165 size_t k3,
166 float4 r_keys[4]) const
167{
168 /* Figure out which steps we need to fetch and their interpolation factor. */
169 const size_t max_step = num_steps - 1;
170 const size_t step = min((size_t)(time * max_step), max_step - 1);
171 const float t = time * max_step - step;
172 /* Fetch vertex coordinates. */
173 float4 curr_keys[4];
174 float4 next_keys[4];
175 cardinal_keys_for_step(attr_P, attr_R, step, k0, k1, k2, k3, curr_keys);
176 cardinal_keys_for_step(attr_P, attr_R, step + 1, k0, k1, k2, k3, next_keys);
177 /* Interpolate between steps. */
178 r_keys[0] = (1.0f - t) * curr_keys[0] + t * next_keys[0];
179 r_keys[1] = (1.0f - t) * curr_keys[1] + t * next_keys[1];
180 r_keys[2] = (1.0f - t) * curr_keys[2] + t * next_keys[2];
181 r_keys[3] = (1.0f - t) * curr_keys[3] + t * next_keys[3];
182}
183
185 const Attribute *attr_R,
186 const size_t step,
187 size_t k0,
188 size_t k1,
189 float4 r_keys[2]) const
190{
191 k0 = max(k0, (size_t)0);
192 k1 = min(k1, (size_t)(num_keys - 1));
193 const packed_float3 *P;
194 const float *R;
195 hair_step_buffers(attr_P, attr_R, step, P, R);
196 r_keys[0] = make_float4(P[first_key + k0], R[first_key + k0]);
197 r_keys[1] = make_float4(P[first_key + k1], R[first_key + k1]);
198}
199
201 const Attribute *attr_R,
202 const size_t step,
203 size_t k0,
204 size_t k1,
205 size_t k2,
206 size_t k3,
207 float4 r_keys[4]) const
208{
209 k0 = max(k0, (size_t)0);
210 k3 = min(k3, (size_t)(num_keys - 1));
211 const packed_float3 *P;
212 const float *R;
213 hair_step_buffers(attr_P, attr_R, step, P, R);
214 r_keys[0] = make_float4(P[first_key + k0], R[first_key + k0]);
215 r_keys[1] = make_float4(P[first_key + k1], R[first_key + k1]);
216 r_keys[2] = make_float4(P[first_key + k2], R[first_key + k2]);
217 r_keys[3] = make_float4(P[first_key + k3], R[first_key + k3]);
218}
219
220/* Hair */
221
223{
224 NodeType *type = NodeType::add("hair", create, NodeType::NONE, Geometry::get_node_base_type());
225
226 SOCKET_INT_ARRAY(curve_first_key, "Curve First Key", array<int>());
227 SOCKET_INT_ARRAY(curve_shader, "Curve Shader", array<int>());
228
229 return type;
230}
231
232Hair::Hair() : Geometry(get_node_type(), Geometry::HAIR)
233{
236
237 add_builtin_attributes();
238}
239
240Hair::~Hair() = default;
241
242void Hair::add_builtin_attributes()
243{
246}
247
248void Hair::resize_curves(const int numcurves, const int numkeys)
249{
251 attr_P->resize(numkeys);
253 attr_R->resize(numkeys);
254 curve_first_key.resize(numcurves);
255 curve_shader.resize(numcurves);
256
258}
259
260void Hair::clear(bool preserve_shaders)
261{
262 Geometry::clear(preserve_shaders);
263
264 curve_first_key.clear();
265 curve_shader.clear();
266
268 add_builtin_attributes();
269}
270
272{
273 const int attr_step = motion_step + 1;
274 const size_t numkeys = num_keys();
275
277 if (attr_P->has_motion()) {
278 std::copy_n(get_position(), numkeys, attr_P->data_for_write<packed_float3>(attr_step));
279 }
280
282 if (attr_R->has_motion()) {
283 std::copy_n(get_radius(), numkeys, attr_R->data_for_write<float>(attr_step));
284 }
285
287 if (attr_vN && attr_vN->has_motion()) {
288 std::copy_n(attr_vN->data<packed_normal>(),
289 numkeys,
290 attr_vN->data_for_write<packed_normal>(attr_step));
291 }
292}
293
294void Hair::get_uv_tiles(ustring map, unordered_set<int> &tiles)
295{
296 Attribute *attr;
297
298 if (map.empty()) {
300 }
301 else {
302 attr = attributes.find(map);
303 }
304
305 if (attr) {
307 }
308}
309
311{
313 const size_t curve_keys_size = num_keys();
314 const packed_float3 *curve_keys_data = get_position();
315 const float *curve_radius_data = get_radius();
316 const size_t curve_num = num_curves();
317
318 if (curve_keys_size > 0) {
319 bnds.grow(parallel_reduce(
320 blocked_range<size_t>(0, curve_num),
322 [&](const blocked_range<size_t> &range, const BoundBox &partial_bounds) {
323 BoundBox current_bounds = partial_bounds;
324 for (size_t i = range.begin(); i < range.end(); ++i) {
325 const Curve curve = get_curve(i);
326 const int num_segments = curve.num_segments();
327 for (int k = 0; k < num_segments; k++) {
328 curve.bounds_grow(k, curve_keys_data, curve_radius_data, current_bounds);
329 }
330 }
331 return current_bounds;
332 },
333 [](const BoundBox &bounds_a, const BoundBox &bounds_b) {
334 BoundBox combined_bounds = bounds_a;
335 combined_bounds.grow(bounds_b);
336 return combined_bounds;
337 }));
338
340 if (use_motion_blur && attr_P->has_motion()) {
341 for (int attr_step = 1; attr_step < attr_P->num_motion_steps(); attr_step++) {
342 const packed_float3 *key_step = attr_P->data<packed_float3>(attr_step);
343 for (size_t i = 0; i < curve_keys_size; i++) {
344 bnds.grow(key_step[i]);
345 }
346 }
347 }
348
349 if (!bnds.valid()) {
350 bnds = BoundBox::empty;
351
352 /* skip nan or inf coordinates */
353 for (size_t i = 0; i < curve_keys_size; i++) {
354 bnds.grow_safe(curve_keys_data[i], curve_radius_data[i]);
355 }
356
357 if (use_motion_blur && attr_P->has_motion()) {
358 for (int attr_step = 1; attr_step < attr_P->num_motion_steps(); attr_step++) {
359 const packed_float3 *key_step = attr_P->data<packed_float3>(attr_step);
360 for (size_t i = 0; i < curve_keys_size; i++) {
361 bnds.grow_safe(key_step[i]);
362 }
363 }
364 }
365 }
366 }
367
368 if (!bnds.valid()) {
369 /* empty mesh */
370 bnds.grow(zero_float3());
371 }
372
373 bounds = bnds;
374}
375
376void Hair::apply_transform(const Transform &tfm, const bool apply_to_motion)
377{
378 /* compute uniform scale */
379 const float3 c0 = transform_get_column(&tfm, 0);
380 const float3 c1 = transform_get_column(&tfm, 1);
381 const float3 c2 = transform_get_column(&tfm, 2);
382 const float scalar = powf(fabsf(dot(cross(c0, c1), c2)), 1.0f / 3.0f);
383
384 /* apply transform to curve keys */
386 float *radius = get_radius_for_write();
387 const size_t numkeys = num_keys();
388 for (size_t i = 0; i < numkeys; i++) {
389 const float3 co = transform_point(&tfm, keys[i]);
390 const float r = radius[i] * scalar;
391
392 /* scale for curve radius is only correct for uniform scale */
393 keys[i] = co;
394 radius[i] = r;
395 }
396
399
400 if (apply_to_motion) {
403
404 if (attr_P->has_motion()) {
405 const bool has_motion_radius = attr_R->has_motion();
406 const size_t nk = num_keys();
407 for (int step = 1; step <= int(attr_P->motion.size()); step++) {
408 packed_float3 *motion_P = attr_P->data_for_write<packed_float3>(step);
409 float *motion_R = has_motion_radius ? attr_R->data_for_write<float>(step) : nullptr;
410 for (size_t i = 0; i < nk; i++) {
411 motion_P[i] = transform_point(&tfm, motion_P[i]);
412 if (motion_R) {
413 motion_R[i] *= scalar;
414 }
415 }
416 }
417 }
418 }
419}
420
422{
423 /* pack curve segments */
425
426 const size_t curve_num = num_curves();
427 size_t index = 0;
428
429 for (size_t i = 0; i < curve_num; i++) {
430 const Curve curve = get_curve(i);
431 int shader_id = curve_shader[i];
432 Shader *shader = (shader_id < used_shaders.size()) ?
433 static_cast<Shader *>(used_shaders[shader_id]) :
434 scene->default_surface;
435 shader_id = scene->shader_manager->get_shader_id(shader, false);
436
437 curves[i].shader_id = shader_id;
438 curves[i].first_key = curve.first_key;
439 curves[i].num_keys = curve.num_keys;
440 curves[i].type = type;
441
442 for (int k = 0; k < curve.num_segments(); ++k, ++index) {
443 curve_segments[index].prim = prim_offset + i;
444 curve_segments[index].type = PRIMITIVE_PACK_SEGMENT(type, k);
445 }
446 }
447}
448
459
460/* Fill in coordinates for curve transparency shader evaluation on device. */
461static int fill_shader_input(const Hair *hair,
462 const size_t object_index,
464{
465 int d_input_size = 0;
466 KernelShaderEvalInput *d_input_data = d_input.data();
467
468 const int num_curves = hair->num_curves();
469 for (int i = 0; i < num_curves; i++) {
470 const Hair::Curve curve = hair->get_curve(i);
471 const int num_segments = curve.num_segments();
472
473 for (int j = 0; j < num_segments + 1; j++) {
475 in.object = object_index;
476 in.prim = hair->prim_offset + i;
477 in.u = (j < num_segments) ? 0.0f : 1.0f;
478 in.v = (j < num_segments) ? __int_as_float(j) : __int_as_float(j - 1);
479 d_input_data[d_input_size++] = in;
480 }
481 }
482
483 return d_input_size;
484}
485
486/* Read back curve transparency shader output. */
487static void read_shader_output(float *shadow_transparency,
488 bool &is_fully_opaque,
489 const device_vector<float> &d_output)
490{
491 const int num_keys = d_output.size();
492 const float *output_data = d_output.data();
493 bool is_opaque = true;
494
495 for (int i = 0; i < num_keys; i++) {
496 shadow_transparency[i] = output_data[i];
497 if (shadow_transparency[i] > 0.0f) {
498 is_opaque = false;
499 }
500 }
501
502 is_fully_opaque = is_opaque;
503}
504
506{
507 if (!is_traceable()) {
508 return false;
509 }
510
511 for (const Node *node : used_shaders) {
512 const Shader *shader = static_cast<const Shader *>(node);
513 if (shader->has_surface_transparent && shader->get_use_transparent_shadow()) {
514 return true;
515 }
516 }
517
518 return false;
519}
520
522{
524 return true;
525 }
526
527 for (const Node *node : used_shaders) {
528 const Shader *shader = static_cast<const Shader *>(node);
530 return true;
531 }
532 }
533
534 return false;
535}
536
538{
540 /* If no shaders with shadow transparency, remove attribute. */
542 if (attr) {
543 attributes.remove(attr);
544 return true;
545 }
546 return false;
547 }
548
550 /* Neither geometry nor shader is modified, no need to update. */
551 return false;
552 }
553
554 const string msg = string_printf("Computing Shadow Transparency %s", name.c_str());
555 progress.set_status("Updating Hair", msg);
556
557 /* Create shadow transparency attribute. */
559 const bool attribute_exists = (attr != nullptr);
560 if (!attribute_exists) {
562 }
563
564 float *attr_data = attr->data_for_write<float>();
565
566 /* Find object index. */
567 size_t object_index = OBJECT_NONE;
568
569 for (size_t i = 0; i < scene->objects.size(); i++) {
570 if (scene->objects[i]->get_geometry() == this) {
571 object_index = i;
572 break;
573 }
574 }
575
576 /* Evaluate shader on device. */
577 ShaderEval shader_eval(device, progress);
578 bool is_fully_opaque = false;
579 shader_eval.eval(
581 num_keys(),
582 1,
583 [this, object_index](device_vector<KernelShaderEvalInput> &d_input) {
584 return fill_shader_input(this, object_index, d_input);
585 },
586 [attr_data, &is_fully_opaque](const device_vector<float> &d_output) {
587 read_shader_output(attr_data, is_fully_opaque, d_output);
588 });
589
590 if (is_fully_opaque) {
591 attributes.remove(attr);
592 return attribute_exists;
593 }
594
595 return true;
596}
597
btScalar max
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
Attribute * find(ustring name) const
Attribute * add(ustring name, const TypeDesc type, AttributeElement element)
void remove(ustring name)
void clear(bool preserve_voxel_data=false)
vector< Buffer > motion
const T * data(const int step=0) const
void resize(Geometry *geom, AttributePrimitive prim)
T * data_for_write(const int step=0)
bool has_motion() const
void get_uv_tiles(Geometry *geom, AttributePrimitive prim, unordered_set< int > &tiles) const
int num_motion_steps() const
const T * data_at_time_step(const int step, const int num_time_steps) const
__forceinline BoundBox()=default
__forceinline bool valid() const
Definition boundbox.h:127
__forceinline void grow_safe(const float3 &pt)
Definition boundbox.h:56
__forceinline void grow(const float3 &pt)
Definition boundbox.h:35
int motion_step(const float time) const
BoundBox bounds
void tag_position_modified()
const packed_float3 * get_position() const
size_t prim_offset
virtual bool has_motion_blur() const
float * get_radius_for_write()
const float * get_radius() const
AttributeSet attributes
Geometry(const NodeType *node_type, const Type type)
void tag_radius_modified()
virtual void clear(bool preserve_shaders=false)
packed_float3 * get_position_for_write()
Definition hair.h:13
bool need_update_shadow_transparency() const
Definition hair.cpp:521
bool is_traceable() const
Definition hair.h:119
bool need_shadow_transparency() const
Definition hair.cpp:505
void pack_curves(Scene *scene, KernelCurve *curve, KernelCurveSegment *curve_segments)
Definition hair.cpp:421
Curve get_curve(const size_t i) const
Definition hair.h:94
void compute_bounds() override
Definition hair.cpp:310
size_t curve_segment_offset
Definition hair.h:76
size_t num_curves() const
Definition hair.h:109
bool update_shadow_transparency(Device *device, Scene *scene, Progress &progress)
Definition hair.cpp:537
void get_uv_tiles(ustring map, unordered_set< int > &tiles) override
Definition hair.cpp:294
void copy_center_to_motion_step(const int motion_step)
Definition hair.cpp:271
void resize_curves(const int numcurves, const int numkeys)
Definition hair.cpp:248
~Hair() override
size_t num_segments() const
Definition hair.h:114
CurveShapeType curve_shape
Definition hair.h:77
void clear(bool preserve_shaders=false) override
Definition hair.cpp:260
size_t num_keys() const
Definition hair.h:103
void apply_transform(const Transform &tfm, const bool apply_to_motion) override
Definition hair.cpp:376
PrimitiveType primitive_type() const override
Definition hair.cpp:449
Hair()
Definition hair.cpp:232
void set_status(const string &status_, const string &substatus_="")
Definition progress.h:248
Definition scene.h:133
Shader * default_surface
Definition scene.h:178
unique_ptr< ShaderManager > shader_manager
Definition scene.h:169
unique_ptr_vector< Object > objects
Definition scene.h:162
bool eval(const ShaderEvalType type, const int max_num_inputs, const int num_channels, const std::function< int(device_vector< KernelShaderEvalInput > &)> &fill_input, const std::function< void(device_vector< float > &)> &read_output)
bool has_surface_transparent
bool need_update_shadow_transparency
size_t size() const
size_t size() const
static void fill_shader_input(device_vector< KernelShaderEvalInput > &d_input, const Octree *octree, const Object *object, const Shader *shader, const int resolution)
static void read_shader_output(const device_vector< float > &d_output, const Octree *octree, const int num_channels, const int resolution, vector< Extrema< float > > &sigmas)
#define PRIMITIVE_PACK_SEGMENT(type, segment)
#define OBJECT_NONE
#define powf(x, y)
#define CCL_NAMESPACE_END
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
#define __int_as_float(x)
float dot(VecOp< float, D >, VecOp< float, D >) RET
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
float3 transform_point(float3x3 mat, float3 point)
static void read_shader_output(float *shadow_transparency, bool &is_fully_opaque, const device_vector< float > &d_output)
Definition hair.cpp:487
static void hair_step_buffers(const Attribute *attr_P, const Attribute *attr_R, const size_t step, const packed_float3 *&P, const float *&R)
Definition hair.cpp:123
static int fill_shader_input(const Hair *hair, const size_t object_index, device_vector< KernelShaderEvalInput > &d_input)
Definition hair.cpp:461
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
PrimitiveType
@ PRIMITIVE_MOTION_CURVE_RIBBON
@ PRIMITIVE_CURVE_THICK_LINEAR
@ PRIMITIVE_CURVE_RIBBON
@ PRIMITIVE_MOTION_CURVE_THICK
@ PRIMITIVE_CURVE_THICK
@ PRIMITIVE_MOTION_CURVE_THICK_LINEAR
@ CURVE_RIBBON
@ CURVE_THICK_LINEAR
@ ATTR_PRIM_GEOMETRY
@ ATTR_STD_UV
@ ATTR_STD_VERTEX_NORMAL
@ ATTR_STD_SHADOW_TRANSPARENCY
@ ATTR_STD_POSITION
@ ATTR_STD_RADIUS
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
Definition math_float3.h:17
#define R
#define SOCKET_INT_ARRAY(name, ui_name, default_value,...)
Definition node_type.h:265
#define NODE_DEFINE(structname)
Definition node_type.h:157
#define fabsf
#define make_float4
CCL_NAMESPACE_BEGIN void curvebounds(float *lower, float *upper, float3 *p, const int dim)
@ SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY
Definition shader_eval.h:21
#define min(a, b)
Definition sort.cc:38
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
Definition string.cpp:25
void keys_for_step(const Attribute *attr_P, const Attribute *attr_R, const size_t step, size_t k0, size_t k1, float4 r_keys[2]) const
Definition hair.cpp:184
void cardinal_motion_keys(const Attribute *attr_P, const Attribute *attr_R, const size_t num_steps, const float time, size_t k0, size_t k1, size_t k2, size_t k3, float4 r_keys[4]) const
Definition hair.cpp:158
void bounds_grow(const int k, const packed_float3 *curve_keys, const float *curve_radius, BoundBox &bounds) const
Definition hair.cpp:44
int first_key
Definition hair.h:19
int num_segments() const
Definition hair.h:22
void cardinal_keys_for_step(const Attribute *attr_P, const Attribute *attr_R, const size_t step, size_t k0, size_t k1, size_t k2, size_t k3, float4 r_keys[4]) const
Definition hair.cpp:200
int num_keys
Definition hair.h:20
void motion_keys(const Attribute *attr_P, const Attribute *attr_R, const size_t num_steps, const float time, size_t k0, size_t k1, float4 r_keys[2]) const
Definition hair.cpp:136
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=nullptr)
const NodeType * type
Definition graph/node.h:179
ustring name
Definition graph/node.h:178
bool is_modified() const
Node(const NodeType *type, ustring name=ustring())
float z
Definition sky_math.h:136
float y
Definition sky_math.h:136
float x
Definition sky_math.h:136
ccl_device_inline float3 transform_get_column(const Transform *t, const int column)
Definition transform.h:387