Monday, January 15, 2018

PCSX2 [DX11]





3D Vision feature for PCSX2, the PlayStation 2 emulator (DX11 hardware renderer). It uses a manual shader stereoization method without using physical shader files, for better future compatibility.


Warning number 1: 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. It also requires games to be booted a certain way.


Installation
- Get a recent PCSX2 build, equal or newer than "v1.5.0-dev-2249-g49cd6bc78". Download links are here.
- Configure the graphics plugin (GSdx) to use the DX11 hardware renderer.
- For PCSX2 to be able to see the "d3d11.dll" of the fix on Windows 8.1 or higher, you need to apply this patch for the moment. If the bat file doesn't work, using the "sdbinst d3d11_fix.sdb" in CMD with admin rights may work.
- Download the fix here and unzip its contents in your PCSX2 folder.


Booting games
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.


GSdx configuration requirements and recommendations


1- Interlacing: games that shake when the option is set at "None" will most likely be perfect with the "Bob tff" option, and in some rare cases, "Bob bff". Knowing is a game is interlaced (half vertical resolution, which most of these shaky games have) is important for the next steps.

2- Large Framebuffer: it's needed for 3D when you play at 3x native resolution or higher IF the game doesn't have a "progressive scan" mode or cheat code. Warning number 2: this option increases VRAM usage A LOT at 5x-6x native resolutions and higher.

3- Custom resolution: it's needed for 3D IF you are playing an interlaced game (unless you play at native or 2x native) OR IF you really don't want to use "Large Framebuffer". Interlaced games need a higher than normal vertical resolution. Example: Devil May Cry only works in 3D with 3840 horizontal resolution if the vertical resolution is 2879 or higher.
Note: there are ways of forcing 3D via "TextureOverride" in "d3dx.ini". Read the shader overrides explanation.

4- Enable HW Hacks: some games need some of these to render right, especially "Align Sprite" (some Namco games like Soul Calibur 3 or Tekken 5), which demands native resolution multipliers, and "Half-pixel Offset", to have some bloom effects at their correct position. Things not related to 3D.


Use of regex toggles
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. In the "PCSX2_3D_game_database.txt" file I include I made a compilation of results of games I have and when you need to disable regex 2 and/or 3 or none.


Use of shader overrides. Warning number 3: 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. Check the "d3dx.ini" file, under "Specific game fixes". The first elements you will see are:

[ShaderOverrideRegex1VS]
Hash=6d64bfd710f98b05
x3=0
w3=0
[ShaderOverrideRegex2VS]
Hash=0c8511661cbc3936
y3=0
[ShaderOverrideRegex3VS]
Hash=a1f8cd42ceaae9e9
z3=0

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 skybos 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.

Sections below them are game fixes with comments saying what they fix. 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.

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

Warning number 4: this will make games less stable when switching out of fullscreen, and VRAM usage will be higher.

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 "d3dx.ini", below the other shader overrides:

[ShaderOverride_TotallyUniqueNameOrElseError]
Hash=07ee058e5bed1e6b
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".

Note: the included "d3dx.ini" includes shader overrides for many games I have (with explanations about what they affect). There could be conflicts with other games, as I have explained. If you suspect they could be interfering with your game of choice, delete them, but not the regex ones that are at the start.


Texture overrides
With this, you can force games to be 3D that you want to play with native resolution multipliers, without needing "Large Framebuffer" or custom resolutions, for games without progressive scan mode. Dump any pixel shader, as previously explained. Check "ShaderUsage.txt" and go to lines starting with "<RenderTarget orig_hash=". Get the hash of all render targets there and write it like this Devil May cry example in "d3dx.ini":

;Stereoization of 3840x2160 in DMC.
[TextureOverride1]
Hash = c742d5b7
StereoMode = 1
[TextureOverride2]
Hash = 3e068917
StereoMode = 1
[TextureOverride3]
Hash = afead9ca
StereoMode = 1
[TextureOverride4]
Hash = 98dd53df
StereoMode = 1

After reloading with F10 or running the game again, it should be 3D. However, every resolution has different hashes. Remember to disable hunting mode.


Hotkeys
You will probably need at least some of these hotkeys (which you can configure in "d3dx.ini") when playing:

- v: it changes the type of 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.

- b: toggle to unstretch 4:3 games from 16:9. It will be buggy depending on the game, and the sides will flicker. Avoid using this if possible.

- j: regex 1 stereoization toggle.

- k: regex 2 stereoization toggle.

- l: regex 3 stereoization toggle.

- h: convergence presets. Different games may need wildly different convergence levels. I tried to cover as many cases as I could.

- g: multiple God of War 1 and 2 separation and convergence combination presets, from higher to lower. 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 convergence presets. The Nvidia separation hotkey or wheel is OK to use. Don't use this hotkey with other games unless you find another like them.

- f: toggle for moderately higher max separation. Some games like Soul Calibur 3, Tekken 5, Ys IV and Ys V use a lower separation than the rest of games. 5.6cm instead of 7cm in my monitor. 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.


Fix updates
I will probably keep updating this if PCSX2 changes the regex shaders. Also, exclusive fullscreen may be an official feature in the future, which will make the included "d3d9.dll" and "d3d9.ini" unnecessary. And it will also make the game booting process simpler and more stable.

I also keep the "d3dx.ini" file in my github account.

User contributions for shader overrides are welcome. Just know the risk of them becoming obsolete in future PCSX2 updates. The fix was done using "pcsx2-v1.5.0-dev-2249-g49cd6bc78-windows-x86", and I can confirm a build few versions newer than this, used by a different person with different drivers, was compatible with all shader overrides.


Side By Side / Top And Bottom / Interlaced compatibility
Normally you would have to uncomment the ";run = CustomShader3DVision2SBS" line in "d3dx.ini" and then press F11 ingame (once it triggers 3D) until you have your desired mode. However, the game window stays black when you try to do it.

The workaround is not enabling that line, having "hunting=2", starting the booting process until after you have "unlocked" the exclusive fullscreen possibility, uncommenting the ";run = CustomShader3DVision2SBS" line, saving changes, going ingame in fullscreen mode, pressing F10 to reload the configuration, and then pressing F11 until your 3D mode is selected.

Painful, I know. I don't know a way to fix this completely. But the workaround works.


Windows 7 compatibility
I haven't tested this with Windows 7. If there are any crashing problems when opening the GSdx configuration at the right time, open "d3dx.ini" and look for this block:

allow_check_interface=1
allow_dxgi1_2=2
allow_create_device=1
allow_platform_update=1

Back when I used 3D in Windows 7 (with an old method that I include but you have to unlock. I don't recommend it so I won't explain here how to use it), I needed those settings to be 0, with maybe "allow_create_device=1" or "allow_create_device=2".


Special thanks
- All 3Dmigoto developers and contributors (bo3b, DarkStarSword, Flugan...).
- All PCSX2 developers and contributors. Without them, we wouldn't be able to even play these games in 2D.
- Kaldaien, for the specific SpecialK build I use to force exclusive fullscreen (0.7.0).
- 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 this and want to contribute for more future fixes, you can donate to this PayPal account: masterotakusuko@gmail.com

Immortal Redneck [DX11]


Keys:
F1 - toggle different values HUD and crosshair depth
F2 - enable/disable gun (disable it on high levels of convergence)

Installation:
  1. Download Tested on 5.6.3.54493 and extract the contents into the game directory.
  2. Use Nvidia Inspector to assign the game's EXE to the profile "3D-Hub Player". (For instructions on how to assign profiles, see this guide)
  3. In your Steam library, right click on "Immortal Redneck" and select "Properties"
  4. Click "Set Launch Options"
  5. In the box, type " -window-mode exclusive" and click "Ok"
  6. If you use not steam version in desktop shortcut's properties in object field add " -window-mode exclusive" after 'ImmortalRedneck.exe'.
I made this using DarkStarSword's Unity template.
If you like this mod, please consider supporting DarkStarSword on Patreon

P.S. I've created "Unity Game Wishlist" HERE

