PCSX2 / pcsx2

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

[BUG]: One specific shadow in Xenosaga Episode III is broken on every single renderer #6623

Open MetrosexualGarbodor opened 2 years ago

MetrosexualGarbodor commented 2 years ago

Describe the Bug

This one particular shadow in the ceiling is broken in every single renderer (haven't tried Metal, can't imagine it'd be different). The reason this shadow is peculiar is because I didn't find any other visual bugs in the entire game that also existed in the Software renderer.

image image image image image

And here it is on original hardware: image

Reproduction Steps

memcards.zip Use this save file, load the one labeled "Outer Shell", walk to the right of the screen and you'll see a monster, evade it and go down a little and you'll see it.

PCSX2 Revision

v1.7.3073

Operating System

Windows 10 (64bit)

CPU

i7-10700k

GPU

RTX 3070

Logs & Dumps

gs_20220714043521_Xenosaga Episode III - Also Sprach Zarathustra _Disc2of2__SLUS-21417.zip

rtj503 commented 1 year ago

As of v1.7.531, the issue still appears to be there. Strangely specific failure.

refractionpcsx2 commented 1 year ago

I was curious, so I ran the dump on my PS2

image

Can you try modifying some core settings, like the EE/VU round mode or clamping settings, to see if t hey make a difference? Or maybe the XGKick Sync Game Fix under View->properties->Game Fixes

rtj503 commented 1 year ago

XGKick Sync Game didn't do anything for me. I toggled a bunch of different options, and I found one that did work! It's under the Vector Units. I set "Rounding Mode" to "Positive".

I'd post a file, but Github isn't letting me for some silly reason.

rtj503 commented 1 year ago

I have a Ryzen 9 6900HS APU, and 6700S discrete GPU in my laptop. Running Vulkan. In case that changes anything. Running the latest release.

refractionpcsx2 commented 1 year ago

Do any of the other rounding modes work? or just positive? Nearest would be preferred, if you can. If Positive is the only one can you make sure nothing else in the game breaks, cos it can be detrimental, depending on how sensitive the game is.

Thanks for checking :)

rtj503 commented 1 year ago

Only "Positive" works at all. I tried setting the game to my integrated graphics, as well as to my graphics card, and it made no difference. I didn't notice anything else breaking in the Zarathustra dungeon, everything looks fine to me. Only way to know would be to play the whole game through. I've played the game on PCSX2 a few times, sometimes finishing, sometimes not. I tested some areas of known instability. It doesn't seem to cause any extra instability in those areas. It also didn't fix any known issues anywhere else, just on that one very specific triangle, huh? The Elsa Hangar is still crashing on newest Nightly Builds.

refractionpcsx2 commented 1 year ago

if you could play a good couple of hours of the game like that, that would be awesome! if it's stable then we can add that to the gamedb, and everybody's happy :)

I do appreciate your thoroughness!

rtj503 commented 1 year ago

There's actually several things I'd add to the GameDB on this specific game. I'm not a coder, but it seems you'd be willing to add that for me. How about this. I'll play through it tomorrow for a while, check out known problematic areas, and I'll test it out on my Desktop computer with Nvidia graphics, as well as my old laptop with an Intel CPU/iGPU. If all check out, I think we could consider it a reasonably stable setting.

refractionpcsx2 commented 1 year ago

hey if you can tell me what settings the game needs, then we can test it and add them :)

rtj503 commented 1 year ago

Sure, I have a pretty good idea. I'll test out my other findings on my other machines, and if those check out, I'd be confident in sharing those findings too in this thread tomorrow. Sounds like plan.

rtj503 commented 1 year ago

So I think I can confidently say that setting the VU Clamping mode to "Positive" doesn't cause any instability. I played a ways into the game, and I tested out the game on both my laptop that has dual integrated (680M) and discrete (6700S) AMD graphics, and my desktop, which has Nvidia graphics (RTX 3060). It's pretty crazy that this one setting only has one use, which is to fix a single black triangle in one dungeon near the end of the game. The benefits are hilariously minimal, but there are also no downsides. I've emulated Xenosaga 3 on many a different machine, and I never noticed any of the clamping modes doing much of anything. I also tested out several problematic areas. The most difficult to emulate sections appear to be 1) The sepia-tone flashback scenes, sometimes half the screen goes all weird 2) Close-up scenes (likely containing higher poly models) that sometimes turn the background completely black 3) When characters see U-DO, the game doesn't like its particle effects 4) When too many ES's go into Anima mode, the vapors seem to cause slowdown 4) The final Zarathustra Dungeon, with its reflections 5) cutscenes involving reflections and shadows. Shadows appear pixelated. The Positive VU clamping didn't effect any of these problem areas, and I played the game for about an hour at 300% speed, so I think it works pretty well. A single friggin' triangle. Also, if you're curious, I did two in-depth tests on previous builds on this forum thread. https://forums.pcsx2.net/Thread-Xenosaga-Episode-III-Also-Sprach-Zarathustra-SLUS-21389-U--28443

