Wednesday, October 25, 2023

DuckStation (PlayStation emulator) [DX11] [Vulkan]






3D Vision and geo-11 fix for DuckStation, a PlayStation emulator. Separate fixes for the "Hardware (D3D11)" (3D Vision and geo-11 fixes) and "Hardware (Vulkan)" renderer.

This is possible thanks to the PGXP feature that improves geometry and texture accuracy. It makes geometry vertices have a real depth value, which can be used for stereoscopic 3D.


Fixed in DirectX 11 with 3Dmigoto and geo-11.

Fixed in Vulkan with Vk3DVision.


Update (2023-10-25): updated geo-11 version to v0.6.182. Apparently now "nvidia_dx9" mode works too, and the nogui version of the emulator doesn't exist anymore. For geo-11, the normal qt version is OK.

Update (2022-07-27): added geo-11 fix. For those with 3D Vision monitors that want to use new GPUs or drivers, I recommend using the Vk3DVision fix.

Update (2022-02-20): reuploaded both DX11 and Vulkan fixes. The Vulkan one is updated to Vk3DVision version 4.19.19. The point of this update in general was making the separation settings equal between DX11 and Vulkan.

Update (2021-12-03): reuploaded Vulkan fix, after seeing that when Vk3DVision doesn't have dev mode enabled, a few games can crash (Vagrant Story, for example).

Update (2021-12-01): added fix for Vulkan made in single frame stereo. For Nvidia GPUs, the 2000 series is required as minimum and also newer drivers than the last ones that can be used with DX11.


What the fix does
- It stereoizes geometry, because even in DX11, 3D Vision Automatic doesn't stereoize anything.
- It has a hotkey with depth options for elements that are detected as 2D (could be HUD, could be skyboxes, could be wrong 2D geometry). Divided into multiple hotkeys in Vulkan.
- It has a hotkey for black frame insertion (only for DX11). Most likely annoying for most people. It has the purpose of making 30fps games look smoother (no double images at 60Hz when tracking elements with your eyes).


