From 70c3ade4dd87907506ab40eb8e1cf04e4db3779a Mon Sep 17 00:00:00 2001 From: UIS Date: Sun, 20 Sep 2020 00:59:00 +0300 Subject: Shader optimization, removed unused argument from GetBlockInfo function --- cwd/assets/altcraft/shaders/vert/face.vs | 8 +++----- 1 file changed, 3 insertions(+), 5 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 044c012..30ae0d7 100644 --- a/cwd/assets/altcraft/shaders/vert/face.vs +++ b/cwd/assets/altcraft/shaders/vert/face.vs @@ -22,11 +22,9 @@ uniform mat4 projView; vec3 TransformTextureCoord(vec4 TextureAtlasCoords, vec2 UvCoords, float Layer) { float x = TextureAtlasCoords.x; float y = TextureAtlasCoords.y; - float w = TextureAtlasCoords.z; +// float w = TextureAtlasCoords.z; float h = TextureAtlasCoords.w; - vec2 A = vec2(x, 1 - y - h); - vec2 B = vec2(x + w, 1 - y); - vec2 transformed = A + UvCoords * (B - A); + vec2 transformed = vec2(x, 1 - y - h) + UvCoords * TextureAtlasCoords.zw; return vec3(transformed.x, transformed.y, Layer); } @@ -42,7 +40,7 @@ void main() texturePos.w = frameHeight; texturePos.y = texturePos.y + currentFrame * frameHeight; - vs_out.UvPosition = vec2(UvCoordinates.x,UvCoordinates.y); + vs_out.UvPosition = UvCoordinates; vs_out.Texture = TransformTextureCoord(texturePos,UvCoordinates,TextureLayer); vs_out.Color = color; vs_out.Light = light; -- cgit v1.2.3