wined3d: Correctly display fog for right-handed projection matrix (try 7)

Stefan Dösinger stefandoesinger at gmail.com
Mon Oct 13 11:05:20 CDT 2014


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

Am 2014-10-13 17:14, schrieb Henri Verbeet:
> But the tests still fail to distinguish between taking the absolute
> of ec_pos.z in shader_glsl_generate_ffp_vertex_shader() and taking
> the absolute of gl_FogFragCoord in shader_glsl_generate_fog_code(),
> of course.
Right, how could I miss this.

Joachim, I think a way to test this would be to generate a fog
gradient from -1 to 1 in the fixed function pipeline codepath, set the
Z coordinate to 0 in the projection matrix to prevent clipping and
checking the fog value between the vertices at x=320. If the absolute
value is taken before the interpolation this will result in a fogged
pixel. If it is taken after the interpolation, it will result in an
unfogged pixel.

As a side effect this should also test the clamp(0.0, 1.0) behavior of
the oFog vertex shader output. If the vertex shader side clamp is
correct it'll result in a half fogged middle. We already know vertex
shaders don't do an abs() like the fixed function pipeline, otherwise
both sides of vs=2, tfog=none would be unfogged. If the clamp is
incorrect this would result in fogged on the left, fogged in the
middle, unfogged on the right (and half fogged at x=480).

A third way negative fog coordinates could enter the fog calculation
is a pretransformed vertex with z < 0 combined with table fog. If the
depth test is off clipping is disabled (zenable_test) .

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

iQIcBAEBAgAGBQJUO/hAAAoJEN0/YqbEcdMwWEgP/0eqNjqDK+b2oAFZ+egFB2Eg
Lflq+62wtuhlL54EeTBZGajXCp7qFEEBqmG74BLG3se0ukylX19AqlwlukfHWFz8
9zVDBXXt19+Zfp5S7IjwlXIi3YaZkey9bvI/pVfIqlu5ytiL/RonNWobLz1PkR+i
M2JpbVLUPm/9f6XBRlwxsKy2a7vY9d1n0nTLHM2Tkc8guJ9mMrJswEr/+sDkRZyv
Jt2zDw23yvhYPvKAzlkEWoD+0HLIwvdOt2t5cBQv6V6RQhdwSb+wAAiOeyXrsWxd
EAbFegpH7/xZx28cXlBQP+yywtS9pG7IM+33TXxdAQMyAoagH0oAnwMOLYj1Jhqg
gZqijd26eflNfk2oKLe8/8azs6mUAANQsOrLMRbksZ/VowrgjeUCwQ8gZGBNiFpd
htTrUhb4bXY9TZnrhvn2q9gKEdG9/0LfVIvXXqkDvSk6+kPqNYtBRJhzcFWbq9vm
TF9oz8vjkp9ElV7T7X+yBbdoxtKgQmRyRN29yngAGMoSEd2uE+C3Zek5Yn1ZqA1X
Va0epOl+CG2ixNChm6JbGsTy1kPZM8LwP5VseEeIz0HmTlBk/Gwj71ofIxtaVrbe
VAiwM/iW5mUoiOkO1x0Vb6W5OE4NHBHv9kRBkyKK6bC3xgB7tZqGtWdQ58crlvIF
/7OMRja2RliIOEzyZBGS
=M3Mi
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list