[2/2] wined3d: Take abs() of vertex z coordinate as FFP fog coordinate (try 7)

Stefan Dösinger stefandoesinger at gmail.com
Wed Nov 19 08:57:43 CST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 2014-11-14 22:40, schrieb Joachim Priesner:
> Take the absolute value of vertex.z as fog coordinate instead of
> just the z coordinate. This fixes e.g. fog for applications that
> use right-handed projection matrices.
> 
> Also test the clamp behavior of the oFog vertex shader output.
Fwiw, the start / end tests look good to me, and the results match
what I expected. However I think Henri still disagrees with this patch.

Henri, I'd appreciate if you would say what you want. Without that I
can offer Joachim only guesswork.

My guess is that the test is too complex. There are some parts that
are technically not required to demonstrate the correctness of the
abs(), but I see some value in the additional checks:

*) The "interrupted" quad with extra vertices at z = 0. It shows that
the fully fogged other quad is not a result of the interpolation
failing entirely and producing INF or NaN.

*) The foggy shader test: It shows how negative values coming from
vertex shaders are treated. It's just logical to test this considering
the behavior of the fixed function pipeline.

*) The manual fog coord / unfogged shader tests: Those could be
removed I guess, although at least the manual fog coord test shows
that there isn't some unexpected interference with negative depth values.

Joachim, I can offer you that I try to simplify those tests. If you're
still motivated to work on this I'm happy to leave this up to you though.

Some ideas for simplifying the test, but I don't know yet if they'll work:

*) Split the shader and fixed function tests into separate tests.

*) Remove the interpolation tests from the fixed function tests.
fog_interpolation_test shows that the fog equation is evaluated in the
vertex pipeline in the affected cases, and the fogstart = -1, fogend =
0 test shows that the abs() happens before the fog equation. So I
think removing this part of the test for the fixed function part is safe.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJUbK/nAAoJEN0/YqbEcdMworwP/2OytnoHiSrHWoFK9YPUvEGQ
XIyIDZhe/PoMKaBGRdgqFWd4EjoVr9haUmCcPWb1BK/0R2MVSTIK0TS88RlotiMx
ZIBcJJWCiiBvhNrydAW5Qqg/80h5UOgaumkWdi2qF4SfkvP/A3jLXvulXZaOU88k
rmnlWXxiQun0EIMzShzms0OZmKxmyKkhm84CXAAr3hIh3k9anXVsr0Nsgi2UXTBl
ey55rNaE/NBZdNMP/in/5kEq76f0WA7bx1CV2zfCds5p34thQPQLjuvYQ0mqz3Qg
zo24W/J52m70W1GmqD/J2+4g5XPO2Gf3xIjV0NyJW988hsCoHIyQHFXZbRkZQpbQ
ULdhBq6VgW6O9d1f9H1hy18HxVwlGPFjnu7gniMTWqtBLzyC3b6pppSqQfg1zRhj
X/Njp/JBhSUWe8is4sP2R7sHl2fqMi5ROWQyXVpca/rUdoiu6dAH8zYo3IqepGDW
P1RoSiwQXXDEh0tV/gzW7pVnk7nNRtcL6el0R5C7aqrytWi3xLXYfdsug6sluKK6
onN/Iz0PpBDsokaTFUMua1JgZ8fx7+Av/S/2xfPvMpSFyrp+q/Q4fw5HdQEKfCIb
+JtA03sG0ZfKLjCWL3JRW2kt3G3TxQTOdaJ+Dic5S50xMjs04Ze2Ie3BzbY4FEn0
ZqXciJ+kIVCN4+LD5aJp
=RHD+
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list