[Release] Pcsx2 with depth buffer access
- MrCassidy
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
Give them a hi on their discord server
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
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)
Enjoy
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.
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
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
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=1664Not related but I just found out about a big issue that I was not aware of while staying all that time in debug view
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
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
github.com/PCSX2/pcsx2/issues/2311#issuecomment-506947109 .
Please Log in or Create an account to join the conversation.
- StuDentBR
Pcsx2 discord server :
discord.gg/zUdrM7
Please Log in or Create an account to join the conversation.
- StuDentBR
Please Log in or Create an account to join the conversation.
- Boulotaur2024
- Topic Author
[strike]Yeah, I'm sorry I cannot reproduce the issue (BlueSkyKnight has the same problem, I know)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.
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 ?
Please Log in or Create an account to join the conversation.
- StuDentBR
Thanks, I will test it as soon as possible and come back with the feedback.Boulotaur2024 wrote:
[strike]Yeah, I'm sorry I cannot reproduce the issue (BlueSkyKnight has the same problem, I know)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.
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 ?
Edit: The issue i had with opengl version and full screen is now fixed. Thank you.
I still need to test the woobling issue.
Please Log in or Create an account to join the conversation.
- Amarx
Please Log in or Create an account to join the conversation.
- Menoly
Please Log in or Create an account to join the conversation.
- gysiguy
Please Log in or Create an account to join the conversation.
- peronmls
Please Log in or Create an account to join the conversation.
- Aztec2012
Please Log in or Create an account to join the conversation.
- acknowledge
Please Log in or Create an account to join the conversation.
- Soul_Reaver 73
I've been strugling with this issue for a long time.
I'm not an expert in the matter so I don't know how to solve shadders that are not working inside pcsx2.
But in order to help someone who might want to find a solution and might provide it, here's what I have found with some testing.
At this point reshade (version 6.7.3) can show the depth buffer correctly in the preview on many games.
Setup and procedure is the same as any other game.
The intensity of the depth buffer might be changed if needded using reshade config:
"RESHADE_DEPTH_LINEARIZATION_FAR_PLANE" set to be 100 , 000
I think not all games need this high value, might be less depending on the game.
I've had a constant problem with depth alignement but i think that's because my monitor is 21:9.
If i use pcsx2 in window mode and use the "Fit to window" option in pcsx2 the depth buffer is automatically aligned (At least with my monitor).
Problem was, or is... that despite the depth buffer is there and correctly identified in "Display Depth" preview the reshade shadders just work but in the wrong way, only if I change the state of "RESHADE_DEPTH_INPUT_IS_REVERSED" making MXAO type effects showing everything very dark.
And that's not the way it is supposed to work.
Something is wrong in the way reshade sees the depth buffer.
Or in the way the shadders expect to interpret the depth buffer info.
I don't know, I'm not an expert.
I came up with this conclusion because the modified qUINT shaders that where available/provided for the original solution on this post work correctly.
Something was changed in code that makes them work.
With the only nuance that some games need that "qUINT_common.fxh" to be edited in order to make the MXAO effect visibale.
Changing the 2 lines on the file from:
"float depth = tex2Dlod(sDepthBufferTex, float4(uv, 0, 0)).x * 1000;"
to
"float depth = tex2Dlod(sDepthBufferTex, float4(uv, 0, 0)).x * 100000;"
So it seems to me that everything is very close to work but the shadders inside reshade don't see the depth info when depth is correctly identified only see something when depth is in the opposite way.
Resuming:
Reshade works correctly in current version if using this quint modified shadders but not with the ones that come with reshade standard (not only quint but with none of them).
It should have a simple fix! But only the people who knows about can do it.
To me it should be done inside reshade and not changing all the shadders code just for Pcsx2.
Probably change should be donne on Generic Depth Addon.
But like I said I'm not an expert! So don't know if there's an easy fix.
But solution seems close... Very close...
And a big thanks to these people who make this amazing tools available for everyone.
Please Log in or Create an account to join the conversation.