dxvk icon indicating copy to clipboard operation
dxvk copied to clipboard

[d3d9] FF: Apply transform flags count to generated texture coords

Open K0bin opened this issue 1 year ago • 3 comments

Fixes the bug in Phantasy Star Online that was reported after merging #4015.

I've tested this PR with both Phantasy Star Online apitraces, the Cold Fear apitrace and the Snowblind apitrace. Those were the games that I know were broken at some point because of fixed function texture coordinate processing. On top of that, I ran the Wine FF texcoord tests again and those were fine too.


Tests show that the count out of D3DTSS_TEXTURETRANSFORMFLAGS gets applied to generated texcoords like D3DTSS_TCI_CAMERASPACEPOSITION too.

At the same time, projection only gets applied (or renders something sensible) when used with FVF_XYZ and D3DTTFF_COUNT3 or higher. With lower values it either produces garbage like this:

image (FVF_TEXCOORDSIZE1 + FLAGS_COUNT1)

or this: image (FVF_TEXCOORDSIZE2 + FLAGS_COUNT1/2)

https://docs.google.com/spreadsheets/d/1XfSsxl1qMMY0mmpn02l3Wph-6CyXiugcR9wkb0VwJg0/edit?usp=sharing

By writing a test app that uses fixed function vertex processing and a shader that does nothing except output the texcoord, I've now verified that native D3D9 also writes the component that gets used for projection into the w component just like we're doing here.

K0bin avatar May 25 '24 12:05 K0bin

@nolrinale This PR fixes the ripples.

K0bin avatar May 25 '24 13:05 K0bin

@nolrinale This PR fixes the ripples.

I just checked it, all working as intended, even the monsters with refraction cloaking too its amazing K0bin thank you so much for your work! now the game is working 100% under Linux/Deck without any graphic bugs left.

Happy 20th Anniversary PSOBB!~

nolrinale avatar May 25 '24 13:05 nolrinale

Awesome, thanks for the good bug reports!

K0bin avatar May 25 '24 13:05 K0bin

Thanks for doing all this :D

misyltoad avatar May 27 '24 20:05 misyltoad