Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Texture Replacement
05-06-2016, 12:56 AM (This post was last modified: 05-31-2016 05:27 PM by YukiHerz.)
Post: #1
Texture Replacement
Relevant Links:
Initial Pull Request: https://github.com/hrydgard/ppsspp/pull/8715
Wildcards Explained: https://github.com/hrydgard/ppsspp/pull/8792

Old Post: So i was casually wanting to play some psp games on the emulator and, as it is normal for me, i went ahead to get the latest build, then i saw:
Code:
Merge: b6d7aab 2e1986d Merge pull request #8715 from unknownbrackets/tex-replace Initial texture replacement support
Along with another comment by Henrik on another thread, this leads me to believe we'll see an actual texture replacement option soon?

Oooor i'm just dreaming and nothing is real?
Find all posts by this user
Quote this message in a reply
05-06-2016, 01:33 AM
Post: #2
RE: Texture Replacement coming?
Actually it's not coming ~ it's already implemented in any version following that merge thanks to [Unknown].

Doesn't really have any ui, but it's pretty easy to use, just edit ppsspp.ini and set:
SaveNewTextures = True
to dump textures into \memstick\PSP\TEXTURES\gameID\new\, then put textures you edit into \memstick\PSP\TEXTURES\gameID\ and set:
ReplaceTextures = True
to have them replaced in game.
There's also optional textures.ini file you can create in \memstick\PSP\TEXTURES\gameID\ which can be used to set different filenames or limit the size of texture, but it's completely optional, you can check it's syntax in the original pull request.

It can use texture scaling(when dumping), should be affected by texture cache settings when replacing and that's pretty much it. If you're on git, you might subscribe to this issue if you're interested about future updates to this feature since it might get more stuff someday.

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
05-06-2016, 11:39 AM
Post: #3
RE: Texture Replacement coming?
I was too lazy to figure how it works, thanks for the explanation LunaMoo ! Wink

♦ Intel Core i7-6700HQ | 16 GB RAM | NVIDIA GeForce GTX 960M | Debian Testing --- Windows 7 Professional SP1 x64
♦ Intel Core i7-2630QM | 4 GB RAM | NVIDIA GeForce GT 540M | Debian Testing
♦ PSP-3004 | 6.60 PRO-C2
Find all posts by this user
Quote this message in a reply
05-06-2016, 01:58 PM
Post: #4
RE: Texture Replacement coming?
[Image: s5dpMGI.png]

Nice, i'll check what i can do later on.
Find all posts by this user
Quote this message in a reply
05-06-2016, 11:43 PM
Post: #5
RE: Texture Replacement coming?
On this note, I wrote a quick little utility to run the texture scaler on images outside PPSSPP. It pulls in all of PPSSPP to do the threading and etc. all the same way.

Basically, this allows you to use a different scaler, or different scaling factor, on different images.

Unfortunately, because I just pulled in all of PPSSPP's code for its scaler, the exe is kinda big. It could be made smaller by cherry picking out what's needed or refactoring some dependencies (unfortunate that the linker didn't do this for me.)

http://forums.ppsspp.org/uploads/xbrz-cli-64.7z

Run without args for basic help.

-[Unknown]
Find all posts by this user
Quote this message in a reply
05-07-2016, 11:54 PM
Post: #6
RE: Texture Replacement coming?
That command line seems to be only for x64 systems.

On that note, not a big fan of upscalers on actual textures, but it works wonders on hud elements and small fonts.
Find all posts by this user
Quote this message in a reply
05-20-2016, 03:48 AM
Post: #7
RE: Texture Replacement coming?
is there anyway i can also find the .png files in the rom and have it internally replaced? i wish to make the tekken 6 textures changed..
Find all posts by this user
Quote this message in a reply
05-20-2016, 05:03 PM
Post: #8
RE: Texture Replacement coming?
You'd need to figure out in what format and how does the game store its textures on the iso, this only fetches the textures in run-time, it doesn't deal with the game's internals.
Find all posts by this user
Quote this message in a reply
05-29-2016, 11:33 PM (This post was last modified: 05-29-2016 11:33 PM by YukiHerz.)
Post: #9
RE: Texture Replacement coming?
Hmm, it seems Monster Hunter games' texture hashes for both areas and monsters change on a per-quest basis, anything that can be done about this?
Find all posts by this user
Quote this message in a reply
05-29-2016, 11:46 PM
Post: #10
RE: Texture Replacement coming?
i'm having a hard time on editing the Tekken 6 Life bars.. every character (40 characters) multiplied by 40 again on one mode (example is practice mode) = all the lifebars on that mode.. i just wish there is a way where the almost similar addresses of .png can be predetermined by the ppsspp texture replacement..

for example, the main menu of tekken has 09a67ee09dc425ed********.png
wherein * are the ones that changes..

how i wish we could just input this 09a67ee09dc425ed********.png instead of the complete address..
Find all posts by this user
Quote this message in a reply
05-30-2016, 12:21 AM
Post: #11
RE: Texture Replacement coming?
Filename without using ini file is not an address, but an address followed by hash, following your example if the hash changes it pretty much means one of the two things:
- textures are different - and you should treat them separately one by one or give up as that's really the only way,
- texture is same, but potentially includes unused/trash data changing the hash.

If you wonder about the second situation check ini file syntax here, especially examples under "[hashranges]" as that's pretty much what allows you to cut just part of the texture of specific size stored at specific address and avoid hashing the trash data.

When it works fine it will actually improve performance since textures will be smaller and there will be less of them;p. There might however be situations like when game stores completely different texture of same size at same address, but using all of it's size where this will cause issues cutting things you don't want:].

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
05-30-2016, 01:02 AM (This post was last modified: 05-30-2016 01:03 AM by [Unknown].)
Post: #12
RE: Texture Replacement coming?
Just to note, the filename is made up of three things, which is also how PPSSPP sees textures:

1. The first 8 characters are the address. For example, 09a67ee0. Games may load different things into the same address, or reuse the address in other scenes. They may also load the same texture in a different address.

2. The next 8 characters are a clut and dimension hash. For most textures, this'll be static. In games that use palette swapping, it'll change for each color variation.

3. The final 8 characters are the data hash. This is based on the data the texture points to in memory. Sometimes there are bleeds, as LunaMoo is describing.

To make it clear, the PSP can only use textures of certain specific sizes. For example, 8x1, 8x2, 8x4, 8x8, and so on. It's not possible to create a 8x3 texture, even if you want one. So games use a larger texture, and when drawing, only draw with part of it.

Here's a visual example:
Code:
+---------+
| X   X   |
|X X X X X|
|   X   X | <-- actual height is 3, but 3 is not supported.
|ASDJASDHS| <-- row 4 isn't used, but it's part of the texture.
+---------+

Because a single texture can be (and usually is) drawn multiple times, we can't always tell that this part is unused (or we could, but everything would get a whole lot slower.) So we're forced to consider it part of the texture.

Another syntax in the ini (WARNING: loaded gun that you can point at your foot) is this:

Code:
[hashes]
09a67ee09dc425ed = 09a67ee09dc425ed.png

If you're absolutely sure the texture never ever ever changes, and the address/clut are never ever ever used by a different texture, you can use the above to map the address/cluthash to a single file.

The main reason for that syntax is actually to be able to ignore frequently-changing textures (e.g. sometimes games draw text or video content.) You can use this to ignore:

Code:
[hashes]
09a67ee09dc425ed =

This also works for full (24 character) hashes. SaveNewTextures will ignore these and not save them.

I'm planning to add a way to map just the data hash (or maybe clut + data hash) to a file... not sure what to call it in the ini. Would probably put it under a new section, like "[datahashes]"? Hm. Sounds weird, don't like it...

-[Unknown]
Find all posts by this user
Quote this message in a reply
05-30-2016, 03:30 AM (This post was last modified: 05-30-2016 03:45 AM by komiks0916.)
Post: #13
RE: Texture Replacement coming?
how about this problem? i just saw that the 1st 7 numbers are the ones who are always changing..

# Life Bars Yellow
09a4c39071d9fdb149ebf5ec = YellowLife.png
09a4c31071d9fdb149ebf5ec = YellowLife.png
09a4370071d9fdb149ebf5ec = YellowLife.png
09a4024071d9fdb149ebf5ec = YellowLife.png
09a4618071d9fdb149ebf5ec = YellowLife.png
09a3ba3071d9fdb149ebf5ec = YellowLife.png
09a3710071d9fdb149ebf5ec = YellowLife.png
09a3669071d9fdb149ebf5ec = YellowLife.png
09a4092071d9fdb149ebf5ec = YellowLife.png
09a408a071d9fdb149ebf5ec = YellowLife.png
09a4342071d9fdb149ebf5ec = YellowLife.png
09a3e26071d9fdb149ebf5ec = YellowLife.png
09a3757071d9fdb149ebf5ec = YellowLife.png
09a3aa7071d9fdb149ebf5ec = YellowLife.png
09a3e09071d9fdb149ebf5ec = YellowLife.png
09a36f7071d9fdb149ebf5ec = YellowLife.png
09a3663071d9fdb149ebf5ec = YellowLife.png
09a3f8a071d9fdb149ebf5ec = YellowLife.png
09a29f1071d9fdb149ebf5ec = YellowLife.png
09a1cca071d9fdb149ebf5ec = YellowLife.png
09a38bd071d9fdb149ebf5ec = YellowLife.png
09a3d09071d9fdb149ebf5ec = YellowLife.png
09a428d071d9fdb149ebf5ec = YellowLife.png
Find all posts by this user
Quote this message in a reply
05-30-2016, 04:20 AM
Post: #14
RE: Texture Replacement coming?
Right, that's the last part of my post above. It means the game is reallocating the texture different places.

-[Unknown]
Find all posts by this user
Quote this message in a reply
05-30-2016, 04:29 AM
Post: #15
RE: Texture Replacement coming?
(05-30-2016 04:20 AM)[Unknown] Wrote:  Right, that's the last part of my post above. It means the game is reallocating the texture different places.

-[Unknown]

does it mean i have to really find all the lifebars? :o
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: