bo3b / 3Dmigoto

Chiri's DX11 wrapper to enable fixing broken stereoscopic effects.
Other
758 stars 118 forks source link

3Dmigoto under linux via proton/dxvk possible? #128

Open frostworx opened 4 years ago

frostworx commented 4 years ago

Hi there, I don't know anything about 3dmigoto, so sorry if this a stupid question: I wondered if 3dmigoto could be made to run under linux via proton/dxvk. What would be the minimal setup to test if it works? Would it be enough to dump the dlls and the 3DMigoto Loader.exe into a gamedirectory (,maybe "preload" those dlls) and check if the game still works? If I understood correctly there's no other installation and no nvidia gfx card or 3d vision required, right?

frostworx commented 4 years ago

I followed the Witcher 3 README here https://github.com/DarkStarSword/3d-fixes/tree/master/Witcher3 but unfortunately every try segfaulted, so it doesn't seem to work - at least for now. In fact not very surprising, as almost every dll injection/override doesn't work with proton/dxvk. ReShade is an exception here, but is probably not feature complete. so sorry for the noise! closing here.

bo3b commented 4 years ago

No problem for asking.

I'd actually expect this to work, but maybe not with the version that is part of Witcher3.

Try using the 1.3.16 release version: https://github.com/bo3b/3Dmigoto/releases/download/1.3.16/3Dmigoto-1.3.16.zip

The 1.3 branch update changed how we wrap objects and made it a lot more compatible.

Also remove or don't install the nvapi.dll, as that is used for 3D hacking, and not required for straight modding. And improves your odds.

It will still try to hook DXGI calls, but if Reshade can do that, I'd expect 3Dmigoto to be able to as well. I've no idea about the proton runtime though.

To answer your original question- yes, just drop the files into the directory where the game resides. If it's running you'll see a green overlay with shader info. By default it also generates a log file that would be worth checking.

(I'm not set up to test proton, but would be curious if it's possible to get this to work.)

frostworx commented 4 years ago

oh wow! Thank you very much for your friendly reply! :) IT WORKS! As you suggested I only d3dcompiler_46.dll, d3d11.dll, d3dx.ini and the ShaderFixes directory without nvapi.dll into the Witcher bin/x64 dir and have a green overlay after a successful restart! I also set those wine overrides which should force to pick the correct dlls: WINEDLLOVERRIDES="dxgi=n,b;d3dcompiler_46=n,b" Can't wait to see 3Dmigoto in action and almost regret now that I'm not at home over the weekend ;) In case you have some use for it, here are the related logs, one from 3Dmigoto and the other two from dxvk: witcher3_d3d11.log witcher3_dxgi.log Thank you very much again! I'll let you know how well it works via proton when I have something interesting to tell ;)

paste of the probably most interesting log failed... 2nd try: d3d11_log.txt

frostworx commented 4 years ago

just gave it another try with this config

d3dx.ini.txt ( It is a merge of the original one from 3Dmigoto-1.3.16.zip and the one from Witcher3) Green splash is still working, on the bottom of the Screen is "Stereo disabled" written. Looks like it is not too far away, but not sure how to proceed here. In case you're interested in the debug log (calls=1,input=1,debug=1) here's a zip (extracted ~25MB): d3d11_log.zip

Have a nice weekend! :)

bo3b commented 4 years ago

Greetings. That previous log looked pretty normal to me. No errors are reported, and all the overridden calls were working as expected.

Tell us more about your use case. What is your goal with 3Dmigoto here, and Witcher3 in particular? There's no stereo 3D on proton that I know about, which is our primary focus, but 3Dmigoto is also useful for general modding. The Witcher3 d3dx.ini is not particularly special. All of the resource and shader overrides there are to fix effects that are broken when run in 3D. These pieces would not seem useful in your case.

You can try hunting shaders as an experiment. That's the top section of the green overlay. You use the numeric keypad keys by default. Specified in hunting section of d3dx.ini. Key 1 and 2 are for hunting pixel shaders, 4 and 5 are for vertex shaders. As you hold those down, it will cycle through every active pixel or vertex shader in the scene, and skip them. You should see different components of the image blink out as you cycle through shaders.

There are people who use 3Dmigoto to create no-HUD versions of games, by finding the shaders, then marking them to be skipped in the d3dx.ini.

frostworx commented 4 years ago

Hello. Oh I didn't know that I would need stereo 3D from proton side, I thought this is delivered from 3Dmigoto. Indeed I wanted to use 3dmigoto to run regular games in VR. Witcher 3 was just the game I used for testing, because it was already installed and the 3d-fixes repo had configs for it. Thank you very much or your friendly reply, but I'm afraid I have no use for it without stereo3d. But hey, at least we know now, that it works under linux :) Have a nice sunday!

bo3b commented 4 years ago

We use the NVidia 3D Vision driver to generate the stereo 3D, and 3Dmigoto is used to fix the broken effects like shadows that are created using deferred rendering. Without 3D Vision or something like it, you won't get 3D in Proton. If Proton supports driver version 425.31, it might be worth trying that. It was the last version with 3D Driver in the package. I've no idea how Linux supports NVidia drivers.

HelixVision is the app we are developing to deliver 3D in VR headsets. But it's presently Windows only because of the 3D Vision requirement. Not impossible that we develop our own 3D Vision replacement, but not anytime soon.

Good to know that 3Dmigoto works under Proton though, I've been considering switching to Linux anyway, because Windows is highly annoying with all the forced updates and they give me no option to be simply left alone.

frostworx commented 4 years ago

Hi again! Thanks a lot for the explanation - I thought only HelixMod requires 3D Vision. I doubt 3d vision drivers can be made to work under linux via wine/proton (in fact I even installed them once and none of the installed exen worked). nvidia ships its own proprietary drivers for linux, but no 3D Vision support, I guess the nvidia linux drivers have to be able to "communicate" directly with 3D Vision and vice versa in order to get it running. And I totally did not know that HelixVision is your project! Looks like we even communicated before ;) https://steamcommunity.com/app/1127310/discussions/0/1628539187780639721/

After more than a decade using nvidia under linux I finally switched to amd though just a few weeks ago and don't regret it. The drivers are opensource and therefore integrate much better than a binary blob, and VR (Valve Index) works much better than on nvidia (comparing RTX 2080 vs Radeon VII). You really should try Linux - I'm sure you won't regret it ;)

edit: just searched a bit for 3D Vision alternatives and found this http://3dsurroundgaming.com/Vk3DVision.html you probably know it already, but as there is no release yet maybe not. :) edit2: to be more precise: proton uses dxvk to wrap d3d9-11 to vulkan and vkd3d for d3d12, so basically everything is vulkan in proton :) edit3: ok HelixVision is even linked on the project page, so mentioning it here was pretty useless... edit4: sorry for the noise - looks like the other guy interested in linux compatibility in above project thread is you... as you see I know nothing about the stereoscopic community...

frostworx commented 4 years ago

Hi, as the issue is not closed yet and I've read that Helifax has "been working with Bo3b to get Vk3DVision to run with HelixVision in VR" and that "SBS, TB and VR using HelixVision DOES NOT require Nvidia 3D Vision" I gave the HelixVision Demo from steam a try and it worked flawlessly ootb, but the full version segfaults (probably because of the dotnet46 dependency which the demo doesn't have) Current Vk3DVision demo depends on dotnet46 as well, but the exe does not even start. Haven't debugged anything, and I can wait, but just wanted to let you know.

edit: proton log reveals: 46724.050:00bc:00c8:err:eventlog:ReportEventW L"Application: HelixVision.exe\nFramework Version: v4.0.30319\nDescription: The process was terminated due to an unhandled exception.\nException Info: System.DllNotFoundException\n at NvAPIWrapper.Native.Helpers.DelegateFactory.NvAPI64_QueryInterface(UInt32)\n at NvAPIWrapper.Native.Hel"... .... 46719.057:00bc:00c0:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Foundation.Diagnostics.AsyncCausalityTracer"

where probably the missing NvApi support is the problem.