gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
773 stars 180 forks source link

Correct mip-map shader for the case when texture level is 0 and detai… #2618

Closed gonetz closed 2 years ago

gonetz commented 2 years ago

…led texture enabled

gonetz commented 2 years ago

@standard-two-simplex please check.

ghost commented 2 years ago
const CachedTexture * _pTexture = textureCache().current[1];
if (_pTexture == nullptr)
    uMaxTile.set(gSP.texture.level, _force);
else
    uMaxTile.set(_pTexture->max_level > 0 ? gSP.texture.level : std::min(gSP.texture.level, 1u), _force);

What was the reason for this? I believe uMaxTile should be gSP.texture.level always.

ghost commented 2 years ago

It seems it is working fine.

gonetz commented 2 years ago

What was the reason for this? I believe uMaxTile should be gSP.texture.level always.

I agree. It is probably a rudiment from the older mipmap implementation.

Edit: it is for HD textures, which have either detailed + first mipmap level, or level1 + level2

gonetz commented 2 years ago

Fix updated. Previous variant caused issues with Zelda MM HD pack.