P.P.S. Oh my god, I can fix even Unity 5.6 (not allowed by DSS's template yet)

Sunday, January 14, 2018

Sniper Ghost Warrior 3 (DX11)


Fix:
- Shadows
- Lights
- CS Tile Lights
- SSR and Reflections
- Volumetric Lighting
- Decals
- Halos in effects
- Lights Shaft
- HUD and Crosshair

TB and SBS Mode:
- The game support SBS/TB Mode using 3Dmigoto. Remove the ";" in the  ;run = CustomShader3DVision2SBS in the [Present] section of the d3dx.ini. Default TB Mode. F11 to cycle.

Settings:
- Use Shadows and Shaders in the HIGHEST (at least those 2 to make the fix work properly)
- Copy-Paste this lines in the game.cfg (\Sniper - Ghost Warrior 3\GameSDK):
   r_DepthOfField = 0
   r_MotionBlur = 0
   r_SSDO = 0

Presets:
- "P" key to cycle Crosshair or you can disable in the game menu

Note:
- Not all HUD elements are in depth, because they share the same texture, so break others stuff.
-  r_SSDO = 0 disable that strange type of AO...make some stuff a litte blurry. You still have a normal AO.

Instructions:
- Extract where SGW3.exe is located (\Sniper - Ghost Warrior 3\win_x64)
- Start the game, when "Rundll32" prompt appear, press "Yes". This is for the Profile Override needed for this game. In Nvidia overlay you will see "3Dfix by DHR".

Download

Screenshots

** Do you like the fix? **
If you like the fix, you can donate to this PAYPAL account: dhr.donation@gmail.com
Thanks!

Mages of Mystralia [DX11]


Updated 14.01.2018 (added fix for Unity 5.5)

Installation:
  1. Download Tested on 5.4 build #27147  or  Tested on 5.5.4.64782  due to game's exe version and extract the contents into the game directory.
  2. In your Steam library, right click on "Mages of Mystralia" and select "Properties"
  3. Click "Set Launch Options"
  4. In the box, type " -window-mode exclusive" and click "Ok"
  5. If you use not steam version in desktop shortcut's properties in object field add " -window-mode exclusive" after 'Build.exe'.
I made this using DarkStarSword's Unity template.
If you like this mod, please consider supporting DarkStarSword on Patreon

P.S. I've created "Unity Game Wishlist" HERE

Saturday, January 13, 2018

Aragami [DX11]


Thanks to DarkStarSword for developing his Unity 5.5 template
  1. Download this ZIP file and extract the contents into the game directory.
  2. Use Nvidia Inspector to assign the game's EXE to the profile "3D-Hub Player". (For instructions on how to assign profiles, see this guide)
  3. In your Steam library, right click on "Aragami" and select "Properties"
  4. Click "Set Launch Options"
  5. In the box, type " -window-mode exclusive" and click "Ok"
  6. If you use not steam version in desktop shortcut's properties in object field add '-window-mode exclusive' after 'Aragami.exe'.
I made this using DarkStarSword's Unity template.
If you like this mod, please consider supporting DarkStarSword on Patreon or Paypal

Friday, January 12, 2018

Life is Strange: Before the Storm

Download the fix: 3Dfix-Life+is+Strange+-+Before+the+Storm-1.0.zip

The long awaited support for Unity 5.5 (and higher) in my Unity template has finally arrived!

We're all used to game and engine updates breaking these fixes from time to time and when it happens it ranges from a minor inconvenience requiring just a few minutes or hours to address, to a massive time waste of having to redo an entire fix from scratch, to a major headache where the new version has fundamentally changed in some way requiring a huge amount of new work put in to solve some new problem that didn't exist before. The Unity 5.5 update was of the later variety due to some major changes in the engine's shader format, but I have at last managed to decipher the new format and we can now enjoy modern Unity games in stereo 3D once again, beginning with the prequel to one of my favourite games of all time :)

Auto-Convergence

This fix introduces a brand new feature to automatically adjust the convergence while playing to suit the wide range of camera angles this game has. This feature tries to always maintain a small amount of pop-out to maximise the 3D effect, while preventing excessive popout that could make the scene uncomfortable to view and lowering the convergence when necessary to prevent objects near the camera from obscuring the view of the game.

The auto-convergence feature replaces the traditional meaning of 3D Vision's convergence setting with a "popout" setting, which is similar to convergence, but gives better results with a wider range of camera angles, monitor sizes and viewing distances. The same keys that normally adjust the convergence will adjust the popout instead when auto-convergence is enabled, and the popout value will be displayed on screen while adjusting it.

Occasionally the auto-convergence may start jumping back and forth between high and low convergence. It has countermeasures to automatically detect when this happens and temporarily lock it to the lower convergence to stop it, but if it happens anyway and you find it distracting you can toggle the auto-convergence feature off by pressing ~

This feature has a number of tunable parameters, which can be tweaked by editing the [Constants] section in the d3dx.ini. These tunables include things such as the initial popout, minimum and maximum allowable convergence values, thresholds for how far the convergence is allowed to get away from the target, and threshold for the anti-judder countermeasure.

  • ~: Toggle auto-convergence feature on and off
  • Ctrl+F5: Reduce popout when auto-convergence is on
  • Ctrl+F6: Increase popout when auto-convergence is on

Installation

  1. Extract the contents of the zip file to the game directory.

  2. Right click on the game in Steam and go to "Properties" -> "Set Launch Options" and enter "-window-mode exclusive" (without the quotes) and click "Ok"

  3. I suggest disabling subtitles, as these are a little distracting.

Troubleshooting

If 3D disengages after leaving the game idle for a while, press alt+enter twice to re-enable it.

Like my Work?

Fixing games takes a lot of time and effort, and I am currently otherwise unemployed largely due to my ongoing battle with mental health issues.

If you are in a position where you are able to do so, please consider supporting me with a monthly donation on Patreon, and thanks again to those that already do! While I prefer the more stable monthly support that Patreon offers, I can of course understand that some of you prefer to make one-off donations when you can, and for that you can use my Paypal. As a reminder, these donations are to support me personally, and do not go to other modders on this site.

This mod is created with 3DMigoto (primarily written by myself, Bo3b and Chiri), and uses Flugan's Assembler. See here for a full list of contributors to 3DMigoto