From 5a6aaf633ce217f828d981cd8c55951ada67e2df Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 27 Jun 2021 21:31:00 +0500 Subject: Moved block face model matrix transformation to CPU --- cwd/assets/altcraft/shaders/vert/face.vs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cwd/assets/altcraft') diff --git a/cwd/assets/altcraft/shaders/vert/face.vs b/cwd/assets/altcraft/shaders/vert/face.vs index 30ae0d7..424e215 100644 --- a/cwd/assets/altcraft/shaders/vert/face.vs +++ b/cwd/assets/altcraft/shaders/vert/face.vs @@ -1,9 +1,8 @@ #version 330 core -layout (location = 0) in vec3 position; +layout (location = 3) in vec4 position[6]; layout (location = 2) in vec2 UvCoordinates; -layout (location = 7) in vec4 Texture; -layout (location = 8) in mat4 model; +layout (location = 11) in vec4 Texture; layout (location = 12) in vec3 color; layout (location = 13) in vec2 light; layout (location = 14) in float TextureLayer; @@ -22,7 +21,6 @@ uniform mat4 projView; vec3 TransformTextureCoord(vec4 TextureAtlasCoords, vec2 UvCoords, float Layer) { float x = TextureAtlasCoords.x; float y = TextureAtlasCoords.y; -// float w = TextureAtlasCoords.z; float h = TextureAtlasCoords.w; vec2 transformed = vec2(x, 1 - y - h) + UvCoords * TextureAtlasCoords.zw; return vec3(transformed.x, transformed.y, Layer); @@ -30,8 +28,7 @@ vec3 TransformTextureCoord(vec4 TextureAtlasCoords, vec2 UvCoords, float Layer) void main() { - vec4 sourcePosition = vec4(position,1.0f); - gl_Position = projView * model * sourcePosition; + gl_Position = projView * position[gl_VertexID]; vec4 texturePos = Texture; float frameHeight = texturePos.w / TextureFrames; -- cgit v1.2.3