Sunday, September 16, 2018

SEGA Mega Drive & Genesis Classics

3D Vision fix for SEGA Mega Drive & Genesis Classics. It includes useful extra features.

Update (2018-09-17): added the "h", "j" and "k" hotkeys for black frame insertion blending.

Update (2018-09-16): added the "n" hotkey for the new black frame insertion feature. I have noticed that the fix can't get your current resolution automatically if 3D Vision is completely disabled, so now I've added the possibility of a manual configuration that will be used in that case if resolution can't be detected automatically.

Update (2018-06-13): added the "3" and "4" hotkeys to handle games with diffent internal resolutions. You'll most likely never need to use "4". Just "3" for games with 256 horizontal pixels.

- Thanks to DarkStarSword's Unity template and some little tweaks done by me, the game room is now fixed. This game uses Unity 2017.
- The emulator screen is now stereoized in fullscreen mode.
- Added scaling features.

- Download this file and extract its contents in the "Sega Classics" folder, where "SEGAGameRoom.exe" is.
- In the "SEGAGameRoom.exe" file, check the "Disable fullscreen optimizations" checkbox. If you don't do it, the Windows 10 1803 update (or later, maybe) will make the game crash.
- IMPORTANT FOR THE SCALING FEATURES: if 3D Vision is disabled in the Nvidia Control Panel, the fix can't calculate your resolution automatically. Open "d3dx.ini", lines 110 and 113, and change the "x3" and "y3" values to the horizontal and vertical resolution you are going to use. If 3D Vision is enabled in the Nvidia Control Panel, these values will be ignored.
- Launch the game, but not using the old game launcher. You need to use the virtual game room, which runs in DirectX 11. Make sure you're running it in fullscreen.
IMPORTANT: after the room has loaded, press F5 to fix some shadows (pressing it again will break them again. It's a toggle). I couldn't find a way to not depend on a hotkey. You need to do this every time you boot the game or every time you press F10 to restore default settings. But after that, the game is perfect.

Scaling features
Sega published this new virtual room recently, but there's something I missed compared to emulators like RetroArch: more scaling options. To be specific, perfect integer scaling. With the number keys from 3 to 9 you unlock and use these features that I made.

First of all, your aspect ratio has to be 4:3 or wider. My code can't handle correctly aspect ratio less wide than this.

My scaling options are made to only work when you use the emulator in fullscreen unless you press the "9" key. If you use that, you can affect the game room TV image, with funny results like this.

The first and simplest thing you need to do to make the emulator use a size and aspect ratio that is a perfect multiple of the native resolution of the console, just press the "6" key. The rest of keys are just extras.

With the first "7" key press, the emulator screen size is divided by 3 or 4 (the first it can find that is a perfect divisor), and with the second press you put the game at native resolution. Keep in mind that you need the "6" key too to achieve pixel perfection.

The "8" key is probable more interesting that the previous one. This one is about manual native resolution multipliers (remember that it depends on the "6" key too for perfect pixels) in case you want to play at some specific sizes. It goes one by one from x1 to x10. After that, it goes back to default. You can cycle backwards with shift + 8.

Some games have an internal resolution of 256x223.25 instead of 320x223.25. Some examples are Shining Force and Wonder Boy in Monster World. To have proper 1:1 pixel aspect ratio in these games, first have the "6" key enabled and then press "3". It toggles between assumed 256px wide and back to 320px wide. The "4" key can be used to assume 240 vertical pixels instead of 223.25, although I don't know if any game in this collection needs it.

If searching around wikis you still can't find if a game uses 256x223.25 resolution, using the x1 size multiplier you will notice right away (pixels will create a wave effect as you move).

Hotkeys (the numbers are not from the numpad)
- F1 or XB_RIGHT_THUMB: convergence presets. One of them will put the emulator screen at screen depth when you use fullscreen mode.
- F4 or XB_LEFT_THUMB: bloom presets that are in this order x0, x0.5, x1, x1.5, x2, x3, x4. The default preset is x1.
- 3: toggle to assume 256px wide instead of 320px. Not used by default.
- 4: toggle to assume 240px tall instead of 223.25px. Not used by default.
- 6: integer scaling toggle. Not used by default.
- 7: emulator image divisors (/3 or /4, and then native resolution). Not used by default.
- 8: native resolution multipliers. Not used by default.
- 9: this toggle unlocks emulator image modifications in the game room.
- n: black frame insertion, intended for 2D 120Hz users that can handle 120fps in the game room preferably (using fullscreen in the virtual TV massively reduces GPU requirements). Three presets (disable one frame, the other, and disabled), and it's disabled by default. This is possible because the emulator inside the virtual room creates duplicate frames to match your maximum fps. As with the PCSX2 fix, it can't know which frame is the original or the repeated one, so you have a preset for each frame. Video demonstration:
- h: black frame insertion blending presets (10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%, 0%). It's 0% by default. This feature uses a reduced brightness image instead of a totally black frame (when it isn't at 0%) to counter image retention. 10% and 20% do a good job about that, at the cost of some "ghosting" caused by the darker image.
- j: black frame insertion blending decrease when you hold this key, over a period of 3.33s if you are playing at 120fps. It's more granular than the "h" presets.
- k: black frame insertion blending increase when you hold this key, over a period of 3.33s if you are playing at 120fps. It's more granular than the "h" presets.

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

Saturday, September 8, 2018

Batman Arkham Knight (DX11)

This fix was made by mike_ar69, DarkStarSword and me (DHR). 

Update Sept 11;
- Add Lensflares-Bloom on/off ("L" key). default off.

- CS Shadows/ Lights
- CS Lights clipping by DSS
- Flickering textures
- Halos in effects
- Decals
- Reflections
- Models
- PS Shadows/Lights
- PS Point Lights
- Lensflares/Bloom (aproximate)
- Water Shore/rips in some zones
- Object Outlines
- HUD....i separate one by one all textures.

TB and SBS Mode (optional):
- The game support SBS/TB Mode using 3Dmigoto. Remove the ";" in the  ";include = ShaderFixes\3dvision2sbs.ini" of the d3dx.ini. Default TB Mode. F11 to cycle. Also remember to use "HDMI Checkerboard" in the NVCP to remove the 720p limitation.

- "F1" to see presets

- Disable Nvidia Gamesworks: Enhanced Light Shafts

Know issues:
- There are still some minor clipping of lights/shadows, specially in interiors.
- Some smokes looks a little strange (i play like that and is minor), that's because i go with the route of fixing with regex some massive PixelShaders that also catch those smokes shaders....i know how to properly fix it (VS+PS) but this should involve to fix manually a lot of shaders (+500).
- Some volumetric lights that appear time to time...this are shared with others fixed shaders that break them, so this is the less harming.

- Extract where BatmanAK.exe is located (\Batman Arkham Knight\Binaries\Win64)
- Start the game, when "Rundll32" prompt appear, press "Yes" (in Win10 this don't appear). This is for the Profile Override needed for this game. In Nvidia overlay you will see "3Dfix by Mike/DSS/DHR".


Planet Alpha (DX11)

- Shadows
- Lights
- Halo
- Decals
- 2D Objects
- Reflections
- Water Reflections
- Light Shafts

TB and SBS Mode (optional):
- The game support SBS/TB Mode using 3Dmigoto. Remove the ";" in the  ";include = ShaderFixes\3dvision2sbs.ini" of the d3dx.ini. Default TB Mode. F11 to cycle. Also remember to use "HDMI Checkerboard" in the NVCP to remove the 720p limitation.

- "F1" to see presets

Know Issues:
- The Sun is 2D

- Disable Volumetric Lights

- Extract where PlanetAlpha-Win64-Shipping.exe is located (\PlanetAlpha\PlanetAlpha\Binaries\Win64)
- Start the game, when "Rundll32" prompt appear, press "Yes" (in Win10 this don't appear). This is for the Profile Override needed for this game. In Nvidia overlay you will see "3Dfix by DHR".


** Do you like the fix? **
If you like the fix, you can donate to this PAYPAL account:

Tuesday, September 4, 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.

UPDATE (2018-09-09): added another preset for the black frame insertion "n" hotkey, so you can choose what frame to turn black (because what the fix detects as the "first frame" is random).

UPDATE (2018-09-08): added the "u" hotkey.

UPDATE (2018-09-04): added one more shader regex to the black frame insertion feature. It's needed for some games, and after a lot of testing I saw that Ratchet & Clank 3 displays a black image with this. Added 3D Vision to anaglyph feature. I have removed manual shaders from the ShaderFixes folder and put them in GameFixes under individual folders, because they were affecting unrelated games. Move those txt files to ShaderFixes if you want to play those specific games, and remove them when you're done.

UPDATE (2018-09-01): added a black frame insertion feature ("n" hotkey), inspired by my RetroArch fix.

IMPORTANT UPDATE (2018-08-28): fix updated with 3Dmigoto 1.3.11. There is now a new folder called "GameFixes", where there are multiple ".ini" files (one per game) with ShaderOverride sections. Now at line 38 of "d3dx.ini" you can load them individually. With this, making fixes for individual games is a lot more easier, and also easier to switch to a different game. Old version here.

ANOTHER IMPORTANT UPDATE (2018-03-16): updated for 3Dmigoto 1.3.6, now compatible with ReShade without needing extra steps unrelated to ReShade (I've tested it as dxgi.dll. Its ingame interface, shaders and hotkeys were working fine). Also, at some point in time it started triggering 3D without SpecialK (the old "d3d9.dll" and "d3d9.ini"). That means no more booting games in a weird manner! It isn't caused by the new 3Dmigoto. It may have been drivers or Windows updates, I'm not sure.
SBS, TAB and other 3D modes now run flawlessly. Check the updated instructions and delete all you had from the previous fix, except for the workaround to make 3Dmigoto load in Windows 10. Old version here.

IMPORTANT UPDATE (2018-01-19): fix updated. the new 3Dmigoto 1.2.70 allows me to stereoize render targets automatically. It means that custom resolution tweaks or "Large Framebuffer" aren't needed anymore.

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.

- Get a recent PCSX2 build, equal or newer than "pcsx2-v1.5.0-dev-2515-gd09ac6d58-windows-x86". 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.
- If you have Windows 7, chances are that PCSX2 won't trigger 3D Vision. If that's the case, unzip this there too and follow the old instructions to boot games.
- Open "d3dx.ini" and go to line 36, 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.

Booting games
Nothing special is needed now. Just make sure you're using DX11 hardware mode and double click the window if you didn't configure PCSX2 to boot games in fullscreen directly. It will automatically use your full resolution and trigger 3D. Switching to other renderers won't crash the emulator anymore. They just won't be 3D.

If you notice strange frame drops to 40fps, try disabling vsync in the drivers.

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.

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. Unneeded after the 2018-01-19 fix.

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. Unneeded after the 2018-01-19 fix.

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, inside the "GameFixes" folder. Check the "d3dx.ini" file, under "Regex vertex shaders". The first elements you will see are:

;analyse_options=dump_tex jps_dds
;analyse_options=dump_tex jps_dds
;analyse_options=dump_tex jps_dds

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

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 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:


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

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.
Hash = c742d5b7
StereoMode = 1
Hash = 3e068917
StereoMode = 1
Hash = afead9ca
StereoMode = 1
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.

 Unneeded after the 2018-01-19 fix.

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.

- o: HUD depth, for elements that have 0 depth or have a "=1" shader override. Regex 2 excluded for image quality reasons.

- p: HUD toggle or its aspect ratio. Same as above for the conditions. The first press changes the aspect ratio of the HUD from 4:3 stretched to 16:9. The second press disables the HUD. The third press restores it.

- n: black frame insertion, intended for 30fps games. 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).

And that's why there are two presets that choose a different frame to turn black. If you care enough about it, run from side to side and choose the preset that shows you the frame that is is more ahead in time. For example, if buildings are moving to the left, choose the frame that moves them clearly more to the left.

If you are crazy and want 20Hz flickering (is there any PS2 game that runs at constant 20fps?), go to the bottom of "d3dx.ini" and change "y4 = (y4 + 1) % 2" to "y4 = (y4 + 1) % 3".

An alternative this hotkey is using ReShade with this shader, if you find games that don't work correctly with mine.

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

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. If the date of that file is newer on github, use it instead of the one that comes with the fix, because it may contain small fixes. Outdated.

User contributions for shader overrides are welcome. Just know the risk of them becoming obsolete in future PCSX2 updates. The fix was first 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
Uncomment the ";run = CustomShader3DVision2SBS" line in "d3dx.ini" and then press F11 ingame (once it triggers 3D) until you have your desired mode.

This below was for the old version of the fix and it's unneeded now (I'm keeping it just in case):

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

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 used in older fix versions 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:

Sunday, September 2, 2018

Ys: Memories of Celceta

3D Vision fix for Ys: Memories of Celceta.

Update (2018-09-02): fix updated with optional dynamic HUD. However, the depth buffer has such a low resolution that the result is wobbly and not 100% accurate. It probably isn't worth the extra GPU usage and you'll prefer to use the manual settings..

- The game now renders in 3D thanks to a profile tweak.
- Shadows that were double stereoized by that profile setting.
- Blizzard effect that was at screen depth now is at full depth.
- Sun brightness at the last dungeon that was at screen depth is now at convergence dependant depth that makes sense.
- Tweakable minimap and HUD depth.

- Download this file and extract its contents in the "Ys Memories of Celceta" folder, where "Ysc_dx11.exe" is.
- Launch the game and let it overwrite the profile.

F1: convergence presets.
F2: HUD depth presets.
F3: HUD toggle. Not disabled by default.
F4: cutscene black bars toggle. It also disables the black square of obtained items while playing, and the black texture of the camera adjustement HUD.
F5: with one press, it disables bloom. With two presses, it also disables some extra brightness. With the third press, it will return to default. Keep in mind that this doesn't modify the gamma modification that HDR does in this game. This just disables the bloom part, but you will get the same performance as with disabled HDR.
F6: tilted HUD presets. Very useful when you are in the field or in dungeons, but I don't recommend it for cutscenes.
F7: fullscreen forcing, in case you use borderless fullscreen (in the first versions of the game, you can't choose your fullscreen resolution and the game uses the maximum it can find. Borderless is a workaround).
6 (not the numpad): dynamic HUD samples (250, 500, 1000, 1500, 2000). More samples mean more accuracy at the cost of GPU usage. But with this low resolution depth buffer you don't need more than 250 or 500. It's 500 by default.
7 (not the numpad): dynamic HUD presets. By default not used. Press it once to put all the HUD at the depth of the center of the screen. Press it again to let all the elements have their own depth. Press it a third time to disable it.

- Use Special K (32 bits, placing it as "dxgi.dll" in the game folder) to create mipmaps for the game. That eliminates all the annoying texture shimmering. In the "dxgi.ini" that it generates, under "[Textures.D3D11]", set "GenerateMipmaps=true". Warning: with this setting enabled, convergence or separation changes while playing will unstereoize the HUD and shadows. You can do a whole game run with it enabled and then disable the setting, so you can use convergence changes and mipmaps at the same time.
Mipmaps will be generated inside a "SK_Res" folder inside the game folder. After completing the game, mine is a bit over 3.5GB. Update: the game now has an extra option in the launcher to create mipmaps natively.
- The game can be CPU dependant if you use the maximum shadow distance and/or resolution. Try reducing them if you see too many fps drops.
- Use the ingame 60fps limiter alongside a 60fps cap in RTSS for perfect smoothness. There can be some microstuttering if you don't do it.

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

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.

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.

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


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.

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

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

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

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.

- Results, showing how it's better than having different colors per eye.

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

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.

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

- 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: