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

Stefan Dösinger stefandoesinger at gmail.com
Sun Nov 9 17:54:48 CST 2014


2014-11-07 20:05 GMT+01:00 Matteo Bruni <matteo.mystral at gmail.com>:

> 2014-11-07 19:53 GMT+01:00 Joachim Priesner <joachim.priesner at web.de>:
>
> > I could move the vertex declaration directly before the shader code like
> in test_scalar_instructions, would that make it clear enough?
>
> I think that would be nicer, yes.
>
I don't think the ordering of the variable declaration is why Henri didn't
ack this patch. Maybe he didn't have time to look at it yet or maybe
there's something else he doesn't like.

I spotted another problem though: Please test negative fog start or end
values, e.g. fogstart = -1 and fogend = 0. As the attached (unfinished)
test shows, vertex fog evaluates the fog equation in the vertex pipeline
and then linearly interpolates the result into the fragment pipeline, which
mixes the colors. This means we have to know if the abs() happens before
the fog equation or afterwards. In my quick testing it seems that the abs
happens before the fog equation, so your change in glsl_shader.c shouldn't
need any changes. I expect that when you set start = -1 and end = 0 all
your tests except the NONE/NONE and foggy shader test should come up with a
fully fogged quad.

The way vertex fog is evaluated also explains the different handling of
fogstart == fogend for vertex and table fog. The attached patch still has
problems with table fog on the Radeon X1600 - for some reason it picks a
static depth = 1.0, and I don't see why. I suspect a driver bug, but I am
not sure yet. The test works on the Radeon 9000 and GeForce 7 GPUs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141110/dae641a9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0022-d3d9-tests-Test-fog-interpolation.patch
Type: text/x-patch
Size: 6240 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141110/dae641a9/attachment.bin>


More information about the wine-devel mailing list