rtj503 commented 1 year ago

Also, the hangar in the Elsa cause some emulation problems too. It has a transparent railing the game doesn't like, and I think all the poly's on the giant robots sometimes cause the game to crash. The effects on the save points used to cause problems in previous builds, but not anymore.

rtj503 commented 1 year ago

As for possible GameDB improvements. After testing on both of my machines (I couldn't find my old Intel machine, oh well), I came up with a few settings that appear to work on each of my setups, and I know these options work pretty well on my other machines in the past as well. Set default renderer to Vulkan or OpenGL. The behavior on each appear to be the same as far as glitches go. But Vulkan is faster than OpenGL. DirectX12 is faster and smoother than Vulkan, but it also exhibits a screen glitch where the screen cycles between light and dark, which makes the game unplayably distracting. This glitch is also present on DirectX11 but it isn't present on DirectX9. If it wasn't for this glitch, I'd have played the game on either of the DirectX's. Set CRC Hack to "Aggressive". This fixes a lot of issues. Unfortunately, it also removes the sepia-filter from the flashback scenes, but the added speedup, stability, and accuracy is easily worth it. Compatible on several machines. "GPU Palette Conversion" needs to be on, otherwise the game crashes on the newest builds. Absolutely essential on all renderers for my AMD machine. Didn't do anything on Nvidia. Didn't cause any performance problems on Nvidia having the option on though. "Half-Screen Fix" has always worked well when set to "Force Disabled". Still does. "Disable Safe Features" used to help a lot on previous builds, now it doesn't appear to have much effect. Doesn't hurt though. "Texture Preloading" did nothing. No benefits, no downsides. "Auto Flush" doesn't seem to do anything either. I suppose it helps on some people's builds. Doesn't seem to hurt either now, might as well keep it. "Preload Frame Data" used to cause significant slowdowns on previous builds. But now it doesn't appear to cause any issues. On my AMD machine, it is also essential that it be turned on alongside "Texture Inside RT" to fix the reflection issues in the Zarathustra Dungeon. The reflection issue is still a problem on my Nvidia machine, nothing works to fix that issue. Unfortunately, Text in RT causes some odd color patterns on the edges of the screen in other sections of the game on my Nvidia machine. Works as expected on AMD machine though, no problems.

I always set "Half-Pixel Offset" to "Special - Texture" for Vulkan/OpenGL and "Normal - Vertex" for DirectX. Neither option works well for either renderer on Nvidia though. Nvidia used to work better on previous builds, now it works worse. Set "Round Sprite" to "Full". Fixes some minor menu problems, doesn't cause any problems elsewhere. "Align Sprite" and "Merge Sprite" also solved some minor graphical issues. Never caused problems on any of my machines. Each of the options on this menu screen never caused any compatibility issues on any of my machines.

And there you have it.

refractionpcsx2 commented 1 year ago

Autoflush made the shadows appear in earlier installments of Xenosaga, I don't know about 3.

As for stuff you want adding to the GameDB, can you give examples of what they fix, you basically listed every hw hack here, and most of them aren't relevant to Xenosaga (some don't even have gamedb settings).

We can do like Half Pixel Offset and Round Sprite, Align Sprite etc... but we need examples (preferably GS dumps) of the problems those are fixing rather than just anecdotes, if that's okay with you?

That said, we already set HPO Special, Round Sprite full and Autoflush on automatically in the GameDB, so most of your problems are solved if you just don't enable manual fixes.

rtj503 commented 1 year ago

I just mentioned the upsides and downsides of several options I chose. It's up to you what you think is worth it. Keeping them off doesn't "solve" most of the graphical problems at all. The game requires manual fixes as the default options do not fix things. Every hack I mentioned is relevant depending on past builds. The only problem is, what options help or harm changes depending on the build - so what is relevant changes. AMD graphics and Nvidia graphics yield pretty different results too. How does GameDB work? Is it graphics architecture specific or one-size fits all? Do the defaults change depending on the Graphics API you choose?

