Something similar to BEER with OSL?

Hi, i’m totally newbie to OSL, i would ask to someone more experienced if is possible to generate custom difuse shaders, for non photorealistic rendering. Something similar to BEER with OSL?

hummm… not really! (and probably, you won’t need OSL for it, except for some more complicated logics that are difficult to do with nodes)

OSL just lets you use the closures that come with Cycles (diffuse, glossy, etc); and you don’t have any information where the lights are, since the whole surroundings contribute to the lightning.

But it’s possible to add up closures to get an approximation to the distribution function you’re after (which can be NPR). This, however, may need some logic to deal with secondary rays, that can bleed unexpected light quantities into your scene.

Also, some passes from OpenGL can only be done in the compositor. This is because every time a shader is called, there will be no information of previous calls, and no way of knowing if that sample has any contribution to the render (the shader just tells the render how much light from some direction will be reflected, but it won’t know how much light is coming in because that part of the calculation is done after the shader has been called).

GLSL Hacker is a cross platform demotool for Windows, Linux and Mac OS X and is based on popular programming languages such as GLSL, Lua and Python.