<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-11-07 20:05 GMT+01:00 Matteo Bruni <span dir="ltr"><<a href="mailto:matteo.mystral@gmail.com" target="_blank">matteo.mystral@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2014-11-07 19:53 GMT+01:00 Joachim Priesner <<a href="mailto:joachim.priesner@web.de">joachim.priesner@web.de</a>>:<br></span><span class=""><br>
> I could move the vertex declaration directly before the shader code like in test_scalar_instructions, would that make it clear enough?<br>
<br>
</span>I think that would be nicer, yes.<br></blockquote><div>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.<br><br>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.</div><div><br></div><div>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.</div></div></div></div>