3

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.

  • You could probably do this in the compositor with various bits of layer information. The object index layer can be used to separate objects if necessary. I haven't spent much time with the compositor so I'll leave it to someone else to write an answer. – Sazerac Jul 31 '17 at 03:01
  • I think this is exactly what Freestyle Render Engine was made for. Not sure if it suits your needs, but see https://freestyleintegration.wordpress.com/page/6/ – Duarte Farrajota Ramos Jul 31 '17 at 04:08
  • @DuarteFarrajotaRamos Freestyle can only render strokes, not fills. – Todd J. York Jul 31 '17 at 04:15
  • If can render fills but it requires scripting I think https://blenderartists.org/forum/showthread.php?152631-Blender-2-49-splash-contest&p=1354984&viewfull=1#post1354984 – Duarte Farrajota Ramos Jul 31 '17 at 04:19
  • @DuarteFarrajotaRamos Thanks for the link, I forgot this effect was called "halftone". Apparently the halftone part was not Freestyle but was a custom node written in python. I'll take a look at that. – Todd J. York Jul 31 '17 at 04:29
  • @Sazerac According to https://blender.stackexchange.com/a/57187/, using custom nodes in compositor for this purpose is currently not possible, especially with Freestyle on. – Todd J. York Jul 31 '17 at 06:47
  • related: https://blender.stackexchange.com/questions/50730/procedural-polka-dot-pattern-with-cycles and https://blender.stackexchange.com/questions/31530/polka-dots-shader –  Jul 31 '17 at 16:59

0 Answers0