|
OSL printf Output
A summary of the data generated from calls to printf() are now
displayed in the Process Monitor. For example, the data from the printfs
shown below would be displayed as shown in figure 1.
shader
dist2Color(float mindistance = 0,
float maxdistance = 15.0,
color mincolor = color(1,0,0),
color maxcolor = color(0,0,1),
string spacename = "object",
output color resultRGB = 0)
{
point p = transform(spacename, P);
float dist = distance(p, point(0,0,0));
float blend = smoothstep(mindistance, maxdistance, dist);
resultRGB = mix(mincolor, maxcolor, blend);
printf("%f\n", dist);
printf("%f\n", resultRGB);
}
Figure 1
|