summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/shaders/vert/rml.vs
blob: c61a4a074a0df47b27d441f0ef121e72d430550a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#version 330 core

in vec2 pos;
in uvec4 col;
in vec2 uvPos;

out vec4 color;
out vec2 uv;

uniform vec2 translation;

layout (std140) uniform Globals {
    mat4 projView;
    mat4 proj;
    mat4 view;
    uvec2 viewportSize;
    vec4 ssaoKernels[64];
    float globalTime;
    float dayTime;
    float gamma;
};

void main() {
    float x = ((pos.x + translation.x) / viewportSize.x) * 2.0f - 1.0f;
    float y = ((pos.y + translation.y) / viewportSize.y) * 2.0f - 1.0f;
    gl_Position = vec4(x, -y, -1.0f, 1.0f);
    color = vec4(float(col.x) / 255.0f, float(col.y) / 255.0f, float(col.z) / 255.0f, float(col.w) / 255.0f);
    uv = uvPos;
}