So algorithm would look like this:
1. For each frame
2. For each geometry
3. For each triangle
3.1 Find sides of the triangle needed to be outlined
3.2 Render outlines on chosen edges.
It seems a lot of computation for real time rendering.
I think it's better to precompute some info and store it as per-vertex data.
I think [3.1] should be precomputed for sure.
So, [somehow] I need to find for each model edges with big difference between normals.
if I have per-vertex data about outlines I need to render: v0<->v1 + v1<->v2
[attachment=30747:Outlines2.png]
Also I have size of a triangle (in object space) => I can find absolute outline coordinates.
What is the best way to encode this information as per-vertex data?
I would like to minimize computation in runtime.
Probably it should be look like:
1. Vertex shader receives this value
2. Pixel shader applyes [a texture?] on each pixel of the triangle.