I am using OpenGL GLSL to draw a quad in the form of two triangles. The vertex data includes a float which is 0 for two of the vertices and 1 for the other two. It is specified as smooth in float interp / smooth out float interp in the shaders (although I have tried noperspective also)
What I would like, of course, is for the value received by the fragment shader to be a smooth fade from 0 to 1 across the quad. What I get is as per the attached image:
There are a few quads there as examples. The result is quite close to correct for quads which are quite close to being rectangles, shows signs of distortion as they become slightly trapezoid, and becomes totally unacceptable once one end is significantly larger than the other.
Is there a reliable method that will get me a consistent result? I assume these results are "correct" as defined by the OpenGL standard, but they are really not good enough for what I need :/