Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jak Collection/inFamous 1 Broken Refracting Particles #11149

Open
JimScript opened this issue Nov 12, 2021 · 38 comments
Open

Jak Collection/inFamous 1 Broken Refracting Particles #11149

JimScript opened this issue Nov 12, 2021 · 38 comments
Assignees

Comments

@JimScript
Copy link

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:

  • SYS: RPCS3 v0.0.19-13006-8b3ed7b5 Alpha | HEAD
  • SYS: AMD Ryzen 5 3600 6-Core Processor | 12 Threads | 15.95 GiB RAM | TSC: 3.600GHz | AVX+ | FMA3
  • SYS: Operating system: Windows, Major: 10, Minor: 0, Build: 19043, Service Pack: none, Compatibility mode: 0
  • RSX: Found vulkan-compatible GPU: 'NVIDIA GeForce RTX 2070 SUPER' running on driver 471.68.0.0
  • SYS: Firmware version: 4.85
@JimScript
Copy link
Author

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
Copy link
Contributor

kd-11 commented Apr 6, 2022

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
Copy link
Member

MSuih commented Apr 6, 2022

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
Copy link
Author

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
Copy link
Contributor

kd-11 commented Apr 6, 2022

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
Copy link

RinMaru commented Apr 6, 2022

(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
Copy link
Contributor

Asinin3 commented Apr 7, 2022

FYI, One other game I saw someone have this issue in was Persona 5, #6993 but I couldn't reproduce it and they didn't update the issue so it was closed.

@JimScript
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

Darkhost1999 commented Apr 23, 2022

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

bf3.mp4

@JimScript
Copy link
Author

JimScript commented Apr 23, 2022

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

Darkhost1999 commented Apr 23, 2022

What makes you think that this is the same issue?

Lack of better knowledge

@JimScript
Copy link
Author

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

@Codex-
Copy link

Codex- commented Jun 1, 2022

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.

  • SYS: RPCS3 v0.0.22-13693-03df3c52 Alpha | master
  • SYS: AMD Ryzen 9 5900X 12-Core Processor | 24 Threads | 31.91 GiB RAM | TSC: 3.700GHz | AVX+ | FMA3
  • SYS: Operating system: Windows, Major: 10, Minor: 0, Build: 22621, Service Pack: none, Compatibility mode: 0
  • SYS: Current Time: 2022-06- 1T22:55:11
  • RSX: Found vulkan-compatible GPU: 'NVIDIA GeForce RTX 3070 Ti' running on driver 512.95.0.0
  • SYS: Firmware version: 4.88

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-
Copy link

Codex- commented Jun 24, 2022

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
Copy link
Author

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

This comment was marked as off-topic.

@JimScript
Copy link
Author

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

@JimScript JimScript changed the title Jak Collection Broken Refracting Particles Jak Collection/inFamous 1 Broken Refracting Particles Oct 13, 2022
@JimScript
Copy link
Author

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:

inFamousHazeFade.mp4

@Llamamoto

This comment was marked as off-topic.

@JimScript
Copy link
Author

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

This comment was marked as off-topic.

@JimScript
Copy link
Author

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

This comment was marked as off-topic.

@KieronJ
Copy link

KieronJ commented Dec 24, 2023

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

This comment has been minimized.

@AlexS2412

This comment has been minimized.

@Pazifix

This comment was marked as off-topic.

@AniLeo
Copy link
Member

AniLeo commented Apr 13, 2024

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

@RPCS3 RPCS3 locked as off-topic and limited conversation to collaborators Apr 13, 2024
@RPCS3 RPCS3 unlocked this conversation Sep 8, 2024
@Hasster1
Copy link
Contributor

Hasster1 commented Sep 8, 2024

Some more info from the InFamous' side of things:
While trying my luck at finding some interesting stuff with Cheat Engine, i've stumbled upon one opcode, that re-activated the bug with the glitched borders of the screen, that was fixed in #4973
I also noticed, that with that bug present on the screen, the broken reflections did not show up (The fire usually produced the reflection particles, but they were hidden)
I've traced that opcode in ghidra, and found the value, that controlled the amount of shifting for both particles and the glitched border. Default amount is set to 0.1.

I hope this info helps a bit with fixing this bug.

@Hasster1
Copy link
Contributor

can you produce a test build with this workaround? would be much appreciated.

There's already a patch for InFamous that sets the shifting to 0, disabling the effect.

@DarkPhobia0
Copy link

DarkPhobia0 commented Sep 11, 2024 via email

@Hasster1
Copy link
Contributor

Just to understand, this doesn’t fix the effect, just disables it, right?

Yes, that's right.

@Hasster1
Copy link
Contributor

I've never used the patch updater before... im just lost sorry.

https://discord.gg/RPCS3

@RPCS3 RPCS3 deleted a comment from AlexS2412 Sep 13, 2024
@AniLeo
Copy link
Member

AniLeo commented Sep 13, 2024

Locking the issue again since the spam is back, which is a shame.

@RPCS3 RPCS3 locked as off-topic and limited conversation to collaborators Sep 13, 2024
@RPCS3 RPCS3 deleted a comment from AlexS2412 Sep 13, 2024
@RPCS3 RPCS3 deleted a comment from AlexS2412 Sep 13, 2024
@RPCS3 RPCS3 deleted a comment from Hasster1 Sep 13, 2024
@RPCS3 RPCS3 deleted a comment from AlexS2412 Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests