I'm interested in the implementation of the polka-dotted non-photorealistic shading in this video in Blender. I know how to code the filter if I have the final rendering result (image) seperated by mesh; But that method is way too hideous because I have to manually apply the filter on every single object, each with a different setting (for example, dot size and color), plus it is not applicable to video rendering due to the enormous amount of frames.
Now the best way I could think of is to make a custom node using OSL in cycles. Say,
/--------------------\ /--------------------\
| Diffuse BSDF | | Script |
| BSDF ·-----\ | BSDF ·
· Color | | | Internal |
· Roughness | | | [polka.osl] |
· Normal | \-----· Shader |
\--------------------/ · Color |
· DotSize |
\--------------------/
Will produce the effect on a simple diffuse shader. But OSL is based on closures, which can't (or at least I think can't) be evaluated by user and can't be accessed in another context, though I could achieve a "shadeless shader" using the method metioned in this question.
I'm not familiar with extending Blender with Python or GLSL, but I would like to know if I could achieve this using them, preferably compatible with Freestyle.