Cycles / OSL:

* Ray Length is now available in OSL (via get_attribute)
This commit is contained in:
Thomas Dinges
2012-10-16 22:42:05 +00:00
parent c9fdf6e496
commit b4a83e1d0e
2 changed files with 13 additions and 1 deletions

View File

@@ -459,6 +459,15 @@ static bool get_object_standard_attribute(KernelGlobals *kg, ShaderData *sd, ust
set_attribute_float3(fval, type, derivatives, val);
return true;
}
/* Ray Length */
else if (name == "std::ray_length") {
float fval[3];
fval[0] = sd->ray_length;
fval[1] = fval[2] = 0.0; /* derivates set to 0 */
set_attribute_float(fval, type, derivatives, val);
return true;
}
else
return false;