pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

Meta: GSdx top left corner issue

Open gregory38 opened this issue 8 years ago • 119 comments

I'm trying to implement a solution to handle properly the top left corner post-processing effect. Let's centralize information here.

Game impacted (from the top of my head, likely more).

  • [x] MGS 2
  • [x] Prince of Persia
  • [x] Urban Chaos
  • [x] killzone
  • [x] destroy all humans
  • [x] Star wars battle front 1
  • [x] star war battle front 2
  • [x] horsez
  • [x] JamesBondEverythingOrNothing
  • [x] DeathByDegreesTekkenNinaWilliams
  • [x] Catwoman
  • [x] Mercenaries (unfortunately suffer of half screen bug)
  • [ ] Summoner
  • [ ] Stolen
  • [ ] Hitman: Contracts
  • [ ] Midnight Club 2 #2708

Better but still broken

  • [x] MGS3 (codec might suffer from another tc issue)
  • [x] GSC_TouristTrophy (better but still has a couple of issue)
  • [x] kung fu panda (remain plenty of other effects)

Broken due to bad detection of the effect

  • [ ] GSC_Manhunt2 => (will need dedicated CRC shader) #2758
  • [x] Tekken5 => dedicated shader must be good now
  • [ ] Ridge Racer V #1327
  • [ ] Ratchet & Clank #914
  • [ ] Ghost in the shell #1327
  • [ ] GT4 (better but still has a couple of issue) #1313
  • [ ] Steambot Chronicles #2722
  • [x] TalesOfAbyss => dedicated shader must be good now

Need test:

  • [ ] GSC_BlackHawkDown (night filter)
  • [ ] GSC_ZettaiZetsumeiToshi2
  • [ ] tales of legendia

gregory38 avatar Apr 28 '16 18:04 gregory38

having a scan through my games to see if i can find any others that do it.

Destroy All Humans - it's not overly noticable (due to the shadow mess on the screen)but its there. Hitman Blood Money - Seems to have 2 levels of it? one shows more than the other (wrong colour though)

Edit: Totally O/T but you've nearly fixed Driver 3's graphics! The text is still a bit broken but it's readable and most of the texture flicker is gone, you just get the odd little bit now.

refractionpcsx2 avatar Apr 28 '16 18:04 refractionpcsx2

I have a dump of this game, but I don't see it. Maybe not the good scene. However there are various postprocessing effect.

gregory38 avatar Apr 28 '16 18:04 gregory38

ill try and get another one if you'd like, it even does it on the menu, but im not totally sure it's right.

I'm updating that post as i find games btw

refractionpcsx2 avatar Apr 28 '16 18:04 refractionpcsx2

Ok. So far I have enough gs dump to implement somethings

gregory38 avatar Apr 28 '16 18:04 gregory38

Stuntman also crashes with a RAM spike with OpenGL(this happens more often now than on 1.4.0).

FlatOutPS2 avatar Apr 28 '16 18:04 FlatOutPS2

Ok. I'm nearly sure it is a variation of a similar effect. Currently my detection is based on FrameBuffer address == Texture address. However Prince Of Persia. Copy the Framebuffer to another place. So my detection is dull. (and move is badly emulated in texture cache). However detection work nicely for MGS and killzone.

gregory38 avatar Apr 28 '16 19:04 gregory38

That's progress :)

refractionpcsx2 avatar Apr 28 '16 19:04 refractionpcsx2

OK finished going through my DVD ISO's, there wasn't really many that weren't already mentioned that I could find. There might be more but I'm totally not going through all my discs ;)

refractionpcsx2 avatar Apr 28 '16 19:04 refractionpcsx2

Ok. Let's me first try to correct MGS/KillZone. For PoP, I need to find a way to detect the mess. Or maybe we could rely on crc/option.

gregory38 avatar Apr 28 '16 20:04 gregory38

For PoP, I need to find a way to detect the mess. Or maybe we could rely on crc/option.

That all depends how often that effect is used and what drain on performance it is. If this is the only game to use it, or there is a huge performance drop, then yeh, option it (so people have an option)

refractionpcsx2 avatar Apr 28 '16 20:04 refractionpcsx2

Without CRC ;)

sub_rt

The trick is to properly detect the effect. My current implementation replace current draw call by an alternate draw call. Option or CRC will help to avoid side effect. Anyway, I need to find a way to correct the move first.

gregory38 avatar Apr 28 '16 20:04 gregory38

@ssakash you need to check several open issues.

At all I pushed my implementation on master. Time to give it a shot.

gregory38 avatar Apr 28 '16 21:04 gregory38

Good job! ill give it a go :)

refractionpcsx2 avatar Apr 28 '16 21:04 refractionpcsx2

