[GLSL] gl_TexCoord

To use gl_TexCoord[x] in the fragment shader, it should be set in the vertex shader in advance.

gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
  • TextureMatrix[x] could be be omitted.

Note that the texture index sent by glUniform1iARB() is just an integer offset from zero (0, 1, 2…) instead of  GLTEXTURE0, GLTEXTURE1… or texture names.


glTexCoordをフラグメントシェーダーで使うには、事前にヴェータックスシェーダーでglTexCoordを設定する必要があります。また、glUniform1iARBで送る値はGL_TEXTURE0やテクスチャーの名前ではなく、0始まりのインデックスです。

Body
Comment me!