Saturday, September 1, 2018

RetroArch [DX11]

3D mod for RetroArch. This is essentially a depth and curvature mod that also includes anaglyph to 3D Vision conversion (for the Virtual Boy, for example) and shutter 3D to 3D Vision conversion (some NES and Sega Master System games, for example). It's done with regex to ensure future compatibility.

Information update (2019-05-19): as of RetroArch 1.7.7, using "full_screen=2" in "d3dx.ini" and some entering/exiting fullscreen will work correctly most of the time, alongside disabled fullscreen optimizations.

Update (2018-09-01): fix updated with more features (shutter 3D conversion, black & white mode for the Virtual Boy or other anaglyph games, reversed 3D for anaglyph games). ReShade is no longer necessary for black & white mode. Added instructions for the Windows 10 2018 spring update, which is problematic. Manually fixed one shader for Dracula X Chronicles, the PSP game. Fix tested with RetroArch 1.7.4.

Update (2018-04-28): added depth and curvature support for slang shaders. Not all of them are compatible, and none of them are compatible with the anaglyph to 3D conversion.


Intallation
- Unzip this file in your "RetroArch" folder (or however you called it), where "retroarch.exe" is.
- Go to the "Driver" settings in RetroArch, and select the "d3d11" Video Driver.
Step 1: DX11 renderer

- You may need to restart the emulator after the first time you set it.
- Make sure you are using exclusive fullscreen in the video options. Warning: Windows 10 Spring Update (1803) makes the image freeze in fullscreen unless you follow the instructions I mention in the known issues section.


Depth and curvature usage
- Once you have loaded a game with a compatible DX11 emulator (non OpenGL specific emulators), press "t" to unlock separation and convergence, and/or press "v" to unlock curvature, which will be separation and convergence dependant (more convergence = more pronounced effect).
- Enabling bilinear filtering in RetroArch will make curvature look less pixelated (after all we are warping sharp pixels), but I still prefer the look of unfiltered integer scaling.

You can see what I mean here (download the images to compare them).
Unfiltered:
unfiltered

Bilinear:
bilinear


Anaglyph to 3D Vision
These are the instructions about how to convert anaglyph 3D to 3D Vision in a Virtual Boy emulator.

- Select the "Beetle VB" core and boot a Virtual Boy game.
step2

- In the core options (Quick Menu -> Options), you need to select "red & cyan" as the anaglyph preset. If it's the first time you set it, boot the game again.
step3

- The game will look like this without using any of my hotkeys. You get the same anaglyph image in both eyes.
step4

- Press the "u" key to separate the red color component from the others. This is enough to give you a real 3D image in 3D Vision.
step5

Outdated content (the "j" key still works): - However, colors can be uncomfortable. With the "j" key you can change the right eye view to something more green instead of blue. This is optional.step6

- What I recommend instead is installing ReShade, opening the configuration with shift+F2 and using the "Monochrome" effect with the color coefficients this screenshot shows (R: 147, G: 184, B:18). This will produce a black and white image with almost the same gray colors for both eyes. It's essentially a black and white console, so you won't lose any color information. You can assign this effect to a key and not use it by default.
step7

- Results, showing how it's better than having different colors per eye.
step8
- Press "u" again to convert the red/cyan image to black and white with balanced gray colors. The "i" key can be used to have a lower contrast image when you are in this mode, with different presets.
- Using the "t" hotkey, you can unlock the ability to move the 3D scene more into depth, or the opposite. Whatever you like the best.step9


The same keys work for other emulators that have an anaglyph mode. Press the "2" key if you want to reverse the eyes of the anaglyph image (it doesn't reverse the separation and convergence provided by 3Dmigoto). The balance of gray colors is tuned for the Virtual Boy emulator, which is purely monochrome. If you try to play colorful games in anaglyph and convert them to black and white, gray colors will be unbalanced between eyes.


Shutter 3D to 3D Vision
There are some old Nintendo and Sega games (use PicoDrive, not Genesis Plus GX) that have a 3D mode that divides the fps by two (30fps per eye). There is a list here, including anaglyph games too.

For these games, press the "3" key once or twice until you get the correct image (synchronization is random). The third press disables it. Without this mod, both eyes get both left and right images. This key discards the image for each eye at a "fps/2" rate in an alternate way. Therefore, beware of the big 30Hz flickering. But it's how it's supposed to work.

This mode can be combined too with the "t", "x" and "v" hotkeys if you want to modify the image further.


Known issues
I can't apparently make the SBS/TAB/interlaced shader work correctly at boot, but there's a workaround that works:
- Boot a game normally.
- Alt+tab out of the emulator, open "d3dx.ini" and uncomment the ";include = ShaderFixes\3dvision2sbs.ini" line.
- Go back into the emulator, press F10 and then start pressing F11 to cycle through different 3D modes.

You'll need to do that after every game boot, not just every RetroArch boot. This happens because RetroArch restarts the window every time you run a game. Sorry for the inconvenience.

Old issue New issue for Windows 10 Spring Update (1803): this update broke the compatibility between RetroArch and 3Dmigoto when you are in fullscreen mode. The image freezes. I discovered a workaround, which is disabling "fullscreen optimizations" in "retroarch.exe", using the interface in windowed mode, and then, after loading a game, pressing the "1" hotkey I made that forces fullscreen. You can alt+tab safely, go back to the game, and press that key again. NEVER use fullscreen in RetroArch natively.

The only problem with this method is that the image looks slightly scaled in some way, so pixels don't look perfectly sharp as they should, if you don't use any kind of filtering.


Hotkeys
- x: convergence presets.
- j: green color for the right eye view toggle.
- t: separation and convergence unlock toggle.
- v: curvature unlock toggle.
- u: anaglyph to active 3D conversion by separating color channels. Press again for black and white mode.
- i: reduced contrast presets for the black and white mode. Not used by default.
- 1 (not the numpad): it forces fullscreen so you can get 3D.
- 2 (not the numpad): reverse anaglyph 3D.
- 3 (not the numpad): shutter 3D conversion. Press again for reversed eyes. Press a third time to disable it.

None of those effects are enabled by default because I assume you'll want to use different emulators at different times.


Note
- PPSSPP already works in 3D in DX11 mode (in RetroArch and also in the standalone emulator). The convergence hotkey probably doesn't suit the convergence needs of PPSSPP except for the latest presets.
- Remember to not use slang shaders if you're going to use the Virtual Boy emulator. Image depth and curvature are safe to use depending on the shader (curvature is less compatible).
- The Virtual Boy works at 50fps, so I recommend playing in 3D at 100Hz (50Hz per eye).


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

1 comment:

  1. why in my retroarch not available ppsspp core..? my computer is windows 7 32 bit, and i'm using direct x 11 version. please help me..

    ReplyDelete