Lyall / MetaphorFix

A fix for Metaphor: ReFantazio that adds ultrawide/narrower support and much more.
MIT License
339 stars 5 forks source link

Misaligned/Badly Scaled Bloom or Glow #57

Open GeorgeKe13 opened 3 weeks ago

GeorgeKe13 commented 3 weeks ago

I haven't seen pretty much anyone talking about this, and at first I really thought I was just seeing things, but it looks like the PC port has very badly scaled bloom/glow on the characters. And it also has a very weird cross pattern on it. I tried to gather as many examples of what I'm talking about to make it clear. Honestly I have no idea if this is even fixable or if the glow is just ruined on PC, but it's worth a try.

system2ckc commented 2 weeks ago

Yeah you can see it alot on lamps too. This is very similar to some of the issues emulators run into as well. When you set the game to 1080p it doesn't exhibit this behavior, probably some scaling issues with those effects. From what I understand usually games are not suppose to scale bloom and such, but Metaphor does for whatever reason.

GeorgeKe13 commented 2 weeks ago

When you set the game to 1080p it doesn't exhibit this behavior

Weird... This is not the case for me. My monitor is 1080p, and it looks exactly how it does in the gifs.. If you look at the 2nd gif, its definitely less noticeable the lower you set the resolution, but it's still not scaled properly. If it looks normal on your monitor, can you get a screenshot and post it here?

system2ckc commented 2 weeks ago

When you set the game to 1080p it doesn't exhibit this behavior

Weird... This is not the case for me. My monitor is 1080p, and it looks exactly how it does in the gifs.. If you look at the 2nd gif, its definitely less noticeable the lower you set the resolution, but it's still not scaled properly. If it looks normal on your monitor, can you get a screenshot and post it here?

Look at the lamp on the left/middle https://imgsli.com/MzA4NjAz Its probably still not going to match the ps5 1:1 because the ps5 isn't running at 1080p, but from what I can see it is still rendering correctly. The ps5 probably just handles the scaling properly, where as the PC is giving the crosshatch grid artifact at higher resolutions past 1080p.

system2ckc commented 2 weeks ago

Diagnosed the issue.

You must boot the game on full-screen mode set in the options. If it's boot in windowed borderless, and then changed to full-screen after it won't be fixed. It has to be booted in full-screen mode first, changing options after is fine. But, if its not full-screen mode on boot up it will glitch out again.

https://imgsli.com/MzA5NDcx

Its possible it still isn't 100% match for the ps5 but atleast its not showing the crosshatch artifact anymore.

GeorgeKe13 commented 2 weeks ago

Diagnosed the issue. You must boot the game on full-screen mode set in the options. If it's boot in windowed borderless, and then changed to full-screen after it won't be fixed. It has to be booted in full-screen mode first, changing options after is fine. But, if its not full-screen mode on boot up it will glitch out again.

I was very hopeful when reading your comment. But sadly I didn't see a difference on my build... Here is how it looks when booted the game on Full-screen, 1920x1080, 100% Resolution: mpv-shot0002 I also tried at 150%, the hatching was still visible.

Also since I haven't gotten at the point you are, I can't really test the lamps. Maybe its just not as noticeable there. By the way I'm running on: AMD RX 6600XT, Ryzen 9 5900X. If that helps at all.

Foul-Tarnished commented 2 weeks ago

Did you try 100% + DSR 4x ? Instead of 200% It seems to be slightly less broken, though I skipped the cutscene before making a screenshot, and I don't have a save before that scene

system2ckc commented 2 weeks ago

Diagnosed the issue. You must boot the game on full-screen mode set in the options. If it's boot in windowed borderless, and then changed to full-screen after it won't be fixed. It has to be booted in full-screen mode first, changing options after is fine. But, if its not full-screen mode on boot up it will glitch out again.

I was very hopeful when reading your comment. But sadly I didn't see a difference on my build... Here is how it looks when booted the game on Full-screen, 1920x1080, 100% Resolution: I also tried at 150%, the hatching was still visible.

Also since I haven't gotten at the point you are, I can't really test the lamps. Maybe its just not as noticeable there. By the way I'm running on: AMD RX 6600XT, Ryzen 9 5900X. If that helps at all.

I've done some further testing. It does fix it for bigger bloom sources I.E lamps and windows. It seems smaller bloom sources like the effect in your screenshot where precision is required will still show the crosshatching artifact. So when your able to get to a good test area you can try my method again. It should atleast fix the bigger bloom artifacts.

