From 46d2c52b19e8c41652f34f87d36caa5a398363f4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Oct 2021 00:12:58 +0200 Subject: [PATCH] - use correct math to access a texel's center for rendering voxels. No idea if this was causing problem, but it surely wasn't 100% correct. --- source/common/models/models_voxel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/models/models_voxel.cpp b/source/common/models/models_voxel.cpp index 2be0521ad..809d25400 100644 --- a/source/common/models/models_voxel.cpp +++ b/source/common/models/models_voxel.cpp @@ -210,8 +210,8 @@ void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3 unsigned int indx[4]; vert.packedNormal = 0; // currently this is not being used for voxels. - vert.u = (((col & 15) * 255 / 16) + 7) / 255.f; - vert.v = (((col / 16) * 255 / 16) + 7) / 255.f; + vert.u = (((col & 15) + 0.5f) / 16.f); + vert.v = (((col / 16) + 0.5f) / 16.f); vert.x = x1 - PivotX; vert.z = -y1 + PivotY;