I think you can try to do the following:
- On the edge, you will choose a base color based on the depth. So the pixel closest to the camera will be used as the edge color.
That’s it. The material setup itself may seem terrifying, but in practice it does exactly what I wrote above.
So the material function I created looks like this:
There is one “thickness” input and an output which is an RGB color. The purple and blue are just named rerouting notes used to clean up messy connections.
Then you just use this function instead of the default colors. You can then divide the color by scalar parameter to darken it or do whatever you want.
This may not be a perfect solution, but I hope it will work for you.
