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

Joachim Priesner joachim.priesner at web.de
Sat Oct 18 09:29:39 CDT 2014


Hi Stefan,

thanks for your continuing help on this issue.

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

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.

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?

Joachim



More information about the wine-devel mailing list