Rachet & Clank - Don't think it ever had this issue, that has mipmapping problems. MGS 3 - Yay looks much better now! :) Prince of Persia - Screen is completely blue GT4 - Still has the weird colours when transitioning between scenes (it was blue this time) Urban Chaos - screen is completely pink tinted but now the box in the top left IS the correct colours and no longer wrong, nor is it sliced! Killzone - has a half screen cut off now. bottom half being darker but you can see the game. Destroy All Humans - Still has the box in the top left, it looks like it is used to fade the background when you have a menu open (this is probably why you never saw it) Hitman Blood Money - Seems to be fixed now! :)

3/6(or 8 if you count possible different issues) fixed! :) i might give you 3.5, half a mark for Prince of Persia ;)

refractionpcsx2 avatar Apr 28 '16 21:04 refractionpcsx2

Killzone already had the half screen issue. The infrared view is now fixed.

Splinter Cell: Pandora Tomorrow infrared view is also fixed.

FlatOutPS2 avatar Apr 28 '16 21:04 FlatOutPS2

Try this hack for killzone UserHacks_ColorDepthClearOverlap = 1 If it doesn't work, I think I know the issue. Various game suffers of this half-screen issue.

gregory38 avatar Apr 28 '16 21:04 gregory38

It doesn't work(yes, userhacks was on).

FlatOutPS2 avatar Apr 28 '16 21:04 FlatOutPS2

Thanks for the test, so it is the 2nd bug ;)

GT seem to be a different issue. Urban Chaos effect is halfly detected. It also moves the RT as pop (but differently).

gregory38 avatar Apr 28 '16 21:04 gregory38

Can confirm (checked with depth enabled on OGL as well, just in case) that the colourdepthclear line doesn't affect Killzone, so yeh, its the half screen issue, which is another one of those affects a ton of games bugs :P

refractionpcsx2 avatar Apr 28 '16 21:04 refractionpcsx2

Oh nice, PoP is pink now. You can chose the rendering for boys or girls ;)

gregory38 avatar Apr 28 '16 22:04 gregory38

Oh nice, PoP is pink now. You can chose the rendering for boys or girls ;)

lol xD

refractionpcsx2 avatar Apr 28 '16 22:04 refractionpcsx2

Hum, actually I think it is working for PoP but it fails to handle the old texture shuffle. It is implemented very strangely (it is maybe not a texture shuffle).

gregory38 avatar Apr 28 '16 22:04 gregory38

I'm sure you'll sus it :)

refractionpcsx2 avatar Apr 28 '16 23:04 refractionpcsx2

My god, I don't know what they smoke but it must be very strong!

Here are the step

  • copy the framebuffer 0x0 to 0x2300
  • channel shuffle: move the red channel (0x0) to others channel (0x2300)
  • change brigthness of 0x2300 to 0x0.
  • texture shuffle: move RGBA_RGBA_... (0x0) to RRGB_ARGB_A...(0x2300) (I think, dunno if it wrap at the end)
  • use alpha channel of 0x2300 to render into 0x0
  • channel shuffle: move the blue channel (0x0) to others channel (0x2300)

....

gregory38 avatar Apr 28 '16 23:04 gregory38

blinks...... blinks again...... tries rubbing eyes...... What the hell??? That seems an awfully long way around doing things.

refractionpcsx2 avatar Apr 28 '16 23:04 refractionpcsx2

Yes it is a nightmare. I don't count the number of texture conversion and the number of draw call to emulate this mess... It is due to the fixed behavior of GS. It will be free on a modern GPU (a single draw call no conversion...) I need to create a new shader to move the blue channel to the alpha channel (for the texture shuffle). I hope will be enough.

gregory38 avatar Apr 28 '16 23:04 gregory38

Fingers crossed.

I feel almost like we should hle this crap and get a fingerprint of the setup of the gs for each type of draw and do it all the pc way and just copy the result back instead of having to do what the gs would normally do.

refractionpcsx2 avatar Apr 29 '16 00:04 refractionpcsx2

Devil May Cry still has the box in the top left corner as well

MrCK1 avatar Apr 29 '16 02:04 MrCK1

@MrCK1 does the game require lots of memory (set scaling to 4x-6x).

@refractionpcsx2 well it is more less what I'm trying to do. I don't emulate texture conversion, and I skip various draw call. But 1 PC draw call can do N GS draw calls (N could be bigger than 300), even a basic effect requires 2/3 GS draw calls. So actually my texture shuffling is partially working so it is maybe not the issue. And finally understood what the game is trying to do with all this mess. It is only a color (gamma?) correction. So rendering is basically

out.r = color_table_r(out.r);
out.g = color_table_g(out.g);
out.b = color_table_b(out.b);

Because GS can access a single channel, the game uses various trick to move thing around. So the first color channel trick will handle the Red. The "old" texture shuffle will do the Green. And the last color channel trick will manage the Blue.

gregory38 avatar Apr 29 '16 09:04 gregory38

Awesome :) I'm expecting the next fix to sort it completely then! :)

refractionpcsx2 avatar Apr 29 '16 09:04 refractionpcsx2