Welcome, Guest.
Username: Password: Remember me

TOPIC: [Release] Pcsx2 with depth buffer access

[Release] Pcsx2 with depth buffer access 5 months 3 days ago #1



Valkyrie Profile 2 with Marty McFly's Ground Truth AO implementation running in PCSX2

This is a dirty hack of Reshade made to help getting access to depth buffer in games emulated by Pcsx2 emulator which is otherwise hard and really quirky.
The emulator does expose a depth buffer (not always but often), sometimes filled with the wrong data... but sometimes actually decent to use.
I will push the changes to my Reshade Github if anyone wants to see how it's done (it is naughty :D)


Instructions :
  • Install latest Pcsx2 SVN build
  • Install Reshade as you would normally do
  • Download and replace your existing Reshade opengl32.dll with the following alternative opengl32.dll :
  • mega.nz/#!vcsiDI6A!AkGWkVRQkJEelOYa7quAOI1cOxHfU-HuDBcS1CnVrTI

  • Download modified qUINT shaders HERE and drop them in the "\reshade-shaders\Shaders\" subfolder
  • Run the emulator once to make sure Reshade is working at all. Also please select OpenGL (Hardware) renderer in GSdx
  • Run pcsx2 again and select "pcsx2" in the "Hacks for custom apps" dropdownlist - in the Opengl tab in Reshade :
  • In Reshade.ini, set RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN to 1
Issues :
  • Atlus games are not working at all (Persona3, 4, Nocturne...)
  • Metal Gear solid 2 does not work : (
  • There is a more or less visible latency between the ssao buffer and the backbuffer
Recommandations :
  • Some games (Okami, Silent Hill 4, Fatal Frame... and maybe more) need a real boost to the depth output so if the resolution parameters are fine and you still don't see any ssao showing, in qUINT_common.fxh set it to :
float depth = tex2Dlod(sDepthBufferTex, float4(uv, 0, 0)).x * 100000;
  • Clicking on Reset upscale settings is a good way to reset & autodetect resolutions parameters per game.
    Additional resizing can be done with the Stretch mode selector
Reshade fork for emulators :
github.com/Boulotaur2024/reshade
Last Edit: 2 months 4 days ago by Boulotaur2024.
The administrator has disabled public write access.
The following user(s) said Thank You: NattyDread, Pondural, Alex_outer, Nerd, Ryukou36, StuDentBR, Talley Rand, Zumokufu

[Release] Pcsx2 with depth buffer access 5 months 2 days ago #2

Awesome! Sucks that Nocturne doesn't work, as that was going to be the first thing I was going to try, but not surprising given the issues it has with shadows. At least I can finally feel good about having to use D3D11 since I'm on AMD.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 5 months 1 day ago #3

Atlus games, MGS2/3, and the KH games were the first to pop into my head when thinking about what games I was going to try first lol. Awesome work regardless!
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #4

Hey, just wanted to kind of chime in here.

I tried your initial release of this modified reshade and had .... limited results. The main issue I had was in the depth buffer detection tab, I'd see some buffer things loading in and out incredibly quick, honestly like 100 times a second. I don't know the terminology of these things, but typically you'd select one of those boxes that's the depth buffer, those boxes and ranges or whatever weren't staying put.

This newer version doesn't seem to load/work properly for me, when named d3d11.dll, it doesn't load and when opengl32.dll, I get the famed "Can't Find Suitable PixelFormat" issue.

Also, if I'm not mistaken, to get ReShade loading with PCSX2 in general, you need to create a fix for PCSX2, since PCSX2 doesn't load the dll as one would expect. There was some talk about it on Github a while back, a guy created a fix that allowed for PCSX2 to forcefully load up d3d11.dll. (And you can create your own fix using Windows Compatibility Administrator Kit)

Would love to see how this progresses.

I would recommend calling your custom dll something else though from just d3d11.dll or opengl32.dll, maybe a version number and something that makes it obvious it's for PCSX2, like "PCSX2 DB ver x.x.dll" or something.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #5

D3D11 is rather clunky, I would suggest using OpenGL now that it's done : )

EDIT : If you still want to use D3D11, you can do so by renaming opengl32.dll to dxgi.dll

And for those of you that have issues with Pcsx2 not loading Reshade at all, use this fix :
https://reshade.me/forum/troubleshooting/4649-solved-pcsx2-dx11-and-reshade#29813


For D3D11 the key to success is ALT-tabbing several times until you get the depth buffer showing : this is a timing issue I guess.
You can completely disregard the D3D11 tab, I don't use the code path Thalixte made because it's not needed here.

I would recommend using OpenGL and relative dll for more stability and ease of use : once loaded the DB shows immediately unlike the D3D11 version
Please give it a try (also the compatibility is a bit better)
Reshade fork for emulators :
github.com/Boulotaur2024/reshade
Last Edit: 4 months 4 days ago by Boulotaur2024.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #6

Ah okay, yeah that fix is exactly what I was talking about. Not sure how many people know about that and use PCSX2 as well.

I'll give the DLL's another try and it's good to know that I don't need to mess with the Depth Tab, guess things will be obvious or not if they work.

Do you have any idea why OpenGL32.dll was giving me that dumb error though? That's something that old versions of ReShade use to say but was fixed in.... 4.1? or something, so =/.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #7

I followed your instructions as best as I could, but everytime I try to boot a game with OpenGL hardware renderer I get the error from PCSX2:

"GS plugin failed to open. Your computer may have insufficient resources, or incompatible hardware/drivers."

However if I use your DX11 dll it works fine with the GSDX DX11 hardware, and the normal opengl32.dll that comes with reshade works fine as well with GSDX opengl, so I'm not sure what I do wrong. From what I tested in ratchet and clank, I can get depth buffer acces in dx11 by manually selecting it in the DX11 tab in reshade, but it isn't optimal since the depth buffer is misaligned, and I guess I need the opengl plugin to alter the reshade.ini to add the extra options that i can adjust the depth buffer height and width (atleast that's what I assume the dll will do).
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #8

I updated the OP with a new DLL that should be more stable (anontsuki you can confirm I think ?)

I guess it crashed because I was not using the same Windows SDK version as Crosire's.
He's using 10.0.17763.0 while I was using 10.0.18362.0...
Well it's a bit too early to tell now but right now it's my best guess...
Reshade fork for emulators :
github.com/Boulotaur2024/reshade
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #9

Yup, the new OGL dll works just fine in not crashing anymore.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #10

OpenGL worked, DX11 didn't even with the fix.

Amazing to see ReShade working on PCSX2, hopefully you can expand that list and make even more emus compatible, this is waay more than the GS shader can offer for sure!
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 3 weeks ago #11

So i've tested opengl32 with sh3 and sh4 and display depth shows only a small patch of screen and even that only in normal map mode.
Do you know what may be the issue here? I've set everything according to the instruction in the first post.
Examples of the output:

The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #12

Mmm.... interesting... do you have an NVIDIA card ?

I never tested it with NVIDIA so I'm unsure about the results.
Judging from the screens the glBlitFramebuffer call might completely fail on NVIDIA, thus catching only a small subset of the screen.

SH4 work fine here for sure on my old AMD HD 7900. Pretty sure SH3 likewise (more or less same engine)
Any better results with some other games... ?

BTW has anyone here got it working like... just fine... or not :D ?
Reshade fork for emulators :
github.com/Boulotaur2024/reshade
Last Edit: 4 months 2 weeks ago by Boulotaur2024.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #13

Nope, I never got anything to work, Talley Rand got further than me with their normals atleast showing something. No matter what I do or use, I don't get a depth buffer and I don't get anything showing, it's a pure white screen or a blue, whatever color, screen for normals.

DisplayDepth doesn't show anything, SMAA depth debug doesn't show anything. =( Nothing works on my end =(.

GTX 1070 here.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #14

1060 here, same problem.
Last Edit: 4 months 2 weeks ago by otherman.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #15

I've tested with some other games and had the same issue of only patch of the screen being visible in normal mode. And yes, i have an nvidia card too (1080Ti).
What pcsx2 build are using, btw?
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #16

Yeah it seems NVIDIA related.

Hopeefully tomorrow I can test it at work, my desktop pc has a gtx 750.
I spent a good portion of the day bypassing the proxy to download... everything to boot it on my rig at work.

Funnily enough, there's no displacement/misalignment issue either with Intel Integrated graphics card.
So if you're a happy owner of Intel Integrated graphics, then you are a lucky man : it works ! Just like with AMD

It's a shame OpenGL can be interpretated so "loosely" from a vendor to another.
A call has its rules and expected results, it shouldn't vary so much from AMD to NVIDIA.
Oh well...
Reshade fork for emulators :
github.com/Boulotaur2024/reshade
The administrator has disabled public write access.
The following user(s) said Thank You: MrCassidy

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #17

I was using the latest PCSX2 ver from buildbot a few days ago, but I'm not sure there's going to be such a huge change between versions in the past several months.

In some ways, I hope it's an Nvidia related problem, but then again, if it is, that sucks and will probably make things more difficult =(.
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 2 weeks ago #18

Hi there. Made an account just so I could report my findings...
So i followed your instructions to a T, and I found that your DX11 depth buffer plugin for reshade works decently well with Square Enix/Soft games. And yes, I'm on a GTX 1070. Here are some screen shots to show my results.



But I noticed on KH 2 that it's just slightly above the bottom of the screen, and when applied to the actual game looks pretty Janky.


Any idea why this might be happening, and how I might fix it? :/
But yes... I can also confirm what everyone else is saying when it comes to the open gl plugin. it's a shame since that seemed like the one that would work for KH2... aww well. Any suggestions?
Last Edit: 4 months 2 weeks ago by MrCassidy. Reason: typo
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 1 week ago #19

I am definatelly interested in this... Did you try god of war games ?
The administrator has disabled public write access.

[Release] Pcsx2 with depth buffer access 4 months 1 week ago #20

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 !

https://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
Reshade fork for emulators :
github.com/Boulotaur2024/reshade
Last Edit: 4 months 1 week ago by Boulotaur2024.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2