summaryrefslogblamecommitdiffstats
path: root/cwd/assets/altcraft/shaders/vert/rml.vs
blob: 897f49d4903663a50d12995031ca79c2eaee6b53 (plain) (tree)
1
2
3
4
5
6
7
8
9

                 





               
 
                         
 

                                 
              
                 
              
                       
                         

                     
                
  

             


                                                                       

                                                                                                             
 
#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 invProj;
    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;
}