diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-10-05 00:08:40 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-10-06 22:58:12 +0200 |
commit | 26a2e42c34b0effac4ffcba59a07df238980282e (patch) | |
tree | bcf466bf4e96e06bde09428dc631494e56da8c46 /src/location/quickmapitems/rhi/shaders/polygon.vert | |
parent | 04320df9f53eae8b5895a9a5767e8434ff36be8d (diff) | |
download | qtlocation-26a2e42c34b0effac4ffcba59a07df238980282e.tar.gz |
Move the RHI implementation into separate folder
Makes it easier to work with the code, the implementations have little
in common that is not anyway abstracted into the common private base
class.
Change-Id: I4d957833f5a881e1b445ff6e912ffa036d10321a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/location/quickmapitems/rhi/shaders/polygon.vert')
-rw-r--r-- | src/location/quickmapitems/rhi/shaders/polygon.vert | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/location/quickmapitems/rhi/shaders/polygon.vert b/src/location/quickmapitems/rhi/shaders/polygon.vert new file mode 100644 index 00000000..06dab03e --- /dev/null +++ b/src/location/quickmapitems/rhi/shaders/polygon.vert @@ -0,0 +1,20 @@ +#version 440 + +layout(location = 0) in highp vec4 vertex; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + mat4 mapProjection; + vec4 center; + vec4 center_lowpart; + float wrapOffset; + vec4 color; +}; + +vec4 wrapped(in vec4 v) { return vec4(v.x + wrapOffset, v.y, 0.0, 1.0); } + +void main() { + vec4 vtx = wrapped(vertex) - center; + vtx = vtx - center_lowpart; + gl_Position = qt_Matrix * mapProjection * vtx; +} |