GeorgeKe13 commented 2 weeks ago

Did you try 100% + DSR 4x ? Instead of 200% It seems to be slightly less broken

I'll have to check, though since my game lags a lot on 200% already, I don't think it's going to run great at 4k Super Resolution.

I've done some further testing. It does fix it for bigger bloom sources I.E lamps and windows. It seems smaller bloom sources like the effect in your screenshot where precision is required will still show the crosshatching artifact. So when your able to get to a good test area you can try my method again. It should atleast fix the bigger bloom artifacts.

I see! Honestly thanks a lot for the help, comparing my 100% Borderless screenshot with the 100% Full-screen, the Full-screen one does look slightly better, though as you said, the small bloom sources still look broken. My main issue was to see if this is something that can be completely fixed to look like the PS5 version, and since this doesn't look to be feasible, I can live with it. Though I am still saddened that not enough people talk about it, so there's less of a chance for Atlus to see it and do something about it in a future patch.

Foul-Tarnished commented 2 weeks ago

image

It looks soooo bad, we really need a fix, or workaround; to fully disable bloom

Lyall commented 1 week ago

So I've looked at this a bit and while I don't have a solution yet, I do have some information to share that might help at least. For one, the bloom is rendered at quarter native res (it is unaffected by the resolution scale). In what little knowledge I have on the topic of bloom, this seems to be fairly typical and I don't know that being rendered at quarter-res is causing these visual errors.

I've had a look at a capture with NSight and I imagine tweaking some of these values might produce more appropriate results. image

Looking at the game code, this specific section when adjusted produces different results with bloom.

METAPHOR.exe+10D5516 - C5FA1005 5A 971601    - vmovss xmm0,[METAPHOR.exe+223EC78] { (159.33) }
METAPHOR.exe+10D551E - C57A1005 8E 536C00    - vmovss xmm8,[METAPHOR.exe+179A8B4] { (0.90) }
METAPHOR.exe+10D5526 - C5C258CE              - vaddss xmm1,xmm7,xmm6
METAPHOR.exe+10D552A - C50A5ECE              - vdivss xmm9,xmm14,xmm6
METAPHOR.exe+10D552E - C57829AC 24 50 010000 - vmovaps [rsp+00000150],xmm13
METAPHOR.exe+10D5537 - 49 8D 9D 5C010000     - lea rbx,[r13+0000015C]
METAPHOR.exe+10D553E - C57A102D F6 686C00    - vmovss xmm13,[METAPHOR.exe+179BE3C] { (0.50) }
METAPHOR.exe+10D5546 - C50A5ED7              - vdivss xmm10,xmm14,xmm7
METAPHOR.exe+10D554A - C5FA103D AE 3C6C00    - vmovss xmm7,[METAPHOR.exe+1799200] { (Nan) }
METAPHOR.exe+10D5552 - C5FA5EF1              - vdivss xmm6,xmm0,xmm1
METAPHOR.exe+10D5556 - C57829BC 24 30 010000 - vmovaps [rsp+00000130],xmm15
METAPHOR.exe+10D555F - C57A103D D9 756D00    - vmovss xmm15,[METAPHOR.exe+17ACB40] { (8.00) }
METAPHOR.exe+10D5567 - C5FA1175 BC           - vmovss [rbp-44],xmm6
METAPHOR.exe+10D556C - C57A114D C4           - vmovss [rbp-3C],xmm9
METAPHOR.exe+10D5571 - C57A1155 C8           - vmovss [rbp-38],xmm10

METAPHOR_2024_10_23_11_31_05_814 METAPHOR_2024_10_23_11_35_44_631

Lyall commented 1 week ago
> METAPHOR.exe+10D462F - C5FA109C 1E C8 030000 - vmovss xmm3,[rsi+rbx+000003C8]
METAPHOR.exe+10D4638 - 41 B8 05000000        - mov r8d,00000005 { 5 }
METAPHOR.exe+10D463E - 48 8B 01              - mov rax,[rcx]

XMM3 here seems to contain the "toonBloomScale" value referenced in the pixel shader. If you adjust that to 0 and check again with NSight, you can see that it has changed.

image

METAPHOR_2024_10_23_11_43_14_182

Foul-Tarnished commented 1 week ago

The first screen looks way better, really excited for a fix/workaround from your part

