World Normal Edge Detection ( and Speedpaint Art Style)

In the previous engine that I was using we had to build a small routine to properly handle this kind of cases. The idea is to take every mesh and it’s smooth-groups and write down an individual index from 0-255 to one of the no used texture coordinates at vertices. Limiting index only to object didn’t worked when mesh hard edges which had to be respected.
Later we render this index into g-buffer and use it in material shader to decide if shadows, ssao or other post process should behave differently when working on the edge of the object or near hard normal.
This is was based on old article, [edit] found it: http://www.students.science.uu.nl/~3220516/advancedgraphics/papers/inferred_lighting.pdf
Perhaps UE4 already has such indexes or if you don’t really care about hard edges then you could pass index as parameter to shader and render into custom g buffer. But again I don’t know if UE4 allows to do it out of the box or you have to modify source code.