- 第 1 引数 index には属性インデックスを指定します。
- 第 2 引数 size は各頂点属性の要素数で 1 ~ 4 の整数を指定します。
- 第 3 引数 type では各要素のデータ型を GL_FLOAT, GL_DOUBLE, GL_INT などで指定します。
- 第 4 引数 normalized を GL_TRUE にすると自動的に正規化されます。
- 第 5 引数 stride は連続する属性間のバイトオフセットを指定します。
- 第 6 引数 pointer はバッファの先頭から最初の属性へのバイトオフセットです。
GPU内の変数とやり取りするための位置情報を取得する。
バーテックスシェーダー内の変数をGPUの何番のレジスタを使うかを割り当てる命令?
void glBindAttribLocation(GLuint program, GLuint index, const GLchar *name);
PARAMETERS
program
Specifies the handle of the program object in which the association is to be made.
index
Specifies the index of the generic vertex attribute to be bound.
name
Specifies a null terminated string containing the name of the vertex shader attribute variable to
which index is to be bound.
- glLinkProgram
フラグメントシェーダーを紐づける命令?
- glLinkProgram
色を付けるやつ。
ピクセルを操作する機能であり、基本的には頂点シェーダからの情報を元にテクスチャを合成したり表面色を適用したりする