[URGENT HELP NEEDED] Make a material only at the rim of an object

How do you get a material to be applied only on the rim of an object, regardless of where the camera is looking from? And how would you have the rest of the space (the faces more turned towards the camera) to be of a different material?

I’m able to get the effect (somewhat) using the ‘Incoming’ Geometry node, but its still way too subdued, and I’m unable to combine it with anything else.

Would appreciate any help anyone can provide. This is for an ongoing commercial project, and I’ve been stumped in this section for quite a while now. I’m trying to model a cable for an earphone.

Cheers!

This is more or less what I’m looking for. The image is by Gleb Alexandrov, for one his tutorial series.

As is seen, the edges (faces that are facing away) are almost uniformly of a different color, light blue, while the faces facing the camera are towards black.


Something like this?

https://dl.dropboxusercontent.com/u/27650383/2016-12-20_suzanne.jpg

You know what Ikari? You. are. a. goddamn. god. You hear me? YOU SAVED MY LIFE.

Thank you so much. Not only did you manage to teach me how its done, you made a cool image out of it too.

Just one more favor to ask :smiley: How can I use this as a mask? As in, retain the blue as is in your image and have the blacks be the mask to an existing complicated material that I’ve already made? Should I use another Mix Shader like you have again, in the end?

That’s what I would do.
To reduce the clutter in the node editor you can always make groups out of the different bits and pieces, like I did with the “GlossyBlue” node group, which is indeed a more complex material in itself.

Would you mind sharing the node setup for GlossyBlue? It looks delicious.