From beb1ad638225aa86b2e6d02b01c12ea747ccd7e8 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Mon, 23 Jan 2023 03:20:07 +0100 Subject: [PATCH] Fixed texture seams and bleeding caused by making our UVs one texel too large --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index ed7ab0e..8ff5307 100644 --- a/main.cpp +++ b/main.cpp @@ -181,8 +181,8 @@ int process_faces(const world_t* world, const std::vector& tex t = (t - minT) / (maxT - minT); // Rescale the UVs to the dimensions of the mipmap we've selected for our texture atlas - faceVertex.u = (unsigned char)(s * ps1tex.w); - faceVertex.v = (unsigned char)(t * ps1tex.h); + faceVertex.u = (unsigned char)(s * (ps1tex.w - 1)); + faceVertex.v = (unsigned char)(t * (ps1tex.h - 1)); outFaceVertices.push_back(faceVertex); }