From 7a65a0f5953c33ea32ab4600064541e82603a8be Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 27 Jun 2016 11:57:27 +0200 Subject: [PATCH] Made mipmapping a little less aggressive --- src/r_segs.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 96bb1f948..2d39a6d97 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -1147,11 +1147,12 @@ WallscanSampler::WallscanSampler(int y1, float swal, double yrepeat, fixed_t xof if (r_mipmap && texture->Mipmapped()) { uint32_t xpos = (uint32_t)((((uint64_t)xoffset) << FRACBITS) / mip_width); - int level = (int)MAX(magnitude - 1.0, 0.0); - while (level != 0) + double texture_bias = 1.7f; + double level = MAX(magnitude - 3.0, 0.0); + while (level > texture_bias) { mipmap_offset += mip_width * mip_height; - level >>= 1; + level *= 0.5f; mip_width = MAX(mip_width >> 1, 1); mip_height = MAX(mip_height >> 1, 1); }