summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/shaders/vert
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2022-12-15 16:41:06 +0100
committerGitHub <noreply@github.com>2022-12-15 16:41:06 +0100
commitd2b2f223cc62a1cc6e9d41d32020ef94d229a581 (patch)
treede0685c59a55557893d8d6d64bad01e9c98d206a /cwd/assets/altcraft/shaders/vert
parentMerge pull request #82 from LaG1924/fix/sdl-wayland-build (diff)
parentAdded liquid rendering pass (diff)
downloadAltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.gz
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.bz2
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.lz
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.xz
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.zst
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.zip
Diffstat (limited to '')
-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;
+}