public class ARBBaseInstance
extends java.lang.Object
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.
| Modifier and Type | Method and Description |
|---|---|
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.
|
static void |
glDrawElementsInstancedBaseInstance(int mode,
java.nio.ByteBuffer indices,
int primcount,
int baseinstance)
Draws multiple instances of a set of elements with an offset applied to instanced attributes
|
static void |
glDrawElementsInstancedBaseInstance(int mode,
java.nio.IntBuffer indices,
int primcount,
int baseinstance)
Draws multiple instances of a set of elements with an offset applied to instanced attributes
|
static void |
glDrawElementsInstancedBaseInstance(int mode,
int type,
java.nio.ByteBuffer indices,
int primcount,
int baseinstance)
Draws multiple instances of a set of elements with an offset applied to instanced attributes
|
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
|
static void |
glDrawElementsInstancedBaseInstance(int mode,
java.nio.ShortBuffer indices,
int primcount,
int baseinstance)
Draws multiple instances of a set of elements with an offset applied to instanced attributes
|
static void |
glDrawElementsInstancedBaseVertexBaseInstance(int mode,
java.nio.ByteBuffer indices,
int primcount,
int basevertex,
int baseinstance)
Renders multiple instances of a set of primitives from array data with a per-element offset.
|
static void |
glDrawElementsInstancedBaseVertexBaseInstance(int mode,
java.nio.IntBuffer indices,
int primcount,
int basevertex,
int baseinstance)
Renders multiple instances of a set of primitives from array data with a per-element offset.
|
static void |
glDrawElementsInstancedBaseVertexBaseInstance(int mode,
int type,
java.nio.ByteBuffer indices,
int primcount,
int basevertex,
int baseinstance)
Renders multiple instances of a set of primitives from array data with a per-element offset.
|
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.
|
static void |
glDrawElementsInstancedBaseVertexBaseInstance(int mode,
java.nio.ShortBuffer indices,
int primcount,
int basevertex,
int baseinstance)
Renders multiple instances of a set of primitives from array data with a per-element offset.
|
static void |
nglDrawElementsInstancedBaseInstance(int mode,
int count,
int type,
long indices,
int primcount,
int baseinstance)
Unsafe version of:
DrawElementsInstancedBaseInstance |
static void |
nglDrawElementsInstancedBaseVertexBaseInstance(int mode,
int count,
int type,
long indices,
int primcount,
int basevertex,
int baseinstance)
Unsafe version of:
DrawElementsInstancedBaseVertexBaseInstance |
public static void glDrawArraysInstancedBaseInstance(int mode,
int first,
int count,
int primcount,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
first - the starting index in the enabled arrayscount - the number of indices to be renderedprimcount - the number of instances of the specified range of indices to be renderedbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void nglDrawElementsInstancedBaseInstance(int mode,
int count,
int type,
long indices,
int primcount,
int baseinstance)
DrawElementsInstancedBaseInstancecount - the number of elements to be renderedtype - the type of the values in indices. One of:UNSIGNED_BYTE | UNSIGNED_SHORT | UNSIGNED_INT |
public static void glDrawElementsInstancedBaseInstance(int mode,
int count,
int type,
long indices,
int primcount,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
count - the number of elements to be renderedtype - the type of the values in indices. One of:UNSIGNED_BYTE | UNSIGNED_SHORT | UNSIGNED_INT |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the specified range of indices to be renderedbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseInstance(int mode,
int type,
java.nio.ByteBuffer indices,
int primcount,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
type - the type of the values in indices. One of:UNSIGNED_BYTE | UNSIGNED_SHORT | UNSIGNED_INT |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the specified range of indices to be renderedbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseInstance(int mode,
java.nio.ByteBuffer indices,
int primcount,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the specified range of indices to be renderedbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseInstance(int mode,
java.nio.ShortBuffer indices,
int primcount,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the specified range of indices to be renderedbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseInstance(int mode,
java.nio.IntBuffer indices,
int primcount,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the specified range of indices to be renderedbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void nglDrawElementsInstancedBaseVertexBaseInstance(int mode,
int count,
int type,
long indices,
int primcount,
int basevertex,
int baseinstance)
DrawElementsInstancedBaseVertexBaseInstancecount - the number of elements to be renderedtype - the type of the values in indices. One of:UNSIGNED_BYTE | UNSIGNED_SHORT | UNSIGNED_INT |
public static void glDrawElementsInstancedBaseVertexBaseInstance(int mode,
int count,
int type,
long indices,
int primcount,
int basevertex,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
count - the number of elements to be renderedtype - the type of the values in indices. One of:UNSIGNED_BYTE | UNSIGNED_SHORT | UNSIGNED_INT |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the indexed geometry that should be drawnbasevertex - a constant that should be added to each element of indices when choosing elements from the enabled vertex arraysbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseVertexBaseInstance(int mode,
int type,
java.nio.ByteBuffer indices,
int primcount,
int basevertex,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
type - the type of the values in indices. One of:UNSIGNED_BYTE | UNSIGNED_SHORT | UNSIGNED_INT |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the indexed geometry that should be drawnbasevertex - a constant that should be added to each element of indices when choosing elements from the enabled vertex arraysbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseVertexBaseInstance(int mode,
java.nio.ByteBuffer indices,
int primcount,
int basevertex,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the indexed geometry that should be drawnbasevertex - a constant that should be added to each element of indices when choosing elements from the enabled vertex arraysbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseVertexBaseInstance(int mode,
java.nio.ShortBuffer indices,
int primcount,
int basevertex,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the indexed geometry that should be drawnbasevertex - a constant that should be added to each element of indices when choosing elements from the enabled vertex arraysbaseinstance - the base instance for use in fetching instanced vertex attributespublic static void glDrawElementsInstancedBaseVertexBaseInstance(int mode,
java.nio.IntBuffer indices,
int primcount,
int basevertex,
int baseinstance)
mode - what kind of primitives to render. One of:POINTS | LINE_STRIP | LINE_LOOP | LINES | TRIANGLE_STRIP | TRIANGLE_FAN | TRIANGLES |
LINES_ADJACENCY | LINE_STRIP_ADJACENCY | TRIANGLES_ADJACENCY | TRIANGLE_STRIP_ADJACENCY | PATCHES | POLYGON | QUADS |
QUAD_STRIP |
indices - a pointer to the location where the indices are storedprimcount - the number of instances of the indexed geometry that should be drawnbasevertex - a constant that should be added to each element of indices when choosing elements from the enabled vertex arraysbaseinstance - the base instance for use in fetching instanced vertex attributesCopyright LWJGL. All Rights Reserved. License terms.