From 08337925fe048d2e8b746bbc82493f4c2b8603d6 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Mon, 28 Jun 2021 21:31:26 +0500 Subject: Compacted vertices format --- cwd/assets/altcraft/shaders/vert/face.vs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cwd') 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)); } -- cgit v1.2.3