Browse Source

Realized we can include the UV offsets into the UVs stored in the exported map file, so we don't need to add those at runtime. Easy performance win.

master
Nico de Poel 3 years ago
parent
commit
6d6766663b
  1. 4
      main.cpp

4
main.cpp

@ -187,8 +187,8 @@ int process_faces(const world_t* world, const std::vector<ps1bsp_texture_t>& tex
if (minT < 0 || maxT > 1) t = (t - minT) / tRange; if (minT < 0 || maxT > 1) t = (t - minT) / tRange;
// Rescale the UVs to the dimensions of the mipmap we've selected for our texture atlas // Rescale the UVs to the dimensions of the mipmap we've selected for our texture atlas
faceVertex.u = (unsigned char)(s * (ps1tex.w - 1));
faceVertex.v = (unsigned char)(t * (ps1tex.h - 1));
faceVertex.u = (unsigned char)(s * (ps1tex.w - 1)) + ps1tex.uoffs;
faceVertex.v = (unsigned char)(t * (ps1tex.h - 1)) + ps1tex.voffs;
outFaceVertices.push_back(faceVertex); outFaceVertices.push_back(faceVertex);
} }

Loading…
Cancel
Save