Closed jlfwong closed 8 years ago
I known what you're saying but gl_TexCoord is actually supposed to be a vec4. It's the same reason why gl_Vertex is a vec4 instead of a vec3. Sometimes you need all four values. When you pass smaller-sized vectors as vertex attribute values, the values for the missing fields are taken from the default value vec4(0, 0, 0, 1). The definition of gl_TexCoord (and gl_Vertex) can be found in the GLSL spec: https://www.opengl.org/registry/doc/GLSLangSpec.Full.1.10.59.pdf.
The behavior for default values isn't in the GLSL spec, but you can find it in the OpenGL spec: https://www.opengl.org/registry/doc/glspec30.20080811.pdf. That behavior is defined in section 2.7: Vertex Specification.
Gotcha :)
I'm perhaps misunderstanding the code here, but it seems to me like gl_TexCoord should be a vec2, given mesh example code that looks like this: