OK, I promised this one.
I implemented as PyPlugs, and pushed to natron-plugins:
- a 3-pass Circular Bokeh blur inspired by https://www.shadertoy.com/view/Xd33Dl (available as Community/GLSL/BokehCircular_GL in natron-plugins)
- a 4-pass Octagonal Bokeh blur inspired by https://www.shadertoy.com/view/lst3Df (available as Community/GLSL/BokehOctagon_GL in natron-plugins)
The principle is very simple: since multipass cannot be done using a single Shadertoy, use several Shadertoy nodes, route the textures between them, and link the parameters.
In the natron-plugins repo (https://github.com/NatronGitHub/natron-plugins/tree/master/GLSL/Blur/BokehCircular_GL and https://github.com/NatronGitHub/natron-plugins/tree/master/GLSL/Blur/BokehOctagon_GL) I also put the individual shader sources for each Shadertoy, as well as the original shader sources from shadertoy.com. You can learn from these two examples.
The only multipass effects that can not be implemented are the shaders that read back the content of a buffer to compute that same buffer, because compositing graphs cannot have loops (the execution of such a graph would cause an infinite recursion). One example is https://www.shadertoy.com/view/MttSWS