RPCS3 / rpcs3

PS3 emulator/debugger
https://rpcs3.net/
GNU General Public License v2.0
14.7k stars 1.87k forks source link

Jak Collection/inFamous 1 Broken Refracting Particles #11149

Open JimScript opened 2 years ago

JimScript commented 2 years ago

Throughout the Jak collection, the particles that refract the scene are broken, even though other refracting effects like water and the scattershot work fine. Some parts of the particles mesh with the scene which leads me to believe this is a uv problem.

Jak and Daxter: BCUS98281_screenshot_2021_11_12_11_48_23 BCUS98281_20211112114854_capture.zip

Jak II: BCUS98281_screenshot_2021_11_12_11_51_28 BCUS98281_20211112115137_capture.zip

System:

JimScript commented 2 years ago

I tried to get a photo of a real ps3, but when the effect is working correctly it is hard to see. 0405221653_HDR 1 0405221653a_HDR 1

kd-11 commented 2 years ago

Maybe you can circle or highlight the difference? I have no idea what this is about otherwise (never played jak)

P.S By highlight I mean, with like a red circle and arrows and such.

MSuih commented 2 years ago

The Jak II scene is supposed to be an air vent blasting hot air out. In his last image you can see it slightly distort the image. In the first post the same distortion effect looks like some ice cubes were stacked on top of the vent or something. You're not supposed to see the edges of the effet so sharply.

JimScript commented 2 years ago

And because of that it is hard to put a red circle around it, it is basically the warped image behind jak above the vent. What it is suppose to look like is a smudge like effect, like the image is bulging out.

kd-11 commented 2 years ago

Oh ok, so its just the infamous distortion shader glitch. For deformation shaders the UVs are from 2 sources, fixed UV in screen space and a deformation vector usually gleaned from dFdx and dFdy + a perturbation ref texture. The functionality is implemented but doesn't work right. I haven't had time to look into the distortion issues, they're fairly low priority all things considered, but if more games are affected I can move it up the queue. Currently I've only heard of it in infamous and now Jak games.

RinMaru commented 2 years ago

(never played jak)

shame on you >.<

but yea i get this error too. ill be upgrading from RX 480 to RX 6700XT soon so i can test on that it that would help with figuring it out

Asinin3 commented 2 years ago

FYI, One other game I saw someone have this issue in was Persona 5, https://github.com/RPCS3/rpcs3/issues/6993 but I couldn't reproduce it and they didn't update the issue so it was closed.

JimScript commented 2 years ago

Is the Persona 5 issue the same, because in both inFamous and Jak the image in the shader is offset to the left and up a bit. Here is a picture of it in action in inFamous: BCUS98119_screenshot_2022_04_08_18_39_17

You can also see it in the Jak II image and a little bit in the Jak I image above, but it is hard to see in the Persona 5 examples in that thread.

JimScript commented 2 years ago

Do you have any examples of fire distortion being broken? It is a little hard to see and the blocking kinda reminds me of anti-aliasing breaking.

JimScript commented 2 years ago

Wow that is a lot more broken than your first post implied, but looking at it closely it looks like MLAA or something is broken. If you look around 4:45 you see the squares form around the flagpoles and the edge of the sculpture. If this error is in effect too, I can hardly tell.

Darkhost1999 commented 2 years ago

If you ignore obvious SPU issues and watch the smoke I think BF3 has same issue as infamous with same effect as infamous vents.

https://user-images.githubusercontent.com/60384196/164947136-fc1f0298-7db2-4e1c-88df-b95aa1d56f23.mp4

JimScript commented 2 years ago

Yeah it kinda looks like MLAA or MSAA is drawing over the games particle systems. Jak and inFamous are both ingame shader problems, this looks like a post-processing problem.

Darkhost1999 commented 2 years ago

Yeah it kinda looks like MLAA or MSAA is drawing over the games particle systems. Jak and inFamous are both ingame shader problems, this looks like a post-processing problem.

image It'd make more sense if the issue went away disabling this and RPCS3 AA. This being disabled in all videos and screenshots above. RPCS3 being on.

JimScript commented 2 years ago

Well now that is strange, maybe it is the same issue, maybe it's just that Battlefield 3 uses the function in a different way than Jak or inFamous. But it is hard to see the similarities, as both Jak and inFamous have it as a glassy image that is offset to left. What makes you think that this is the same issue?

Darkhost1999 commented 2 years ago

What makes you think that this is the same issue?

Lack of better knowledge

JimScript commented 2 years ago

Well I guess we won't know for sure if this or the Persona 5 issue is related until it is fixed.

Codex- commented 2 years ago

Came to open the same issue, happy to try or test things.

So far I've tried many combinations and permutations of settings to no avail.

Current (as of v0.0.22-13693-03df3c52, 2022-06-01): image

Expected: image

Can see a video of how the particles are meant to look here at 3:48

Codex- commented 2 years ago

It sounds like you already have a strong suspicion as to what the issue is, kd-11, I was having a read through the jak and daxter decompilation project and thought it might help provide some more concrete insight to the implementation details for these. Albeit for the ps2 version but who knows: https://github.com/open-goal/jak-project/tree/master/goal_src/engine

