Debugging OSL
Posted: Thu Dec 03, 2020 8:55 pm
Hello,
I am trying to teach myself OSL using the spec, the OctaneRender OSL documentation, and this training series.
I have a simple OSL shader where I am trying to print to the OSL console.
That leads to this error:
printf is not listed in the Unsupported features. I would only want this to print once, though, and my .osl experiments in Blender with printf in the Shader function call it every draw of the Viewport.
How do I debug my shaders in Octane (e.g. printing their variables to the console once)?
I am trying to teach myself OSL using the spec, the OctaneRender OSL documentation, and this training series.
I have a simple OSL shader where I am trying to print to the OSL console.
Code: Select all
color AddColors(
color a,
color b)
{
return a + b;
}
shader NewColor(output color d=0)
{
color x = AddColors(color(0.5,0.2,0.4),color(0.2,0.1,0.2));
printf ("x = %g", x);
d = x;
}
Code: Select all
<node 'Osl Texture'>:5: error: Unsupported feature: printf()
How do I debug my shaders in Octane (e.g. printing their variables to the console once)?