Compare commits

...

4 Commits

Author SHA1 Message Date
MelonSpeedruns ad9bb06a29 fix mipmaps 2026-05-29 16:51:57 -04:00
MelonSpeedruns 871fc75514 oops reversed the calculations 2026-05-29 14:56:59 -04:00
MelonSpeedruns e641044535 proper calculation of maxlod & mipmapenabled 2026-05-29 14:38:03 -04:00
Lurs c0429110db another mipmap/LOD try with GX_ANISO_4 2026-05-29 16:21:52 +02:00
+12 -6
View File
@@ -476,11 +476,14 @@ void registerHdTexturesForArc(std::vector<u8>& arcBytes,
const u32 newImgOff = 0x20 + i * 0x20;
timg->imageOffset = static_cast<s32>(newImgOff);
const u8 hdMips = static_cast<u8>(std::clamp<u32>(s.mipCount, 1u, 11u));
const u8 hdMips = static_cast<u8>(std::clamp<u32>(s.mipCount, 1u, 13u));
timg->mipmapEnabled = hdMips > 1;
timg->mipmapCount = hdMips;
timg->maxLOD = static_cast<s8>((hdMips - 1) * 8);
//timg->maxAnisotropy = 16;
//timg->LODBias = -50;
if (timg->mipmapEnabled) {
timg->minFilter = GX_LIN_MIP_LIN;
}
timg->maxAnisotropy = GX_ANISO_4;
registerHdSurface(*m, s,
arcBytes.data() + f.dataOffset + btiAbs + newImgOff,
gtx->name, i);
@@ -512,11 +515,14 @@ void registerHdTexturesForArc(std::vector<u8>& arcBytes,
// i_img + 0x20, matching where we register below.
auto* timg = reinterpret_cast<ResTIMG*>(arcBytes.data() + f.dataOffset);
timg->imageOffset = 0x20;
const u8 hdMips = static_cast<u8>(std::clamp<u32>(s.mipCount, 1u, 11u));
const u8 hdMips = static_cast<u8>(std::clamp<u32>(s.mipCount, 1u, 13u));
timg->mipmapEnabled = hdMips > 1;
timg->mipmapCount = hdMips;
timg->maxLOD = static_cast<s8>((hdMips - 1) * 8);
//timg->maxAnisotropy = 16;
//timg->LODBias = -50;
if (timg->mipmapEnabled) {
timg->minFilter = GX_LIN_MIP_LIN;
}
timg->maxAnisotropy = GX_ANISO_4;
registerHdSurface(*m, s, arcBytes.data() + f.dataOffset + 0x20,
gtx->name, 0);
++btiReg;