From 2b186e688c2812f03c08f83e69571a1d97748393 Mon Sep 17 00:00:00 2001 From: gm-matthew <108370479+gm-matthew@users.noreply.github.com> Date: Sat, 6 Jul 2024 00:04:52 +0100 Subject: [PATCH] Texture mipmaps must be at least 2x2 Fixes sky in Dirt Devils --- Src/Graphics/New3D/R3DShaderCommon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Graphics/New3D/R3DShaderCommon.h b/Src/Graphics/New3D/R3DShaderCommon.h index ec335d8..8534078 100644 --- a/Src/Graphics/New3D/R3DShaderCommon.h +++ b/Src/Graphics/New3D/R3DShaderCommon.h @@ -210,7 +210,7 @@ vec4 texBiLinear(usampler2D texSampler, ivec2 wrapMode, vec2 texSize, ivec2 texP vec4 GetTextureValue() { float lod = mip_map_level(fsViewVertex); - float numLevels = floor(log2(min(float(baseTexInfo.z), float(baseTexInfo.w)))); // r3d only generates down to 1:1 for square textures, otherwise its the min dimension + float numLevels = floor(log2(min(float(baseTexInfo.z), float(baseTexInfo.w)))) - 1.0; // r3d only generates down to 2:2 for square textures, otherwise its the min dimension float fLevel = clamp(lod, 0.0, numLevels); int iLevel = int(fLevel);