I wrote a script that finds the edges of a mesh and creates an edge map and/or creates roughed up edges on the mesh. Just pick a mesh and choose your settings and the script will render out a map for you. The script tessellates the the mesh and colors the vertices black where ever it finds corners, so you can choose if you want the high poly mesh or just bake a edge map to use on the low poly mesh.
I did some optimizing and it really paid of. It's much faster now.
Here are some test results with standard settings on:
--Very high mesh complexity--------
NEW EF: 43.786s.
OLD EF: 865.042s.
--Medium mesh complexity--------
NEW EF: 2.484s.
OLD EF: 7.687s.
--Low mesh complexity--------
NEW EF: 1.349s.
OLD EF: 2.852s.
Image of the high complexity mesh I tested it on:
The main settings are the minimum and the maximum angle that decides the threshold for finding an angle to colorize. The tessellations settings decides how detailed the high poly mesh and the edge map will be. Higher values give more cleaner results, but give more heavier meshes and if used with the jagged edges-setting the execution time will be much higher, more on that soon. The edge size-setting controls how large the edges will be on the map and how broad the jagged edges are. See the comparison between tessellations and edge size below:
I came over make parallel edges script on scriptspot and it is great for isolating the edges. To use this just check on the optimize edges button. This gives a lot more control over the edge size controller. It also gives tighter edges, so you don't have to use a high tessellation count to get a smoother edge map. Comparison here:
The high poly mesh after running the script on a standard box with 3 tessellations and edge size 1. Optimized to the left, regular to the right:
The next important setting is the jagged edges-setting. It will create randomized mesh where the edges are. The effect is bumpy-looking edges. Using this on dense meshes with a high tessellation count is not recommended since this method is kind of slow! It creates the same effect as doing this. Jagged edges comparison:
If you want automatically jagged edges but don't need a high poly version of the mesh to do it for you, choose the mix with noise-setting that will blend the edge map with a noise map and put it in the material editor for you. The image on top was generated using this method with some standard mental ray shaders and lightning. For this to work you have to bake the edge map. Select your preferred image size and choose a save path.
A picture of high poly meshes generated from the script and a picture showing different edge maps:
The object needs to be unwrapped (a simple flatten mapping will do) before using the script if you are baking a map.
I've added falloff to the edges, and a custom falloff editor. It's pretty self explanatory on how to use it. 0 = Black, 1 = White.
Still testing this, would love some feedback!