-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-10-22 14:53, schrieb Joachim Priesner:
Okay, so the fog clamp is not wrong. I'll be happy to re-add it and modify the test so it accepts both variants.
There's D3DPMISCCAPS_FOGVERTEXCLAMPED. I can't find any docs with a quick google search, but it sounds related.
/* No vertex shader */
{0, D3DFOG_NONE, D3DFOG_LINEAR, C_UNFOGGED, C_HALF_FOGGED, C_HALF_FOGGED, C_FOGGED},
{0, D3DFOG_LINEAR, D3DFOG_LINEAR, C_UNFOGGED, C_HALF_FOGGED, C_HALF_FOGGED, C_FOGGED},
{0, D3DFOG_LINEAR, D3DFOG_NONE, C_FOGGED, C_UNFOGGED, C_FOGGED, C_FOGGED},
{0, D3DFOG_NONE, D3DFOG_NONE, C_FOGGED, C_FOGGED, C_FOGGED, C_FOGGED},
I am wondering about the table fog = linear cases. As far as I understand it they are different from the table fog = none, vertex fog = linear case because of the "w fog" functionality, which is called ortho_fog in wined3d.
The trouble is that the vfog=linear, tfog=none case has an open question: What exactly do the d3d docs mean with "applies fog calculations at each vertex in a polygon". Does that mean no fog factor (oFog) is written by the fixed function pipeline, and the fog color merged into oD0 right away? In other words, assume fixed function vertex processing with an 1.x pixel shader. The vertex input color is red, the fog color green, the Z coordinate results in a fully fogged quad and the pixel shader writes blue. Does that produce a blue or green output? (We may have a test that deliberately or accidentally tests this. I will check.)
If you bypass the W fog thing e.g. by using 1.000001f in proj_matrix[3][3] you get a fully fogged quad in the table fog case as well. But then your sanity check with quad2/quad3 is fully green as well, and I don't yet understand why.
Gosh this is complicated. So much for a simple abs().