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

Please add a native stereoscopic mode or a graphical mode that lets ReShade read the depth buffer #239

Open
DevilMaster opened this issue Mar 13, 2024 · 2 comments

Comments

@DevilMaster
Copy link

DevilMaster commented Mar 13, 2024

I would love to play ReShade in stereoscopic 3D, as I do with many other games with ReShade and the SuperDepth3D.fx shader. As of now I can't, because if I try, ReShade will not be able to read the depth buffer (it will generate a uniform depth map where everything is either at maximum depth or at screen depth).

This is what I verified.

  • Although ReShade has the intrinsic inability to read the depth buffer when antialiasing is on, in Red Faction the depth buffer will not be read even when antialiasing is off. So, the problem is not wrong game settings.
  • ReShade can successfully read the depth buffer of DX8 games wrapped to DX9 with Crosire's wrapper (I tried it with GTA3, Vice City, Halo, Duke Nukem Manhattan Project, Grand Prix 4, the Unreal Engine 2 runtime demo, and the original executable of Duke Nukem Forever 2001). So, the problem is not the translation of DX8 to DX9..

For this, I'm requesting the addition of either a graphical mode that lets ReShade read the depth buffer, or a native side-by-side stereoscopic mode, where two views (one for each eye) are generated instead of just one. Thank you!

@rafalh
Copy link
Owner

rafalh commented Mar 16, 2024

How does this 3D shader work? Is it something for VR headsets like Meta Quest or maybe you use it with 3d monitors? I wonder if by native you mean implementing support for OpenXR which is something modern headsets support or something maybe else?
I got impression that you suggest that game not working with this shader is an unusual thing, but according to https://reshade.me/forum/shader-presentation/2128-3d-depth-map-based-stereoscopic-shader compatibility problems are pretty common.
As for now I have no idea what RF does differently from other games and how ReShade accesses the depth buffer so this will be hard to fix without more information..

@DevilMaster
Copy link
Author

DevilMaster commented Mar 16, 2024

How does this 3D shader work? Is it something for VR headsets like Meta Quest or maybe you use it with 3d monitors?

This shader is designed to work with 3D monitors. I use it with a homemade headset which the system sees as a monitor anyway.
In short, it looks at the depth buffer, and depending on the value, it decides how much to shift a pixel to the left or to the right when it generates the view for an eye. In addition, if the original resolution is e.g. 1920x1080, the shader will output frames with that resolution, composed of two views placed side by side, each of which has been squashed horizontally to half of the original resolution. Then the 3D monitor or headset will restore the views to their original aspect ratio.

For reference, at the URL https://fastupload.io/2TbocravIFi8Fp2/file I uploaded the complete setup of ReShade I use for Rollcage Redux, which is completely supported.

  • The shader that creates the views from the original frame is called "SuperDepth3D.fx" and is located in the "reshade-shaders\Shaders" subdirectory.
  • The library "d3d9.dll" is what actually does the processing.
  • The file "d3d9.ini" tells the library where the shaders, textures and presets are located.
  • The file "fnord.ini" (which could've had any other name, but I named it like that to identify it immediately) contains the shader presets that must be used when the game is being run.

I wonder if by native you mean implementing support for OpenXR which is something modern headsets support or something maybe else?

I actually meant how it's done in GZDoom, where the program itself generates two side-by-side, horizontally squashed, views as part of a single frame (again, meant to be viewed on a 3D monitor). In this case, the two views are not made by processing a single 2D frame depending on the value of the depth buffer, but they are actually generated by rendering the scene from two different points of view. I proposed this as an alternative, in case it was impossible to make Red Faction "play nice" with ReShade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants