[Mesa-dev] softpipe color interpolation

Christoph Bumiller e0425955 at student.tuwien.ac.at
Mon Dec 19 09:59:18 PST 2011


On 19.12.2011 18:10, Dave Airlie wrote:
> Hi guys,
>
> So we have some piglit tests
> generated_tests/spec/glsl-1.10/execution/interpolation/interpolation-none-gl_FrontColor-smooth-none.shader_test
> that piglit fails
>
> This seems to be due to its linear interpolation not producing the
> correct answers compared to the hardware, on the rendered triangle,
> there is a obvious circle of darkness that isn't there on hw rendered.
>
> Looking at tri_linear_coeff I notice a large comment explaining that
> this could be done better, llvmpipe also uses the same code, is this
> what is causing the fail?

I noticed that a while ago, the lighting in a level in nexuiz was
looking weird on nv50, and I discovered it was due to colours using
linear (noperspective) interpolation instead of perspective correct
interpolation, at TGSI's behest.

It looked fine on llvmpipe, because its linear interpolation was more
like the perspective correct interpolation on nv50 ...

We should probably do GL_PERSPECTIVE_CORRECTION_HINT GL_NICEST, as newer
GL versions require anyway, and set the COLOR interpolants to
TGSI_INTERPOLATE_PERSPECTIVE in the state tracker.

For visualization: http://people.freedesktop.org/~chrisbmr/linterp.png
(that's supposed to be noperspective, iirc)

> Dave.
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list