diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-28 18:31:26 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-28 18:31:26 +0200 |
commit | 08337925fe048d2e8b746bbc82493f4c2b8603d6 (patch) | |
tree | dbedfb5aae51c59423fbc590b2c2f322f9362a79 /cwd | |
parent | Implemented vertex data iterleaving (diff) | |
download | AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.gz AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.bz2 AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.lz AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.xz AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.zst AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.zip |
Diffstat (limited to 'cwd')
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/face.vs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cwd/assets/altcraft/shaders/vert/face.vs b/cwd/assets/altcraft/shaders/vert/face.vs index e1f01fc..bea9228 100644 --- a/cwd/assets/altcraft/shaders/vert/face.vs +++ b/cwd/assets/altcraft/shaders/vert/face.vs @@ -1,9 +1,9 @@ #version 330 core -layout (location = 0) in vec4 position[4]; +layout (location = 0) in vec3 position[4]; layout (location = 4) in vec2 uv[4]; layout (location = 8) in float uvLayer; -layout (location = 9) in vec2 animation; +layout (location = 9) in float animation; layout (location = 10) in vec3 color; layout (location = 11) in vec2 light; @@ -17,9 +17,9 @@ uniform float GlobalTime; uniform mat4 projView; void main() { - gl_Position = projView * position[gl_VertexID]; + gl_Position = projView * vec4(position[gl_VertexID], 1.0f); vs_out.Color = color; vs_out.Light = light; vs_out.Texture = vec3(uv[gl_VertexID], uvLayer); - vs_out.Texture.y -= animation.x * trunc(mod(GlobalTime * 4.0f, animation.y)); + vs_out.Texture.y -= (uv[2].y - uv[0].y) * trunc(mod(GlobalTime * 4.0f, animation)); } |