・attributeとin/out
attributeは古い。
https://siguma-sig.hatenablog.com/entry/2017/04/25/203250
・glEnableClientStateとglEnableVertexAttribArray
glEnableClientStateはgl_Vertexなどの組み込み属性配列を利用する。
glEnableVertexAttribArrayはattribute変数を利用する。
https://jpcodeqa.com/q/a2b139f4eebef00e3630c83d6eaaaec9
・attribute変数の利用方法
attributeは古い。
https://siguma-sig.hatenablog.com/entry/2017/04/25/203250
・glEnableClientStateとglEnableVertexAttribArray
glEnableClientStateはgl_Vertexなどの組み込み属性配列を利用する。
glEnableVertexAttribArrayはattribute変数を利用する。
https://jpcodeqa.com/q/a2b139f4eebef00e3630c83d6eaaaec9
・attribute変数の利用方法
#version 400
in vec4 position;
void main(void)
{
gl_Position = position;
}
#version 400
out vec4 color;
void main (void)
{
color = vec4(0.0, 1.0, 0.0, 1.0);
}
gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vbo[0])
val positionId = gl.glGetAttribLocation(programId!!, "position")
gl.glEnableVertexAttribArray(positionId)
gl.glVertexAttribPointer(positionId, 3, GL2.GL_FLOAT, false, 0, 0)
gl.glDrawArrays(GL2.GL_QUADS, 0, vertices.size)
gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0)