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
This commit is contained in:
@@ -231,6 +231,9 @@ public:
|
||||
if(attr.same_storage(attr.type, TypeDesc::TypeFloat)) {
|
||||
primvar_refiner.Interpolate(i+1, (OsdValue<float>*)src, (OsdValue<float>*&)dest);
|
||||
}
|
||||
else if(attr.same_storage(attr.type, TypeFloat2)) {
|
||||
primvar_refiner.Interpolate(i+1, (OsdValue<float2>*)src, (OsdValue<float2>*&)dest);
|
||||
}
|
||||
else {
|
||||
primvar_refiner.Interpolate(i+1, (OsdValue<float4>*)src, (OsdValue<float4>*&)dest);
|
||||
}
|
||||
@@ -243,6 +246,10 @@ public:
|
||||
patch_table->ComputeLocalPointValues((OsdValue<float>*)&attr.buffer[0],
|
||||
(OsdValue<float>*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]);
|
||||
}
|
||||
else if(attr.same_storage(attr.type, TypeFloat2)) {
|
||||
patch_table->ComputeLocalPointValues((OsdValue<float2>*)&attr.buffer[0],
|
||||
(OsdValue<float2>*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]);
|
||||
}
|
||||
else {
|
||||
patch_table->ComputeLocalPointValues((OsdValue<float4>*)&attr.buffer[0],
|
||||
(OsdValue<float4>*)&attr.buffer[num_refiner_verts * attr.data_sizeof()]);
|
||||
|
||||
Reference in New Issue
Block a user