diff options
Diffstat (limited to 'src/quick/scenegraph/shaders_ng/visualization.vert')
-rw-r--r-- | src/quick/scenegraph/shaders_ng/visualization.vert | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/quick/scenegraph/shaders_ng/visualization.vert b/src/quick/scenegraph/shaders_ng/visualization.vert new file mode 100644 index 0000000000..c29492417a --- /dev/null +++ b/src/quick/scenegraph/shaders_ng/visualization.vert @@ -0,0 +1,28 @@ +#version 440 + +layout(location = 0) in vec4 v; +layout(location = 0) out vec2 pos; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 rotation; + vec4 color; + float pattern; + int projection; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() +{ + vec4 p = ubuf.matrix * v; + + if (ubuf.projection != 0) { + vec4 proj = ubuf.rotation * p; + gl_Position = vec4(proj.x, proj.y, 0, proj.z); + } else { + gl_Position = p; + } + + pos = v.xy * 1.37; +} |