As seen at #bcon16. These were produced quickly and probably need further work. SIMPLE variant draws triangle mesh edges. Based on this research: http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/4884/pdf/imm4884.pdf http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf Non-SIMPLE variant can adjust thickness per edge. This can be used to draw only some edges, or accentuate some edges. Given the right inputs this is a general n-gon perimeter shader. Part of T49165
14 lines
244 B
GLSL
14 lines
244 B
GLSL
|
|
//mat4 ModelViewProjectionMatrix;
|
|
|
|
in vec3 pos;
|
|
in float edgeWidthModulator;
|
|
|
|
out vec4 pos_xformed;
|
|
out float widthModulator;
|
|
|
|
void main() {
|
|
pos_xformed = gl_ModelViewProjectionMatrix * vec4(pos, 1.0);
|
|
widthModulator = edgeWidthModulator;
|
|
}
|