Showing posts with label emulation. Show all posts
Showing posts with label emulation. Show all posts

Sunday, December 3, 2023

PCSX2 [DX11]







3D Vision feature for PCSX2, the PlayStation 2 emulator (DX11 hardware renderer).

At this moment the fix has 533 individual ini files that you can enable (only one at a time).


UPDATE (2023-12-03): updated the fix to work with the latest (as of this date) PCSX2 versions. Added 360 new profiles, for a total of 533. Updated geo-11 to v0.6.90, the last one where "direct_mode = nvidia_dx11" works properly.

UPDATE (2022-06-22): geo-11 fix added, which performs much better than in 3D Vision.

UPDATE (2022-05-06): fix updated to work with recent (at this moment) 64 bit builds of PCSX2. I've also done performance improvements to the fix and changed some hotkeys.

UPDATE (2021-05-07): big update with 181 manually fixed games (some better than others), compared to the 30 something incomplete profiles from the previous version. I have also balanced the convergence scaling of those games, so normal gameplay is fine without having to change convergence.


Warning: this isn't as "plug and play" as PC games fixes. It will need user involvement depending on how much you want a perfect experience, because it's impossible to have all games fixed at the same time.


Installation
- geo-11 (recommended, using build v0.6.90): download the fix here and unzip its contents in your PCSX2 folder, where "pcsx2-qtx64-avx2.exe" is (if you use the AVX2 version). Remember to edit "d3dxdm.ini" to change your "direct_mode" to the output you need.
- (Old 3D Vision fix, for historic purposes. Better use the geo-11 fix above): download the fix here and unzip its contents in your PCSX2 folder, where "pcsx2x64-avx2.exe" is (if you use the AVX2 version).
Important: open "d3dx.ini" and go to line 44, where it says "List of game fixes.". Uncomment the line for the game you want to play. Don't uncomment more than one at the same time. If you want to create your own overrides, create a new ".ini" file in the "GameFixes" folder and load it the same way as the existing files. You can change profiles mid game. Press F10 to reload the changes made to the ini files.
- Open the emulator, go to "Settings -> Graphics" and set "Renderer" to "Direct3D 11". Configure the rest of the settings as you want, but I recommend "Fullscreen Mode" set to "Borderless Fullscreen" in the "Display" tab. Here are my settings:



- Go to "Settings -> Interface -> Game Display" and preferably check the "Start Fullscreen" checkbox and make sure "Render To Separate Window" is checked, so you can alt+tab to change settings without stability issues in 3D Vision output modes. I recommend setting vsync in the emulator and "application controlled" in the drivers, to be able to speed up with F4 without limits and still get vsync at normal speed.
- Open the emulator and launch the game you want.


In short, install the fix, select your "direct_mode" in "d3dxdm.ini", select the game profile in "d3dx.ini", open the emulator, make sure it's running in DX11 hardware mode, and run the game.
Do not switch games and profiles while playing another game. Problems may happen when you reload settings with F10.


Old instructions, not needed anymore:

This needs a special procedure. After installing all the needed files, if you try to open the GSdx configuration, the emulator will crash. Follow these steps:

- Open the emulator.
- Choose a game (choosing the ISO from the recent list, or searching one manually...) and boot it.
- After graphics of the game start to appear, or at any moment after that, open the GSdx configuration (you can press escape to close the game or just open the configuration directly), change settings if you want, and then close it. It doesn't matter if you apply changes or not. This action will unlock esclusive fullscreen, needed for the next steps.
- Double click on the game window so it's resized to borderless fullscreen.
- Press alt+enter, and the game should trigger exclusive fullscreen and 3D Vision.
- If it doesn't work at first try, double click again until it's borderless fullscreen and try pressing alt+ enter again.


