protonscr

[D3D9] FVF draws without a specular color are unaffected by fog

dxvkopen d3d9
doitsujin/dxvk#5470 · opened 2026-01-25 by CookiePLMonster · updated 2026-01-25 · 1 comments · github
CCookiePLMonster 2026-01-25 github

I was working on rewriting the FVF-based minimap in the game, and encountered a disparity between native D3D9 and DXVK during one of the iterations. A bug (white minimap) I caused by not accounting for a fog render state showed up natively, but not with DXVK.

D3D9:
Image

DXVK:
Image

The affected draw call has the following relevant states:

  • DrawPrimitiveUP, a line list.
  • FVF: XYZRHW | DIFFUSE
  • Fog enabled

In the original game, this artifact did not surface, because their FVF also had a SPECULAR color, a constant RGBA 0, 0, 0, 255. I have confirmed that re-adding this vertex attribute "fixed" native D3D9 (the lines are no longer affected by fog), but the real fix on the game/mod side is to disable fog entirely.

Regardless, even though ultimately this was an issue on the game side, D3D9 and DXVK behaved differently.

Software information

Hard Truck 2: King of the Road, using a development version of D2GI that wraps the game from D3D7 to D3D9, with additional fixes.

System information

  • GPU: NVIDIA GeForce RTX 5070 Ti
  • Driver: 580.88
  • Wine version: N/A, on Windows
  • DXVK version: 2.7.1

Apitrace file(s)

N/A

Log files

N/A

WWinterSnowfall 2026-01-25 github

I have also noticed this fixed function limitation in a D3D6 game, so it's definitely a legacy from pre-T&L times. I doubt it's much of an actual problem for D3D9 applications, but earlier APIs might be affected in some odd cases. So help me K0bin-wan Kenobi, you're my only hope.

Nothing extracted yet.