Procedural polka dot pattern with cycles I would like to generate a polka dot pattern using material nodes.
In the meantime I found this script which seems to achieve exactly what I want.

However, when I create a script node, link to the script internally and pipe the color output to a diffuse shader, my object is rendered black.
Has something changed in Blender preventing this to work? Because I get no errors whatsoever.
OSL is nice but does not run on GPU which limits performance. The Polka pattern is not that hard to construct procedurally using nodes:

Start with a simple dot - a spherical gradient with Color Ramp:



With the ColorRamp you can control the size of the dot.

Next create tiling for procedural textures, but staggered. Extra is a Mapping node to control the size of the whole pattern:



That's it. You can also map it with Cylindrical or Spherical projection.