I'm trying to figure out the best way to create outlines for my GLSL toon shader.
So far I've found the following solutions:
Using a Geometry Shader
In the OpenGL 4 Shading Language Cookbook, there's a section in chapter 7 called Drawing silhouette lines using the geometry shader. You can read the geometry shader code here (the link button not working):
https://github.com/PacktPublishing/OpenGL-4-Shading-Language-Cookbook-Third-Edition/blob/master/chapter07/shader/silhouette.gs
Apparently, I need to load my model "with adjacency", and I'm not sure how to do that with tiny_gltf. Is there a way I can accomplish the same results but with a normal triangle layout instead of adjacency?
Post Processor Outlines
I read outlines are also created during post-processing. I can't find any example code, but I could search deeper if this solution is worth trying out. I'd prefer the first solution over this one though.
Needing Suggestions
The geometry shader solution seems like an interesting and straightforward option, but that adjacency triangles issue would slow me down, I have no experience with this data layout.
Any suggestions on how to accomplish these outlines are welcome. Although if you have ideas on how to get the first solution mentioned working with normal triangles, wow that would be perfect!
Thanks!