45 const size_t max_step = num_steps - 1;
46 const size_t step =
min((
size_t)(time * max_step), max_step - 1);
47 const float t = time * max_step - step;
50 points, radius, point_steps,
num_points, num_steps, step, p);
52 points, radius, point_steps,
num_points, num_steps, step + 1, p);
54 return (1.0f - t) * curr_key + t * next_key;
65 const size_t center_step = ((num_steps - 1) / 2);
66 if (step == center_step) {
68 return make_float4(points[p].
x, points[p].
y, points[p].
z, radius[p]);
72 if (step > center_step) {
76 return point_steps[offset + p];
85 "pointcloud", create,
NodeType::NONE, Geometry::get_node_base_type());
100 points.resize(numpoints);
101 radius.resize(numpoints);
102 shader.resize(numpoints);
105 tag_points_modified();
106 tag_radius_modified();
107 tag_shader_modified();
112 points.reserve(numpoints);
113 radius.reserve(numpoints);
114 shader.reserve(numpoints);
127 tag_points_modified();
128 tag_radius_modified();
129 tag_shader_modified();
134 points.push_back_reserved(co);
135 radius.push_back_reserved(r);
136 shader.push_back_reserved(shader_index);
138 tag_points_modified();
139 tag_radius_modified();
140 tag_shader_modified();
147 float3 *points_data = points.data();
148 size_t numpoints = points.size();
149 float *radius_data = radius.data();
152 for (
int i = 0; i < numpoints; i++) {
154 float r = radius_data[i];
179 size_t numpoints = points.size();
182 for (
size_t i = 0; i < numpoints; i++) {
183 bnds.
grow(points[i], radius[i]);
187 if (use_motion_blur && attr) {
188 size_t steps_size = points.size() * (motion_steps - 1);
191 for (
size_t i = 0; i < steps_size; i++) {
200 for (
size_t i = 0; i < numpoints; i++) {
204 if (use_motion_blur && attr) {
205 size_t steps_size = points.size() * (motion_steps - 1);
208 for (
size_t i = 0; i < steps_size; i++) {
232 for (
size_t i = 0; i < points.size(); i++) {
234 float r = radius[i] * scalar;
242 if (apply_to_motion) {
247 size_t steps_size = points.size() * (motion_steps - 1);
250 for (
size_t i = 0; i < steps_size; i++) {
252 float radius = point_steps[i].w * scalar;
257 point_steps[i].w = radius;
265 size_t numpoints = points.size();
266 float3 *points_data = points.data();
267 float *radius_data = radius.data();
268 int *shader_data = shader.data();
270 for (
size_t i = 0; i < numpoints; i++) {
272 points_data[i].
x, points_data[i].
y, points_data[i].
z, radius_data[i]);
276 uint last_shader = -1;
277 for (
size_t i = 0; i < numpoints; i++) {
278 if (last_shader != shader_data[i]) {
279 last_shader = shader_data[i];
280 Shader *shader = (last_shader < used_shaders.size()) ?
281 static_cast<Shader *
>(used_shaders[last_shader]) :
285 packed_shader[i] = shader_id;
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 Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture 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
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void get_uv_tiles(Geometry *geom, AttributePrimitive prim, unordered_set< int > &tiles) const
int motion_step(float time) const
bool has_motion_blur() const
Geometry(const NodeType *node_type, const Type type)
virtual void clear(bool preserve_shaders=false)
int get_shader_id(Shader *shader, bool smooth=false)
additional_info("compositor_sum_squared_difference_float_shared") .push_constant(Type output_img float dot(value.rgb, luminance_coefficients)") .define("LOAD(value)"
#define CCL_NAMESPACE_END
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
@ ATTR_STD_MOTION_VERTEX_POSITION
ccl_device_inline float cross(const float2 a, const float2 b)
#define SOCKET_POINT_ARRAY(name, ui_name, default_value,...)
#define SOCKET_FLOAT_ARRAY(name, ui_name, default_value,...)
#define SOCKET_INT_ARRAY(name, ui_name, default_value,...)
#define NODE_DEFINE(structname)
__forceinline bool valid() const
__forceinline void grow_safe(const float3 &pt)
__forceinline void grow(const float3 &pt)
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=NULL)
float4 motion_key(const float3 *points, const float *radius, const float4 *point_steps, size_t num_points, size_t num_steps, float time, size_t p) const
void bounds_grow(const float3 *points, const float *radius, BoundBox &bounds) const
float4 point_for_step(const float3 *points, const float *radius, const float4 *point_steps, size_t num_points, size_t num_steps, size_t step, size_t p) 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)
ShaderManager * shader_manager
VecBase< float, 4 > float4
ccl_device_inline float4 float3_to_float4(const float3 a)
ccl_device_inline float3 float4_to_float3(const float4 a)