Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/scene/attribute.cpp
| Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | AttrKernelDataType Attribute::kernel_type(const Attribute &attr) | ||||
| if (attr.type == TypeDesc::TypeFloat) { | if (attr.type == TypeDesc::TypeFloat) { | ||||
| return AttrKernelDataType::FLOAT; | return AttrKernelDataType::FLOAT; | ||||
| } | } | ||||
| if (attr.type == TypeFloat2) { | if (attr.type == TypeFloat2) { | ||||
| return AttrKernelDataType::FLOAT2; | return AttrKernelDataType::FLOAT2; | ||||
| } | } | ||||
| if (attr.type == TypeFloat4 || attr.type == TypeRGBA || attr.type == TypeDesc::TypeMatrix) { | |||||
| return AttrKernelDataType::FLOAT4; | |||||
| } | |||||
| return AttrKernelDataType::FLOAT3; | return AttrKernelDataType::FLOAT3; | ||||
| } | } | ||||
| void Attribute::get_uv_tiles(Geometry *geom, | void Attribute::get_uv_tiles(Geometry *geom, | ||||
| AttributePrimitive prim, | AttributePrimitive prim, | ||||
| unordered_set<int> &tiles) const | unordered_set<int> &tiles) const | ||||
| { | { | ||||
| if (type != TypeFloat2) { | if (type != TypeFloat2) { | ||||
| ▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | else if (geometry->geometry_type == Geometry::HAIR) { | ||||
| switch (std) { | switch (std) { | ||||
| case ATTR_STD_UV: | case ATTR_STD_UV: | ||||
| attr = add(name, TypeFloat2, ATTR_ELEMENT_CURVE); | attr = add(name, TypeFloat2, ATTR_ELEMENT_CURVE); | ||||
| break; | break; | ||||
| case ATTR_STD_GENERATED: | case ATTR_STD_GENERATED: | ||||
| attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); | attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE); | ||||
| break; | break; | ||||
| case ATTR_STD_MOTION_VERTEX_POSITION: | case ATTR_STD_MOTION_VERTEX_POSITION: | ||||
| attr = add(name, TypeDesc::TypePoint, ATTR_ELEMENT_CURVE_KEY_MOTION); | attr = add(name, TypeDesc::TypeFloat4, ATTR_ELEMENT_CURVE_KEY_MOTION); | ||||
| break; | break; | ||||
| case ATTR_STD_CURVE_INTERCEPT: | case ATTR_STD_CURVE_INTERCEPT: | ||||
| attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); | attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE_KEY); | ||||
| break; | break; | ||||
| case ATTR_STD_CURVE_LENGTH: | case ATTR_STD_CURVE_LENGTH: | ||||
| attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE); | attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_CURVE); | ||||
| break; | break; | ||||
| case ATTR_STD_CURVE_RANDOM: | case ATTR_STD_CURVE_RANDOM: | ||||
| ▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines | |||||