PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.48k stars 1.6k forks source link

[BUG]: Persona 3 FES - Flickering with texture replacement #5862

Closed DniweTamp closed 1 year ago

DniweTamp commented 2 years ago

Describe the Bug

While using texture replacement feature (with both png and dds images) some ui elements in P3FES flicker between replaced and original variants for some reason. Which elements flicker and which don't is random between each play session. Font is always flickering.

Reproduction Steps

All I did was dump some textures and upscale them, for testing. Was using Vulkan renderer. Later tried D3D11 and OGL - same thing.

PCSX2 Revision

v1.7.2587

Operating System

Windows 11

CPU

i5-8250u

GPU

Geforce MX130

GS Settings

image image image

GS Window Screenshots

https://user-images.githubusercontent.com/39583006/163265693-3ad24084-46e1-4d31-98ce-0bede3cacc2d.mp4

Gunlaus commented 2 years ago

Did you scale your texture's alpha before upscaling them and then revert them to original alpha value?

DniweTamp commented 2 years ago

this is a raw upscale, the alpha was untouched

FuxorLuck commented 2 years ago

I encoutred alot of textures become invisible ,turning black or become broken and here is what I am doing in order to fix it.

Download ctt-ps and Image Magick Win64 static at 8 bits-per-pixel component to the same folder

https://forums.dolphin-emu.org/Thread-custom-texture-tool-ps-v50-1

I open ctt-ps Choose expert mode and in Operation I Choose PNG Alpha Manipulation, then customize data, enable modify and click customize and set A=1

e50b9707cba0bcee7949af767dfdf2028705c16c

Click the $ symbol and load the texture that is responsible for the issue or all of them if i dont know which texture is responsible click start

Not sure if it's a pcsx2 bug.

Gunlaus commented 2 years ago

https://github.com/PCSX2/pcsx2/blob/master/tools/texture_dump_alpha_scaler.py

ZwipZwapZapony commented 2 years ago

In (at least) Secret Agent Clank, I experience something that seems related. I replaced a GUI texture, though rather than flickering, it's just sometimes the original texture and sometimes my replacement, switching every few minutes or so.

My uneducated guess is that when a texture is loaded, it's "randomly" either the original texture or the replacement. In Persona 3, the text texture (possibly) reloads every frame, causing "random" flickering, while in Secret Agent Clank, it stays loaded for a longer time before being reloaded.

DniweTamp commented 2 years ago

even if you do use the alpha scaling script (which does somewhat help), text will still be flickering (look at Mitsuru's text, near the end of the video)

https://user-images.githubusercontent.com/39583006/164283954-626599aa-5af5-4ed8-8491-afa05775b0e1.mp4

stenzek commented 2 years ago

If you can isolate it to a single texture, I can look into it, but otherwise this isn't really enough information to investigate what's going on.

DniweTamp commented 2 years ago

each font letter, in each color variant is a separate image

so uuuuuuuhhhhh yeah i don't know about that

ZwipZwapZapony commented 2 years ago

I've found a way to reproduce it on demand in the PAL version of Secret Agent Clank (SCES-55496). If it matters, I'm using the Vulkan renderer. This zip contains a texture that makes text have orange outlines instead of blue, as well as a (new game plus) save state for reproduction: Secret Agent Clank (SCES-55496) Custom Texture Bug.zip

\ - Load the save state. Clank will be staring into a corner. Hold Triangle to open the Quick Select menu, then let go to close it. The bolt/money counter in the top right should now have the custom orange outlines. - Now use the right stick to turn the camera and look behind Clank. The bolt counter should now have the original blue outlines, even if you open the Quick Select menu again. - Now look into the corner in front of Clank and open the Quick Select menu again. The bolt counter should now have the custom orange outlines again.

(If that doesn't work, then pause the game, go to "Special" > "Cinematics", and load a cutscene. This should make the text have the custom orange outlines for one frame before the cutscene plays.)

MrCK1 commented 2 years ago

Closing this since texture replacement is provided as-is. Glitches with some games are expected.

stenzek commented 2 years ago

Tbh this one could probably stay open, as it sounded like there was an issue, at least for the OP. Just can't do anything about it unless they provide replacement files, so I can see what's going on.

The Secret Agent Clank thing sounded like a non-issue, and just a different texture.

DniweTamp commented 2 years ago

alright I got some P3HD textures ported https://drive.google.com/file/d/1VRWGVWXbUQEZfodG3Axy__ClEb0R-kM8/view?usp=sharing

stenzek commented 2 years ago

Looking into it, I think this is entirely an issue with your replacements, not the system, so we can close this as invalid.

I couldn't reproduce the text flickering (but that just looks like it switching between normal and replacement textures; make sure you've handled all of them, the hash is probably slightly different).

As for the other broken elements on the screen, those errors are in your textures, not the system. Here's an example: image

The corruption is present in the .dds files you uploaded.

I also confirmed that the textures dump correctly. Here's the one I was using for testing (2c4dccf19f225781-71d7736c4416cb41-00005994.png): 2c4dccf19f225781-71d7736c4416cb41-00005994

DniweTamp commented 2 years ago

I'm aware of corruptions in the dds itself The font however should he fully replaced Every letter is each own texture (at least when dumped, not in files), and it gets fully properly replaced in all previous "hacky inaccurate" implementations, as well as P3P on PPSSPP alpha should be correct too, as it was scaled down using your python script

stenzek commented 2 years ago

The only "flicker" I saw is when it was async loading the textures for the first time. Once they were loaded, it's fine.

Like I said, this is invalid, the issue is with your replacement textures, not the system.

DniweTamp commented 2 years ago

Okay then. Are you at least able to upscale and replace text without running into the same issues?

stenzek commented 2 years ago

I'm not really interested in spending time messing around with textures myself. Got plenty of other more important things to work on.

Like I said, if you can provide replacements (which aren't broken, yours are) that have an issue, I'll look into it, which I've done here, and I cannot reproduce your issue.

DniweTamp commented 2 years ago

Well, the actual texture corruption we can fix ourselves, that's a non-issue. The only thing I'm concerned about is the font flickering, everything else is a non-issue. And the font textures are fine, no corruptions, no over the limit alpha, they are valid textures. And yet there is still flickering. Just because you checked 1-2 text boxes and it was fine doesn't mean it's a non-issue. Check some dialogue selection boxes, they seem to always introduce the flickering

stenzek commented 2 years ago

I did check dialogue boxes. But considering you didn't even provide a memory card, if it's specific to one area, I don't really feel like guessing where it is.

ZwipZwapZapony commented 2 years ago

Does this still happen in v1.7.2747?

ghost commented 2 years ago

i'm using 1.7.3126 and on the 4th floor i get flickering in in some Places too, what fixed it for me was setting vu to extra + preserve sign , Fmvs have slight color bug on the bottom

Mrlinkwii commented 1 year ago

closing due to lack of response