Open utterances-bot opened 2 years ago
Very nice writeup, and wonderfully illustrated, thanks! Two additional remarks:
GL_EXT_fragment_shader_barycentric
, but it requires adding an explicit vec3
vertex attribute that's (1,0,0) on one vertex of each triangle, (0,1,0) on another, and (0,0,1) on the third. (The order doesn't matter though.) This makes it hard to use on general meshes since you may need to duplicate vertices in some places in order to ensure that each vertex of a triangle has a different "color", but if you're preparing your mesh with wireframe rendering in mind, that's a possible solution.
GL_EXT_fragment_shader_barycentric: Wireframe – Wunk
https://wunkolo.github.io/post/2022/07/gl_ext_fragment_shader_barycentric-wireframe/