diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 96bb1f948c..2d39a6d973 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); }