dxvk icon indicating copy to clipboard operation
dxvk copied to clipboard

Tom Clancy's Splinter Cell - Missing shadow filtering and light beams

Open Joshhhuaaa opened this issue 7 months ago • 28 comments

Software information

Tom Clancy's Splinter Cell

System information

  • GPU: NVIDIA GeForce RTX 2070 Super
  • Driver: 561.09
  • Wine version: Windows 11, 23H2
  • DXVK version: dxvk-2.6.2

Apitrace file(s)

  • Attempting to use apitrace causes the game to crash immediately on startup?

Log files

splintercell_d3d9.log

Issue 1: Missing Shadow Filtering

Shadows rendered using the shadow buffer technique appear without edge softening. On GeForce 4 hardware, shadows had softer edges due to a shadow filtering algorithm.

DXVK - Missing shadow filtering Image

dgVoodoo2 - Shadow filtering Image

Issue 2: Missing Light Beams

Light beams are not rendered at all with DXVK.

DXVK - Missing light beam Image

dgVoodoo2 - Light beam Image

Joshhhuaaa avatar Jun 15 '25 00:06 Joshhhuaaa

Shadows rendered using the shadow buffer technique appear without edge softening. On GeForce 4 hardware, shadows had softer edges due to a shadow filtering algorithm.

Perhaps, but the effect is very subtle. It could very well be softened by dithering rather than filtering, which the game indeed uses and dxvk does not support as of now.

Light beams are not rendered at all with DXVK.

I'm pretty sure I've seen light beams rendered properly and in their full glory in the game, when I did a comparison to Windows XP running on a GeForce 4 Ti GPU. That being said, can you remind me please where the particular light beam showed in the screenshot is (which level and how long into it)?

P.S.: dgVoodoo2 is known to spruce up things in the shadow buffering department, so I wouldn't take it as ground truth. That being said, I can always check on native hardware and compare.

WinterSnowfall avatar Jun 15 '25 07:06 WinterSnowfall

That being said, can you remind me please where the particular light beam showed in the screenshot is (which level and how long into it)?

That light beam is at the spawn point of the Kalinatek mission. If you already have the level unlocked, it’s easy to get there. I can share a profile save if needed, or you can load the map directly by opening the console (F2) and typing open 2_2_1_Kalinatek.

P.S.: dgVoodoo2 is known to spruce up things in the shadow buffering department, so I wouldn't take it as ground truth. That being said, I can always check on native hardware and compare.

If you're wondering whether dgVoodoo2 might have altered the edge softening, the original Xbox appears to be about the same. I'm fairly sure the GeForce 4 does as well. Either way, it's always helpful to have native hardware as a reference.

It can sometimes be hard to tell whether a problem is caused by dgVoodoo2 or just a bug in the PC port when comparing to Xbox version. The PC version definitely cut some corners. For example, shadow buffer lights can't cast onto reflective surfaces, while the Xbox handles that properly. On PC, reflective objects are usually given a bForceShowReflection flag, which I believe forces them to render using Shadow Projector mode instead. So in this case, the issue isn’t dgVoodoo2’s fault, it’s just a limitation of the PC version. It would be nice to fix, but it’s way over my head. Even Microsoft's own Xbox 360 and One emulator can’t handle this either, and shows the same issue on PC, where buffers don’t cast onto reflective objects.

Joshhhuaaa avatar Jun 15 '25 09:06 Joshhhuaaa

If you're wondering whether dgVoodoo2 might have altered the edge softening, the original Xbox appears to be about the same. I'm fairly sure the GeForce 4 does as well. Either way, it's always helpful to have native hardware as a reference.

I honestly can't tell the difference when it comes to shadow filtering, however you are on point about the missing light beams.

GeForce 4/Windows XP:

Image

dxvk:

Image

WinterSnowfall avatar Jun 15 '25 10:06 WinterSnowfall

I honestly can't tell the difference when it comes to shadow filtering

Do you mean that the GeForce 4 looks identical to the DXVK shadows, or that dgVoodoo2’s shadow buffers closely match native hardware here? Admittedly, it's hard to notice the effect in these screenshots given the resolution and angle. That said, I think it's noticeable when actually playing the game. It’s by no means unplayable without it, but I do think it’s a nice addition. Thanks again for testing.

Joshhhuaaa avatar Jun 15 '25 16:06 Joshhhuaaa

Do you mean that the GeForce 4 looks identical to the DXVK shadows, or that dgVoodoo2’s shadow buffers closely match native hardware here?

The former. Well, perhaps not identical, but I can't really tell them apart. I've looked rather closely at the projected shadows in game trying to spot any differences, but I admit I'm not exactly a pixel hunter.

