KillzXGaming / Switch-Toolbox

A tool to edit many video game file formats
GNU General Public License v3.0
953 stars 154 forks source link

Importing textures into GFPAKs for Pokemon games is INSANELY slow due to the lack of GPU-acceleration. #451

Open Akira13641 opened 2 years ago

Akira13641 commented 2 years ago

An option to use CUDA-accelerated batch DDS compression via something like nvbatchcompress.exe from Nvidia Texture Tools (while simultaneously retaining the ability of Toolbox to choose exactly the correct DDS format to convert to automatically) is desperately needed to facilitate the efficient creation of texture packs for recent Pokemon games.

CPU-based DDS compression is highly undesirable to begin with for performance reasons even when implemented in languages that aren't garbage collected and that don't run in a virtual machine, meaning the written-in-C# implementation provided by Toolbox currently makes it even worse to basically unusable levels, to be blunt.

Nazosan commented 2 years ago

On this note, using multithreading helps enormously (in fact it seems to scale in a nonlinear fashion oddly enough,) so I really think it should be enabled by default on the things that benefit from it such as BC7. I don't know if it has been unstable in the past or what, but it seems to be stable now, so perhaps it should be an option so the user doesn't have to tick it every single time. GPU acceleration would be best of course, but I do think that could help at times anyway. I tried processing a number of textures and had to manually tick that every single time. Ticking it restarts the process, so a fairly considerable amount of time can be wasted sometimes if one forgets.

There are a couple of HD texture projects and it seems that with the HD textures it can literally require several minutes to compress some with multithreading on. Without it it can take probably more than ten minutes for one...

(BTW, unrelated to actually fixing this, but the game will accept RGBA textures. This is sufficient for testing purposes, though BC7 should be used on the final output. It takes longer to save the .gfpak file with RGBA textures and they take longer to load into the game, but it's still less aggregate time versus the BC7 compression so is good for intermediate testing purposes.)