doitsujin / dxvk

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

[d3d8] Missing f(r)og in NFS Hot Pursuit 2 #4113

Open WinterSnowfall opened 4 months ago

WinterSnowfall commented 4 months ago

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

casasfernando commented 1 day ago

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

WinterSnowfall commented 1 day ago

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.

Screenshot ![d3d8to9](https://github.com/user-attachments/assets/05eba23c-4d63-4477-a1e0-7edb88e80fe5)

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.

casasfernando commented 1 day ago

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.

WinterSnowfall commented 1 day ago

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.

casasfernando commented 1 day ago

Makes sense.

Hopefully one of the devs can look into this. I can also provide traces and logs if needed.

casasfernando commented 1 day ago

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.