OSL Scripts No Longer Compile in 2.69.8

Hi All,

I was playing around with OSL and noticed that a lot of the already posted OSL code no longer compile.

Is the OSL API that unstable?
Can someone explain how to fix this and possibly all the other posted, now broken, shader scripts?

For instance, this Yin Yang shader, by Thomas Dinges, no longer compiles.


/* Based on OpenGL Code by Inigo Quilez
 * http://www.iquilezles.org/apps/shadertoy/index.html */

#include <stdosl.h>

float yinyang(float x, float y, float rot) 
{
    float nx = x;
    float ny = y;
    x = 1.5*(nx*cos(0.2*rot) - ny*sin(0.2*rot));
    y = 1.5*(nx*sin(0.2*rot) + ny*cos(0.2*rot));
    float h = x*x + y*y;
    float d = abs(y)-h;
    float a = d-0.23;
    float b = h-1.00;
    float c = sign(a*b*(y+x + (y-x)*sign(d)));

    c = mix( c, 0.0, smoothstep(0.98,1.00,h) );
    c = mix( c, 1.0, smoothstep(1.00,1.02,h) );
    return c;
}

shader node_yinyang(
    float Scale = 1.0,
    float Rotation = 1.0,
    point Vector = P,
    output color Color = (0.0),
    output float Fac = 0.0)
{
    point p= Scale*Vector;
    
    Fac = yinyang(float(p[0]),float(p[1]), Rotation);
    Color = color(Fac);
}

Thanks

I guess it is not really obvious, but it looks like you need a special build of Blender to use OSL. I thought OSL was already built into blender as of 2.68 but I guess it has not been ‘officially’ included in the trunk.

I pulled down this build: http://graphicall.org/110 and the scripts work again.

I wonder how long until OSL is officially in the trunk?

OSL is enabled in “trunk” (now called master) since Blender 2.65 already (December 2012) and was in every stable Blender release since then.

Either you downloaded a build which had OSL disabled for some reason, or you should paste the error message you got.

Thanks for the clarification. The 2.69 official release has been difficult to work with and I have been using buildbot and some graphicall builds to proceed with my node based AddOn development. There were some node events broken in the official 2.69 release.

or you should paste the error message you got.

Thats the problem I was experiencing. Blender told me I had an error and to check the console but there were no messages in the console.

Do you know if builbot builds are compiled with all features or is it just hit or miss what features you get? A lot of the graphicall builds list what flags are enabled but builbbot does not.