This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_edges_overlay_vert.glsl
Mike Erwin 5b26c36008 OpenGL: edge overlay shaders
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
2016-11-05 19:26:13 +01:00

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;
}