Altough there is still a sort of fake X cross of light beams (I mean like how you see lights when you squint your eyes, or how some stars look through some telescope) https://github.com/user-attachments/assets/c1c15b86-657d-47bc-857d-2667910fd5e0

You can see on Grius a few \ of bloom on him (idk why \ is more visible than / on characters, unlike lanterns)

This is probably another shader, made as a sort of "artistic" choice, because I never saw any bloom effect make that, at least not as prononced and so big/long

GeorgeKe13 commented 1 week ago

The first screen looks way better, really excited for a fix/workaround from your part Altough there is still a sort of fake X cross of light beams (I mean like how you see lights when you squint your eyes, or how some stars look through some telescope) You can see on Grius a few \ of bloom on him (idk why \ is more visible than / on characters, unlike lanterns)

I think these light beams are like that in the PS5 version too, and don't have to do with bloom. Basically I think they're meant to look this way.

Foul-Tarnished commented 1 week ago

I think so too, but ngl it looks bad. If it was tuned down (not in intensity, but in length) it would look better

You would never see lights like that, jnless you have some eyesight issue, and still it wouldn't be that stretched out, or at least thinner and brighter, not a that long and hazy

The "StarScale" in NSight look like it could control this weird effect

I wonder what the diff between toonBloom and Bloom is

GeorgeKe13 commented 1 week ago

So I've looked at this a bit and while I don't have a solution yet, I do have some information to share that might help at least.

Thanks a lot for taking some time to look through this issue! I'm not sure if it can be fixed or not, but honestly at this point I wouldn't even mind playing with Bloom disabled.

Foul-Tarnished commented 4 days ago

This mod to disable archetypes glow is a good workaround

Though it doesn't fix the underlying issue, you can still see the broken bloom on lightsources, and with the sword glow in his screenshot: image Unless these awful blurry lines are coming from something else ?

Randy28CR commented 2 days ago

So I've looked at this a bit and while I don't have a solution yet, I do have some information to share that might help at least.

Thanks a lot for taking some time to look through this issue! I'm not sure if it can be fixed or not, but honestly at this point I wouldn't even mind playing with Bloom disabled.

Same

GeorgeKe13 commented 2 days ago

This mod to disable archetypes glow is a good workaround

I mean this is something, but I don't like the fact it has to completely remove the orange archetype patterns from the characters. I feel like without them, they look kinda bland. Plus as you said, this would only get rid of the visible issues on the characters, and not on anything else, while also removing a part of the game that I visually like. So it doesn't feel like good exchange for me...

Randy28CR commented 2 days ago

I wanted to humbly share an update on something, even though I am not an expert. Although I am not able to replicate a 1 o 1 escenario like some of you did here, I tried something nobody here stated to do, as far as I can tell.

I am currently playing on Steam, however, I also have an Xbox Series X. I have downloaded the demo there and I have reached out to Grand Trad at night. I went there on my PC save as well.

According to Digital Foundry, PS5 and XSX versions run at a weird 1656p, so thanks to MetaphorFix I was able to set the internal scale to 1644p (0.76 of 4k).

After checking many light sources in the city and battles throughout different enviroments, I have noticed pretty much the same behavior in bloom in both versions when in comes to Archetypes, lamps, candles, windows and more stuff like that. If there are differences in those escenarios I tested, there is no way a normal person can tell them unless they are veeeery close to the screen and have a very trained eye.

I do not dare to say there is nothing broken exclusively on the PC version regarding bloom effect, as I have not been able to replicate the Strolh awakening like some of you did in both devices (due to time, mostly), but I do not see the bloom stuff as a PC version issue per se. I do believe that, if Atlus patched the game for PS5 Pro to run at 4k 100% internal scalling, it would have the same bloom issues PC has at 4k 100%., or at least veeeeery similar.

So I think what it might be needed is finding the sources of this issue and make it stop getting broken when increasing resolution. Of course I don't know if this this possible, but that would really be a nice QoL fix and very future probing.

As everything addressed by Lyall in his awesome mod, this seems to be a problem with how the game has been build. Unless Lyall or some other modder gets anything after a lot of research or devs actually care, we will have to deal with either shimmery image with correct bloom or cleaner image with incorrect bloom rendering.

GeorgeKe13 commented 19 hours ago

According to Digital Foundry, PS5 and XSX versions run at a weird 1656p, so thanks to MetaphorFix I was able to set the internal scale to 1644p (0.76 of 4k).

