doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.28k stars 854 forks source link

Secret World Legends shadow/lighting artifacts [d3d9] #2418

Open HK47196 opened 2 years ago

HK47196 commented 2 years ago

Software information

Game: Secret World Legends, non-steam version used for testing purposes but seems functionally identical to Steam version. Settings: Requires winetricks installation of d3dcompiler & d3dx11_43. Game itself is ran in d3d9 mode.

System information

Apitrace file(s)

Log files

I can get a longer trace/log file if needed, the shadow artifacts are visible on the character selection screen so I exited there to keep them short.

Example of artifacts ingame: Screenshot_2021-12-27_12-23-39 Screenshot_2021-12-27_12-25-33 Shadowing errors on geometry(steps): Screenshot_2021-12-27_12-27-42 Screenshot_2021-12-27_12-28-40

Let me know if there's anything else I can do to help.

HK47196 commented 2 years ago

No idea if it'll help, but here's a similar apitrace taken on windows: https://drive.google.com/file/d/1BDZEPYP87Qhzc4E1-1-7lEJMgQDWlMzg

Frame 100 has the full character being drawn with the background.

Perhaps I fundamentally misunderstand how apitrace works, but it actually looks right when running the trace on linux via wine with dxvk.

Using dxvk on windows produces the same artifacts, btw.

HK47196 commented 2 years ago

The issue persists in the first version of DXVK that contained d3d9.dll and the oldest version of D9VK I could find that actually renders the game(0.13f), therefore the issue has always been there. I'm unable to find the source of the issue. The same issue happens with wined3d BTW.

krumpfwylg commented 2 years ago

I got the very same issue with that game. That weird rendering occurs when game is in directX9 mode, no matter if using dxvk, or wine OpenGL renderer. Some time ago, I asked to a few Windows users to try the game with dxvk, they get same results as us on Linux. One of them told me his game log was spammed with :

warn: ConvertFormat: Unknown format encountered: D3D9Format::AL16
warn: ConvertFormat: Unknown format encountered: D3D9Format::R16

So I start to wonder, could this be caused by the game using a weird texture format (or some hack) in dx9 ? Or could that be the format used for textures has no equivalent in Vulkan (a bit like the drowner morphing issue in Witcher 3 long ago) ?

K0bin commented 2 years ago

Those log lines do not matter at all. The AMD or Nvidia D3D9 drivers don't support those formats either. It is possible to implement those but pretty pointless.

HK47196 commented 2 years ago

I was unable to fix the issue, AFAICT it's unrelated to the missing texture format support after tinkering with it. I'm unsure of what causes it.

krumpfwylg commented 2 years ago

Since it happens whether using wine's OpenGL or DXVK, I believe it's not a DXVK issue, but more likely a wine issue (which i doubt), or a game engine issue (which imo is more likely). Secret World (in dx11 mode) + DXVK renders perfectly, but is extremely sensitive to drivers used (on nvidia cards for sure, dunno about amd ones). I've been playing without a crash using nvidia driver 460.91.03 for quite a while, but had to upgrade to 470.xx (460.xx drivers are not supported with kernel > 5.13 on my distro). Since the driver switch, game crashes a lot in dx11 (it's also very unstable on Windows), so I set it on dx9 mode and live with those lighting artefacts

K0bin commented 2 years ago

Try installing d3dx9 and d3dcompiler with winetricks.

krumpfwylg commented 2 years ago

The few people who I got to try dxvk dlls on a genuine Windows install get the same weird lighting render, so I don't think installing d3dx9 would change much. After checking my wineprefix, d3dcompiiler_43 and _47 are already installed as well as d3dx9_43 and d3dx11_43.