Does anybody know if you can disable the texture interpolation in the rasterizer before the fragment goes to the fragment shader?
What I would like to do is have a quad in world coordinate with each vertex having four texture coordinates attached to it. The four texture coordinates are the four vertices of the quad. I would like to have that information in the fragment shader.
Let’s assume you can disable interpolation. You have triangle with 3 vertices. One defines texture coordinate as (0.0, 0.0), second as (1.0, 0.0) and third as (1.0, 1.0). What’s the texture coordinate at center of polygon? Undefined?
This is why you cannot disable interpolation - it just makes no sense.
If you need some texture coordinate to be constant across polygon then you must make it equal at all it’s vertices.
You can do this with GL_NV_gpu_program4 or GL_EXT_gpu_shader4. They expose flat, centroid, and noperspective (not perspectively corrected) in addition to the normal linear interpolation.