-----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) .