New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GS: Add texture dumping and replacement system #5547
GS: Add texture dumping and replacement system #5547
Conversation
|
Quick notes:
|
6a239ce
to
f43e6dd
Compare
|
Just to clarify, what happens if the dimensions of the replacement texture mismatches the original (i.e. if it's bigger)? In other words, is the feature suitable for creating high-res texture packs? |
It's scaled in the same way that target copies are; in other words, high res packs will work as expected. |
f43e6dd
to
37a04f8
Compare
|
No idea if i can even comment here just want to thank you and everyone working on PCSX2 you guys rock |
|
Excellent work. Will DDS support (in the future) come with compression support as well? (DXT) |
|
37a04f8
to
293dfb1
Compare
Should be fixed with the last push (both GL and Vulkan). |
fe2009d
to
704eda7
Compare
|
Asynchronous loading added (so it won't cause GS thread stutter while it loads from disk), as well as caching for known replacement textures. Note that new replacements added while the game is running won't register now until it rescans them, the easiest way is to just toggle software on and off, but I'll add a proper hotkey for this in the future (at least in Qt). DDS textures should load now, and BC1(DXT1)/BC2(DXT2-3)/BC3(DXT4-5)/BC7 compressed formats will be natively uploaded to the GPU. Replacement filename was changed, sorry, it was missing some bits which are needed to uniquely identify the texture. Hopefully the last change though.
|
704eda7
to
f5b4034
Compare
|
What's the hashing algo used? |
xxhash
Working as intended. Most of these textures have an alpha of 128, even in 32bit CLUT mode. You can ignore the alpha channel, or scale it before and after editing. |
|
If it already is broken , it's likely a Texture Cache issue which this PR won't solve. |
|
yes considering how broken Ace Combat 04 is in hardware mode, I wouldn't use that to gauge reliability of this PR, I would consider that out of scope. Texture replacements wont fix games with broken graphics, that's not the intention of this feature. |
|
With the no interlacing code and changing some settings, 04 actually works fine aside missing some effects like volumetric clouds. Eitherway, if it's not something that could be easily fixed then too bad. |
That's probably correct, you'll find multiple dumps with the same first part of the filename (the texture data/indices hash), but a different second part (palette/clut hash). I specifically addressed this in the OP:
|
When trying to dump, I get this error soon after startup, Cant really say much, if you want more details just ask. https://www.youtube.com/watch?v=1Nn3Q9QQFhU |
|
That backtrace is meaningless. Need to run under gdb, ideally with symbols. |
|
For the palette/CLUT thing, would it be possible to (optionally) dump indexed textures and palettes for them separately? So instead of dumping a different texture for each texture and palette combination, we can just have one indexed texture and then a bunch of .pal files (or whatever) next to them. Then have it apply the original CLUT to any loaded texture that doesn't have the second hash in the filename. I think there are cases where doing it this way would be much, much easier on people trying to do texture edits. |
|
It's a possibility, sure. But outside of the scope of this PR; personally I'm more in the camp of resolving palettes prior to dumping. |
|
Amazing work but i have an odd issue with it i made warriors textures and bumped them massively it works but i always get Hash Cache has used x amount of Vram Disabling then i get black screen but Vram it hits about 2GB then i get warning but i have a RTX3090 24GB iv'e tried all 3 settings seems more usable with opengl compared to vulkan but still getting hit with hash cache |
|
Amazing work but my invisible car could this becaused by Hash Cache disabling no matter what option I use I always get that message and it's when this happens could it because textures to big for cache and I've tried deleting all junk textures also but didn't fix so unsure if it could be mips related |
|
looks like you messed up your alpha values |
|
@SayakaMaizono see if creating a |
Craete a folder inside pcsx2 called "textures" Also I think next pcsx2 build should come with an emptey folder called "textures" |
Wow I swear I tried that before and it didn't work. That solved it, thanks! |
|
There are two glitched textures here in NHL 09- one for Jaromir Jagr's portrait, and another for Avangard Omsk's logo- in fact, ALL of the logo and portrait textures appear to be glitched. The only ones that don't appear glitched for NHL 09 (and would likely apply to 2005 through 08 as well) when dumped are some UI elements and text. |
Similar thing happens in some other games that I tried, mainly all Ace Combat games. |
|
Would it be possible to detect and seperate any texture which has an alpha channel? For bulk upscaling just to get an idea of how amazing this feature can become, It'd be nice to be able to seperate alpha textures or else they look broken without special care. Testing this on Ratchet and Clank 3 right now. |
|
Hi,
https://ibb.co/ynhLk43 |
Sorry, would you mind to share the upscaled textures? I tried mysefl using AI programs and online webs, but they're not free and I can just upload one image at the same time. Is there any website or program to do this with a lot of images at the same time? Thanks! |
|
Sorry we're not allowing textures to be shared on our github, discord or forums due to the amount of copyrighted material that could be floating around, if you wish to share texture packs, you are all welcome to set up your own website and share them there, and if there is moderation and vetting to make sure no copyrighted assets are being used, we'll even link to it. But directly, we don't have the man power to deal with it, so please do not share them here. |













Description of Changes
Something that many have requested and others have done very poorly and hackily. This one is (in my opinion) clean and mergeable.
Rough TODO:
Textures using multiple CLUTs/palettes will be dumped as multiple textures (e.g. Xenosaga). Mapping texels to CLUTs is outside the scope of this PR, since it works well enough without it in most games, and adds complexity. I might look into it later on.
Please note that while I'm not planning on changing the texture filenames or hashes, I can't guarantee that it won't change before the PR is merged. So keep that in mind if you're experimenting with it.
Rationale behind Changes
Suggested Testing Steps
Test dumping/replacement across a bunch of games, but probably wait until it's more complete first. But feel free to experiment :)