Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / map / src / main / rust / shaders / puck.vert
puck.vert20 lines · 770 BRaw
| 1 | #version 450 |
| 2 | // User puck: one screen-anchored quad, drawn analytically by `puck.frag`. |
| 3 | // |
| 4 | // The vertex data is a fixed unit square in -1..1, uploaded once at startup. Where the |
| 5 | // puck sits and how big it is both live in the matrix, which for an overlay maps -1..1 |
| 6 | // to a quad of a fixed Dp radius centred on a lon/lat rather than to a tile |
| 7 | // (`Camera::screen_quad_to_clip`). So a pan, a zoom and a new fix are all a push |
| 8 | // constant, and no buffer is touched after startup. |
| 9 | layout(location = 0) in vec2 inLocal; |
| 10 | layout(location = 0) out vec2 outLocal; |
| 11 | layout(push_constant) uniform Push { |
| 12 | mat4 tileToClip; |
| 13 | vec4 color; |
| 14 | vec4 line; |
| 15 | vec4 misc; |
| 16 | } push; |
| 17 | void main() { |
| 18 | outLocal = inLocal; |
| 19 | gl_Position = push.tileToClip * vec4(inLocal, 0.0, 1.0); |
| 20 | } |