Friday, March 12, 2010

texture, object, uniform mattes

define AOVs by specifying primvars with the correct type. uniform if its the same color throughout the surface, ie holdout mattes varying if it has different colors through the surface.





primvars


output varying color matte_name;  


sl
extern color matte_name = v1;
result = 0; 


To specify per object mattes would be to use attribute() and match() functions to assign colors to groups or single objects. For example,




sl


string xxoo; attribute("identifier:name", xxoo); 
if (match("cubeShape10",xxoo)) 
    extern color matte_cubes = color(r,0,0);
else if (match("cubeShape20", xxoo)) 
    extern color matte_cubes = color(0,g,0); 
else if (match("coneShape30",xxoo)) 
    extern color matte_cones = color(r,0,0);


 So, the above code writes to two mattes, cubes and cones, in which cubeShape10 will be red and cubeShape20 will be green in matte_cubes.

0 comments:

Post a Comment