Package org.lwjgl.opengl
Class ARBVertexAttribBinding
- java.lang.Object
-
- org.lwjgl.opengl.ARBVertexAttribBinding
-
public class ARBVertexAttribBinding extends java.lang.Object
Native bindings to the ARB_vertex_attrib_binding extension.OpenGL currently supports (at least) 16 vertex attributes and 16 vertex buffer bindings, with a fixed mapping between vertex attributes and vertex buffer bindings. This extension allows the application to change the mapping between attributes and bindings, which can make it more efficient to update vertex buffer bindings for interleaved vertex formats where many attributes share the same buffer.
This extension also separates the vertex binding update from the vertex attribute format update, which saves applications the effort of redundantly specifying the same format state over and over.
Conceptually, this extension splits the state for generic vertex attribute arrays into:
- An array of vertex buffer binding points, each of which specifies:
- a bound buffer object
- a starting offset for the vertex attribute data in that buffer object
- a stride used by all attributes using that binding point, and
- a frequency divisor used by all attributes using that binding point.
- An array of generic vertex attribute format information records, each of which specifies:
- a reference to one of the new buffer binding points above
- a component count and format, and a normalization flag for the attribute data, and
- the offset of the attribute data relative to the base offset of each vertex found at the associated binding point.
Promoted to core in
OpenGL 4.3
. - An array of vertex buffer binding points, each of which specifies:
-
-
Field Summary
Fields Modifier and Type Field and Description static int
GL_MAX_VERTEX_ATTRIB_BINDINGS
GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSETAccepted by thepname
parameter of GetIntegerv, ....static int
GL_VERTEX_ATTRIB_BINDING
GL_VERTEX_ATTRIB_RELATIVE_OFFSETAccepted by thepname
parameter of GetVertexAttrib*v.static int
GL_VERTEX_BINDING_BUFFER
GL_VERTEX_BINDING_DIVISOR
GL_VERTEX_BINDING_OFFSET
GL_VERTEX_BINDING_STRIDEAccepted by thetarget
parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
glBindVertexBuffer(int bindingindex, int buffer, long offset, int stride)
Binds a buffer to a vertex buffer bind point.static void
glVertexArrayBindVertexBufferEXT(int vaobj, int bindingindex, int buffer, long offset, int stride)
DSA version ofBindVertexBuffer
.static void
glVertexArrayVertexAttribBindingEXT(int vaobj, int attribindex, int bindingindex)
DSA version ofVertexAttribBinding
.static void
glVertexArrayVertexAttribFormatEXT(int vaobj, int attribindex, int size, int type, boolean normalized, int relativeoffset)
DSA version ofVertexAttribFormat
.static void
glVertexArrayVertexAttribIFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset)
DSA version ofVertexAttribIFormat
.static void
glVertexArrayVertexAttribLFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset)
DSA version ofVertexAttribLFormat
.static void
glVertexArrayVertexBindingDivisorEXT(int vaobj, int bindingindex, int divisor)
DSA version ofVertexBindingDivisor
.static void
glVertexAttribBinding(int attribindex, int bindingindex)
Associate a vertex attribute and a vertex buffer binding.static void
glVertexAttribFormat(int attribindex, int size, int type, boolean normalized, int relativeoffset)
Specifies the organization of data in vertex arrays.static void
glVertexAttribIFormat(int attribindex, int size, int type, int relativeoffset)
Specifies the organization of pure integer data in vertex arrays.static void
glVertexAttribLFormat(int attribindex, int size, int type, int relativeoffset)
Specifies the organization of 64-bit double data in vertex arrays.static void
glVertexBindingDivisor(int bindingindex, int divisor)
Modifies the rate at which generic vertex attributes advance during instanced rendering.
-
-
-
Field Detail
-
GL_VERTEX_ATTRIB_BINDING, GL_VERTEX_ATTRIB_RELATIVE_OFFSET
Accepted by thepname
parameter of GetVertexAttrib*v.
-
GL_VERTEX_BINDING_DIVISOR, GL_VERTEX_BINDING_OFFSET, GL_VERTEX_BINDING_STRIDE, GL_VERTEX_BINDING_BUFFER
Accepted by thetarget
parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v.
-
GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, GL_MAX_VERTEX_ATTRIB_BINDINGS
Accepted by thepname
parameter of GetIntegerv, ....
-
-
Method Detail
-
glBindVertexBuffer
public static void glBindVertexBuffer(int bindingindex, int buffer, long offset, int stride)
Binds a buffer to a vertex buffer bind point.- Parameters:
bindingindex
- the index of the vertex buffer binding point to which to bind the bufferbuffer
- the name of an existing buffer to bind to the vertex buffer binding pointoffset
- the offset of the first element of the bufferstride
- the distance between elements within the buffer
-
glVertexAttribFormat
public static void glVertexAttribFormat(int attribindex, int size, int type, boolean normalized, int relativeoffset)
Specifies the organization of data in vertex arrays.- Parameters:
attribindex
- the generic vertex attribute array being describedsize
- the number of values per vertex that are stored in the array. One of:1 2 3 4 BGRA
type
- the type of the data stored in the arraynormalized
- if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is directly converted to floating point.relativeoffset
- the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from
-
glVertexAttribIFormat
public static void glVertexAttribIFormat(int attribindex, int size, int type, int relativeoffset)
Specifies the organization of pure integer data in vertex arrays.- Parameters:
attribindex
- the generic vertex attribute array being describedsize
- the number of values per vertex that are stored in the array. One of:1 2 3 4 BGRA
type
- the type of the data stored in the arrayrelativeoffset
- the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from
-
glVertexAttribLFormat
public static void glVertexAttribLFormat(int attribindex, int size, int type, int relativeoffset)
Specifies the organization of 64-bit double data in vertex arrays.- Parameters:
attribindex
- the generic vertex attribute array being describedsize
- the number of values per vertex that are stored in the array. One of:1 2 3 4 BGRA
type
- the type of the data stored in the arrayrelativeoffset
- the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from
-
glVertexAttribBinding
public static void glVertexAttribBinding(int attribindex, int bindingindex)
Associate a vertex attribute and a vertex buffer binding.- Parameters:
attribindex
- the index of the attribute to associate with a vertex buffer bindingbindingindex
- the index of the vertex buffer binding with which to associate the generic vertex attribute
-
glVertexBindingDivisor
public static void glVertexBindingDivisor(int bindingindex, int divisor)
Modifies the rate at which generic vertex attributes advance during instanced rendering.- Parameters:
bindingindex
- the index of the generic vertex attributedivisor
- the number of instances that will pass between updates of the generic attribute at slotindex
-
glVertexArrayBindVertexBufferEXT
public static void glVertexArrayBindVertexBufferEXT(int vaobj, int bindingindex, int buffer, long offset, int stride)
DSA version ofBindVertexBuffer
.- Parameters:
vaobj
- the vertex array objectbindingindex
- the index of the vertex buffer binding point to which to bind the bufferbuffer
- the name of an existing buffer to bind to the vertex buffer binding pointoffset
- the offset of the first element of the bufferstride
- the distance between elements within the buffer
-
glVertexArrayVertexAttribFormatEXT
public static void glVertexArrayVertexAttribFormatEXT(int vaobj, int attribindex, int size, int type, boolean normalized, int relativeoffset)
DSA version ofVertexAttribFormat
.- Parameters:
vaobj
- the vertex array objectattribindex
- the generic vertex attribute array being describedsize
- the number of values per vertex that are stored in the array. One of:1 2 3 4 BGRA
type
- the type of the data stored in the arraynormalized
- if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is directly converted to floating point.relativeoffset
- the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from
-
glVertexArrayVertexAttribIFormatEXT
public static void glVertexArrayVertexAttribIFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset)
DSA version ofVertexAttribIFormat
.- Parameters:
vaobj
- the vertex array objectattribindex
- the generic vertex attribute array being describedsize
- the number of values per vertex that are stored in the array. One of:1 2 3 4 BGRA
type
- the type of the data stored in the arrayrelativeoffset
- the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from
-
glVertexArrayVertexAttribLFormatEXT
public static void glVertexArrayVertexAttribLFormatEXT(int vaobj, int attribindex, int size, int type, int relativeoffset)
DSA version ofVertexAttribLFormat
.- Parameters:
vaobj
- the vertex array objectattribindex
- the generic vertex attribute array being describedsize
- the number of values per vertex that are stored in the array. One of:1 2 3 4 BGRA
type
- the type of the data stored in the arrayrelativeoffset
- the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from
-
glVertexArrayVertexAttribBindingEXT
public static void glVertexArrayVertexAttribBindingEXT(int vaobj, int attribindex, int bindingindex)
DSA version ofVertexAttribBinding
.- Parameters:
vaobj
- the vertex array objectattribindex
- the index of the attribute to associate with a vertex buffer bindingbindingindex
- the index of the vertex buffer binding with which to associate the generic vertex attribute
-
glVertexArrayVertexBindingDivisorEXT
public static void glVertexArrayVertexBindingDivisorEXT(int vaobj, int bindingindex, int divisor)
DSA version ofVertexBindingDivisor
.- Parameters:
vaobj
- the vertex array objectbindingindex
- the index of the generic vertex attributedivisor
- the number of instances that will pass between updates of the generic attribute at slotindex
-
-