Am 18.10.2014 16:30 schrieb "Joachim Priesner"
Setting z=0 in the projection matrix (matrix[2][2] = 0) seems to lead to
problems on Windows. As Windows uses the projection matrix to calculate w-based fog, all vertices will have a fog coordinate of 0.
I don't have the docs or Wine code available right now to look up how w fog works (yeah, we have some tests for that). Can you use matrix[2][3] to set z=1 or something?
My proposal would be to keep the identity projection matrix and test only
vertex fog, not pixel fog. The left half of the image will be clipped because the z coordinates are negative in this area, but the color is still calculated for each vertex and is interpolated. This test would still detect the issue I'm trying to fix. However, it would not be possible to test pixel fog with negative z coordinates that way. What do you think?
Since vertex fog is supposed to be calculated per vertex the only possible answer to where the abs() happens is in the vertex pipeline. There may be surprises though.
Why doesn't table fog work? I'd expect the fog corrdinate to be interpolated separately from the z coordinate, so you still get an interpolation from abs_maybe(-1.0) to 1.0, even if only half the quad is drawn.