PCSX2 / pcsx2

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

[GSDX HW] Syphon Filter series: Sprite Flickering/Corruption #2249

Closed MrCK1 closed 2 years ago

MrCK1 commented 6 years ago

PCSX2 version: PCSX2 1.5.0-20171228104611 - compiled on Dec 27 2017

PCSX2 options: Defaults

Plugins used: Defaults, OGL HW, DX11 HW

Description of the issue: While moving around, sprites will flicker/become corrupted and appear as another texture.

How to reproduce the issue: Go into any level, walk around.

Last known version to work: Never

PC specifications: i5-6600K, GTX 1070, Windows 10 64-bit Home

GS Dump: (rename to .7z) SF_spritecorruption_gsdump.zip

RAW GSdx dump w/debug log: (rename to .7z) syphonfilter_spritecorruption.zip

Normal - HW: gsdx_20180103170250

Corrupt - HW: gsdx_20180103170309

OGL SW: gsdx_20180103170543

ghost commented 6 years ago

Would you want I add the gif fifo gamefix for this one?

MrCK1 commented 6 years ago

Not yet, it could still be a GSdx issue as well.

ghost commented 6 years ago

Also, Ace Combat 4 have a very similar issue with the lightning, did you try the preload frame data and the cpu framebuffer hacks?

And what about DirectX?

MrCK1 commented 6 years ago

DirectX 11 HW is the same, I made that more clear in the original post :)

Edit: FWIW, this assert also gets triggered, just like in #1602: ASSERT(m_vt.m_min.p.z > max_z); // sfex capcom logo

MrCK1 commented 6 years ago

The Omega Strain also contains this issue but to a lesser degree. Sprites will still flicker as squares; but are not visible through walls.

FoxHand commented 6 years ago

Hi everyone. I solve this issue in my way: sfdm yes sfdm no And the settings I use: settings This work also for The Omega Strain and Logan's Shadow. Enjoy! :)

I trying to solve the same issue in these games in PPSSPP but for now I don't have a luck, maybe you have the solution?

FlatOutPS2 commented 6 years ago

@FoxHand You've enabled too many options/hacks to see which (combination) actually resolves the issue. Can you check which ones are absolutely necessary?

MrCK1 commented 6 years ago

I never tried FBC hack, I forgot actually. Auto Flush is the only one that's needed.

I'll just boot my PC quick and check.

Edit: Not sure how I didn't spot this before. Auto Flush fixes visibility and Preload Frame Data fixes the flickering. I'm going to wipe my GSdx.ini just to be positive.

I'm not sure about the map border yet, I know a few places that trigger it.

FoxHand commented 6 years ago

Auto Flush and Preload Frame Data just needed. Also random combination of Half-Pixels Offset and Round Sprite options affects visibility of lights. Widescreen cheats and Internal Res also affects resulst in some way.

MrCK1 commented 6 years ago

@gregory38 @FlatOutPS2 This is an interesting case actually. Only Auto Flush is needed. The problem is, the fix only works at native resolution.

Once you start upscaling, you're going to have visible sprites through walls and corruption/flickering. Must be another memory trick :P

The issue stays open for now, because most people aren't going to be playing at native resolution, and it's still technically present.

FlatOutPS2 commented 6 years ago

I shortly tried Omega Strain and noticed the same thing. Only Auto Flush has a real positive effect on the issue, and only on native resolution. Above that it seems to work only partially and where it does it creates the flickering/corruption.

FoxHand commented 6 years ago

@MrCK1 2x Native is not that bad you know. :) @FlatOutPS2 In Omega Strain I just use SkipDraw 1.

FlatOutPS2 commented 6 years ago

@FoxHand What effect does skipdraw 1 have? AFAIK it doesn't fix anything.

FoxHand commented 6 years ago

@FlatOutPS2 It's just removes light sprites at all. You can play in Custom Resolution mode with it instead of Native and AutoFlush.

FlatOutPS2 commented 6 years ago

@FoxHand Removing the lights is not a solution though. ;) It will be less bothersome than flickering lights, but what we ultimately want to work towards is a solution where the lights are visible and don't flicker/corrupt at any resolution. That's why there an issue on github, rather than just a forum topic on the PCSX2 website.

FoxHand commented 6 years ago

@FlatOutPS2 Well, hope you can fix it completely after all. For me, Skipdraw 1 for Omega Strain is the best way. Much better than flickering here and there. I hope someone can handle light problem in Syphon Filter series on PPSSPP.

gregory38 commented 6 years ago

Hum, this resolution effect is strange. @CK1 if you can reproduce it on a gsdump, I suggest that you dunp all textures in hw mode (native and 2x) to understand what happen.

Hum, I saw 2 diff in upscaling. Texture cache that downscale an old fb. Or the target upload. It could also be linked to the framebuffer resolution. I don't remember if the base resolution depends on the upscaling factor.

MrCK1 commented 6 years ago

I'll do that in a little bit.

Edit: This is odd, I actually can't get the sprites to appear in the raw dumps. The only "leads" I have so far are a few drawcalls where the framebuffer is scaled down to calculate some sort of bloom effect - don't think they're related however.

MrCK1 commented 6 years ago

So it seems the framebuffer scaling is different at native vs 2x native which may be the source of the issue? - I'm just taking a whild guess here. At native res, it's sized at 1280x1024, but 2x native is 2048x2048.

Native _00719_f5001_rt0_00000_c_32

2x Native _00718_f5001_rt0_00000_c_32

Also, it seems this input texture (appears at various addresses, not just 2f20 here) is being scaled at 2x native. Based on the context, these appear what are supposed to be the sprites - these get replaced at resolutions higher than native as shown above by the squares.

Native (64x64 black texture) _00695_f5001_itex_02f20_c_32_11_00_00_00_00

2x Native (128x128 texture) _00694_f5001_itex_02f20_c_32_11_00_00_00_00

gregory38 commented 6 years ago

Wait I remember some code in gsstate that depends on the upscaling. Could you find it and try to toggle it

MrCK1 commented 6 years ago

I'll take a look.

Sorry, I didn't find anything. Are you positive it was in GSState?

gregory38 commented 6 years ago

Check m_nativeres variable. IIRC it impacts some optimizations in vertex processing.

FlatOutPS2 commented 6 years ago

@gregory38 It doesn't seem to affect the issue.

MrCK1 commented 6 years ago

@FlatOutPS2 Did you ever happen to check and see if this issue occurs in custom resolution? (if not I can check later)

I gave it another look last night, didn't rely see anything useful. This is probably my next priority for now, but I did manage to get 2 raw dumps (native and 2x native) within 1 drawcall of each other that may help out later.

FlatOutPS2 commented 6 years ago

No, I never use Custom Resolution (unless I'm specifically testing for CR related issues).

MrCK1 commented 6 years ago

So I was messing around with GSdx hacks and found a partial solution to this issue. Using the large framebuffer hack removes sprites that were previously visible through objects (*about 99%, if you look really hard you can still see them "leaking" through a bit) and reduces the "box-effect" when sprites flicker - you can still see red outlines where the boxes are but it's a bit less distracting now. The flickering effect is still there, and some sprites have the wrong depth (they should be behind the lights, not in front) haven't found a solution to that.

Large Framebuffer disabled: gsdx_20180314154251 gsdx_20180314154719 Large Framebuffer enabled:

gsdx_20180314154301

gsdx_20180314154727

refractionpcsx2 commented 2 years ago

Is this still a problem?