diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-05 16:54:54 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2019-03-05 16:55:21 +0300 |
commit | db7f9a70b0addd17a2f8a8d87c0b4d77d78b536e (patch) | |
tree | 46a8b0a62f146a17a2e764159b58a6f0c66e01f6 /intern/cycles/render/attribute.cpp | |
parent | a325bc6bf3e6dace5d1e15330650ea532052c9fc (diff) |
Cycles: Added Float2 attribute type.
Float2 are now a new type for attributes in Cycles. Before, the choices
for attribute storage were float and float3, the latter padded to
float4. This meant that UV maps were inflated to twice the size
necessary.
Reviewers: brecht, sergey
Reviewed By: brecht
Subscribers: #cycles
Tags: #cycles
Differential Revision: https://developer.blender.org/D4409
Diffstat (limited to 'intern/cycles/render/attribute.cpp')
-rw-r--r-- | intern/cycles/render/attribute.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index ca167a7c722..70f75a4b573 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -48,7 +48,8 @@ void Attribute::set(ustring name_, TypeDesc type_, AttributeElement element_) /* string and matrix not supported! */ assert(type == TypeDesc::TypeFloat || type == TypeDesc::TypeColor || type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeMatrix); + type == TypeDesc::TypeNormal || type == TypeDesc::TypeMatrix || + type == TypeFloat2); } void Attribute::resize(Mesh *mesh, AttributePrimitive prim, bool reserve_only) @@ -400,7 +401,7 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) attr = add(name, TypeDesc::TypeNormal, ATTR_ELEMENT_FACE); break; case ATTR_STD_UV: - attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CORNER); + attr = add(name, TypeFloat2, ATTR_ELEMENT_CORNER); break; case ATTR_STD_UV_TANGENT: attr = add(name, TypeDesc::TypeVector, ATTR_ELEMENT_CORNER); |