summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/shaders/vert/liquid_face.vs
diff options
context:
space:
mode:
Diffstat (limited to 'cwd/assets/altcraft/shaders/vert/liquid_face.vs')
-rw-r--r--cwd/assets/altcraft/shaders/vert/liquid_face.vs38
1 files changed, 38 insertions, 0 deletions
diff --git a/cwd/assets/altcraft/shaders/vert/liquid_face.vs b/cwd/assets/altcraft/shaders/vert/liquid_face.vs
new file mode 100644
index 0000000..101e4d0
--- /dev/null
+++ b/cwd/assets/altcraft/shaders/vert/liquid_face.vs
@@ -0,0 +1,38 @@
+#version 330 core
+
+in vec3 pos[4];
+in vec2 uv[4];
+in vec2 light[4];
+in vec3 normal;
+in vec3 color;
+in vec3 layerAnimationAo;
+
+out vec3 faceTextureUv;
+out vec3 faceNormal;
+out vec3 faceAddColor;
+out vec2 faceLight;
+out float faceAmbientOcclusion;
+
+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() {
+ gl_Position = projView * vec4(pos[gl_VertexID], 1.0f);
+
+ faceTextureUv = vec3(uv[gl_VertexID], layerAnimationAo.r);
+ faceTextureUv.y -= (uv[2].y - uv[0].y) * trunc(mod(globalTime * 4.0f, layerAnimationAo.g));
+
+ faceNormal = (view * vec4(normal, 0.0f)).xyz;
+ faceAddColor = color;
+ faceLight = light[gl_VertexID];
+ faceAmbientOcclusion = layerAnimationAo.b;
+}