diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-27 18:31:00 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-27 18:31:00 +0200 |
commit | 5a6aaf633ce217f828d981cd8c55951ada67e2df (patch) | |
tree | 4719852bbba79f005a95be8d632a32200abcf142 /cwd/assets | |
parent | Merge pull request #63 from LaG1924/ftr/cmake-minor-improvements (diff) | |
download | AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.gz AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.bz2 AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.lz AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.xz AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.tar.zst AltCraft-5a6aaf633ce217f828d981cd8c55951ada67e2df.zip |
Diffstat (limited to '')
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/face.vs | 9 |
1 files changed, 3 insertions, 6 deletions
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; |