1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00
Files
OpenRCT2/data/shaders/drawline.vert
2017-10-30 16:21:49 +01:00

23 lines
435 B
GLSL

#version 150
uniform ivec2 uScreenSize;
uniform ivec4 uBounds;
uniform ivec4 uClip;
in mat4x2 vVertMat;
out vec2 fPosition;
void main()
{
vec2 pos = clamp(vVertMat * uBounds, uClip.xy, uClip.zw);
fPosition = pos;
// Transform screen coordinates to viewport
pos.x = (pos.x * (2.0 / uScreenSize.x)) - 1.0;
pos.y = (pos.y * (2.0 / uScreenSize.y)) - 1.0;
pos.y *= -1;
gl_Position = vec4(pos, 0.0, 1.0);
}