From 9595bd3b7a25496b3a1c50f4581df023837fa961 Mon Sep 17 00:00:00 2001 From: RaveYard <29225776+MrRaveYard@users.noreply.github.com> Date: Mon, 11 Sep 2023 00:44:15 +0200 Subject: [PATCH] Fix sample distance power of two rounding --- src/rendering/hwrenderer/doom_levelmesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index 97e16b37e8..41a8ebb0cf 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -1118,7 +1118,7 @@ void DoomLevelMesh::BuildSurfaceParams(int lightMapTextureWidth, int lightMapTex n |= n >> 2; n |= n >> 4; n |= n >> 8; - ++n; + n = (n + 1) >> 1; surface.sampleDimension = uint16_t(n) ? uint16_t(n) : uint16_t(0xFFFF); }