I just found this issue while playing the game. Fog is fine with WineD3D.
I tried to use d3d8to9 + dxvk to workaround the problem but I just corrupted graphics (unplayable).
Is there any additional information that is need to further troubleshoot this issue?
Thanks
System information
I tried to use d3d8to9 + dxvk to workaround the problem but I just corrupted graphics (unplayable).
Everything looks good here with d3d8to9 + dxvk, including the fog.
Is there any additional information that is need to further troubleshoot this issue?
I don't think so. We pretty much know there's a fog problem with SM1, and it's reproducible with the above trace, but at least I have no idea what the root cause actually is.
Did you install any native libraries?
I installed d3dx9_43 and d3dcompiler_47 and things improved a bit with d3d8to9 but yet cars were corrupted among other things. Without them all graphics were completely broken.
Anyways, I’m just curious. It can be mesa, the GPU drivers, Wine version, etc.
I tried the latest version of d3d8to9 from GitHub.
Did you install any native libraries?
Yes, I think I have all the native d3dcompiler and d3dx9 stuff. The d3dcompiler bits are definitely a must as d3d8to9 needs them for shader disassembly.
Makes sense.
Hopefully one of the devs can look into this.
I can also provide traces and logs if needed.
Just sharing an update in case is useful for anyone else finding this issue and wanting to get d3d8to9 working with DXVK, as a workaround.
I narrowed down the native libraries requirements (can be installed with winetricks) to:
I don't think d3dcompiler_47 is really needed and everything seems to work without it but of course YMMV.
On a sidenote, as of c6dc7e0, d3d9.shaderModel = 0 can be used as a workaround to force the game on a fixed function path with working fixed-function fog, albeit with an equally reduced quality of reflections (as pixel shader support will be entirely disabled).
@casasfernando I think I've figured it out. Feel free to give this build a try and let me know if you have any issues with it: https://github.com/doitsujin/dxvk/actions/runs/13005728817/artifacts/2495705427
@WinterSnowfall I will do my best to test this later today and report back.
Anything I need to bear in mind? I guess I need to remove d3d8to9 and use only DXVK while also keeping the d3d native libraries mentioned above. Right?
@WinterSnowfall I will do my best to test this later today and report back.
No worries, whenever you can. It's hardly urgent.
Anything I need to bear in mind? I guess I need to remove d3d8to9 and use only DXVK while also keeping the d3d native libraries mentioned above. Right?
Yes, that's about right. Also keep in mind you'll need both d3d8 and d3d9 dlls from dxvk for use with d3d8 games, otherwise things will simply crash on startup.
Quickly tested the build in Hot Pursuit 2 and a few other games. The fog is present, didn't notice any visual regressions. Mesa 24.3.4, Intel HD Graphics 630.
Quickly tested the build in Hot Pursuit 2 and a few other games. The fog is present, didn't notice any visual regressions.
Always good to get outside confirmation. Thanks for testing. I'm doing a broader regression check with all the d3d8 titles I have around (they're quite a few, in the range of ~200) after which we'll probably merge the fix.
Just tested the build above and I can confirm that fog is now working and I didn't observe any glitches or whatsoever (only tested a couple of races though).
Moreover, I didn't have to install any native libraries as I had to do when using d3d8to9 as mentioned in my previous comment.
This is really awesome, looking forward to the next release!
System information
Thanks
I don't know where the f(r)og is. Both WineD3D and d3d8to9 + dxvk render fog correctly, while d8vk does not.
I've captured a trace using WineD3D which reproduces the issue. Fog should be instantly visible (or not) on race start, although it's a somewhat subtle effect. Looking at the lighthouse in the distance near the end of the trace provides more clarity on the matter.
P.S.: The game does indeed use a lot of VS with
exp oFog.x, -r1, but that doesn't currently do anything fog-wise.Software information
Need for Speed: Hot Pursuit 2
System information
Apitrace file(s)
NFSHP2.trace.tar.xz
Log files
NFSHP2.log