Dolphin, the GameCube and Wii emulator - Forums

Full Version: Arbitrary mipmap detection option for external textures
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(12-17-2022, 05:25 AM)Venomalia Wrote: [ -> ]do you use nvtt_export.exe to convert the files to dds format? i don't know about the performans but maybe you can also use DirectXTex or give the option for it?
You only need to make the paths relative. the programs that are on github could also be easily downloaded if they are not available.

I was thinking of using CompressonatorCLI.exe or texconv.exe like the Custom Texture Tools PS do, but since Bighead said Compressonator fails creating some of the textures, I tested with nvtt_export.exe first. It doesn't have the best performace (it can't work on multiple files at once, only on individual files, and that's a big performance hit, just like AutoCrispy), but it can upscale (!!) the textures with AI Super Resolution while converting to DDS. I tried upscaling the hdcube2 4x textures with their 4x Super Resolution (4x * 4x = 16x?), but unfortunally their upscaling create line artifacts in continuous textures (mario sunshine's ocean with big lines dividing it...). I still want to test the 2x Super Resolution to see if it also make artifacts.

I might change indeed, but must measure the performance first. nvtt_export.exe has 4 quality presets, 2 of them being CUDA optmized (which I assume are hella fast). I use the "normal" CUDA preset (performance and normal are CUDA, quality and best quality are CPU, and are SLOOOOOOOW).
Sorry I haven't noticed this thread until now, but I wanted to share my two cents on this comment and say a few other things:

(12-12-2022, 02:26 PM)vlbastos Wrote: [ -> ]It already works in Dolphin, if you don't use external textures. I don't know if it's simple, but just get the detection of the internal textures and apply to external textures (if the external textures don't have the *_arb*.* suffix).

I do not think this is ideal as there is some problems with this approach. Textures with arbitrary mipmaps have their mipmaps drawn at a "fixed" distance, while textures that do not have them (or rather the "_arb" suffix), the mipmap draw distance is affected by anisotropic filtering and the internal resolution. This is a feature and not a bug, as arbitrary mipmaps have a very intended effect, the level of detail must match the internal resolution and not "scale up" or the effect is broken. I posted several examples on this thread (do keep in mind many of the examples are before this was fixed):
https://forums.dolphin-emu.org/Thread-dolphin-custom-texture-mipmaps - (Esp post #13)

So what is the problem then? Well, the arbitrary mipmap heuristic in Dolphin is not perfect. Several games have false positives such as Xenoblade Chronicles, Skies of Arcadia, several others. If a texture pack creator decides to retexture one of these games, they may intentionally leave out the "_arb" suffix so it does not get treated as such. This allows mipmaps to be affected by the increased level of detail from higher IRs, and prevent the "blurry mipmaps" that having the "_arb" suffix can cause. There is some things to consider when using this suffix: since the distance is fixed, created textures should target a specific internal resolution (like 4x) which would still look relatively decent in both 3x and 5x.

I think the best route would be to either dump these textures by playing, or wait for Venomalia to implement arbitrary mipmap detection into the Dolphin Texture Extraction Tool (if it isn't already). Having Dolphin try to automatically handle any more cases will only further complicate an already complicating situation. Here are all the nuances to mipmaps that I know of:

• Mipmap LOD is affected by IR and anisotropic filtering. Higher IR, mipmaps are drawn further out.
• Arbitrary mipmaps are not affected by IR and anisotropic filtering when using the "_arb" suffix. Mipmap draw distance is static.
• Dolphin can make use of mipmaps on non-mipmap textures. This was an interesting discovery (I mentioned it here). There is a caveat though (below).
• Adding the "_arb" suffix does not work to fix the mipmap draw distance if the texture was not originally a mipmap texture ("_m" flag). This means that adding it is pointless, as arbitrary mipmaps can be added to any texture, the "_arb" suffix just controls the level of detail. I'm assuming this is an unintended consequence, Dolphin's code probably does not perform any arbitrary mipmap functions unless the texture has "_m" in the filename.
• Adding "_m" to a filename does not make a texture a mipmap texture. Dolphin just won't see it. But Dolphin will still use mipmaps if the texture has them included.
• The "_arb" suffix is only dumped by Dolphin if the option to use arbitrary mipmaps is checked, and GPU Texture Decoding is unchecked. I am not sure if it still reads custom textures with the "_arb" suffix if the above is true (I think it does but don't quote me on that).

(12-17-2022, 08:58 AM)vlbastos Wrote: [ -> ]I was thinking of using CompressonatorCLI.exe or texconv.exe like the Custom Texture Tools PS do, but since Bighead said Compressonator fails creating some of the textures...

I'm not sure if this is still the case, but it was awhile back (several versions/years ago). The textures it would sometimes fail to create were small textures with resolution of like 8x8 and below. This usually resulted in missing mipmaps since I generate all levels manually. I tried to figure why, but could come up with no ideas as to why. It seemed completely random, although it probably wasn't as the failure was consistent on certain images.

(12-12-2022, 11:04 PM)Venomalia Wrote: [ -> ]
(12-12-2022, 02:47 PM)vlbastos Wrote: [ -> ]I don't know if the Custom Texture Tool can dump textures from ROMs, it seems it only works on existing dumped textures.
the beta version of the Custom Texture Tool has the option to use the Texture Extraction Tool to get the textures from ROMs.

While this is true, I'm not sure if I can currently suggest using Texture Extraction Tool through CTT-PS. It does add some overhead so it takes longer to complete than using it natively. If one is more comfortable using CTT-PS, its not (too) much longer, but the bottleneck is there and there probably isn't much more I can do about it. I do eventually want to get the support into a "release" version, but life hasn't been easy for me these past few months and my interest in working on projects has been low...

While it looks like most have moved on I definitely don't suggest doing ESRGAN upscaling with CTT-PS as there are now much better options like Cupscale. I eventually wanted to match many of its features and the ability to use newer models, add more types of upscalers, check out newer DDS generating programs and possibly add them, etc... but I don't really have the time these days and I question if it's even worth it since things like Cupscale already exist. Not relevant to the topic but I just wanted to throw that out there.
(01-22-2023, 12:09 PM)Bighead Wrote: [ -> ]While it looks like most have moved on I definitely don't suggest doing ESRGAN upscaling with CTT-PS as there are now much better options like Cupscale. I eventually wanted to match many of its features and the ability to use newer models, add more types of upscalers, check out newer DDS generating programs and possibly add them, etc... but I don't really have the time these days and I question if it's even worth it since things like Cupscale already exist. Not relevant to the topic but I just wanted to throw that out there.

I can't speak for others but Venomalia and I have moved on to Chainner!
Pages: 1 2