Here's to hoping it helps a little πŸ˜…

JimScript commented 2 years ago

Well I imagine that Mass*Media(the company that ported the collection) might have changed a few things behind the scenes for it to work on the PS3. But then again, the Jak project could have too. The PS2 and PS3 are two very different consoles, so the work might not be transferable.

cRAzyyKirill0101 commented 1 year ago

ΠŸΡ€ΠΎΠ±Π»Π΅ΠΌΠ° с Persona 5 такая ΠΆΠ΅, ΠΏΠΎΡ‚ΠΎΠΌΡƒ Ρ‡Ρ‚ΠΎ ΠΈ Π² inFamous, ΠΈ Π² Jak ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ Π² ΡˆΠ΅ΠΉΠ΄Π΅Ρ€Π΅ смСщСно Π²Π»Π΅Π²ΠΎ ΠΈ Π½Π΅ΠΌΠ½ΠΎΠ³ΠΎ Π²Π²Π΅Ρ€Ρ…. Π’ΠΎΡ‚ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ этого Π² дСйствии Π² InFamous: BCUS98119_screenshot_2022_04_08_18_39_17

Π’Ρ‹ Ρ‚Π°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΡƒΠ²ΠΈΠ΄Π΅Ρ‚ΡŒ это Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ Jak II ΠΈ Π½Π΅ΠΌΠ½ΠΎΠ³ΠΎ Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ Jak I Π²Ρ‹ΡˆΠ΅, Π½ΠΎ это Ρ‚Ρ€ΡƒΠ΄Π½ΠΎ ΡƒΠ²ΠΈΠ΄Π΅Ρ‚ΡŒ Π² ΠΏΡ€ΠΈΠΌΠ΅Ρ€Π°Ρ… Persona 5 Π² этой Π²Π΅Ρ‚ΠΊΠ΅.

hi, I need help how did you launch this game on your system, what characteristics do you have, and can you tell what configuration you have in the emulator, I just run it and I have 5-10 frames per second, I can't understand why the gpu and cpu don't go to the ceiling when "playing" here I think because of what can it be, and yes, sorry if that offtop just really need help because I really love this game ((((

JimScript commented 1 year ago

Thanks for bumping the issue, maybe I should change the name to include inFamous 1 so these issues stop popping up.

JimScript commented 1 year ago

For some reason, inFamous 1 fades into the broken refraction and at a certain distance some of it is fine, with it getting progressively worse when it gets closer to the camera:

https://user-images.githubusercontent.com/66685584/214114614-274b919f-a900-4680-94c4-d8b3f4b8ac83.mp4

Llamamoto commented 1 year ago

I've got $10 in BTC for whoever can fix this;)

JimScript commented 1 year ago

infamousRenderExample Okay, so I tried dissecting the scene and I found this normal that dictates the refraction: infamousNormalExample I then dissected it further to see what the problem was, and found that the working parts are all increments from the 128 base value while the broken parts are all solidly 255. Here is an example I made for the Red Channel, exaggerated for easy viewing: infamousRedExample The red parts go from 129-131 red while the blue parts are all 255 red, interesting that they are on opposite sides. Which makes me think there might be an integer underflow problem when it tries to become 127 or lower, so it loops back to 255. Here is the example for Green Channel too, also exaggerated: infamousGreenExample Don't know how this affects Jak though. Here is the RSX capture of the scene: BCUS98119_20230128235239_capture.zip

ghost commented 1 year ago

someone can fix this issue please, thanks

JimScript commented 11 months ago

Well, I decided to look back into how the Jak issue relates to the inFamous issue: JakRenderExample With the normal that the refraction uses of course: JakNormalExample And it's similar in that below its midway point it whites out, but this midway point is 127 instead. It also looks like it's more based off of polygons instead of textures, and when a any pixel in a triangle goes below 127, then that whole triangle for that channel whites out. That's probably why some of the polygons flicker ingame, they're going in and out of the broken range. Here are the channels re-rendered in between 127-140 for better viewing: Red Example: JakRedExample Green Example: JakGreenExample

matthewmgraf commented 6 months ago

I would love to learn how to fix this, whether it means I have to learn some game design or whatever, but do we have any leads on how to fix this issue?

KieronJ commented 6 months ago

For reference, this shader works by rendering the pentagons with additive blending. The vertex "color" seen above comes from vert_uv - vert_xy. A second pass then uses the RG channels of the pentagon buffer as a screen space displacement.

Pazifix commented 3 months ago

Any new leads or updates on fixing this issue?

AlexS2412 commented 2 months ago

still nothing i guess years later? nobody cared enough to fix this in jak or infamous... tbh i feel like just modding the games to remove the effect as a work around

Pazifix commented 2 months ago

still nothing i guess years later? nobody cared enough to fix this in jak or infamous... tbh i feel like just modding the games to remove the effect as a work around

Yeah really a shame cause jak and infamous are true gems and deserve to be played in its full glory, I would help but I am a noob on this subject, I just really like infamous and jak.

AniLeo commented 2 months ago

I'm locking this due to all the off topic spam, if you have new information to add ping me on Discord to have it reopened, otherwise kd will reopen it when he works on it