summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/shaders/vert/face.vs
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2021-06-27 05:46:22 +0200
committerGitHub <noreply@github.com>2021-06-27 05:46:22 +0200
commitdd1323d398733f0f4a3b285b396ed3a47fb8eb96 (patch)
tree3064b292efd41a36b5655fd4d07ec42053463ffb /cwd/assets/altcraft/shaders/vert/face.vs
parentMerge pull request #60 from LaG1924/fix/memleak (diff)
parentFixed entity bug found by @uis246 (diff)
downloadAltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar
AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.gz
AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.bz2
AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.lz
AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.xz
AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.tar.zst
AltCraft-dd1323d398733f0f4a3b285b396ed3a47fb8eb96.zip
Diffstat (limited to 'cwd/assets/altcraft/shaders/vert/face.vs')
-rw-r--r--cwd/assets/altcraft/shaders/vert/face.vs8
1 files changed, 3 insertions, 5 deletions
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;