Saturday, April 14, 2018

UE4 Universal Fix



I made this UE4 Universal Fix because the time spending on fixing games is HUGE, so this save A LOT OF TIME. End results: More time to play and less time spending on fixing a game. And second i made this because there are a lot of games that are not fixed (not catch the attention of a Shaderhacker, or they are very niche....so sadly, not fix for them)....this add a new possibility if those games are using this engine :)

This Universal Fixes are made thanks to DarkStarSword, who add ShaderRegex to 3Dmigoto, for me the TOP1 feature. This feature have an incredible potencial and is very very consistent....i use this feature in every game i fixed since the feature was released.

Thanks to bo3b for help me solving some swizzle in asm with some of the variant of the 2D Objects and Decals.


This Univeral Fix should fix any UE4 game about 90% and 98%.If devs change or tweak the vanilla engine, the fix may not work properly in some effects (example: Hellblade). Read the README.txt for more info.

The effects that are "Not fixed" are related to shaders that DON'T have a common pattern, so add a universal fix can cause others effects broke that originaly are working correctly....is too risky! and can make the game looks worst. In any case this should always be the starting point to fix a game using this engines.

Update: 04-16-2019
- Update to 3Dmigoto 1.3.16
- Decals fix cycle option - "L" key
- Extend Shadows, lights, reflections fixes
- SSR fix add - the one pattern that is universal (Thanks to masterotaku!)

Fix on the Fly:
- Shadows
- Lights
- Tile Lights
- Reflections
- VS Reflections (by sun or moon)
- Volumetric Lighting
- Light Shafts
- 2D Objects
- 2D Decals
- Halos
- SSR

Not Fixed:
- HUD elements
- Object Outlines (see the bottom of the d3dx.ni for the instructions to fix it)
- Some variant of effects


Download


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

65 comments:

  1. hi thanks for the fix i try Rad Rodgers but when i press ctrl+T the 3d not working

    ReplyDelete
    Replies
    1. You need to make sure that the game is running in 3D before you add this fix. This fixes the broken 3D effects, but can't do anything if you are not already running in 3D.

      Delete
    2. can you tell me how to run this game ( Rad Rodgers ) in 3d pls witch profile to use

      Delete
    3. The fix already have a profile override.
      Make sure you are using fullscreen to activate 3D....like bo3b says, make sure the game run in 3D before using the fix.

      Delete
  2. thank alot man but sbs is not working

    ReplyDelete
    Replies
    1. Remove the ";" in the ;run = CustomShader3DVision2SBS in the [Present] section of the d3dx.ini. Default TB Mode. F11 to cycle. Use Checkerboard in the NVCP.

      Delete
  3. Jesus....amazing the things you all do with the fixes!!!!!
    Thanks a LOOOOOT to all you Shaderhackers!!!!!

    ReplyDelete
  4. Hello, can ANYONE here, explain me, what "Helix Mod" is? I searched on Google..., found no answer. And also here, I don't find any answer. That's not realy user friendly. Some people may stumble over that topic, because it have to do with "3D gaming", but don't find any explaining, what for "Helix Mod" is and what it do. It's like somoeone would sell cars without any name or other information. "You want a car? I have a car for You! Brand? The brand is "car". What engine? It has a engine! Tires? Four!". Sanyone get what I mean?? Nobody starts a book in the middle, because then some essential information would be missed. Or is that a secret society here? ;-D Sincerely

    ReplyDelete
    Replies
    1. Well, if you don't know what HelixMod is... you don't need it. :->

      It's not exactly as secret society, but we are small in numbers, but very enthusiastic about our mods. The short story is that we all use NVidia 3D Vision to play games in stereoscopic 3D. But, the games are complicated and typically have broken effects in 3D, like shadows looking out of place. Our mods using the HelixMod tool for DX9, and 3Dmigoto for DX11 manually fix these problems by editing and replacing the shaders that the games use.

      This particular fix of UE4 universal fix, automates that process from being a manual search for shaders, into one that uses regex expressions, because we know that all UE4 games use the same shaders, so we can do an automatic replacement for known patterns.

      Upshot- we make games playable in stereoscopic 3D, that were never designed with that in mind. Nearly every game looks better and is more fun in stereoscopic 3D. A big part of the appeal of the current VR craze is that people are getting to see actual stereoscopic 3D for the first time.

      Delete
    2. BTW, if you want to see a bunch of game screenshots, you can look through http://photos.3dvisionlive.com/. You can see some examples of before and after fixes.

      You can view these screenshots with normal red/cyan glasses for a rough idea. Normal 3D Vision hardware, or good 3D TVs are much better than anaglyph.

      Delete
    3. This comment has been removed by the author.

      Delete
    4. Thank you a lot, for that stupid first sentence! I don't know why people treat other poeple in this way, without any plausible reason! Like if I would be to stupid to understand something! This is just asocial!

      Delete
    5. But anyway, thank you, that I got already before my first post. So HelixMod is like Tridef or VorpX, or it only correct some issues while playing non-stereoscopic-games in 3D? I want to know that because I also play games in 3D, but with Tridef and Vorpx, over a 3D-Beamer. And I want to know, if HelixMod would also help, when I play Games in 3D over my 3D-Beamer (shutter)and without Nvidia 3D-Vision. Thanks for anyones answers.

      Delete
    6. I also would like to know, if it only work with anaglyph-3D (because all the pictures behind the link you sended me, were in anaglyph). But I can't imagine that, because the 3DVision-Kit's also work with shutter-technic.

      Delete
    7. Hmm... So you already knew what HelixMod does, but just came here to complain?

      For 3D Vision on an unsupported projector, you can use 3D TV Play. See this thread for background.

      This is not the spot to discuss our failings. Go to the 3D Vision forums if you have further questions.

      Delete
  5. Hi, can't make it working with Vanishing of Ethan Carter REDUX. It's bugged in 3D mode with or without this fix. Please help. Thanks a lot.

    ReplyDelete
    Replies
    1. I took a look using the GoG version, which also provides the free Redux version.

      This universal fix does not work with the Redux version completely. There are some shaders that are clearly being fixed in the log, but graphical effects are broken including shadows and water reflections and decals like blood. I also tried the 3 variants of decals and none work for this game. Shaders must be too different.

      Always possible that the variants are small, and with enough enthusiasm you can possibly compare the universal versions to this game's versions, and work out how to manually tweak the shaders.

      Playing the original version that includes the DX9 fix, I don't actually see any visual difference between the versions. Graphical comparisons on the web also suggest there is no actual visual difference, it's just a new conversion for Xbone. Original game is still spectacular and fix works fine.

      Delete
    2. Probably they change the constant buffer # related to each effect (i see this in another UE4 game). Since the DX9 version is fixed and is the same has DX11, graphicaly speaking, not make any sense to waste time making it work.

      Delete
  6. I am having issues getting the software cursor to work in 2 different games.. Conan Exiles and Fractured Space.. Am I supposed to do somethins special to the files besides uncomment the line to enable it??

    ReplyDelete
    Replies
    1. Probably needs more setup, depending upon what you are trying to do.

      Release notes

      You can set to fixed depth in the shader, manually. Or you can pass in a depth map to get it be like a lasersight. By default I think it follows whatever the original game cursor would do, so if the game cursor is stuck at screen depth, this will too.

      Delete
  7. Well I am getting the software mouse to show. the problem is it is not is stereo.. I seen in the Mouse.hlsl configuration the section it says where I can add more depth but have no idea how to get it too work or configure it..

    // Adjust stereo depth of pos here using whatever means you feel is
    // suitable for this game, e.g. with a suitable crosshair.hlsl you
    // could automatically adjust it from the depth buffer:
    //float2 mouse_pos = (cursor_window / window_size * 2 - 1);
    //output.pos.x += adjust_from_depth_buffer(mouse_pos.x, mouse_pos.y);

    I would appreciate some help on what I am supposed to do there as I have no idea and it is not clear to me..

    ReplyDelete
    Replies
    1. I have no idea either, I haven't used it. Here is a guide for using the depth buffer.

      Crosshair Guide

      Depending upon what you need, you might just set it to a fixed depth. Should work like normal depth setting, so maybe just multiply pos.x by 0.75 or something.

      Delete
  8. OK I figured it out. I needed to add the following to the Mouse.hlsl file and I got it working in Stereo:

    //NEW LINES-----------------------------

    float4 stereo = StereoParams.Load(0);
    float4 iniParams = IniParams.Load(0);
    output.pos.x += stereo.x * 0.4; //pushes mouse cursor further into the screen

    ReplyDelete
  9. Hi, thanks DHR and bo3b. I'd like To know if the F11 cycle key can be changed with another key in d3dx.ini file. For example Dragon Ball fighterZ is in conflict with F11 key to activate top bottom or side by side modes in checkerboard full hd.

    ReplyDelete
    Replies
    1. Yes, you can change the key to anything you prefer. Edit the d3dx.ini file and look for the [KeyChange3DVision2SBSOutputMode] section. You can change the "key = F11" there.

      Delete
    2. Thanks a lot bo3b!

      Delete
  10. Hi bo3b, i have change the key to F10 or F12 in the [KeyChange3DVision2SBSOutputMode] section into the 3dvision2sbs.ini file but it doesn't work. When i run dragonball fighterz and press F10 or F12 key nothing happens. If i let the no_modifier F11, i get a fatal error ingame when i push F11. Yet i have changed x7=5 by x7=2 (sbs) and delete the ; before "include = ShaderFixes\3dvision2sbs.ini". Please help me Boss.

    ReplyDelete
    Replies
    1. Did you use the "key = no_modifier F10" for the test? Default should be no_modifier, but I'm not certain what is optional. If it doesn't work in this game, try the experiment on a different game that is working to test.

      SBS may not work with this game. There is a lot of complexity, and it might break something when it changes. Default of x7=5 should startup in that format, without needing a change. What happened in that case?

      Delete
    2. Hi bo3b. First thanks for your last answer and for according this time to my issue. In that case, the game is running well but no reversed top and bottom mode. Yet i let the default of x7=5 (reversed top and bottom), and i also let "key = no_modifier F10" and even try with "key = no_modifier F11". I'm using the last version of UE4 Universal Fix witch is Universal.Fixes-3Dmigoto.1.3.11.x64-3DFix.UE4.Engine.zip. It's frustrating, i don't understand why it doesn't work. According to this steam game, without any 3d fix, when you press F11 it disable the fullscreen mode (=windowed mode). If you use the fix and press F11, you get a fatal error message. Dragon ball fighters from steam have 2 executables in 2 folders: DBFighterZ.exe in ...:\Jeux\Steam\SteamApps\common\DRAGON BALL FighterZ and RED-Win64-Shipping.exe located into ...:\Jeux\Steam\SteamApps\common\DRAGON BALL FighterZ\RED\Binaries\Win64. I put the fix into one of them and even both at the same time. In 720p, 3d is activated and impressive, Ctrl+T is working well. No way in 1080p (checkerboard checked in nvidia control panel). Mystery case!

      Delete
    3. I forgot to tell you this game is using a program called EasyAntiCheat, so do you think it could prevent the 3Dmigoto d3d11.dll to load. Maybe no modding allowed to prevent cheating ? If it's true why is it working in 720p?

      Delete
    4. Interesting about EAC. That's blocked us out of a couple of games, including Far Cry 5. DarkStarSword was in contact with them to try to get us whitelisted, but I don't know where that stands.

      Seems like if it works a 720p, then we are whitelisted, or at least not blocked, and it would not be EAC. You can tell for certain one way or the other, if you enable our logging by setting 'calls =1' in d3dx.ini. If you get a lot file, we are connecting. If not, we are blocked.

      Most likely answer here is that SBS shader is not compatible with this game. But because it works in 720, could be some interaction with NVidia driver or 3D TV Play blocking it as unsupported. (I don't use 3DTVPlay, so no experience here)

      Delete
    5. You're right bo3b, i have read reshade was whitelisted, hope DarkStarSword will give us a good new from them. i'll try to set 'calls =1' in d3dx.ini and come back soon to give you the results. Sorry for my conjugation from France (Cow's land).

      Delete
    6. No lot file so we are blocked. d3d11.dll is in conflict with EAC connexion and nvapi64.dll generate an untrusted system file error. No solution excepted a whitelist from Bandai (or Unreal according to the game). Thanks a lot bo3b.

      Delete
    7. OK, bummer. You might want to add your voice on the EAC forums for 3Dmigoto support. If they hear about it more often, they might eventually figure out we are not cheating. If DSS is offline, please feel free to direct them to me as the codebase owner on GitHub. We can do anything they need to make it trusted.

      For a super hack version, it might be interesting to try putting 3Dmigoto dlls into the System32 folder. If you rename the real version, then proxy through to it, they can sit in the same directory. Not sure if that will avoid the EAC problem, but it's a thought. Be sort of dumb if that works though, not much of an anti-cheat.

      Delete
    8. Thank you bo3b, i'll try it but before do you think there's a risk of being banned because i'm playing only original games and i'll be disappointed in reading "you have been banned" or something like that

      Delete
    9. Goku is my friend since i was a child so i dont want him to become an enemy.

      Delete
    10. We really don't know. No one has been banned to date, but you could be the first. Given that you would actually be bummed from that, I'd say it's probably not worth the risk, because EAC is more hard ass than any prior people we've seen. I expect to see EAC follow the same path as Denuvo- successful for awhile, until the hackers get interested and blow them up. People keep trying to do this DRM/restriction stuff, and it has never worked long term.

      Maybe try it with an alternate account or something if that's possible.

      Delete
  11. So how does one go about installing this fix? And someobody said the game has to be running in 3D to run this fix? What do you mean by that? Do you need to have the game running then install this fix?

    ReplyDelete
    Replies
    1. You drag and drop the 3Dmigoto files into the game folder, next to the game .exe. You would only use this if you were trying to fix a game that doesn't not already have a fix, and is created using UE4.

      For better understanding, you should ask questions and do some searches in the Nvidia 3D Vision forums. Or join the Discord and ask there.

      Delete
    2. Ok, i wonder if they have tutorials on how to use 3dmigoto, Nvidia 3D CM. Because I don't actually know anything about these. I just started testing out 3D vision this past weekend

      Unrelated: Is there a way to make sure one games 3d depth and convergence settings doesnt' affect anothers. I hit CTL+F7 to save the game settings but when I start another game, the settings from the last game get transferred to the settings of the new game. My Arkham City settings bleed into GTA V and vice versa depending on which one I configured last. In fact I suspect this is why GTA V crashes sometimes. Because it doesn't remeber using those settings

      Delete
    3. If you are new, best bet is to join the community on the NVidia forums at https://forums.geforce.com/default/board/49/

      Tons and tons of helpful information there. You've already found the best resource, HelixModBlog, our fixes are superior to pretty much anything that NVidia puts out.

      Since you are new, the easiest way to get going is to use the 3D Fix Manager, navbar at the top of page. This works as an easy installer and simplifies a lot of the setup. Scans for every game you have installed that has a matching 3D Fix.

      For ctrl-F7: As a general rule, that should already be working on a per-game basis. The way it works is by saving the convergence value to the game profile. See NVidia Profile Inspector as a tool that lets you inspect and change these profile values. Separation/depth is not saved, and is always a global parameter. Often you'll set separation to match your viewing device and use convergence to tune a given game.

      If you are getting convergence changes in other games, that probably means you are changing the default/primary profile instead. You can avoid that by making a new profile for the game in question. GTA V may not have a profile for example, so might be using default.

      Also, GTA V uses their built in 3D, you should use that, not the automatic mode of the 3D Driver. In-game settings for separation/convergence in GTA V. Try using other games first, GTA V is notoriously ill behaved and will be confusing for newcomer.

      Delete
    4. I actually don't see any changes in the image when I change the convergence settings in game settings for GTA V. Only when I change it via Nvidia and for whatever reason, even if I change it for a different game it bleeds into GTA V.

      How do I make a game profile for a game in Nvidia then? I only see 3d settings for each game but none of the options concern 3D. Or can 3D fix manager do that for me, even if the fix is not installed. I don't want to install the GTA V 3D fix since its not required. Can I still edit its 3d settings in 3D fm?

      Delete
  12. Hi, Thanks for this. I tried this with Hellblade Senua's Sacrifice but could not get it to work. I copied the files in the
    Steam\steamapps\common\Hellblade\HellbladeGame\Binaries\Win64 folder, but did not work. Can anyone confirm if these files work for you? Thank you very much.

    Also a small detail, in the Readme file, it says "drop the file" and the zip folder has 32 files, so please add an "s" to the word "file" in order not to confuse someone :)

    ReplyDelete
    Replies
    1. For Hellblade in particular, this already has a full working fix. Not sure why it didn't make it to the blog, but go to https://forums.geforce.com/default/topic/938077/3d-vision/hellblade-senuas-sacrifice/10/ to find a finished fix.

      Delete
    2. ohh... crap. I finished the game and uninstalled it. Did not know that this topic would be watched by someone so fast. Thanks bro! I will re-install and try it.
      Definitely, this should be in the game list here.

      Delete
  13. Not working with UE4 version 4.19 when SteamVR is running. Restarting the game without SteamVR works but defeats the whole purpose of SBS if you can't open SteamVR to actually use your headset.

    ReplyDelete
    Replies
    1. I don't think this has anything to do with this UE4 Universal Fix. If you run without the fix installed, don't you get the same result?

      This is most likely to be a UE4 project that has left the VR flag enabled on their builds. Unless it's an actual VR game, it makes no sense to leave that on, but multiple games have done this because it's the poor default to be on. 3DFM will automatically fix this by renaming the bad DLLs out of the way. See for example Turing Test.

      Delete
    2. Thanks for the reply,

      I was passing -nohmd as a launch parameter to disable VR because like you said the VR flag is enabled when it shouldn't be.

      The guide for disabling it in Turing Test involves a plugins folder and uplugin files which does not exist in these games. I don't think that 3d Fix Manager is resolving the DLLs, as SteamVR still starts without the -nohmd parameter. I'm unsure of how to do it manually as literally renaming the VR-related DLLs gives "fatal error." Perhaps I am setting up the game incorrectly? I'm setting "Custom Root / Game Path" to "//Binaries/Win64/" and "Game Launcher Exe" to "-Win64-Shipping.exe" where is the proper name. Any idea on what I'm doing wrong?

      Also to note: these aren't Steam games so part of the Turing Test guide is inapplicable.

      Delete
    3. "-noHmd" does not work. Probably wrong version of UE4. But I'm not sure that ever worked.

      I just tested this and 3DFM most definitely fixes the problem of disabling the VR launch for Turing Test. If it's a UE4 game, it should work here. I think it deletes the unreal plugins, not use -nohmd or delete any dlls. OpenVR.dll cannot be deleted because it typically is hard-linked to a game.

      Delete
    4. Sorry I think I posted this as a new comment instead of a reply.

      It seems specific to newer versions that -nohmd was added and plugins were removed, making the current method obsolete. I made sure there wasn't a plugins folder in a fresh installation since you mentioned 3DFM deletes them. Confirmed this with version UE4 version 4.18 as well, not sure about anything older.

      The behavior is very strange. With SteamVR closed, open the game with -nohmd and the fix applied (stereo works), open SteamVR, suddenly stereo is disabled. When I press Numpad0 I can see the convergence and separation but after opening SteamVR it simply says "Stereo Disabled". I thought Ctrl+T might enable it but it doesn't.

      Delete
    5. On the game window do you see any blocky red text describing that it is not running both stereo and VR at the same time?

      I've seen this problem with The Witness, where they have a VR addition that is not used, but it directly locks out stereo from working at the same time. Looks like something in the OpenVR that forces stereo off. I have not been able to come up with a workaround yet.

      There was some way to change settings files with UE4 also, as a way to disable it from auto-launching VR. Essentially fix the flag the game devs neglected to uncheck.

      Delete
    6. I saw "close oculus/steamvr and relaunch game" once when switching to full-screen. It disappears fast, though.

      Delete
    7. Ah yes, that's the one. My best guess here is that is something drawn by the OpenVR layer, and something they are doing with regard to killing stereo. It's the wrong choice, but their programmers often make mistakes like this.

      It pretty much has to be in the OpenVR layer, because I see the same thing with The Witness, and that game uses a custom game engine, not UE4. This is highly annoying, because we could also play other games in SBS if they weren't being stupid.

      If you can narrow down how to bypass the problem on UE4, that might explain how to fix it. I tried replacing the OpenVR.dll with a stub dll that didn't call through, but it didn't fix it. Something they've linked with is calling out to SteamVR and making them launch when they shouldn't.

      Delete
    8. Not sure if this helps but the source code for openvr_api.dll is available.

      https://github.com/ValveSoftware/openvr/tree/master/src

      Delete
    9. Yes, I'd taken a look at their code recently, and I don't find where this might happen. That suggests it's part of the SteamVR layer, instead of OpenVR. Could also be NVidia driver, but they have a different mechanism using profile flag to disable 3D for VR apps like Oculus Home.

      If it's part of SteamVR, that's out of our reach, and Valve never responds to anything ever, so we can't reach them.

      We know it happens in multiple games, Assetto Corsa, The Witness, UE4 here, Unity apps. Clearly not game engine related. It doesn't always happen, because 3D works fine while VR is running for a lot of cases. Seems to only happen for some scenarios where the game itself supports VR, even if it's half baked like The Witness. Doesn't always happen though, because Dirt Rally supports Oculus, and does not interfere. Another hint that it is SteamVR causing the problem.

      Don't know. That's all I've got so far.

      Delete
    10. It's very strange. I hope you or somebody finds the solution.

      If only there was a way to hide from the application that SteamVR is running.

      Delete
    11. There is always a way, just typically hella hard to figure out how. I [i]might[/i] come back to this later, but it's so few games that I can't justify the time.

      If this is important to you, you need to at least file a bug report with Valve to let them know they are doing it wrong and it's the wrong approach. They will never respond, but there is an off chance they'll notice and fix it.

      Delete
    12. I watched d3d11_log.txt from the moment I opened SteamVR and there are only 2 lines:

      updating stereo texture with eyeSeparation = 0.000000e+000, separation = 0.000000e+000, convergence = 0.000000e+000, active = 0
      nvapi fetched screen width: 1920.000000, height: 1080.000000

      Delete
    13. Actually, that will be the nvapi.log instead. I previously tried changing some settings in d3dx.ini, like force_no_nvapi and force_stereo=0, as a possible way to lie to the OpenVR runtime about 3D being enabled, but had no success.

      For experimentation, I currently think that it might be possible to move SteamVR out of the way at the right moment to avoid this, but it's not clear.

      Most likely solution here will be Valve fixing the bug in their software.

      Delete
    14. Sorry posted as a comment again. Blogspot you confusing me. ��

      I feel like I've tried most of the settings.

      I took out "if stereo_active && $mode" in 3dvision2bs.ini which forces it to draw SBS but without any eye separation so it's just 2D SBS. Do you know of any way that might force those values? It's quite the hack but it might work.

      Delete
  14. I feel like I've tried most of the settings.

    I took out "if stereo_active && $mode" in 3dvision2bs.ini which forces it to draw SBS but without any eye separation so it's just 2D SBS. Do you know of any way that might force those values? It's quite the hack but it might work.

    ReplyDelete
    Replies
    1. No, sorry, I'm not up to date on that part of the SBS shader. Best bet would be to ask this question on the Discord channel for 3D, as DarkStarSword can likely help. Someone there might also have a better idea regarding the VR problem.

      Delete
  15. I am playing Warmachine tactics with this and there is green text showing vs cs gs. From my understanding it's using a debug dll, is there any way to disable this text? p.s. Thank you so much for updating this fix!

    ReplyDelete
    Replies
    1. Please ignore the above, an uninstall and re-install fixed it :)

      Delete