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






                    
 



                      
 
                         
 



                                 
             
                                                               
 





                                                                                    
 
#version 330 core

in vec3 position[4];
in vec3 normal;
in vec2 uv[4];
in float uvLayer;
in float animation;
in vec3 color;
in vec2 light;

out vec3 faceTexture;
out vec3 faceNormal;
out vec3 faceAddColor;
out vec2 faceLight;

uniform float GlobalTime;

layout (std140) uniform Globals {
    mat4 projView;
};

void main() {
    gl_Position = projView * vec4(position[gl_VertexID], 1.0f);

    faceTexture = vec3(uv[gl_VertexID], uvLayer);
    faceTexture.y -= (uv[2].y - uv[0].y) * trunc(mod(GlobalTime * 4.0f, animation));

    faceNormal = normal;
    faceAddColor = color;
    faceLight = light;
}