Probably a dumb question, but I can't find (or am not understanding) a conclusive answer in the spec or in other questions (e.g., this one).
For smoothly-interpolated varying vec
and mat
vertex shader outputs / fragment shader inputs, is each element of the vector or matrix interpolated individually?
GL spec sec. 13.5.1 (clipping) describes linear clip-space interpolation of the "output values associated with a vertex." It also says that those are componentwise for vectors, but doesn't mention matrices.
Similarly, sec. 14.5.1 (rasterizing lines) and sec 14.6 (rasterizing polygons) describe interpolation of an "associated datum f for the fragment". Is each element of a vector or matrix considered an individual "associated datum" and interpolated independently from the other elements of the vector or matrix?
Secs. 11.1.3.10 (shader outputs) and 15.1 (fragment shader variables) mention interpolation but refer elsewhere for the details.
Similarly, in the GLSL spec, sec. 4.5 (interpolation qualifiers) says that interpolation happens but does not distinguish scalars from multi-component variables.
I am looking for a definitive statement about how vec
s and mat
s are interpolated, if there is one. Or let me know if there isn't! Thank you!
(Note: answers can be for any OpenGL version.)