Adjust mip bias.

This commit is contained in:
Dario 2025-03-22 13:47:59 -03:00
parent 9f55e2d2af
commit 676bd084f5
2 changed files with 2 additions and 2 deletions

View File

@ -192,7 +192,7 @@ namespace RT64 {
samplerDesc.addressW = RenderTextureAddressMode::CLAMP; samplerDesc.addressW = RenderTextureAddressMode::CLAMP;
// This matches the bias used in the shader when native samplers are not used. // This matches the bias used in the shader when native samplers are not used.
samplerDesc.mipLODBias = -0.5f; samplerDesc.mipLODBias = -0.25f;
// WRAP. // WRAP.
samplerDesc.addressU = RenderTextureAddressMode::WRAP; samplerDesc.addressU = RenderTextureAddressMode::WRAP;

View File

@ -215,7 +215,7 @@ float4 sampleTexture(OtherMode otherMode, RenderFlags renderFlags, float2 inputU
float2 ddxUVxScaled = ddxUVx * gpuTile.tcScale; float2 ddxUVxScaled = ddxUVx * gpuTile.tcScale;
float2 ddxUVyScaled = ddyUVy * gpuTile.tcScale; float2 ddxUVyScaled = ddyUVy * gpuTile.tcScale;
float ddMax = max(dot(ddxUVxScaled, ddxUVxScaled), dot(ddxUVyScaled, ddxUVyScaled)); float ddMax = max(dot(ddxUVxScaled, ddxUVxScaled), dot(ddxUVyScaled, ddxUVyScaled));
float mipBias = -0.5f; float mipBias = -0.25f;
mip = 0.5 * log2(ddMax) + mipBias; mip = 0.5 * log2(ddMax) + mipBias;
float maxMip = float(textureLevels - 1); float maxMip = float(textureLevels - 1);
RDPMipLevels[0] = min(floor(mip), maxMip); RDPMipLevels[0] = min(floor(mip), maxMip);