Incredible! This really did get rid of the problem! And to show the results in the scene you weren't able to check, I tried it myself.

TEST1 TEST2 TEST3

But now I'm curious... Could we somehow, make it so I can play this without having to boost my game to 4K? Cause my graphics card isn't really built for this resolution (it was chugging bad), and in any case my monitor is 1080p... I feel greedy for asking this, but it just feels like we're one step closer to potentially fixing this for any resolution. (Though of course I'm saying that without knowing a thing about modding)

Randy28CR commented 18 hours ago

According to Digital Foundry, PS5 and XSX versions run at a weird 1656p, so thanks to MetaphorFix I was able to set the internal scale to 1644p (0.76 of 4k).

Incredible! This really did get rid of the problem! And to show the results in the scene you weren't able to check, I tried it myself.

TEST1 TEST1 TEST2 TEST2 TEST3 TEST3

But now I'm curious... Could we somehow, make it so I can play this without having to boost my game to 4K? Cause my graphics card isn't really built for this resolution (it was chugging bad), and in any case my monitor is 1080p... I feel greedy for asking this, but it just feels like we're one step closer to potentially fixing this for any resolution. (Though of course I'm saying that without knowing a thing about modding)

I don't think that is possible unless devs or Lyall actually find a way to make the bloom behave as it behaves at 4k 0.76% of internal res regardless the resolution chosen. I also have to be very honest with you, George: I am a PC gamer with a very trained eye. At 4k 100%, I have only been able to notice a problem with bloom in two escenarios: in the awakenings (which is the one you have focused a lot) and in the animation of characters when you unlock a new archetype. The rest like in battle, lamps and more stuff, the difference in bloom between 4k 0.76% and 4k 100% is stupidly hard to notice. It exist, but at least in my case, I am not able to notice itnwhile playing on a 4k tv at 2m from the screen. I can start noticing it when I set it up to 4k 150% though. There the bloom on characters in battle definitely start looking misaligned. Would you be so kind to make a comparison like the one you have done with Strolh, but actually in battle, in that dungeon, to the character model and its glowing effect? I assure you if you make a 4k 0.76% vs 4k 100%, the difference will be very hard to notice in that escenario, which is the most important one in the end. I ask you this because I think you are focusing in the worst case escenario and, according to my findings, in the most part of the game bloom is not broken like that whatsoever, at least at 4k 100%.

Also, It seems like they used a base of 1656p for consoles and did not measured the scalability, going up and down. I have informed Atlus directly via ticket, but I have more faith on Lyall doing something if he wants that Atlus wanting to fix it. As said, if PS5 pro boosts this game's res, that version will have the same problem unless devs actually fix that by playing with the code.

I can say for sure that at 4k 0.76% the game's bloom works as intended everywhere, but looks very shimmery. At 4k 100% the bloom issue is only noticeable in two escenarios that represents nothing while playing: awakenings cinematics and new new archetype animation in Academia. This while the image looking way more clean. So this last one is the sweetest spot as of now imo.

GeorgeKe13 commented 17 hours ago

I assure you if you make a 4k 0.76% vs 4k 100%, the difference will be very hard to notice in that escenario, which is the most important one in the end.

I understand. This issue is mostly just me trying to get the game to look as it was intended to look (The console versions), it really isn't that visible outside of these cutscenes (in 4K).

Though it definitely still is visible on my end (in 1080p), since I have a 1080p monitor and I sit right in front of it, where I have to bump up the game to 150% or so just to make it not look super jagged. Thus increasing the intensity of the issue at the same time...

I ask you this because I think you are focusing in the worst case escenario and, according to my findings, in the most part of the game bloom is not broken like that whatsoever, at least at 4k 100%.

The reason why I used the awakening scene to begin with, was exactly the fact it was the most obvious during it. So it would be clearer to everyone what issue I'm even talking about. I understand its not as visible anywhere else.

Still I really appreciate your help here! Now it's up to whether or not its possible for Lyall to do anything with it, or if it's just something genuinely unfixable/not worth the trouble...

Randy28CR commented 17 hours ago

I assure you if you make a 4k 0.76% vs 4k 100%, the difference will be very hard to notice in that escenario, which is the most important one in the end.

I understand. This issue is mostly just me trying to get the game to look as it was intended to look (The console versions), it really isn't that visible outside of these cutscenes (in 4K).

