Sorry for the waffle but I think a little explaination of what I want to do and where I have been is needed as I have noticed this is a common type of request.
What I am trying to write a very stylized non photorealistic shader - like woodcut of free line sketching. I am passionate about keeping it native to blender using texture and/or sequence plugins.
There are some good examples on this page,
I have seen @ndy’s solution,
… and union S8’s verne shading,
These are good approximations of what I want but I need something more controlable and something more stylized.
Strictly speaking there is no direct support for writing shader plugins in blender - from what I can see blender splits the render pipeline into these distinct phases/components,
(1) texture plugins
(2) material/shading (no dynamic plugin support)
(3) sequence plugins
Hense my main problem is that I am missing data at the points where I can effect the render,
(1) texture plugins don’t have access to lighting information so you can’t vary the output in the texture based on the light hitting an point.
(2) the sequence plugin only has access to zbuffer and colour information - hence can’t determine information about the geometry of the scene e.g. normal direction at a point
I notice that the ImBuf structure (sequence plugins) there is a userdata pointer. Is this something that can be populated by a texture plugin? I can’t find an example of it being used.
Is there any other way of hacking in to data structures that might be useful, geometry, lighting, etc, from with in the texture or sequence plugins?
Should I be looking at doing this in yafray? Is there any good documentatio n on writing shaders for yafray? I was unable to find shader/plugin support API or similar.