From c905ede556c892d39fd69d3945026ba244567ce9 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 27 Nov 2021 21:08:58 +0500 Subject: Changed shaders to use SPB --- cwd/assets/altcraft/shaders/vert/face.vs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'cwd/assets/altcraft/shaders/vert/face.vs') diff --git a/cwd/assets/altcraft/shaders/vert/face.vs b/cwd/assets/altcraft/shaders/vert/face.vs index d73e164..5fb9357 100644 --- a/cwd/assets/altcraft/shaders/vert/face.vs +++ b/cwd/assets/altcraft/shaders/vert/face.vs @@ -1,6 +1,6 @@ #version 330 core -in vec3 position[4]; +in vec3 pos[4]; in vec3 normal; in vec2 uv[4]; in float uvLayer; @@ -8,22 +8,23 @@ in float animation; in vec3 color; in vec2 light; -out vec3 faceTexture; +out vec3 faceTextureUv; out vec3 faceNormal; out vec3 faceAddColor; out vec2 faceLight; -uniform float GlobalTime; - layout (std140) uniform Globals { mat4 projView; + uvec2 viewportSize; + float globalTime; + float dayTime; }; void main() { - gl_Position = projView * vec4(position[gl_VertexID], 1.0f); + gl_Position = projView * vec4(pos[gl_VertexID], 1.0f); - faceTexture = vec3(uv[gl_VertexID], uvLayer); - faceTexture.y -= (uv[2].y - uv[0].y) * trunc(mod(GlobalTime * 4.0f, animation)); + faceTextureUv = vec3(uv[gl_VertexID], uvLayer); + faceTextureUv.y -= (uv[2].y - uv[0].y) * trunc(mod(globalTime * 4.0f, animation)); faceNormal = normal; faceAddColor = color; -- cgit v1.2.3