Graphics settings recommendations
- Deinterlacing: games that shake when the option is set at "None" will most likely be perfect with the "Bob (top field first)" option, and in some cases, "Bob (bottom field first)". I recommend enabling the "Settings -> Graphics -> Enable No-Interlacing Patches" checkbox (you can check this PCSX2 thread for manual patches too, if the emulator doesn't include your game yet).
- Also enable "Settings -> Graphics -> Anti-Blur". It will remove blurriness from many games.
- Internal Resolution: as high as you can handle, but keep in mind that some games will slow down before reaching 100% GPU usage.
- In "Settings -> Graphics -> Display", any "Aspect Ratio" will work fine (F6 hotkey for real time switching), but I suggest 16:9 and enabling "Settings -> Emulation -> Enable Widescreen Patches".


-----------------------------------------------------------------------------------------------------------------------------
ADVANCED SECTIONS HERE UNTIL BEFORE THE HOTKEYS SECTION
ONLY FOR PEOPLE THAT WANT TO FIX GAMES THAT AREN'T INCLUDED IN THE LIST


Use of regex toggles
Note: with the list of fixed games by me, you won't need this. You can ignore this section unless you want to play games outside of that list.

This fix was done without using physical shader files, for better future compatibility. Instead, it uses a real time "find and replace" function for exactly three shaders that control all geometry in all games.

The problem is that some effects of those shaders need to not be stereoized, like the HUD or some double stereoized effects (sometimes bloom, blur filters, shadows...). The regex function tries to not stereoize things that have a depth value of 0 or 1, and in some games it works (most of the HUD of the Kingdom Hearts games).

The first and most simple solution, which may be partial or fix some things and break others but it's useful many times, is using three hotkeys I offer to disable stereoization in each of the three shaders that control geometry. They are "j", "k" and "l", and I'll refer to them as "regex 1", "regex 2" and "regex 3". And that's also their order of importance, as you'll almost never have to disable the first one. A lot of times a mix of regex 3 and regex 2 will fix HUD issues, but regex 2 is usually related to other effects.


Use of shader overrides. Warning: for advanced users and perfectionists
Sometimes, or usually, disabling some of the regex isn't enough to make a game perfect or almost perfect, because you will be disabling more things than needed. Or maybe the HUD is related to regex 1. In these cases, you need to tell the regex to not stereoize a specific pixel shader. This is where things get more complicated, for these reasons:

1- Future PCSX2 (specifically GSdx) builds may change the hash of the generated shaders, rendering all game specific fixes useless. Still, games don't usually need a lot of these. Most of the affected games need between 1 and 3 in my experience.
2- Fixing something in one game can break something else in another game, or even in the same game in some cases. So fixing all games at the same time is impossible. Even with a small library of 30 something games I found a little more than 10 conflicts between games.

Now about how to do a shader override. The fix includes working examples for games I own, inside the "GameFixes" folder.

Those are the three vertex shaders I stereoize with regexes, and their default values for stereoization. "x3" for regex 1, "y3" for regex 2, and "z3" for regex 3. "w3" is an extra option about the fix I made for the skybox in the Ratchet & Clank saga (it forces the skybox to max depth without breaking other things in those games).

The values after "Hash=" may change with future GSdx versions, but I will be able to recognize them and update the fix.

In the ".ini" files inside "GameFixes" there are shader overrides with comments saying what they fix (sometimes). They contain the hash of the pixel shader, and the value they pass to their parent vertex shader. If you write for example "z3=1", it means that regex 3 won't stereoize that specific pixel shader. If it's "y3=0", it means it will stereoize it, the same as not writing the shader override at all. Useful if you want to enable/disable game fixes break effects in other games.

New: setting them to "=1" now assumes that they are HUD shaders, so they'll be affected by the HUD hotkeys. Set them to "=2" to not stereoize them but not making them count as HUD.


How to get the pixel shader hashes? Search the "hunting=0" line and change it to "hunting=2".

After that, run the emulator and play the game you want. Press "0" in the numpad and you will see a green overlay. Numpad keys 1 and 2 will cycle through the available pixel shaders, disabling the current one. Numpad key 3 will dump the shader inside the "ShaderFixes" folder. Get the hash (filename part before "-ps_replace.txt"), open the "ShaderUsage.txt" file that will appear in the emulator folder and search that hash. Example of a random pixel shader:

<PixelShader hash="07ee058e5bed1e6b">
  <ParentVertexShaders>6d64bfd710f98b05 </ParentVertexShaders>

The pixel shader "07ee058e5bed1e6b" is related to vertex shader "6d64bfd710f98b05". If you look a few paragraphs above in this post, you will see that it's regex 1. If you want to not stereoize that effect, write this in the appropriate ".ini" game file (you can create new empty files and then include them in "d3dx.ini" like the existing examples), below other shader overrides if there are any:

[ShaderOverride_TotallyUniqueNameOrElseError]
Hash=07ee058e5bed1e6b
filter_index = 0
x3=1

Then you can go back ingame without closing it, make the game 3D with the explained method, and press F10. Changes should be applied instantly (it will also reset the state of all hotkeys).

When you are done, close the game and set "hunting" to 0 again. And you can delete your dumped shaders that are inside "ShaderFixes".


OSD and depth hunting (advanced users mostly)
You can enable an OSD that shows information about the current value of hotkeys and other useful information. By default this is disabled, because you could use the depth hunting hotkeys accidentally. With this, you can do a much better kind of fixes than shader overrides. They should be universal for past and future PCSX2 versions.

Uncomment the ";include = ShaderFixes\help.ini" line, in line 19.

When you are ingame, press "c" and the OSD will appear near the bottom left corner. This screenshot shows the default state:


Warning: all the following hotkeys can be used even if the OSD is turned off with its hotkey. Be careful of using them accidentally.

Most fixable game effects and HUD that are broken in 3D usually have a specific depth value assigned to them. Under "Depth hunting Regex0", you will see the navigation speed multiplier, "greater or equal than" value and "lower than" value. Depth values between them will become 2D

To select which regex you want to affect, use the "x" and "z" keys. Then it will say "Depth hunting Regex1" and so on.

Use the left and right arrow keys to modify the ">=" value.
Use the up and down arrow keys to modify the "<" value.
Use the ctrl key to change the amount each of the previous case navigate. By default, one press equals +1 or -1. The highest multiplier is x100000.
Hold the shift key and then hold the arrow keys to navigate the depth values a lot faster.

If you press "a", the "Value to save" will be saved in the first free (non 0) variable it will find.
If you press "q", the current depth range will be saved in two variables if they are free (non 0).

A message will appear in the bottom left corner when you press them.

After saving at least one value, if you press F10, the "d3dx_user.ini" will appear in the emulator folder. Inside you will see a "[Constants]" section. Variables go:

- From "$a0" to "$a39": 40 possible depth values that won't be stereoized for Regex 1.
- From "$ar1" to "$ar8": 4 possible depth range pairs that won't be stereoized for Regex 1. The first one in a pair is ">=", and the second is "<".
- From "$b0" to "$b39": 40 possible depth values that won't be stereoized for Regex 2.
- From "$br1" to "$br8": 4 possible depth range pairs that won't be stereoized for Regex 2. The first one in a pair is ">=", and the second is "<".
- From "$c0" to "$c39": 40 possible depth values that won't be stereoized for Regex 3.
- From "$cr1" to "$cr8": 4 possible depth range pairs that won't be stereoized for Regex 3. The first one in a pair is ">=", and the second is "<".

Further F10 presses will keep adding new values you save into free variables.

Pressing ctrl+alt+F10 will delete this file so you can start over saving values.

Now to do a game fix with these values, you need to create a ".ini" for the game in the "GameFixes" folder. Make a copy of "template.ini" with the name of the game and include it in "d3dx.ini" as you see in the existing examples (like "include = GameFixes\Dark_Cloud_2.ini").

In your new game ini file you will see variables corresponding for each regex (40 values and 4 pairs of ranges for each one). The comments in the text let you know what they're for intuitively.

Copy the depth values from "d3dx_user.ini" in the corresponding variables (the order doesn't matter as long as you are in the correct regex), save the changes to the file, and press F10 ingame if the emulator is running. The fixes should take place immediately.

Of course, you can skip the usage of "d3dx_user.ini" to write the values in the game ini directly, if you remember them or alt+tab a few times, because you will see the numbers onscreen.

-----------------------------------------------------------------------------------------------------------------------------

Hotkeys
You will probably need at least some of these hotkeys (which you can configure in "d3dx.ini") when playing. Hotkeys with more than one preset use "shift" as a modifier to cycle backwards.

FOR NORMAL USERS, the only hotkey that you will want to press is "h", which cycles through the convergence presets. And maybe "g" for some select games like the God of War games.

- v: it changes the dominant eye of the stereoscopic cameras. By default, both eyes get a modified view for 3D. With one click, the right eye will have the same camera angle as 2D and the left eye will do all the 3D work. One more click, and the opposite will happen. And the last preset returns it to normal. It can be useful for games that stereoize the HUD, making it invisible at normal convergence modes. With the dominant eye you will see all game effects normally at least in one eye.
- j: regex 1 stereoization toggle. Not needed for fixed games from the list.
- k: regex 2 stereoization toggle. Not needed for fixed games from the list.
- l: regex 3 stereoization toggle. Not needed for fixed games from the list.
- h: convergence presets (0, 0.25, 0.5, 1, 2). 1 by default. All of the fixed games have balanced convergence so that the default convergence is ideal for normal gameplay.
- ctrl + h: a lot of convergence presets to cover more possibilities for games outside of the fixed games list. Different games may need wildly different convergence levels. I tried to cover as many cases as I could.
- g: exclusive to God of War, God of War 2, Gun, and Haunting Ground (and some other games). Multiple separation and convergence combination presets made for those games. These games present geometry with very compressed depth. This is a workaround that makes them normal. Each preset was carefully crafted, so don't touch your Nvidia convergence hotkey or "h" and "ctrl+h" convergence presets.
- f: toggle for moderately higher max separation. Not needed if you use game specific fixes. Some games like Soul Calibur 3, Tekken 5, Ys IV and Ys V use a lower separation than the rest of games. This hotkey makes them have the same depth as the other games. Don't use it with unaffected games unless you know you want it.
- o (not in use anymore): HUD depth, for elements that have 0 depth or have a "=1" shader override. Only for Regex 3 for performance and image quality reasons. Very buggy and I recommend not using it.
- n: black frame insertion, intended for 30fps games. Not recommended. Three presets (disable one frame, the other, and disabled), and it's disabled by default. This is possible because PCSX2 outputs 60fps no matter the internal fps. Don't use in 60fps games. And beware of the nasty 30Hz flickering, if you are sensitive to it. This black frame insertion mode doesn't know what frame is the original and what frame is the duplicate, so input lag may vary because it's chosen at random (loading savestates may change it too). If you want 20Hz flickering, go to the bottom of "d3dx.ini" and change "y4 = (y4 + 1) % 2" to "y4 = (y4 + 1) % 3".
- i: 3D Vision to anaglyph conversion presets (normal, reversed, disabled). Disabled by default. Why use this when you have 3D Vision Discover for anaglyph? Two reasons. One: it allows two or more people to use 3D Vision and anaglyph glasses at the same time, at the cost of some color quality for the 3D Vision glasses users compared to not using anaglyph. Two: for this emulator, it's better to get 60Hz + 60fps per eye than 120Hz + 60fps per eye. Better vsync, low motion blur, etc.
- u: black frame insertion in 2D, made for 60fps at 120Hz. It's mandatory to have 3D Vision enabled. This hotkey is a quick toggle that disables stereoization for all regexes and blacks out the image of the right eye. The result is that at 120Hz you receive 60 games frames and 60 black frames. It can be combined with the "n" hotkey for 30fps games. This doesn't reduce GPU usage in any way. It's the same as if you were playing in 3D. Unless you comment or delete the "[TextureOverride3DRenderTarget]" block in "d3dx.ini", which is necessary to be there for 3D. That way, you'll get 2D performance with black frame insertion.
- t: reverse 3D Vision.


Recommendations
No interlacing codes (use the search function), to avoid shaking in games: https://forums.pcsx2.net/Thread-No-interlacing-codes

60fps codes (some may be unreliable): https://forums.pcsx2.net/Thread-60-fps-codes

Widescreen game patches (in case you want something very new that isn't included with the emulator yet): https://forums.pcsx2.net/Thread-PCSX2-Widescreen-Game-Patches


Special thanks
- All 3Dmigoto and geo-11 developers and contributors (bo3b, DarkStarSword, davegl1234, Flugan...).
- All PCSX2 developers and contributors. Without them, we wouldn't be able to even play these games in 2D.
- (Old) Kaldaien, for the specific SpecialK build I used in older fix versions to force exclusive fullscreen (0.7.0). Now using 10.1 for newer drivers.
- (Old) RibShark, the one who made the compatibility patch to make 3Dmigoto work with PCSX2 on Windows 10.
- Kaimasta, for helping with testing and giving good ideas and inspiration, like the God of War hotkey.


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

Sunday, October 29, 2023

3dSen






geo-11 fix for both 3dSen PC and 3dSen VR (the VR version running in Desktop Mode), the NES emulator on Steam. I specifically have the VR version, which has everything that the PC version has, plus VR modes.


Fixed
- Specular reflections of the virtual TVs.
- Monoized menu to make it visible at normal convergence levels.
- Autoconvergence configured.


Installation
geo-11 (with build v0.6.182): download this file and extract its contents in the "3dSenVR" folder (or the equivalent for the PC version), where "3dSenVR.exe" (or the equivalent for the PC version). Remember to edit "d3dxdm.ini" to change your "direct_mode" to the output you need. For 3D Vision monitors, only "nvidia_dx9" works.
"upscaling = 1" is enabled by default in "d3dxdm.ini" to make the mouse cursor visible.
- Run the game.


Hotkeys (optional stuff)
F1: five convergence presets. Only if autoconvergence is disabled.
u: anaglyph to geo-11 3D conversion, intended for 2D mode games that may have this mode. Two presets, plus disabled state which is default.
i: reverse eyes for the anaglyph conversion.
- o: shutter 3D to geo-11 3D conversion, for 2D mode games that may use this. Normal, reversed eyes, and disabled, which is default.


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

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

Sunday, July 31, 2022

PPSSPP (PSP emulator) [DX11]










geo-11 fix for PPSSPP, the PlayStation Portable (PSP) emulator. Only for the Direct3D 11 backend.

Tested with PPSSPP 1.13.1 version and some surrounding builds.


What the fix does
- It sets "allow_create_device=0" in geo-11 to make it work.
- It stereoizes the necessary render targets to allow 3D. Shaders are stereoized by geo-11 automatically.
- Per game profiles (56 profiles for 64 games at this moment) that set my preferred default convergence, and in some cases with shader fixes included in those profiles. For example the heatwave in Castlevania Dracula X Chronicles, the HUD in Ape Escape, and shadows in the God of War games. Sometimes optional effects disabling is commented, like the noise in the Silent Hill games.
- By default, "include = ShaderFixes\mouse.ini" enabled in d3dx.ini to make proper use of the mouse cursor when using sbs or tab outputs.
- "swap_effect = 4" enabled in d3dx.ini to force flip model, which triggers 3D Vision in "nvidia_dx11" direct mode.


Installation
- Get the latest emulator version for Windows 64 bit from the PPSSPP downloads page.
geo-11 (with build v0.6.58): download this file and extract its contents in the "ppsspp" folder (or whatever you called it), where "PPSSPPWindows64.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 gives a black right eye).
- Run the emulator and set the "Settings -> Graphics -> Rendering mode -> Backend" setting to "Direct3D 11".
- Preferably play in fullscreen.

Before you run any game, open "d3dx.ini" and check the lines below the one that says";------ List of game fixes. Uncomment only the one you are going to play. -----". Starting at line 37 currently.
Remove the ";" at the beginning of the line of the game profile you want to choose, and save the changes to the file.

You can do this while playing if you alt+tab out of the emulator. Press F10 ingame to reload the changes to the file, and it will work just fine.

Do not load more than one profile at the same time.


Hotkeys
- m: general convergence hotkey with lots of presets, because games with a profile have unpredictable convergence needs. shift+m to cycle backwards.
- n or XB_LEFT_THUMB: only active when you load a game profile, this is a hotkey that has only a few convergence presets relative to the default convergence I set for the game profile. x0.25, x0.5, x1 and x2. By default it will be x1.


Creating game profiles
Inside the "GameFixes" folder that comes with the fix, you will see many ".ini" files. They contain a "[Stereo]" section with the default "dm_convergence", a "[Constants]" section with x10 defined with the same value as "dm_convergence" (to be used by the convergence hotkey), and sometimes some ShaderOverride blocks for fixing or disabling shaders. Some are optional and commented.

If you want to create a profile of your own, make a copy of "template.ini" and put the name you want (preferably without spaces), set "dm_convergence" and "x10" to the default convergence value you need, and then in "d3dx.ini" add a line with "include = GameFixes\Your_Game_Name.ini" below the others. Comment it with a ";" at the beginning of the line when you don't want to use it.


Recommendations
- Check the list of 60fps patches for games that you may play. The usually require a specific game region.
- The emulator can be overclocked, usually with the result of better fps. Some games may not work with that.
- For better graphics quality, I recommend setting "Settings -> Graphics -> Postprocessing effects -> Postprocessing shader #1" to "Supersampling AA (Gauss)". Apparently it overrides the internal resolution you choose. For me it looks better than 10x PSP resolution for a 2560x1440 output.


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

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

Tuesday, September 8, 2020

Nintendo DS [OpenGL]












3D Vision fix for Nintendo DS emulators, mostly intended for melonDS (tested with the 0.9 version) but it also can work with DeSmuME.



What this fix does
- It stereoizes geometry, and sometimes sprites layers.
- I provide two different stereoization formulas. The default one is meant to be used with most games played with melonDS. The other one is a standard formula that should work with DeSmuMe, but only for 60fps games.
- 60fps games show 30fps per eye in 3D, but 30fps games (with melonDS) also show 30fps per eye. For that case, getting sequential or synchronized frames is random. Using fast forward for a bit may help.
- It's compatible with KHMelonMix.



The fix, common for melonDS and DeSmuME
This is the link.


Installation (melonDS)
- Before installing the fix, configure all the emulator settings the way you want (high resolution, maximized window, etc). It's important to check the "Config -> Limit framerate" option to avoid problems
- Extract the fix contents in the folder of the melonDS emulator (like "melonDS_0.9_win64"), where "melonDS.exe" is. From this moment, every time you need to access a pop up config menu (like the controls or graphics) you need to temporarily rename the "opengl32.dll" file to something else. Otherwise the emulator will crash.
- Right click "melonDS.exe", go to the compatibility tab and set it to run as administrator and to disable fullscreen optimizations.
- Drag and drop a game ROM to the "melonDS.exe" file.


Installation (DeSmuME)
- Before installing the fix, configure all the emulator settings the way you want (high resolution but not as much as in melonDS, a big window size, etc).
- Extract the fix contents in the folder of the DeSmuME emulator (like "desmume-git#be2735b3-windows-x64"), where the emulator exe file is. From this moment, every time you need to access a pop up config menu (like the controls or graphics) you need to temporarily rename the "opengl32.dll" file to something else. Otherwise the emulator will crash.
- Copy the "3DVisionWrapper.ini" file that is inside the "desmume_wrapper_config" folder and paste it in the emulator folder.
- Right click the emulator exe, go to the compatibility tab and set it to run as administrator. Disabling fullscreen optimizations is optional and I didn't see a difference, unlike in melonDS.
- Important: use RTSS to limit the emulator exe to exactly 90fps.
- Drag and drop a game ROM to the emulator exe file.
- Sometimes the emulator may break the stereoization or invert it. Press the fast forward hotkey briefly to fix it.


Game compatibility
- For melonDS, check the "melonds_compatibility.txt" to see what games can or can't work. They are games I personally tested.
- For DeSmuME, in general you can play games that run at 60fps. But you won't get 3D from games that run at 30fps because of the way it repeats frames.


Emulator comparison table

melonDSDeSmuME
Can it run 60fps games?YesYes
Can it run 30fps games?YesNo
Stable at very high resolutions?YesNo
Does it have texture filtering?NoYes


Hotkeys
- Numbers (not numpad) from 1 to 0: convergence settings (1, 2, 3, 8, 16, 32, 64, 128, 256, and 0, respectively).
- o: default stereoization formula for melonDS. You don't need to press it at launch if it's what you want to use.
- k: different stereoization formula for melonDS, which works for a pair of games.
- l: addition of a depth check for the first stereoization formula. This makes Pokémons in battle in Black / White versions that scale too much with convergence be at screen depth. It isn't used by default because some polygons can be caught in other games or locations.


Recommendations
- Each screen has a 4:3 aspect ratio, and therefore the maximum separation is lower than when you play a 16:9 game. You can open "3DVisionWrapper.ini" and use a higher "DepthMultiplicationFactor" to compensate that. In theory, 1.333333 is the multiplier you need to get the equivalent max separation of a 16:9 game, assuming the full vertical space is being used.


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

Sunday, May 24, 2020

RPCS3 (PlayStation 3 emulator) [OpenGL]







3D Vision fix for RPCS3, the PlayStation 3 emulator. This fix was made thanks to the OpenGL wrapper that Helifax made (using the "OpenGL3DVision-v10.1.Beta" 64 bit version).


Update (2020-05-24): fix updated to work with newer emulator versions (at least 0.0.10-10425), because recently something changed in the code of the shaders. You can download the old fix here. The most recent fix is in the installation steps below.


Installation of the fix
- Download this file and extract its contents in the folder where "rpcs3.exe" is, like "rpcs3-v0.0.6-8503-f2a2dfda_win64" (it changes per build).
- Open the properties of the "rpcs3.exe" file and check the "Run as administrator" checkbox.


Configuration and running games
Configure the emulator options like this (globally or per game):
- GPU -> Renderer -> OpenGL
- Emulator -> Emulator Settings -> Automatically start games after boot
- Emulator -> Emulator Settings -> Start games in Fullscreen mode
- Emulator -> Emulator Settings -> Use native user interface

Choose the rest of settings as you like, like resolution scale, anisotropic filter, etc. That can be game dependant or depending on your hardware.
Make sure that in the current windows (or drivers) session you have used something in 3D at least once. Usually OpenGL refuses to trigger 3D Vision otherwise. For example, open a 3D screenshot, put it in fullscreen, enable 3D, exit fullscreen, and enable 3D again in windowed mode.

After everything is configured and prepared, play a game. After you are ingame, you can press the "Pause" key to disable the top right information window.


Fps limits
The OpenGL wrapper works in a way that divides fps by two in 3D. It means that for games like these you will be capped at half the fps per eye. If a game is usually 30fps in 2D, it means 15fps per eye in 3D. It it's 60fps in 2D, then 30fps per eye in 3D.

This is done in a frame sequential way. Each frame happens in a different moment in time. To give a simple example, imagine L1 is frame one (in time terms) going to left eye, R2 is frame two going to right eye, and so on:
- DirectX with 3D Vision Automatic: L1 R1 L2 R2 L3 R3 L4 R4. Four moments in time, eight total eye frames.
- OpenGL with this wrapper: L1 R2 L3 R4. Four moments in time, four total eye frames. You get half the visual information than DirectX in the same time.

To get 60fps per eye, you need games to run at 120fps in 2D. Thankfully, some games have patches for increased fps in RPCS3, surpassing the original capabilities. Let's take Demon's Souls as an example, which is an originally 30fps game.


Save that as "patch.yml" in the emulator folder. Make sure you have made a custom config for the game (right click a game and configure something for it) and then edit its yml file inside the "config\custom_configs" folder.

With "Vblank Rate: 120", the game will run at real 60fps, meaning 30fps per eye.
The other setting they tell you to change is "Clocks scale: 200". However, this doesn't control something important about game speed in this case. Instead, it controls the frame skipping rate of the game. It means that the game will always be targeting the full framerate, but when your PC can't keep up, it will display a black frame (for one of the eyes). Thankfully, the eyes remain synchronized, but these black frames can be very annoying. I recommend leaving Clocks scale at 100 (the original 30fps 2D). I prefer slowdowns rather than black frames.

You can set the vblank rate to 240 to get 60fps per eye (and also enable the 120fps patch), but realistically in 2019 we can't reach that number with current CPUs.

Silent Hill Downpour works at 60fps 2D (30fps 3D) with just the "Vblank Rate: 120" setting.


Problems and limitations
OpenGL is noticeably slower and has more graphics glitches than Vulkan in this emulator. If you can get good fps in Vulkan it doesn't mean they will be so close to that in OpenGL.

If a game for some reason closes the game window to open it later, it will inevitably crash. Example: Kingdom Hearts 2.5, or sometimes when the emulator wants to compile PPU modules after a game has started (which usually happens just once).


Hotkeys
- 0 to 9 (not the numpad): multiple convergence settings, from lower to higher. Default is 1 convergence. Each game will need different numbers and you can edit them in "3DVisionWrapper.ini", after the ";Convergence hotkeys." line.


Game fixes
For now, this fix specifically fixes all 3D issues of Demon's Souls (haloing, water and shadows).

The rest of games should already have basic stereoization and should be playable, if the emulator works in 2D already. I can't promise any game specific fix other than this or other future games I feel like fixing, because the fixing process in this case is tedious and time consuming.

If the emulator can at some point in the future make native 3D modes work, I'll try to adapt that to 3D Vision.


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