[Release] Pcsx2 with depth buffer access

  • MrCassidy
More
4 years 10 months ago #21 by MrCassidy Replied by MrCassidy on topic [Release] Pcsx2 with depth buffer access
Great job on the debugging! The OpenGL plugin is now detecting the screen space more accurately than before. :) However I'm still unable to aline the depth buffer accurately to the screen space of KH 2. I've tried using EMU modes1-3. No success... Is there something else I should try?
I'll provide visuals for all 3 modes.




Let me know if you know if you have an idea on what's going on. Also let me know what I can do to help as well. :)

Please Log in or Create an account to join the conversation.

  • TheGordinho
More
4 years 10 months ago #22 by TheGordinho Replied by TheGordinho on topic [Release] Pcsx2 with depth buffer access
The official/unnoficiall devs of pcsx2 seem to be pretty interested on this (at least one of them)
Give them a hi on their discord server

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
More
4 years 10 months ago - 4 years 10 months ago #23 by BlueSkyKnight Replied by BlueSkyKnight on topic [Release] Pcsx2 with depth buffer access

Boulotaur2024 wrote: So it was an excruciatingly painful debugging work but after switching to NVIDIA and spending hours trying to figure out why it didn't work.
I finally managed to get it working fine on NVIDIA !

abload.de/img/captureblj0g.jpg

For now I'll let people choose between NVIDIA or AMD dll but I'm pretty sure the NVIDIA one works with both cards, just in case...
I dropped entirely support for D3D11 as it was... buggy, now it's all about OpenGL (even though I hate everything about it :D)

Enjoy :P


Tested the Nvidia version on my RX 580x and it didn't work.

Tested the AMD version it worked.

The game I tested was Fatal Frame USA Version. With the New OpenGL Version, you posted.

I did have one issue with the OpenGL version though. The issue happens when going from windowed mode to fullscreen. I lose the depth buffer.
This issue goes away when using the games native 4:3 AR.

Now, this issue does not happen with the older DirectX version of the DLL you posted here.
Last edit: 4 years 10 months ago by BlueSkyKnight.

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
More
4 years 10 months ago #24 by BlueSkyKnight Replied by BlueSkyKnight on topic [Release] Pcsx2 with depth buffer access

TheGordinho wrote: The official/unnoficiall devs of pcsx2 seem to be pretty interested on this (at least one of them)
Give them a hi on their discord server


Ask them if they can do anything about the low bit depth in some games. Like Fatal Frame. en.wikipedia.org/wiki/Fatal_Frame

Please Log in or Create an account to join the conversation.

  • Boulotaur2024
  • Topic Author
More
4 years 10 months ago - 4 years 8 months ago #25 by Boulotaur2024 Replied by Boulotaur2024 on topic [Release] Pcsx2 with depth buffer access

MrCassidy wrote: Great job on the debugging! The OpenGL plugin is now detecting the screen space more accurately than before. :) However I'm still unable to aline the depth buffer accurately to the screen space of KH 2. I've tried using EMU modes1-3. No success... Is there something else I should try?


It works for me on the PAL version (I guess you are using NTSC) with this config :
[EMULATORS]
EMUName=pcsx2
EMUMode=1
EMUWidth=2048
EMUHeight=1664
Play around with the height values : you want to reduce (yes reduce) the value you have already input


Not related but I just found out about a big issue that I was not aware of while staying all that time in debug view :dry:
But once you blend in the SSAO with the final image, you will realize that there is always a delay between the SSAO buffer and the emu output :



So basically when you move the camera around the SSAO is "trailing" behind (or before ?) the game output.
EDIT : actually its *ahead* of the game output. The ssao buffer visibly draws on the screen *before* the game.
Look at how the shadow/crease on the stairs slowly detach from where it should be as the camera moves on.

It does *not* show on static images, if you take screenshot on still characters, the issue won't show.
But once you start moving around the camera, you can see that the ssao buffer draws ahead of everything !

Nerrel in this forum documented the exact same issue but for GlideN64.
Well it looks like PCSX2 is affected by that too...

Any dev willing to chime in and explain the delay between the SSAO buffer and the emulator output ?
This is a big issue and I have absolutely no idea how to fix it by myself.

But if this gets fixed, the GlideN64 case is solved as well, so this is a good news too : )

EDIT : Could be related to Vsync or something.
EDIT : No I tried every possible setting in NVIDIA Control Panel... That and the Maximum Pre-Rendered Frames NVIDIA thingy
EDIT : Could it be that the emu is internally triple-buffered thus slower to output the frame when Reshade is not (triple-buffered) ?
I'm at work but I can't stop thinking about it :pinch:
EDIT : turns out the solution would be to alter code in Pcsx2 in order for the emu to output the depth buffer at frame buffer 0 (main framebuffer). I doubt people over there care enough to ever make the change (and Gregory is a father now :D) but if you want news about it, then this is the place to go for answers :
github.com/PCSX2/pcsx2/issues/2311#issuecomment-506947109 .
Last edit: 4 years 8 months ago by Boulotaur2024.

Please Log in or Create an account to join the conversation.

  • StuDentBR
More
4 years 10 months ago - 4 years 10 months ago #26 by StuDentBR Replied by StuDentBR on topic [Release] Pcsx2 with depth buffer access
Did you try talking to the pcsx2 devs on discord? They seemed to be willing to help...

Pcsx2 discord server :
discord.gg/zUdrM7
Last edit: 4 years 10 months ago by StuDentBR.

Please Log in or Create an account to join the conversation.

  • StuDentBR
More
4 years 10 months ago #27 by StuDentBR Replied by StuDentBR on topic [Release] Pcsx2 with depth buffer access
I am having an issue with Nvidia version using opengl, I get depth buffer only if the emulator is windowed and the window is small if go full screen or even maximize the window the depth buffer goes blank... This issue does not happen on the dx11 version that you have released earlier. I am using a 4k TV at native 4k resolution, and a gtx 1070.

Please Log in or Create an account to join the conversation.

  • Boulotaur2024
  • Topic Author
More
4 years 10 months ago - 4 years 10 months ago #28 by Boulotaur2024 Replied by Boulotaur2024 on topic [Release] Pcsx2 with depth buffer access

StuDentBR wrote: I am having an issue with Nvidia version using opengl, I get depth buffer only if the emulator is windowed and the window is small if go full screen or even maximize the window the depth buffer goes blank... This issue does not happen on the dx11 version that you have released earlier. I am using a 4k TV at native 4k resolution, and a gtx 1070.

[strike]Yeah, I'm sorry I cannot reproduce the issue (BlueSkyKnight has the same problem, I know)
You might want to zip up your pcsx2 folder (up to 50 mb if properly zipped) and send it to me. Your internal resolution could be really weird, I don't know your pcsx2 settings (or the game you try to play)[/strike]

EDIT : I think I solved the issue. I updated the OP
Do let me know if that works for you.


About the wobbling ssao effect described above, I'm slowly losing faith that I can come up with a solution... But at least I tried to document it as much I could (that gif took me forever to make lol, I lost the habit of doing that, but it does illustrate the issue well enough).

It's not related to pcsx2 because every emulator using OpenGL suffer from the same symptoms. It's a Reshade thing (imho).
[strike]Maybe because the "Copy Depth from FBO" trick that Crosire uses * runs too fast (a few frames ahead) compared to the framebuffer (?) used by emulators. I'd guess that the latter has more work to be done and thus takes more time to output frames (pure guess, I have no clue)
[/strike]
EDIT : Turns out D3D11 has the same issue, so forget about my "OpenGL is broken" theory...

I thought about Vsync and had the idea that maybe vsync needed to be forced within Resade so it could be perfectly synced so I wrote some lines of code but to no avail.

Still it would be nice to know if you guys have the same issue... Or is it a driver thing again ?
Last edit: 4 years 10 months ago by Boulotaur2024.

Please Log in or Create an account to join the conversation.

  • StuDentBR
More
4 years 10 months ago - 4 years 9 months ago #29 by StuDentBR Replied by StuDentBR on topic [Release] Pcsx2 with depth buffer access

Boulotaur2024 wrote:

StuDentBR wrote: I am having an issue with Nvidia version using opengl, I get depth buffer only if the emulator is windowed and the window is small if go full screen or even maximize the window the depth buffer goes blank... This issue does not happen on the dx11 version that you have released earlier. I am using a 4k TV at native 4k resolution, and a gtx 1070.

[strike]Yeah, I'm sorry I cannot reproduce the issue (BlueSkyKnight has the same problem, I know)
You might want to zip up your pcsx2 folder (up to 50 mb if properly zipped) and send it to me. Your internal resolution could be really weird, I don't know your pcsx2 settings (or the game you try to play)[/strike]

EDIT : I think I solved the issue. I updated the OP
Do let me know if that works for you.


About the wobbling ssao effect described above, I'm slowly losing faith that I can come up with a solution... But at least I tried to document it as much I could (that gif took me forever to make lol, I lost the habit of doing that, but it does illustrate the issue well enough).

It's not related to pcsx2 because every emulator using OpenGL suffer from the same symptoms. It's a Reshade thing (imho).
[strike]Maybe because the "Copy Depth from FBO" trick that Crosire uses * runs too fast (a few frames ahead) compared to the framebuffer (?) used by emulators. I'd guess that the latter has more work to be done and thus takes more time to output frames (pure guess, I have no clue)
[/strike]
EDIT : Turns out D3D11 has the same issue, so forget about my "OpenGL is broken" theory...

I thought about Vsync and had the idea that maybe vsync needed to be forced within Resade so it could be perfectly synced so I wrote some lines of code but to no avail.

Still it would be nice to know if you guys have the same issue... Or is it a driver thing again ?

Thanks, I will test it as soon as possible and come back with the feedback.

Edit: The issue i had with opengl version and full screen is now fixed. Thank you.
I still need to test the woobling issue.
Last edit: 4 years 9 months ago by StuDentBR.

Please Log in or Create an account to join the conversation.

  • Amarx
More
4 years 7 months ago #30 by Amarx Replied by Amarx on topic [Release] Pcsx2 with depth buffer access
Doesn't seem to be working in Capsule Monster Coliseum and Sly 3.

Please Log in or Create an account to join the conversation.

  • Menoly
More
2 years 10 months ago - 2 years 10 months ago #31 by Menoly Replied by Menoly on topic [Release] Pcsx2 with depth buffer access
Hey so im trying to use this to use this with Spy vs. Spy and im getting a weird "Failed to Compile" error when i install the modified Reshade OpenGL DLL. Is there a fix for this? https://ibb.co/3FTxrth
Last edit: 2 years 10 months ago by Menoly.

Please Log in or Create an account to join the conversation.

  • gysiguy
More
8 months 1 week ago #32 by gysiguy Replied by gysiguy on topic [Release] Pcsx2 with depth buffer access
Any chance of getting this updated to work on the current versoins of ReShade and pcsx2 in 2023? Possibly using Vulkan rather than OpenGL? Would love to enjoy some ps2 games with beautiful RTGI!!

Please Log in or Create an account to join the conversation.

  • peronmls
More
6 months 3 weeks ago #33 by peronmls Replied by peronmls on topic [Release] Pcsx2 with depth buffer access
I cannot get this to work on anything. Use to be real simple back in the day without any hacks. 

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.