diff options
author | makamys <makamys@outlook.com> | 2022-06-23 13:17:45 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-23 13:17:45 +0200 |
commit | cc72faceab58271a2419458133191af4b028e2f0 (patch) | |
tree | acbc9142bd6ce9f33e64f8e89a11dcab6bf2a9ff /src/main/java/makamys | |
parent | a0a262b8a91527f822356baf27f894be0c31e3af (diff) | |
download | Neodymium-cc72faceab58271a2419458133191af4b028e2f0.tar.gz Neodymium-cc72faceab58271a2419458133191af4b028e2f0.tar.bz2 Neodymium-cc72faceab58271a2419458133191af4b028e2f0.zip |
Make short UV more accurate
Diffstat (limited to 'src/main/java/makamys')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/MeshQuad.java | 4 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoRenderer.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/MeshQuad.java b/src/main/java/makamys/neodymium/renderer/MeshQuad.java index 23617a4..db8bd25 100644 --- a/src/main/java/makamys/neodymium/renderer/MeshQuad.java +++ b/src/main/java/makamys/neodymium/renderer/MeshQuad.java @@ -167,8 +167,8 @@ public class MeshQuad { float v = vs[vi]; if(Config.shortUV) { - out.writeShort((short)(u * 16384)); - out.writeShort((short)(v * 16384)); + out.writeShort((short)(u * 32768)); + out.writeShort((short)(v * 32768)); } else { out.writeFloat(u); out.writeFloat(v); diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java index 701e009..f2591cb 100644 --- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java +++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java @@ -443,7 +443,7 @@ public class NeoRenderer { int stride = MeshQuad.getStride(); glVertexAttribPointer(0, 3, GL_FLOAT, false, stride, 0); - glVertexAttribPointer(1, 2, Config.shortUV ? GL_SHORT : GL_FLOAT, false, stride, 3 * 4); + glVertexAttribPointer(1, 2, Config.shortUV ? GL_UNSIGNED_SHORT : GL_FLOAT, false, stride, 3 * 4); int uvEnd = Config.shortUV ? 4 * 4 : 5 * 4; glVertexAttribPointer(2, 2, GL_SHORT, false, stride, uvEnd); glVertexAttribPointer(3, 4, GL_UNSIGNED_BYTE, false, stride, uvEnd + 1 * 4); |