If we ever get to sorting out dithering, it would be interesting to see if it has any effect here.

In any case, thank you for the well made issue, we'll keep both points in mind.

WinterSnowfall avatar Jun 15 '25 19:06 WinterSnowfall

I'm pretty confident dgvoodoo2 shadow filtering is not accurate to either GeForce 4 or Xbox. DXVK appears accurate. The shadows were much sharper and harsher on real hardware than the super soft dgvoodoo2 appearance.

KuraiShidosha avatar Jun 25 '25 00:06 KuraiShidosha

I'm pretty confident dgvoodoo2 shadow filtering is not accurate to either GeForce 4 or Xbox. DXVK appears accurate.

I agree, I’d say DXVK now replicates the Xbox most closely after seeing a decent reference image of the Xbox hardware.

The Xbox seems to run with either low or medium shadow resolution. The PC version lacks the bloom effect on the windows, which is typical for the PC port, so neither dgVoodoo nor DXVK are to blame for that.

Xbox

Image

DXVK v2.6.2

Image

dgVoodoo 2.86.1

Image

While taking this comparison shot, I noticed some lighting issues in DXVK that would need to be fixed. Once those are polished up, along with the light beams, it would be the closest to the original hardware.

Image

Some might still prefer dgVoodoo's added softening as an option, even if it’s not entirely hardware accurate, but I can understand if DXVK wouldn't want to bother with it.

Joshhhuaaa avatar Jun 25 '25 03:06 Joshhhuaaa

Image

Some might still prefer dgVoodoo's added softening as an option, even if it’s not entirely hardware accurate, but I can understand if DXVK wouldn't want to bother with it.

Interesting. I'm guessing there's a cutoff to projections depending on surface angle and distance (currently we don't consider either, simply enable it globally). The good news is that there have been some recent upstream fixes in apitrace which make the game traceable, so it should be a bit easier to spot/debug things now.

WinterSnowfall avatar Jun 26 '25 16:06 WinterSnowfall

Sounds good, I'm happy to help with any tracing if needed. Hopefully, these issues can be addressed in DXVK, since the latest versions of dgVoodoo crash on Linux. We've had several begin reversing the game and managed to override the awful LOD distance. We might also look into raising the shadow resolution beyond its original cap, though dgVoodoo may not handle that well. Ideally, we’d like to bring back the Xbox version’s bloom and depth of field effects, although that will probably be a bit difficult.

Joshhhuaaa avatar Jun 26 '25 17:06 Joshhhuaaa

Sounds good, I'm happy to help with any tracing if needed.

No worries, I have the game and can trace it. Also have a retail copy of Pandora Tomorrow for that matter, which is harder to come by these days.

WinterSnowfall avatar Jun 26 '25 17:06 WinterSnowfall

Here's another example of broken lighting effects. In this example dgVoodoo matches original Xbox hardware and guessing GeForce 4/Windows XP

DXVK v2.6.2 Image

dgVoodoo 2.86.1 Image

Franatix93 avatar Jul 03 '25 08:07 Franatix93

Here's another example of broken lighting effects.

What GPU is this on? If you're on AMD, please try d3d9.hideAmdGpu = True. In hindsight, I'm guessing it's a good idea to always report an Nvidia GPU for the game, since the "software" projection the games uses on the AMD path does indeed disable some light sources.

P.S.: Note that you need to specify ForceShadowMode=1 in SplinterCell.ini to make the game use shadow buffers with dxvk.

WinterSnowfall avatar Jul 03 '25 11:07 WinterSnowfall

This is on Steam Deck with Proton 10 Beta

Franatix93 avatar Jul 03 '25 13:07 Franatix93

Proton 10 Beta

In that case, you'd also need to launch the game with PROTON_DXVK_D3D8=1. Proton does not use dxvk for d3d8 by default yet. Assuming the game's ini file is in order, things should work pretty well, bar the issues mentioned above.

WinterSnowfall avatar Jul 03 '25 13:07 WinterSnowfall

Yeah, I can confirm that's not an issue with Nvidia, DXVK is rendering it just like dgVoodoo/GF4 would. If you're noticing that Sam's shadow isn't casting onto the wall like the Xbox version, that's a separate issue with the PC version, and I'm not sure if it can be fixed.

Image

Joshhhuaaa avatar Jul 03 '25 13:07 Joshhhuaaa

Here is another example of light beam issues within DXVK. This example is at the Beginning of 'Chinese Embassy'. It seems all car headlight beams act like this. The car headlights in 'Defense Ministry' are another example

DXVK v2.6.2 Image

Original Xbox/dgVoodoo Image

Franatix93 avatar Jul 09 '25 16:07 Franatix93

Here is another example of light beam issues within DXVK. This example is at the Beginning of 'Chinese Embassy'. It seems all car headlight beams act like this. The car headlights in 'Defense Ministry' are another example

Thanks for making note of it, as it will be a good reference when debugging, and yes, I expected as much - meaning not only the light beam in the Kalinatek level opening to be missing.

WinterSnowfall avatar Jul 09 '25 16:07 WinterSnowfall

@WinterSnowfall Hey, if you can be bothered to test at some point, could you see if this is a rendering issue on your GeForce 4 GPU?

https://github.com/user-attachments/assets/aa6155e1-aad1-4ab9-b770-716c0358d666

  1. Load the save game, 'ChemFlareTest'
  2. Equip the Chemical Flare (E key by default)
  3. Blue lighting suddenly appears around you

It doesn't seem related to dgVoodoo2, I get the same rendering bug on DirectX8 with nothing hooked. I'm curious if it's a PC port issue or modern hardware/OS caused it.

Save.zip

Joshhhuaaa avatar Jul 25 '25 19:07 Joshhhuaaa

@WinterSnowfall Hey, if you can be bothered to test at some point, could you see if this is a rendering issue on your GeForce 4 GPU?

Image

Looks good on the GeForce 4 / Windows XP, no blue lights.

WinterSnowfall avatar Jul 26 '25 11:07 WinterSnowfall

Thanks for verifying, I guess it must be modern hardware problem. It occurs on native DirectX8, DXVK, and dgVoodoo2 for me on a Nvidia card. I'm unsure about Intel or AMD having the issue.

Joshhhuaaa avatar Jul 26 '25 17:07 Joshhhuaaa

It could also be unrelated to graphics actually, as I've seen all kinds of odd behavior on modern OSes from games designed to run on Windows 9x/XP, including vertex explosions when SSE math is used in msvcrt.

WinterSnowfall avatar Jul 27 '25 07:07 WinterSnowfall

Thanks for verifying, I guess it must be modern hardware problem. It occurs on native DirectX8, DXVK, and dgVoodoo2 for me on a Nvidia card. I'm unsure about Intel or AMD having the issue.

Exact same results on Steam Deck. Just tested out of curiosity

Franatix93 avatar Aug 15 '25 21:08 Franatix93

@WinterSnowfall did you have much luck looking into some of these?

Franatix93 avatar Sep 26 '25 21:09 Franatix93

@WinterSnowfall did you have much luck looking into some of these?

I did manage to get a trace of the relevant section, since that is possible now, but nothing stands out to me as far as the missing light cones go. I guess it would need @AlpyneDreams' special touch, as would the shadow buffer differences spotted above.

WinterSnowfall avatar Sep 27 '25 14:09 WinterSnowfall

Just wanted to document another light beam issue. This one is in "Police Station" - T'blisi Old Town Streets

https://github.com/user-attachments/assets/23f40558-f703-4c7c-9615-f5e8fd407c20

Franatix93 avatar Nov 19 '25 17:11 Franatix93

Please make an apitrace of that.

K0bin avatar Nov 19 '25 17:11 K0bin

I talked to @Franatix93 and he accidentally recorded that clip with dgVoodoo2 instead of DXVK. At the moment DXVK has no lightbeam rendering at all. The issue above where the lightbeam turns on or off depending on camera position is something that happens on dgVoodoo2. I have no idea if that behavior is related to it or if the original PC game did it on old hardware.

Regardless if it is helpful here is an apitrace of that area with the lightbeam issues shown above. There were no lightbeams but I shifted my camera as if they were rendering.

Joshhhuaaa avatar Nov 19 '25 21:11 Joshhhuaaa

I made this comparison shot several months ago, and I originally thought all the lights shown here were shadow buffers, but the broken one is actually something unique.

Xbox

Image

DXVK v2.6.2

Image

dgVoodoo 2.86.1

Image

Without any wrappers hooked, the broken light renders in the same broken way that DXVK currently does: Image

Image

In-game, this broken light corresponds to LightEffect=LE_ESpotOrthoShadow.

The standard shadow buffer lights that require a GF4 to render are LE_ESpotShadow.

There are also LE_ESpotOrthoShadowDistatten and LE_ESpotShadowDistAtten, but I assume they would render the same, just with distance attenuation.

Not sure if that’s useful information, but it does seem to be a completely different light effect. So at the moment, DXVK can’t render ESpotOrthoShadow correctly or lightbeams.

Joshhhuaaa avatar Nov 19 '25 21:11 Joshhhuaaa