I can't upload files, Github keeps saying "Something went really wrong, and we can't process that file. Try again." Otherwise I'd include more. Sorry. I'd contribute but if GitHub isn't cooperating there isn't much I can do.

refractionpcsx2 commented 1 year ago

okay but I would still like GS Dumps of the areas where you feel the options improve things, it would be nice for us to see it ourselves too.

you can use google drive or something if you can't upload here.

rtj503 commented 1 year ago

How should I get it to you then if not over GitHub? Forums?

refractionpcsx2 commented 1 year ago

Google drive, any number of file upload services, plenty of options :)

rtj503 commented 1 year ago

I'll upload a few things. How do I share it with you?

refractionpcsx2 commented 1 year ago

just pop the links here direct to the files :)

rtj503 commented 1 year ago

https://drive.google.com/file/d/1WGnHRwzGFrExKUgXmjSGp_zWavMNbiSe/view?usp=sharing https://drive.google.com/file/d/1WVOhs7ggSknPeNcIhKfSf19up28rxJyI/view?usp=sharing https://drive.google.com/file/d/1qLXsKm_ZgjAeg19Ta6aPNTPX9jXdWJE6/view?usp=sharing The game crashes on AMD graphics without GPU Palette Conversion. That's the evidence, one image has to be a screen shot from Windows since PCSX2 completely crashes on both discrete and integrated graphics.

refractionpcsx2 commented 1 year ago

X3 GS Dump for same area.zip

Uploading the GS Dump here

refractionpcsx2 commented 1 year ago

Okay so I tried Align Sprite and Merge Sprite as you suggested and my results on your GS Dump were as follows

Align Sprite: Didn't seem to do a lot, but caused the lighting on the elevator/door thingy at the back to have some kind of bars instead of being smooth.

Merge sprite: removed all the bloom lighting from the scene, not every authentic.

HPO Special + Round Sprite Full are already on by default, so nothing to change there. Autoflush is also auto, and unlike you said before, it does infact do something and make the shadows show.

Was there anything else you wanted me to check?

rtj503 commented 1 year ago

I suppose it's all a matter of taste, it fixed some specific things for me, but I'd have to really hunt down every example. Your choice, as I said.

And then here's the evidence that the Zarathustra Dungeon requires both Preload Textures and Text in RT to be on at the same time in order to work. Here's a link to the entire folder. However, Text in RT does cause some yellow artifacting on Nvidia graphics in some areas while not even fixing the Zarathustra reflections. I'd have to hop on my other computer to prove that though. But it's completely compatible on AMD, even though the fix is...blurrier than on the original hardware than I remember - it's not that much artistically different, and it's exponentially better than before. https://drive.google.com/drive/folders/1eFNZ-ytpz0bDh6v1LHVDuGRJxpn9MdTW?usp=share_link

rtj503 commented 1 year ago

Any other issue I mentioned you're curious enough about to have me research? I won't research anything you wouldn't find relevant.

refractionpcsx2 commented 1 year ago

No need to make a GS dump for each version of the options, the dump is made before any options anyways, so I can toggle them on my end to see the difference with just one dump :)

I see what you mean, preload and Tex in RT seems to fix it, cool, okay that should probably be added then!

refractionpcsx2 commented 1 year ago

I don't know why your AMD hardware is crashing, that's news to me. do you get a .dmp crash file in your PCSX2 folder after it crashes? we might be able to see what happened.

you will need to .zip the file to upload it here.

refractionpcsx2 commented 1 year ago

bad news on the tex in rt thing, it causes other problems, it did previously have that https://github.com/PCSX2/pcsx2/pull/6612

rtj503 commented 1 year ago

I kinda figured the Text in RT thing would. It only works properly on AMD graphics. And even then, it only seems to work on my RDNA2 graphics. Could be useful knowledge for the Steam Deck maybe. It just messed up my Vega iGPU exactly in the manner that bug listed. I could test it out again later though. Although that laptop only has Linux on it now.

Otherwise, sure, I can make it crash and upload some of the crashes for you. The Hangar of the Else is a great place to make the game crash. Doesn't crash literally anywhere else I can find. Text in RT and Preload Frame Data effect the nature of the crash: Without either, the game crashes with a bunch of yellow junk data all over the screen. No crash file produced. With both ON the game merely freezes. No crash file produced. But with Preload Frame Data alone, the game freezes and crashes in such a way that it actually does produce a crash file. With Text in RT alone, it just freezes with no crash file. I also included a pre-cash GS dump, right before it normally happens. https://drive.google.com/drive/folders/15T56VE2r8ZOBZkGLg_zYaUbph8yAMaoy?usp=sharing

rtj503 commented 1 year ago

Dude, why the HE-double-hockey sticks is the game all of a sudden working in this area after I made it crash 20 effing times? I have tons of graphical problems, but no crashing. It all of a sudden stopped crashing. Absolutely ludicrous, and it works on default and manual options.

rtj503 commented 1 year ago

Dude dude dude. But walking around, despite the fact that the game isn't crashing, I can't make a GS Dump, and the game crashed when I tried to make a Save State. That's totally crazy. I ought to make a YouTube video of it to prove it.

rtj503 commented 1 year ago

Okay. The video link is here. https://drive.google.com/file/d/1uhmpGu8-ktXFmQzNf0M-0iTy3Vz9ZwIj/view?usp=sharing Windows video capture couldn't show me trying to make a GS Dump or a Save State, but you can guess it by the mouse behavior. I'm gonna go work on something else now.

refractionpcsx2 commented 1 year ago

Hey just in case the guy who did #6612 isn't around, any chance you could check this out again on #8016 and see if it's still OK, and if you can check those other things they mentioned were broken, that'd be amazing, if it is okay, I'd you could confirm it happens still on master.

Just to be sure to enable all the fixes that get disabled also, it'll tell you in the top right what they are when you enable manual fixes

Thanks :)

rtj503 commented 1 year ago

The dark triangle thing? The dark triangle is still there. Was the rounding mode options taken out? Can't find it. No changes to the broken reflections in Zarathustra Dungeon. They still look the same. I could upload a picture, but it looks the same as always without or without Text in RT or Texture Preloading enabled. I have been able to go to the Elsa hangar without it crashing on most builds recently. A lot of junk textures would flash on screen like the Zarathustra Dungeon reflection junk textures. This most recent build is just straight up crashing though at the same place as it used to in the past.

refractionpcsx2 commented 1 year ago

Did it not need Tex in RT and Preload Textures?, I don't know if the rounding mode thing ever got added cos I thought we discovered it was Tex in RT :/

rtj503 commented 1 year ago

No, the black triangle was always there. In order to fix it you'd need to set Vector Clamping mode to "Positive" or the EE clamping mode to "Extra + Preserve Sign".

What happened was, we got off track and starting testing the broken reflection in the Zarathustra Dungeon, and the crashing in the Elsa hangar. The discovery was that in order for Tex in RT to fix the issues in the Zarathustra Dungeon, Preload Textures would also need to be checked as well. It had nothing to do with the black triangle. Testing it out, no setting fixes the reflectivity issues, and the Elsa Hangar is back to crashing again. Tex in RT had no effect on the Elsa Hangar crashing ever I'm pretty certain.

refractionpcsx2 commented 1 year ago

Ah right :D Yeah that broken reflection seems to need Tex in RT, but possibly preload frame too? It's hard to tell from a GS dump, kinda skews the results with preload.

If it's just Extra + sign on the EE, we can do that, I like that idea more than messing with the rounding!

rtj503 commented 1 year ago

Sounds good to me. I've played the game all the way through twice on PCSX2 thus far. I've never found any stability issues related to the EE or Vector settings.

The Tex in RT setting only sometimes fixes the reflections, and the Elsa Hangar only sometimes crashes. They're both constantly switching between working and not working depending on the build.

refractionpcsx2 commented 1 year ago

well That's why I'm wondering if Tex in RT is any better now (the changes are now live in main builds) as I have done some modifications to it

rtj503 commented 1 year ago

Alright, I downloaded the newest of the new build, and the problem is still there though. I could upload the picture, but the problem is the same as always. Elsa Hangar is still crashing too.

rtj503 commented 1 year ago

Elsa Hangar isn't crashing on newest build. No junk textures appearing either. No change on Zarathustra.

refractionpcsx2 commented 1 year ago

no crashing is a good start, idk what changed. I'd need a crash dump to see why it crashed.