Top Description Constructors Methods
org.lwjgl.opengl

public Class ARBBaseInstance

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.system.*

Native bindings to the ARB_base_instance extension.

This extension allows the offset within buffer objects used for instanced rendering to be specified. This is congruent with the first parameter in DrawArrays and the basevertex parameter in DrawElements. When instanced rendering is performed (for example, through DrawArraysInstanced), instanced vertex attributes whose vertex attribute divisors are non-zero are fetched from enabled vertex arrays per-instance rather than per-vertex. However, in unextended OpenGL, there is no way to define the offset into those arrays from which the attributes are fetched. This extension adds that offset in the form of a <baseinstance> parameter to several new procedures.

The baseinstance parameter is added to the index of the array element, after division by the vertex attribute divisor. This allows several sets of instanced vertex attribute data to be stored in a single vertex array, and the base offset of that data to be specified for each draw. Further, this extension exposes the <baseinstance> parameter as the final and previously undefined structure member of the draw-indirect data structure.

Requires OpenGL 3.1 or ARB_draw_instanced. Promoted to core in OpenGL 4.2.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glDrawArraysInstancedBaseInstance(int mode, int
the starting index in the enabled arrays
first
,
int
the number of indices to be rendered
count
,
int
the number of instances of the specified range of indices to be rendered
primcount
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Draws multiple instances of a range of elements with an offset applied to instanced attributes.

public static void
glDrawElementsInstancedBaseInstance(int mode, int
the number of elements to be rendered
count
,
int
the type of the values in indices. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
long
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the specified range of indices to be rendered
primcount
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

public static void
glDrawElementsInstancedBaseInstance(int mode, int
the type of the values in indices. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
ByteBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the specified range of indices to be rendered
primcount
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

public static void
glDrawElementsInstancedBaseInstance(int mode, ByteBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the specified range of indices to be rendered
primcount
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

public static void
glDrawElementsInstancedBaseInstance(int mode, ShortBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the specified range of indices to be rendered
primcount
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

public static void
glDrawElementsInstancedBaseInstance(int mode, IntBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the specified range of indices to be rendered
primcount
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

public static void
glDrawElementsInstancedBaseVertexBaseInstance(int mode, int
the number of elements to be rendered
count
,
int
the type of the values in indices. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
long
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the indexed geometry that should be drawn
primcount
,
int
a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays
basevertex
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Renders multiple instances of a set of primitives from array data with a per-element offset.

public static void
glDrawElementsInstancedBaseVertexBaseInstance(int mode, int
the type of the values in indices. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
ByteBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the indexed geometry that should be drawn
primcount
,
int
a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays
basevertex
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Renders multiple instances of a set of primitives from array data with a per-element offset.

public static void
glDrawElementsInstancedBaseVertexBaseInstance(int mode, ByteBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the indexed geometry that should be drawn
primcount
,
int
a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays
basevertex
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Renders multiple instances of a set of primitives from array data with a per-element offset.

public static void
glDrawElementsInstancedBaseVertexBaseInstance(int mode, ShortBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the indexed geometry that should be drawn
primcount
,
int
a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays
basevertex
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Renders multiple instances of a set of primitives from array data with a per-element offset.

public static void
glDrawElementsInstancedBaseVertexBaseInstance(int mode, IntBuffer
a pointer to the location where the indices are stored
indices
,
int
the number of instances of the indexed geometry that should be drawn
primcount
,
int
a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays
basevertex
,
int
the base instance for use in fetching instanced vertex attributes
baseinstance
)

Renders multiple instances of a set of primitives from array data with a per-element offset.

public static void
nglDrawElementsInstancedBaseInstance(int mode, int
the number of elements to be rendered
count
,
int
the type of the values in indices. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
long indices, int primcount, int baseinstance)

Unsafe version of: DrawElementsInstancedBaseInstance

public static void
nglDrawElementsInstancedBaseVertexBaseInstance(int mode, int
the number of elements to be rendered
count
,
int
the type of the values in indices. One of:
UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
type
,
long indices, int primcount, int basevertex, int baseinstance)

Unsafe version of: DrawElementsInstancedBaseVertexBaseInstance

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ARBBaseInstanceback to summary
protected ARBBaseInstance()

Method Detail

glDrawArraysInstancedBaseInstanceback to summary
public static void glDrawArraysInstancedBaseInstance(int mode, int first, int count, int primcount, int baseinstance)

Draws multiple instances of a range of elements with an offset applied to instanced attributes.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
first:int

the starting index in the enabled arrays

count:int

the number of indices to be rendered

primcount:int

the number of instances of the specified range of indices to be rendered

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseInstanceback to summary
public static void glDrawElementsInstancedBaseInstance(int mode, int count, int type, long indices, int primcount, int baseinstance)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
count:int

the number of elements to be rendered

type:int

the type of the values in indices. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indices:long

a pointer to the location where the indices are stored

primcount:int

the number of instances of the specified range of indices to be rendered

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseInstanceback to summary
public static void glDrawElementsInstancedBaseInstance(int mode, int type, ByteBuffer indices, int primcount, int baseinstance)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
type:int

the type of the values in indices. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indices:ByteBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the specified range of indices to be rendered

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseInstanceback to summary
public static void glDrawElementsInstancedBaseInstance(int mode, ByteBuffer indices, int primcount, int baseinstance)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indices:ByteBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the specified range of indices to be rendered

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseInstanceback to summary
public static void glDrawElementsInstancedBaseInstance(int mode, ShortBuffer indices, int primcount, int baseinstance)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indices:ShortBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the specified range of indices to be rendered

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseInstanceback to summary
public static void glDrawElementsInstancedBaseInstance(int mode, IntBuffer indices, int primcount, int baseinstance)

Draws multiple instances of a set of elements with an offset applied to instanced attributes

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indices:IntBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the specified range of indices to be rendered

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseVertexBaseInstanceback to summary
public static void glDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, long indices, int primcount, int basevertex, int baseinstance)

Renders multiple instances of a set of primitives from array data with a per-element offset.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
count:int

the number of elements to be rendered

type:int

the type of the values in indices. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indices:long

a pointer to the location where the indices are stored

primcount:int

the number of instances of the indexed geometry that should be drawn

basevertex:int

a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseVertexBaseInstanceback to summary
public static void glDrawElementsInstancedBaseVertexBaseInstance(int mode, int type, ByteBuffer indices, int primcount, int basevertex, int baseinstance)

Renders multiple instances of a set of primitives from array data with a per-element offset.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
type:int

the type of the values in indices. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
indices:ByteBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the indexed geometry that should be drawn

basevertex:int

a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseVertexBaseInstanceback to summary
public static void glDrawElementsInstancedBaseVertexBaseInstance(int mode, ByteBuffer indices, int primcount, int basevertex, int baseinstance)

Renders multiple instances of a set of primitives from array data with a per-element offset.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indices:ByteBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the indexed geometry that should be drawn

basevertex:int

a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseVertexBaseInstanceback to summary
public static void glDrawElementsInstancedBaseVertexBaseInstance(int mode, ShortBuffer indices, int primcount, int basevertex, int baseinstance)

Renders multiple instances of a set of primitives from array data with a per-element offset.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indices:ShortBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the indexed geometry that should be drawn

basevertex:int

a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays

baseinstance:int

the base instance for use in fetching instanced vertex attributes

glDrawElementsInstancedBaseVertexBaseInstanceback to summary
public static void glDrawElementsInstancedBaseVertexBaseInstance(int mode, IntBuffer indices, int primcount, int basevertex, int baseinstance)

Renders multiple instances of a set of primitives from array data with a per-element offset.

Parameters
mode:int

what kind of primitives to render. One of:

POINTSLINE_STRIPLINE_LOOPLINESTRIANGLE_STRIPTRIANGLE_FANTRIANGLES
LINES_ADJACENCYLINE_STRIP_ADJACENCYTRIANGLES_ADJACENCYTRIANGLE_STRIP_ADJACENCYPATCHESPOLYGONQUADS
QUAD_STRIP
indices:IntBuffer

a pointer to the location where the indices are stored

primcount:int

the number of instances of the indexed geometry that should be drawn

basevertex:int

a constant that should be added to each element of indices when choosing elements from the enabled vertex arrays

baseinstance:int

the base instance for use in fetching instanced vertex attributes

nglDrawElementsInstancedBaseInstanceback to summary
public static void nglDrawElementsInstancedBaseInstance(int mode, int count, int type, long indices, int primcount, int baseinstance)

Unsafe version of: DrawElementsInstancedBaseInstance

Parameters
count:int

the number of elements to be rendered

type:int

the type of the values in indices. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT
nglDrawElementsInstancedBaseVertexBaseInstanceback to summary
public static void nglDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, long indices, int primcount, int basevertex, int baseinstance)

Unsafe version of: DrawElementsInstancedBaseVertexBaseInstance

Parameters
count:int

the number of elements to be rendered

type:int

the type of the values in indices. One of:

UNSIGNED_BYTEUNSIGNED_SHORTUNSIGNED_INT