(01-05-2018, 12:35 PM)AnyOldName3 Wrote: Okay, so here's a completely bizarre idea: allow mip levels for custom textures which replace mipmaps. This would mean that when a game would use the 256x256 mip level of a texture at 1x IR, we look for a series of textures which replace the 256x256 mip level in particular, and choose the one closest to the display resolution of the texture for the actual IR we're using. This would allow the separation of custom texture mip levels from original game mip levels, which basically seems to be what we want.
We'd probably want some way for either texture pack creators to specify that they want this behaviour for a specific texture (as otherwise, most textures would just be duplicates) or for Dolphin to only enable it when it detects that the original texture has non-trivial mipmaps.
In terms of the texture dumping and loading system, that could be done by making it consider non-trivial mipmaps of a texture to be a different texture. I think we could handle the GPU side texture selection by using the same maths as the GPU does under the hood to select mip levels, but instead of using the hardware provided screen-space derivatives, scale them to match 1xIR screen space and use that to select a texture from a sampler array.
I think the shader mods you are suggesting are the same as adding a lod bias of sqrt(IR) to the samplers in question? But you'd get possibly weird visuals as it would possibly select a significantly lower quality texture for the primitives that use said textures than others in the same scene.
I feel the best solution would be for custom texture authors to provide different mipchains for these specific textures for a range of IR scales (which probably isn't too many, with non integer IRs being kinda busted and hidden anyway), and either allow dolphin to select at runtime, or get the user to download or overlay the correct package for there IR.
Naturally, I'll lean towards no extra complexity in dolphin itself