I'm running into the problem of affine transformed quads in a mesh and therefore wrong texture coordinate interpolations. I believe that in the fixed function pipeline you could just set the folloing glHint:
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
But looking at the doc this seems to be deprecated. So I guess there is no more "simple" solution to do this and I need to specify all my texture coordinates as 4D vectors?
Additionally does this mean that if I want to load a mesh that only specifies 2D texture coordinates I need to manually detect quads and correct for this?
The image below displays my problem on a torus made out of 4 slices.
I also tried to use interpolation qualifiers in my shaders as suggested by Nicol Bolas here.
Although I believe smooth is the default setting anyway. This had no effect on my output.
The question on how to do perspective correct texture mapping has come up multiple times here on SO. But I'm asking if there is no easier solution. My personal conclusion on why the fixed function pipeline was able to do this for you is because of GL_QUADS. And I have the feeling that specifying 4D texture coordinats is the only solution in the core profile.
Here are some links on the topic that explain how the 4D coordinates work:
Getting to know the Q texture coordinate...