diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-03 16:09:09 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-03 16:09:09 +0400 |
commit | bf25f1ea96d01b513907cf3067e8e2dd3c7e41b4 (patch) | |
tree | 822c28fa6ecf5e08c051e5eb7a05f6bc6e2e8742 /intern/cycles/render/attribute.cpp | |
parent | 57cf48e7c6fd04f864072c21433a822907774f78 (diff) |
Cycles Hair: refactoring to store curves with the index of the first key and the
number of keys in the curve, rather than curve segments with the indices of two
keys. ShaderData.segment now stores the segment number in the curve.
Diffstat (limited to 'intern/cycles/render/attribute.cpp')
-rw-r--r-- | intern/cycles/render/attribute.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index 758e4e5e820..b6f6ba47fe8 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -80,7 +80,7 @@ size_t Attribute::element_size(int numverts, int numtris, int numcurves, int num return numtris; else if(element == ATTR_ELEMENT_CORNER) return numtris*3; - else if(element == ATTR_ELEMENT_CURVE_SEGMENT) + else if(element == ATTR_ELEMENT_CURVE) return numcurves; else if(element == ATTR_ELEMENT_CURVE_KEY) return numkeys; @@ -176,7 +176,7 @@ Attribute *AttributeSet::add(ustring name, TypeDesc type, AttributeElement eleme if(triangle_mesh) attr->reserve(triangle_mesh->verts.size(), triangle_mesh->triangles.size(), 0, 0); if(curve_mesh) - attr->reserve(0, 0, curve_mesh->curve_segments.size(), curve_mesh->curve_keys.size()); + attr->reserve(0, 0, curve_mesh->curves.size(), curve_mesh->curve_keys.size()); return attr; } @@ -239,9 +239,9 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) } else if(curve_mesh) { if(std == ATTR_STD_UV) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_SEGMENT); + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); else if(std == ATTR_STD_GENERATED) - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_SEGMENT); + attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); else if(std == ATTR_STD_MOTION_PRE) attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY); else if(std == ATTR_STD_MOTION_POST) @@ -298,7 +298,7 @@ void AttributeSet::reserve() if(triangle_mesh) attr.reserve(triangle_mesh->verts.size(), triangle_mesh->triangles.size(), 0, 0); if(curve_mesh) - attr.reserve(0, 0, curve_mesh->curve_segments.size(), curve_mesh->curve_keys.size()); + attr.reserve(0, 0, curve_mesh->curves.size(), curve_mesh->curve_keys.size()); } } |