-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Feature Request: Texture dump and replace #4630
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
Comments
So here's what I'm thinking:
-[Unknown] |
Doing this will practically "lock down" the texture hash so we really need to be sure this is the one we want to use. Dolphin has chosen an interesting path: Combining a few parallell CRCs allows both a parallel implementation and using CRC hardware, where available. Might be a good choice, I don't know how it compares speed-wise to our algorithm. As for mipmaps, we could either just generate them on load, or allow .DDS or another file format that can store mipmaps. It would be possible to "preload" all replace-textures on game startup and keep them in a separate texture cache in order to avoid framerate hitches from loading .png, given enough RAM. Alternatively load them on a background thread as they are needed, using the original texture until they are done, although that might look ugly. |
But, how will that perform on platforms where there's no hardware crc (arm pre-aarch32/64, x86 phones)? Anyway, we should probably bench some more algorithms and see how they compare. Maybe it would be faster for neon anyway with some also-parallel algo. The current one is probably not that strong, but I've never actually run it through smhasher or anything to know how not-strong it is. -[Unknown] |
It might be just remotely related, but I wonder if there would be any technical problem to do something similar also for movies? At least for the video part, as I understand it's just h264/mpeg4-avc so maybe it wouldn't be impossible to load higher quality video stream from external source while continue to make the game happy with whatever it needs from the original pmf? I'm mostly interested in movies because pmf container isn't exactly easy to work with and would really preffer something I can create myself or at least reencode it later without using some warez programs flying around which most google results about pmf encoding/muxing leads towards.:c |
Well, the way that games provide the video makes that a little complicated. They provide frames and can do whatever they want (such as custom looping or swapping video streams mid video), which a few games do. We might be able to get the pts from the packets and map it to a video, but things would get complicated. Another complication is that the game can then do whatever it wants to the video - for example, draw subtitles on top, draw it behind characters, or even draw it not full screen. Since video decoding goes to memory, this requires a lot of somewhat complicated tracking to follow - it's something that would at best probably only work in some (maybe many) games. Anyway, it's something that could be interesting, since applying an xBRZ filter to the video realtime wouldn't necessarily work except on very, very powerful computers. But it's definitely a lot of work - more than texture replacement. -[Unknown] |
Cool, thanks for answer:3. |
More into the topic, do you guys have any idea of when are you going to implement texture dumping/loading? |
Nothing? |
So here's an initial implementation of dumping and replacing: master...unknownbrackets:tex-replace This also allows overriding the hash range, for example if you know the part of a texture used is only 480x272, you can just specify that. It will load the png at that size, and hash only that area (well, at least the h, right now.) Example textures.ini file:
This causes it to only hash a smaller section of these particular textures, preventing some duplicate copies of textures. So it could be used (almost as a hack) to improve performance in some games. Note: one thing that will inevitably confuse people is the alpha channel. Textures can and do have zero alpha with important colors, but many programs make it hard to work with PNGs that have a 0 alpha channel for all pixels. Also, with the "save new textures" option enabled, this is capable of dumping scaled textures. That means theoretically, it could be used as a "cache" for texture scaling once it supports loading the PNGs. I'm expecting loading a PNG to be faster than actual xBRZ scaling, at least at higher levels (probably all levels?) -[Unknown] |
Well, pngs are fairly fast but there's definitely a penalty. If I let FF2 generate most of the different permutations in a certain area (~100 MB of PNGs at 1x) and then disable saving new textures, it's still dominated by loading those PNGs - 75% - 80%. For most games, it'll probably be fine, and even 2x scaling is even more murderous in the same scene of FF2, if we disable the max texels per frame, etc. That being said, it could be worth storing the images with a faster compression format or no compression, optionally (since the time is all spent in -[Unknown] |
Things we could still do here from #8715:
-[Unknown] |
Any news on this feature, and/or when it's being added to PPSSPP? |
Did you read #8715? -[Unknown] |
Is there is currently a way to preload textures? like hrydgard saids "It would be possible to "preload" all replace-textures on game startup and keep them in a separate texture cache in order to avoid framerate hitches from loading .png, given enough RAM" ? |
I'm going to close this since it's essentially implemented now - see #12059 for a possible improvement, related to my comment above in 2016. -[Unknown] |
It would be nice to have this feature, so that people can make for example highres texture pack for games. Dolphin has a nice implementation.
The text was updated successfully, but these errors were encountered: