protonscr

TimeShift broken Shadows

dxvkclosed d3d9
doitsujin/dxvk#2239 · opened 2021-08-12 by Riesi · updated 2022-07-07 · 8 comments · github
RRiesi 2021-08-12 github

Original issue: https://github.com/Joshua-Ashton/d9vk/issues/338

Issue is directly visible in the starting area. As seen in the screenshot below the shadow rendering is not quite correct with those straight lines that dont contain any shadow, which are located right to the door and in front of the open door. The issue can also be seen when replaying the native windows d3d9 trace with dxvk.

@CME42 said that the game requires non-seamless cubemaps and he can probably elaborate on that with more details below. (will ping him)

2021-08-12-18-00-23

Software information

https://store.steampowered.com/app/10130/TimeShift/

System information

  • GPU: Nvidia GTX970
  • Driver: 470.56.5
  • Wine version: 6.13
  • DXVK version: a2330b89d228f7bdd6ba5f415051345634c3cb7c

Apitrace file(s)

https://git.froggi.es/Riesi/tracehub/src/branch/master/traces/d3d9/TimeShift [native].trace.tar.xz

Log files

NNerosTie 2021-08-23 github

How do you launch the game?

For many months this is the error I have when I launch the game on Steam:

Screenshot_20210823_181510

EDIT:
I managed to fixe it. You need these 2 patches:
https://community.pcgamingwiki.com/files/file/1026-timeshift-update-12-steam/
https://community.pcgamingwiki.com/files/file/1722-timeshift-fix-for-startup-crash-with-8-thread-cpu/
And delete bin/TimeShift.Exe in the installation folder.

The shadows are still broken though.

DDadSchoorse 2021-09-18 github

The extension was rejected, see https://github.com/KhronosGroup/Vulkan-Docs/pull/1628
The solution is to manually lower cubes to 2D arrays, but I don't feel motivated enough to work on that rn.

NNerosTie 2021-10-19 github

With 1.9.2, it seems these shadows are now disabled and the option "Projected Shadows" is set to "None" and grayed out.

Screenshot_20211020_003221

Screenshot_20211020_002449

DDadSchoorse 2021-10-28 github

For future reference, here's the shader code ANGLE generates to emulate this:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/angle/src/compiler/translator/tree_ops/RewriteCubeMapSamplersAs2DArray.cpp;l=309

Fwiw, we would need more emulation than ANGLE, since GLES2 doesn't have shadow samplers.

SShabbyX 2021-10-29 github

What's probably worse than shadow cube maps is that desktop GL has a per-texture toggle for this (while in GLES it's global (ES2 = seamful, ES3+ = seamless). I don't know if D3D has this madness too or not. For the purposes of DXVK you may just want to care to implement enough for what real applications do.

DDadSchoorse 2021-10-29 github

D3D9 is fully seamful, D3D10+ seamless.

Upstream links