diff options
Diffstat (limited to 'intern/cycles/render/geometry.h')
-rw-r--r-- | intern/cycles/render/geometry.h | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/intern/cycles/render/geometry.h b/intern/cycles/render/geometry.h index bcadb3a8051..1a374c57463 100644 --- a/intern/cycles/render/geometry.h +++ b/intern/cycles/render/geometry.h @@ -56,13 +56,13 @@ class Geometry : public Node { VOLUME, }; - Type type; + Type geometry_type; /* Attributes */ AttributeSet attributes; /* Shaders */ - vector<Shader *> used_shaders; + NODE_SOCKET_API_ARRAY(array<Node *>, used_shaders) /* Transform */ BoundBox bounds; @@ -71,8 +71,8 @@ class Geometry : public Node { Transform transform_normal; /* Motion Blur */ - uint motion_steps; - bool use_motion_blur; + NODE_SOCKET_API(uint, motion_steps) + NODE_SOCKET_API(bool, use_motion_blur) /* Maximum number of motion steps supported (due to Embree). */ static const uint MAX_MOTION_STEPS = 129; @@ -88,7 +88,6 @@ class Geometry : public Node { bool has_surface_bssrdf; /* Set in the device_update_flags(). */ /* Update Flags */ - bool need_update; bool need_update_rebuild; /* Constructor/Destructor */ @@ -138,6 +137,16 @@ class Geometry : public Node { bool has_motion_blur() const; bool has_voxel_attributes() const; + bool is_mesh() const + { + return geometry_type == MESH; + } + + bool is_hair() const + { + return geometry_type == HAIR; + } + /* Updates */ void tag_update(Scene *scene, bool rebuild); }; @@ -200,6 +209,21 @@ class GeometryManager { void device_update_displacement_images(Device *device, Scene *scene, Progress &progress); void device_update_volume_images(Device *device, Scene *scene, Progress &progress); + + private: + static void update_attribute_element_offset(Geometry *geom, + device_vector<float> &attr_float, + size_t &attr_float_offset, + device_vector<float2> &attr_float2, + size_t &attr_float2_offset, + device_vector<float4> &attr_float3, + size_t &attr_float3_offset, + device_vector<uchar4> &attr_uchar4, + size_t &attr_uchar4_offset, + Attribute *mattr, + AttributePrimitive prim, + TypeDesc &type, + AttributeDescriptor &desc); }; CCL_NAMESPACE_END |