Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WinterSnowfall opened this issue Jul 7, 2024 · 13 comments · May be fixed by #4653
Open

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

WinterSnowfall opened this issue Jul 7, 2024 · 13 comments · May be fixed by #4653
Labels

Comments

@WinterSnowfall
Copy link
Contributor

WinterSnowfall commented Jul 7, 2024

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

  • GPU: RTX 4070
  • Driver: 535.183.01
  • Wine version: 9.12 Staging
  • DXVK version: fe9c875

Apitrace file(s)

NFSHP2.trace.tar.xz

Log files

NFSHP2.log

@casasfernando
Copy link

casasfernando commented Nov 24, 2024

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

  • GPU: Radeon RX6700XT
  • Driver: mesa 23.2.1
  • Wine version: WineGE-8-26
  • DXVK version: 2.5.1

@WinterSnowfall
Copy link
Contributor Author

WinterSnowfall commented Nov 24, 2024

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

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
Copy link

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
Copy link
Contributor Author

WinterSnowfall commented Nov 24, 2024

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
Copy link

Makes sense.

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

@casasfernando
Copy link

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:

  • d3dcompiler_43
  • d3dx9_43

I don't think d3dcompiler_47 is really needed and everything seems to work without it but of course YMMV.

@WinterSnowfall
Copy link
Contributor Author

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).

@WinterSnowfall
Copy link
Contributor Author

@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

@casasfernando
Copy link

@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
Copy link
Contributor Author

@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.

@GranMinigun
Copy link

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.

@WinterSnowfall
Copy link
Contributor Author

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.

@casasfernando
Copy link

casasfernando commented Jan 28, 2025

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

  • GPU: Radeon RX6700XT
  • Driver: mesa 23.2.1
  • Wine version: WineGE-8-26

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants