doitsujin / dxvk

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

[d3d9] Fruit Ninja HD background rendering issue #2480

Open Leopard1907 opened 2 years ago

Leopard1907 commented 2 years ago

Software information

Fruit Ninja HD

System information

Apitrace file(s)

Log files

Additional info

Screenshot_20220205_184333

K0bin commented 2 years ago

This is using fixed function and inverting the view * world matrix doesn't work. So we end up passing a matrix full of NaN and INF to the shader which messes up the normal and the lighting after that.

K0bin commented 2 years ago

Apparently D3D9 just passes the transposed WorldView matrix when it can not be inverted.

K0bin commented 2 years ago

Then there's also this:

directional light: 0, 0, -1 normals: 0, 0, 1 3rd column in the transform matrix: 0, 0, 0

K0bin commented 1 year ago

My best theory is that D3DRS_NORMALIZENORMALS turns the 0,0,0 normal that we get after applying the normal matrix into something sensible that works here. I haven't confirmed that yet though.