Known issues (Common)
- Some games detect part of the geometry as 2D (PGXP can't improve them), and as a consequence they can't have proper depth in 3D. It's usually geometry that is close to the camera, in the games affected by this problem. Examples: Ape Escape, Spyro games, Medievil games.
- Sprites that should be inside the game world may appear in 2D (they can be moved with a hotkey, but it won't be accurate depth). Examples: Dragon Quest VII, Tomba!.


Known issues (Vulkan)
- You're forced to use the "duckstation-nogui-x64-ReleaseLTCG.exe" of DuckStation, because Vk3DVision crashes just by launching a game with the interface of the other exe. This is why I recommend configuring everything first with the other exe and then setting some hotkeys to open the quick menu, decrease and increase resolution, etc.
- The "Multisample Antialiasing" option doesn't work in 3D. It's inside "Settings -> Advanced Settings". It's fine in DX11.
- Fast forwarding can make convergence reset to default.


Installation (DX11)
- Don't use Windows 7. The fix relies on flip model, which the emulator uses by default. That feature should work on Windows 8 and newer.
- Get the latest emulator version for Windows x64 from github.
- geo-11 (with build v0.6.182): download this file and extract its contents in the "duckstation-windows-x64-release" folder, where "duckstation-qt-x64-ReleaseLTCG.exe" is. Remember to edit "d3dxdm.ini" to change your "direct_mode" to the output you need. It's sbs by default. For 3D Vision monitors, both "direct_mode = nvidia_dx11" and "nvidia_dx9" work but "nvidia_dx9" may have imperfect vsync.
- 3D Vision (old alternative): download this file and extract its contents in the "duckstation-windows-x64-release" folder, where "duckstation-qt-x64-ReleaseLTCG.exe" and "duckstation-nogui-x64-ReleaseLTCG.exe" are.
- To configure the emulator easily, use "duckstation-qt-x64-ReleaseLTCG.exe" to your liking, but there are some key components for stereoscopic 3D. I'm going to mention them even if some of them are correct by default:
  • Settings -> Display Settings -> Basic -> Renderer -> Hardware (D3D11)
  • Settings -> Display Settings -> Basic -> Fullscreen Mode -> Borderless Fullscreen
  • Settings -> Display Settings -> Basic -> Use Blit Swap Chain -> Off
  • Settings -> Enhancement Settings -> PGXP -> Geometry Correction -> On
  • Settings -> Enhancement Settings -> PGXP -> Texture Correction -> On
Metal Gear Solid also needs "Settings -> Enhancement Settings -> PGXP -> CPU Mode (Very Slow) -> On".

- Run the game you want. The first time, in 3D Vision modes, Windows will ask for permission to modify the Nvidia profile.


Installation (Vulkan)
- Get the latest emulator version for Windows x64 from github.
- Download this file and extract its contents anywhere you want (it can be the emulator folder or not).
- To configure the emulator easily, use "duckstation-qt-x64-ReleaseLTCG.exe" to your liking, but there are some key components for stereoscopic 3D. I'm going to mention them even if some of them are correct by default:
  • Settings -> Display Settings -> Basic -> Renderer -> Hardware (Vulkan)
  • Settings -> Display Settings -> Basic -> Fullscreen Mode -> Borderless Fullscreen
  • Settings -> Display Settings -> Basic -> Use Blit Swap Chain -> Off
  • Settings -> Enhancement Settings -> PGXP -> Geometry Correction -> On
  • Settings -> Enhancement Settings -> PGXP -> Texture Correction -> On
- Open "Profiles\DuckStation\Vk3DVision.ini" and set your preferred "Stereo3DViewMode" depending on your type of display. It's configured as "Stereo3DViewMode = 3DVision" by default. You can also set your preferred default separation and convergence.
- Run "Vk3DVision.exe" and then "duckstation-nogui-x64-ReleaseLTCG.exe". The emulator should trigger 3D and run in fullscreen. Then load the game you want.


Hotkeys (DX11)
p: convergence presets (0, 0.5, 1, 2, 3, 4, 8, 16). 1 by default. Different games need different convergence levels.
o: depth presets for 2D elements (0%, 25%, 50%, 62.5%, 75%, 85%, 100%). 0% depth by default.
i: maximum depth settings (x0.325, x0.4225, x0.4875, x0.56875, x0.62), because some games have more effective separation than others. x0.325 by default.
u: black frame insertion, intended for 30fps games. I don't recommend using it because it flickers a lot. One press enables it, another press makes the opposite frame black (which one has less latency may vary), and another press disables it. Disabled by default.


Hotkeys (Vulkan)
1,2,3,4,5,6 (not the numpad): convergence presets (0, 0.5, 1, 2, 3, 4). 1 by default. Different games need different convergence levels.
g,h,j,k,l: depth presets for 2D elements (0%, 50%, 70%, 85%, 100%). 0% depth by default.
y,u,i,o,p: maximum depth settings (x0.5, x0.65, x0.75, x0.875, x1.0), because some games have more effective separation than others. x0.5 by default. The numbers here are different than the DX11 ones, but the effective separation is the same.
- m: reset to default status of the hotkeys.


Recommendations (DX11)
- (For the old 3D Vision fix, not geo-11) To avoid one eye bugs (which can be solved by loading a savestate anyway), configure everything with "duckstation-qt-x64-ReleaseLTCG.exe" but then play the games with "duckstation-nogui-x64-ReleaseLTCG.exe", because 3D will be enabled during the entire session, even inside menus, so bugs like that one can't happen. It may be too annoying to navigate this UI if you prefer the other interface.
- If you have a powerful GPU, use a high "Internal Resolution Scale" setting in combination with the advanced setting "Multisample Antialiasing" set to some SSAA value.
- I don't recomment using any other "Texture Filtering" other than "Nearest-Neighbor". At least in Vagrant Story, I saw the motion blur effect being rendered black with other settings.
- For easy widescreen mode, go to Display Settings and set Aspect Ratio to "Auto (Match Window)" and enable the Widescreen Hack in the Enhancement settings.
- Enable all PGXP settings except Depth Buffer and CPU Mode. CPU Mode is needed for Metal Gear Solid, but it can cause issues in other games.
- Don't force vsync through the drivers, because the fast forward key in the emulator can't bypass it. Instead, use vsync in the emulator (Display Settings).


Recommendations (Vulkan)
- Since you need to play using the DuckStation exe that has a more limited interface, I recommend setting the hotkey that opens the quick menu, and also others to increase and decrease resolution, for example.
- Don't alt+tab or alt+enter. You risk a crash.
- Force vsync in the drivers. I needed it despite having it enabled in the emulator. But this makes fast forward do nothing.


If you liked the fix and want to contribute for more future fixes, you can donate to this PayPal account: masterotakusuko@gmail.com

18 comments:

  1. PCSXR-PGXP also works for this purpose (with actual exclusive fullscreen), but the process was much more on the hacky-janky side (it requires double wrapping with both gldirect5 and dgVoodoo2 for optimal results).

    I tested a whole bunch of games using that method, but i have no idea if the results are applicable here, so i'll hold off on sharing them here until i have the time to check if compatibility seems different with this method.

    (If they are applicable, that 2D element depth hotkey is going to get a *ton* of use, as "Sky renders at screen depth" was my most common compatibility note by far for games that would have otherwise been stereo-ready.)

    ReplyDelete
  2. Wow I haven't played PS1 games in 3D since bleem!\WinXP\H3D shutter glasses... :)

    ReplyDelete
  3. Replies
    1. Graphically they are the same, and each has different pros and cons.

      The Vulkan fix can be used with new drivers, and it doesn't have the one eye bug that can happen when launching games (when they quick load the last state).

      The DX11 fix is compatible with MSAA and SSAA, you can go in and out of fullscreen without risk, you can use proper vsync + fast forwarding, it has black frame insertion as an option, and the amount of hotkeys I made is lower, but with the same functionality.

      With both fixes you can go way above the maximum separation that you should use, if you configure some variables :p.

      Delete
  4. Damn. Awesome. I was gonna say though the z buffer original state of the PS1 would have felt like a psychedelic experience in 3d XD.

    ReplyDelete
  5. I finally got around to comparing this to the old PCSXR-PGXP double wrapper solution.

    By default, the results appear to be identical, but this is *much* less finicky to set up obviously.

    The PGXP options under Advanced Settings can be a real gamechanger tho. For example, Spyro has oodles of graphical/depth/rendering glitches with default settings, to the point that it isn't really playable in my opinion. But with PGXP Geometry Tolerance set to 0, it looks pretty good. (PGXP's CPU Mode option also needs to be on)

    https://i.imgur.com/WRvXnPf.png

    Relatedly, Metal Gear Solid and some of those other games that "detect part of the geometry as 2D" are also fixed by turning CPU Mode on.

    https://i.imgur.com/mMbf2zu.png

    ReplyDelete
  6. Oh, it's also probably worth mentioning that the DirectX 11 fix doesn't seem to work with 452.06 drivers for whatever reason. 3D Vision activates, but the right eye image is displayed for both eyes (this is distinct from the *other* one eye bug masterotaku mentioned, which only shows a right eye image, with nothing for the left eye.)

    If you experience something similar, try 425.31 drivers instead.

    ReplyDelete
  7. Any way to get this 3D mode baked into Duckstation ala Dolphin?

    ReplyDelete
  8. I can run duckstation no-gui without a problem but after I run VK3dvision and then open duckstation no-gui I always get an error. Panic triggered: 'Failed to create placeholder texture' in function FullscreenUI::LoadTextureResource
    (D:/a/duckstation\duckstation\src\frontend-common\fullscreen_ui.cpp:525)

    Do you want to attempt to break into a debugger? Pressing Cancel will abort the application.

    I'm trying to run it in vr. I have changed the .ini to Stereo3DViewMode = OpenVR.

    This is with the latest version of DuckStation.

    ReplyDelete
  9. Just tried this out for the first time tonight on Mega Man Legends. As others noted the sky wasn't rendering correctly. It was only a quick test with very little play. I was amazed to be able to play a ps1 game in 3D. I'll spend more time on it in future date to learn the ins and out. Even though the sky was rendering off, I still loved the 3D gameplay and would play it in 3D even with that issue.

    ReplyDelete
  10. I'm using driver 452.06 by the way.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. If anyone is still using this fix make sure you set the games to start in fullscreen or you will have left eye issues!

    ReplyDelete
  13. 1- Does it work with anaglyph 3d green/magenta ? .... 2- Does it work on windows 7 ?

    ReplyDelete
  14. on windows 7 do i need to install some driver (vulkan, or some other), or do i need just the emulator and the fix ?

    ReplyDelete
  15. Can anyone please provide a download link on these articles? Why are they so tough to find? It's a bad hassle when i see updates, backwards screenshots, instructions, and anything else but a download link. Why is it so hard to put in a direct download link?

    ReplyDelete
  16. So happy this works with the geo-11 fix. Thank you for this!

    ReplyDelete