aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/MeshQuad.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-23 13:48:34 +0200
committermakamys <makamys@outlook.com>2022-06-23 13:48:58 +0200
commit99e641b182c2dcaf067e61fc1193208086e8a98b (patch)
tree3676fda1cf7b53c972c8e12065df59a3ea76ef38 /src/main/java/makamys/neodymium/renderer/MeshQuad.java
parent7528004ec23e424d89ad20596a3705462d208e38 (diff)
downloadNeodymium-99e641b182c2dcaf067e61fc1193208086e8a98b.tar.gz
Neodymium-99e641b182c2dcaf067e61fc1193208086e8a98b.tar.bz2
Neodymium-99e641b182c2dcaf067e61fc1193208086e8a98b.zip
Make short UV even more accurate by rounding it
Previously the difference was extreme in GTNH, now it's only noticable if you're looking for it.
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/MeshQuad.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/MeshQuad.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/MeshQuad.java b/src/main/java/makamys/neodymium/renderer/MeshQuad.java
index db8bd25..1d2c196 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 * 32768));
- out.writeShort((short)(v * 32768));
+ out.writeShort((short)(Math.round(u * 32768f)));
+ out.writeShort((short)(Math.round(v * 32768f)));
} else {
out.writeFloat(u);
out.writeFloat(v);