diff options
Diffstat (limited to 'resources/shaders/toolpaths_lines.vs')
-rw-r--r-- | resources/shaders/toolpaths_lines.vs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/resources/shaders/toolpaths_lines.vs b/resources/shaders/toolpaths_lines.vs new file mode 100644 index 000000000..85d5c641f --- /dev/null +++ b/resources/shaders/toolpaths_lines.vs @@ -0,0 +1,19 @@ +#version 110 + +varying vec3 eye_normal; + +vec3 world_normal() +{ + // the world normal is always parallel to the world XY plane + // the x component is stored into gl_Vertex.w + float x = gl_Vertex.w; + float y = sqrt(1.0 - x * x); + return vec3(x, y, 0.0); +} + +void main() +{ + vec4 world_position = vec4(gl_Vertex.xyz, 1.0); + gl_Position = gl_ModelViewProjectionMatrix * world_position; + eye_normal = gl_NormalMatrix * world_normal(); +} |