Is it possible to create a shader that treats the edges of an object differently?

I wonder how Algorithmic is doing it for the edge masks they generate in substance designer? I suspect the use local normal space somehow. Hmm… It’s an interesting problem.