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
As the topic says.

I'm testing a lot with the Dolphin Texture Extraction Tool, and it's awesome. However, as good as it is, it still can't detect arbitrary mipmap textures and rename them accordingly.

Without the *_arb*.* name in textures, we get good texture filtering in all textures, but the arbitrary effects get lost (ie: mario sunshine's water).

So I tested renaming ALL textures to *_arb*.*, and it fixed the places where arbitrary textures are needed (ie: mario sunshine's water), but also caused the "false positive" effect mentioned in the Arbitrary Mipmap Detection option, where the far textures get blurred.

Then I turned off external textures and tested again, and noticed Dolphin can take care of all the issues with textures with the Arbitrary Mipmap Detection option turned on.

So, why can't we use the same internal textures detection for external textures too? I know the Dolphin developers left up to the modders to rename their textures accordingly so they can get any kind of result they wish, but what if we could just automate the offline extraction and upscaling jobs (it's what I'm doing right now) so we don't need to pick and rename the correct textures to *_arb*.*, and just leave ALL textures without *_arb.*, and let Dolphin enable the *_arb.* corrections ingame, on-the-fly, like it does with the internal textures?

That way you still can allow modders to do their work the way they want, and also gives us an option to just automate everything and get everything working like it does with internal textures.

Thanks in advance.
Personally, I think it would make more sense to add this to a tool like the Custom Texture Tool rather than adding it inside Dolphin. If it's added inside Dolphin, the user would need to keep track of whether a given texture pack was intended to be used with automatic arbitrary mipmap detection on or off, which would no doubt result in some users getting it wrong. If it's added in a tool, the author of the texture pack can choose whether they want to handle it automatically or manually.
Worth mentioning that our automated detection does have some false positives. Most users want the ability to manually specify when arbitrary mipmap detection should be triggered because they haven't been happy with the automated detection.

As for your comment, I don't follow it completely but I believe you want a way for us to know whether a texture is an arbitrary mipmap texture without looking at the filename. My initial inclination would be I'd be more inclined to handle it offline in a tool (like the Dolphin Texture Extraction Tool), rather than enhancing Dolphin to do more processing but I'd need to look more at the logic.
(12-12-2022, 10:26 AM)iwubcode Wrote: [ -> ]Worth mentioning that our automated detection does have some false positives.  Most users want the ability to manually specify when arbitrary mipmap detection should be triggered because they haven't been happy with the automated detection.

As for your comment, I don't follow it completely but I believe you want a way for us to know whether a texture is an arbitrary mipmap texture without looking at the filename.  My initial inclination would be I'd be more inclined to handle it offline in a tool (like the Dolphin Texture Extraction Tool), rather than enhancing Dolphin to do more processing but I'd need to look more at the logic.

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).

It's just enabling the option for external textures too, just like it works for internal textures.

Example: Mario Sunshine

1. Dolphin dumps tex1_128x256_m_21e544278a7fd949_0_arb.png, but Dolphin Texture Extraction Tool dumps tex1_128x256_m_21e544278a7fd949_0.png.

2. We won't know tex1_128x256_m_21e544278a7fd949_0.png is arbitrary if we only dump with DTET (not implemented), but we want it to be arbitrary so the water doesn't break.

3. Dolphin detects tex1_128x256_m_21e544278a7fd949_0.png as arbitrary internally if you're using internal textures, then just make the external tex1_128x256_m_21e544278a7fd949_0.png (dumped by DTET) arbitrary ingame too, even if it doesn't have _arb in the name (don't need to rename the file, that can get messy) (make a new option so it doesn't interfere with current settings - something like "Apply Arbitrary Mipmap Detection on external textures without _arb suffix" or anything like that  Big Grin ).

4. Any external texture named *_arb*.* will still be forced as arbitrary (won't change anything for the mod community, they still have control over arbitrary textures).

It's hard to put in words, but it's simple if you understand. I just don't know if it's simple for coding.
(12-12-2022, 08:55 AM)JosJuice Wrote: [ -> ]Personally, I think it would make more sense to add this to a tool like the Custom Texture Tool rather than adding it inside Dolphin. If it's added inside Dolphin, the user would need to keep track of whether a given texture pack was intended to be used with automatic arbitrary mipmap detection on or off, which would no doubt result in some users getting it wrong. If it's added in a tool, the author of the texture pack can choose whether they want to handle it automatically or manually.

I don't know if the Custom Texture Tool can dump textures from ROMs, it seems it only works on existing dumped textures.

What I'm trying to achieve here is an automated dump and upscaling batch that will try to dump all textures from the ROM without having to play the game in Dolphin to extract the textures. I know Dolphin Texture Extraction Tool can't get 100% of the textures all the time, but 96% ~ 99% is good enough to pre-upscale before playing.

I'm trying to do the things my way, instead of downloading a texture pack, so I can play the games with everything upscaled by me beforehand.

I use DTET to dump the textures, then I use realesrgan-ncnn-vulkan.exe to upscale to 4x with the 4x_HDCube2_250k-NKNN model, then I use the NVIDIA Texture Tools to convert it all to DDS. All of this in a single batch. Took less than 50 mins to upscale and convert 2351 textures from Mario Sunshine.

Then when I was going to start playing in all 4k/4x glory, I noticed the water problem (no _arb), then the blurred textures problem (everything _arb).
(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.

(12-12-2022, 02:47 PM)vlbastos Wrote: [ -> ]I use DTET to dump the textures, then I use realesrgan-ncnn-vulkan.exe to upscale to 4x with the 4x_HDCube2_250k-NKNN model, then I use the NVIDIA Texture Tools to convert it all to DDS. All of this in a single batch. Took less than 50 mins to upscale and convert 2351 textures from Mario Sunshine.
50 minutes is very fast, I'm working on HDcube3 right now and it's almost done, it might be interesting for you to know that I'm going to work on a compact model that can upscale textures in real time.

(12-12-2022, 02:47 PM)vlbastos Wrote: [ -> ]Then when I was going to start playing in all 4k/4x glory, I noticed the water problem (no _arb), then the blurred textures problem (everything _arb).
The texture extraction tool doesn't have arbitrary mipmap detection yet simply because I don't know exactly how it works, but it's on my to-do list.
(12-12-2022, 11:04 PM)Venomalia Wrote: [ -> ]the beta version of the Custom Texture Tool has the option to use the Texture Extraction Tool to get the textures from ROMs.

50 minutes is very fast, I'm working on HDcube3 right now and it's almost done, it might be interesting for you to know that I'm going to work on a compact model that can upscale textures in real time.

The texture extraction tool doesn't have arbitrary mipmap detection yet simply because I don't know exactly how it works, but it's on my to-do list.

1. That's good to know, I shall take a better look there!

2. OH MY GOD, the BEST esrgan model for game textures is getting BETTER? That's awesome!!!! Can't wait for it! And this compact model will be totally useful for my realtime upscaler batch. You see, we can try to upscale the most we can extract from the ROM before playing, so when we do the realtime upscaling while playing, it's a lot less work and hardware stressing. And with the compact mode, we can do the 2 step upscale I did with waifu2x (First the compact model to give a nice preview ingame, and a parallel job doing the more complex upscale with tta to replace the compact model after a while. It's the best of both worlds.)

3. Yes please, that would help a lot.

Thanks again JosJuice, iwubcode and Venomalia, I can't thank you enough for all your work and all the help you 3 always lend me.
I love you 3, you always answer my stupid posts!  Big Grin
(12-13-2022, 12:03 PM)vlbastos Wrote: [ -> ]2. OH MY GOD, the BEST esrgan model for game textures is getting BETTER? That's awesome!!!! Can't wait for it! And this compact model will be totally useful for my realtime upscaler batch. You see, we can try to upscale the most we can extract from the ROM before playing, so when we do the realtime upscaling while playing, it's a lot less work and hardware stressing. And with the compact mode, we can do the 2 step upscale I did with waifu2x (First the compact model to give a nice preview ingame, and a parallel job doing the more complex upscale with tta to replace the compact model after a while. It's the best of both worlds.)

do you also plan to publish the script/program, it sounds very practical!
The new version of HDcube is now also available.^^
(12-15-2022, 05:11 AM)Venomalia Wrote: [ -> ]do you also plan to publish the script/program, it sounds very practical!
The new version of HDcube is now also available.^^

Of course! It's just a bunch of .bats that call each other and keep looking for dumped textures in the background while you play something... You see, I'm not a real programmer, I just try real hard to get some clunky batches to do what's needed to do.

I posted the waifu2x version in another topic, but I plan to improve it and make it work flawlessly. I kinda started, but paused... I will finish it eventually for sure.

The .bats that work with Dolphin Texture Extraction Tool are pretty much complete, they work very nicely. I just don't know how to post it to the public, because they use DolphinTextureExtraction.tool.exe, realesrgan-ncnn-vulkan.exe, nvtt_export.exe (this one is Nvidia's - it's free, but to get the download link, you must sign up their dev thing), and to configure it, you must edit each .bat (I didn't bother to make a .cfg or anything like that, but I probably should).

Oh, and I surely noticed the new HDCube 3 in your git!!!! I'm in love with it just by looking at your image comparisons! Even better outlines, even better details, even better colors, and even the foliage sharpening popping thingy is fixed now!!! Grass and foliage will look a lot better! Thanks for this new version, awesome work! I'm gonna test it this weekend, as soon as I can!
(12-16-2022, 03:22 PM)vlbastos Wrote: [ -> ]The .bats that work with Dolphin Texture Extraction Tool are pretty much complete, they work very nicely. I just don't know how to post it to the public, because they use DolphinTextureExtraction.tool.exe, realesrgan-ncnn-vulkan.exe, nvtt_export.exe (this one is Nvidia's - it's free, but to get the download link, you must sign up their dev thing), and to configure it, you must edit each .bat (I didn't bother to make a .cfg or anything like that, but I probably should).

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.
Pages: 1 2