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.
This commit is contained in:
Brecht Van Lommel
2013-01-03 12:09:09 +00:00
parent 57cf48e7c6
commit bf25f1ea96
26 changed files with 330 additions and 289 deletions

View File

@@ -457,7 +457,7 @@ float3 OSLShader::volume_eval_phase(const ShaderClosure *sc, const float3 omega_
int OSLShader::find_attribute(KernelGlobals *kg, const ShaderData *sd, uint id, AttributeElement *elem)
{
/* for OSL, a hash map is used to lookup the attribute by name. */
int object = sd->object*ATTR_PRIM_TYPES + (sd->curve_seg != ~0);
int object = sd->object*ATTR_PRIM_TYPES + (sd->segment != ~0);
OSLGlobals::AttributeMap &attr_map = kg->osl->attribute_map[object];
ustring stdname(std::string("geom:") + std::string(Attribute::standard_name((AttributeStandard)id)));
OSLGlobals::AttributeMap::const_iterator it = attr_map.find(stdname);