Wednesday, December 29, 2021

Flycast (Dreamcast emulator) [DX11] [Vulkan]










3D Vision and geo-11 fix for Flycast, a Dreamcast emulator. Separate fixes for the "DirectX 11" and "Vulkan" graphics API options.


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

Fixed in Vulkan with Vk3DVision.


What the fix does
- It stereoizes geometry, because even in DX11, 3D Vision Automatic doesn't stereoize anything because of the way shaders are made in the emulator.
- It has a hotkey with depth options for elements that are detected as 2D. Divided into multiple hotkeys in Vulkan.
- For DX11, hotkeys to control which eye is dominant (if you don't want a centered view) and the possibility to reverse 3D. The dominant eye is a native option of Vk3DVision already.
- Adds an OSD that can be shown with F1 for the DX11 renderer. It shows the current state of hotkeys, and separation and convergence values.


Known issues (Common)
- "Transparent Sorting" set to "Per Pixel" doesn't work correctly. In Vulkan it crashes, and in DX11 many effects are only visible in one eye. Use "Per Triangle" or "Per Strip" instead. I tested "Per Triangle" the most.
- You will have to configure the "StereoCutoff" settings every time you want to play and with different settings per game, because the depth value of HUD elements varies per game, as well as normal convergence values. Default settings are more or less safe in general, but the convergence you need can vary wildly.


Installation (DX11)
Don't use Windows 7. The fix relies on flip model, which the 3Dmigoto "d3d11.dll" forces. 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.58): download this file and extract its contents in the "flycast" folder, where "flycast.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, only "direct_mode = nvidia_dx11" works (nvidia_dx9 isn't triggering 3D Vision), so better use the Vulkan fix for 3D Vision monitors if you're using new drivers or GPUs. No drawbacks in using the geo-11 fix (compared to the 3D Vision fix) with old drivers or GPUs.
- 3D Vision (outdaterd): download this file and extract its contents in the "flycast" folder, where "flycast.exe" is.
- Run the emulator and set the "Graphics API" setting to "DirectX 11". Make sure "Transparent Sorting" is NOT set to "Per Pixel". Use any resolution you want, and widescreen or not, what you prefer.
- (3D Vision) Use alt+enter to set the emulator to fullscreen the first time, which should trigger 3D. Everything in the emulator is configured from the inside, so you won't need to revert to a window. I exit the emulator with alt+F4.
- Run the game you want. The first time, 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 in the "flycast" folder, where "flycast.exe" is.
- Run the emulator and set the "Graphics API" setting to "Vulkan". Make sure "Transparent Sorting" is NOT set to "Per Pixel". Use any resolution you want, and widescreen or not, what you prefer.
- Use alt+tab to set the emulator to fullscreen, which should trigger 3D. Everything in the emulator is configured from the inside, so you won't need to revert to a window. I exit the emulator with alt+F4.
- Open "Vk3DVision\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. For monitor users, I recommend setting "Separation" to over 100 if 100 is too low. I use 160 personally.
- Run "Vk3DVision.exe" and then "flycast.exe". The emulator should trigger 3D and run in fullscreen. Then load the game you want.


Hotkeys (DX11)
- F1: toggles the OSD at the left of the screen that shows the current state of hotkeys and other values.
F2: convergence presets (0, 0.05, 0.5, 1.01, 2.01, 10.01, 25.01, 50.01, 100.01, 200.01, 300.01, 600.01, 1000.01). 1 by default. Different games need different convergence levels.
F3: presets for the first stereo cutoff setting (0.7, 0.9, 1, 1.001, 300). 0.9 by default. This controls the maximum depth value that is allowed to be stereoized. If you see geometry becoming flat near the camera, you need to use a higher value (extreme example: Soul Reaver needs the 300 setting). If HUD elements fly out of the screen, controlled by convergence, use a lower value.
F4: presets for the second stereo cutoff setting (0.25, 0.4, 10.01). 0.4 by default. Same function as the previous hotkey, but for different shaders that are more likely to be part of the HUD.
F5: depth presets for 2D elements (0%, 20%, 40%, 60%, 80%, 100%). 0% depth by default.
F6: dominant eye (center, left, right). Center by default. Useful to not use a centered view if you want HUD elements to at least always be visible in one eye.
F8: reverse 3D toggle. Normal orientation by default.

You can reset the settings with F10, as usual for 3Dmigoto. It won't reset separation and convergence.


Hotkeys (Vulkan)
- 1,2,3,4,5,6,7,8,9,0 (not the numpad): convergence presets (0, 0.05, 0.5, 1, 2, 10, 25, 100, 300, 1000). 1 by default. Different games need different convergence levels.
- y,u,i,o,p: presets for the first stereo cutoff setting (0.7, 0.9, 1, 1.001, 300). 0.9 by default. This controls the maximum depth value that is allowed to be stereoized. If you see geometry becoming flat near the camera, you need to use a higher value (extreme example: Soul Reaver needs the 300 setting). If HUD elements fly out of the screen, controlled by convergence, use a lower value.
v,b,n: presets for the second stereo cutoff setting (0.25, 0.4, 10.01). 0.4 by default. Same function as the previous hotkeys, but for different shaders that are more likely to be part of the HUD.
- m: this resets the settings, including convergence but not separation.



If you liked the fix and want to contribute for more future fixes, you can donate to this PayPal account: masterotakusuko@gmail.com
Or you can join my Patreon: https://www.patreon.com/masterotaku

6 comments:

  1. Well done! I had wondered if you would manage to get 3D Vision working with Flycast when i heard they were adding a DX11 renderer. This is an absolutely *massive* improvement over the old nullDC_100b1_6 w/ dgVoodoo solution.

    Not sure if this is a universal issue, but recent Windows x64 Flycast builds don't seem to have vibration for me. If anyone else experiences this issue while using the DX11 fix, try net-rollback 325cd9a 2021-12-17T12:52:15.000Z, as it seems to be the most recent build with both the DX11 backend and working vibration on my system (no master build has both). If you are using Vulkan, you could instead try master bf87f7b 2021-12-20T13:32:18.000Z.

    ReplyDelete
    Replies
    1. The vibration bug has been fixed as of master 746b3c5 2022-01-06T08:02:28.000Z.

      For net-rollback, 325cd9a 2021-12-17T12:52:15.000Z is still the most recent version with working vibration at the time of this post.

      Delete
  2. So I see there's an android APK for Flycast... any possible way to get this running natively in VR on a quest 2?

    ReplyDelete
    Replies
    1. I'll literally sell you my soul to get Shenmue or JSR running standalone in VR on my Quest 2

      Delete