Though it definitely still is visible on my end (in 1080p), since I have a 1080p monitor and I sit right in front of it, where I have to bump up the game to 150% or so just to make it not look super jagged. Thus increasing the intensity of the issue at the same time...

I ask you this because I think you are focusing in the worst case escenario and, according to my findings, in the most part of the game bloom is not broken like that whatsoever, at least at 4k 100%.

The reason why I used the awakening scene to begin with, was exactly the fact it was the most obvious during it. So it would be clearer to everyone what issue I'm even talking about. I understand its not as visible anywhere else.

Still I really appreciate your help here! Now it's up to whether or not its possible for Lyall to do anything with it, or if it's just something genuinely unfixable/not worth the trouble...

I get your point. I would be pissed off knowing such issue is tied to a internal screen percentage regardless the resolution... I have a 3070 and a 4k tv so I am playing there and having a blast. As I want the game to be as polished as possible, specially for future probing, I have submitted a ticket to Sega with the images you provided. It would be a cool idea if you can do the same: https://support.sega.com/hc/ja/requests/new?ticket_form_id=9956344998033

Make sure to translate it to japanese. It can be a pain in the *, but hey, that is what you can do in the meantime. Btw, do you have an Nvidia GPU? Normally, at what internal res you play? (I mean 10800 ???%) As the issue seems to be you need to put the internal res to 76% (idk if it works for 75 as well), there is a tip I could give you.

GeorgeKe13 commented 17 hours ago

I have submitted a ticket to Sega with the images you provided. It would be a cool idea if you can do the same:

I'll make sure to do so! Though I don't expect much from them, since they haven't even bothered to fix the 8-way movement. (Thankfully Lyall has)

Btw, do you have an Nvidia GPU? Normally, at what internal res you play? (I mean 10800 ???%)

I have an AMD GPU, I mentioned it in one of my earlier posts. Its an AMD RX 6600XT GPU, and a Ryzen 9 5900X CPU. And I usually play at 125% or 150%. I did try lowering the internal res to 76% while setting the game to 1080p, and the issue was still there. It was only fixed while at 4K (Super Resolution) at 76% internal.

Randy28CR commented 17 hours ago

So it seems like that effect is pretty much tied to that 1656p ish, cause 0.76% is actually 1643p and still works as intended. Unless the bloom is broken in those resolutions as broken as it is when you go below 4k 125%, the option you might have is playing the game at 4k 0.76% but 30fps. I know it is not ideal, but this is why we gotta push devs in order to provide visibility and hopefully it be addressed (I dont think so, but I always try). I have created 2 tickets + posting on bug disscusion thread of the game on Steam in both japanese and english. Not for now, as I am really enjoying it at 4k 100%, but what about if I had to go to a lower end GPU or if I get a beast in the future so I can get to 200%, the image is clean af but bloom is trash? I try to put myself in those escenarios and that is why I push for it when I like a game. Hopefully Lyall can get something, although I would not blame when if he finds no success. This, just like many stuff in MetaphorFix, is stuff devs should have to take care when QA. It is a shame... Worst part is console version SUCK HARD, man. And PS5 pro would get this same issue if they patch it and just increase internal res.

GeorgeKe13 commented 15 hours ago

I know it is not ideal, but this is why we gotta push devs in order to provide visibility and hopefully it be addressed (I dont think so, but I always try). I have created 2 tickets + posting on bug disscusion thread of the game on Steam in both japanese and english

I've sent them a report about this issue as well. I tried to get my request as clear and simple as possible, and translated it through DeepL to Japanese (Its probably not even close to perfect, but oh well).

Worst part is console version SUCK HARD, man. And PS5 pro would get this same issue if they patch it and just increase internal res.

Can you imagine if they somehow fix that issue on the higher resolution PS5 Pro version, but never bother to fix it for PC? I guess it would be a very Atlus thing to do.

Randy28CR commented 15 hours ago

I used that trick as well hehe. The important thing is that reaches to the guys in charge of the game. I don't think they would only fix that on PS5 Pro if they find it.

If it was an "easy fix" spread all over the code, I bet you they would just tweak it, just like Lyall has tweaked a bunch of things. I think this has something to do with deeper and a bit more complex stuff, like models or shaders. I actually think a PS5 Pro patch could actually let them know what is going on so they can fix it, or at least make it better than how it is rn. If they release the PS5 Pro patch and it is pretty much tweaking to 4k %100 res, it will definitely have that bloom issue in those particular scenarios. Let's cross fingers something cool ends up happening