I'd like to shade the edges of my objects darker, like a toon shader, based on abrupt Z depth transitions to neighboring pixels -- in other words wherever the Z gradient is high, darken the image. I imagine that can be done in the compositor (?), but can it be done in object space in the material shader editor?
Asked
Active
Viewed 68 times
3
-
Can you show an example of result? – Carlo Jan 19 '21 at 20:31
-
Added a couple of samples of what I'm looking for. – GaryO Jan 19 '21 at 20:50
-
Have you tried freestyle? – susu Jan 19 '21 at 20:54
-
https://blender.stackexchange.com/questions/192498/is-it-possible-to-create-realtime-outline-effect-in-eevee-only-with-shaders/192538#192538 – susu Jan 19 '21 at 20:56
-
I have tried using Fresnel but that's only based on the normal (dot product of normal and eye vectors), not Z distance discontinuity, so it doesn't pick up edges of a flat object. Works OK for spheres though. – GaryO Jan 19 '21 at 21:13
-
I've tried enabling Freestyle but it never seems to do anything. Probably something I'm missing in the setup? – GaryO Jan 19 '21 at 21:19
