'\" t .\" Title: glDrawArraysInstancedBaseInstance .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 05/21/2015 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLDRAWARRAYSINSTANCE" "3G" "05/21/2015" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" glDrawArraysInstancedBaseInstance \- draw multiple instances of a range of elements with offset applied to instanced attributes .SH "C SPECIFICATION" .HP \w'void\ glDrawArraysInstancedBaseInstance('u .BI "void glDrawArraysInstancedBaseInstance(GLenum\ " "mode" ", GLint\ " "first" ", GLsizei\ " "count" ", GLsizei\ " "primcount" ", GLuint\ " "baseinstance" ");" .SH "PARAMETERS" .PP \fImode\fR .RS 4 Specifies what kind of primitives to render\&. Symbolic constants \fBGL_POINTS\fR, \fBGL_LINE_STRIP\fR, \fBGL_LINE_LOOP\fR, \fBGL_LINES\fR, \fBGL_TRIANGLE_STRIP\fR, \fBGL_TRIANGLE_FAN\fR, \fBGL_TRIANGLES\fR\fBGL_LINES_ADJACENCY\fR, \fBGL_LINE_STRIP_ADJACENCY\fR, \fBGL_TRIANGLES_ADJACENCY\fR, \fBGL_TRIANGLE_STRIP_ADJACENCY\fR and \fBGL_PATCHES\fR are accepted\&. .RE .PP \fIfirst\fR .RS 4 Specifies the starting index in the enabled arrays\&. .RE .PP \fIcount\fR .RS 4 Specifies the number of indices to be rendered\&. .RE .PP \fIprimcount\fR .RS 4 Specifies the number of instances of the specified range of indices to be rendered\&. .RE .PP \fIbaseinstance\fR .RS 4 Specifies the base instance for use in fetching instanced vertex attributes\&. .RE .SH "DESCRIPTION" .PP \fBglDrawArraysInstancedBaseInstance\fR behaves identically to \fBglDrawArrays\fR() except that \fIprimcount\fR instances of the range of elements are executed and the value of the internal counter \fIinstanceID\fR advances for each iteration\&. \fIinstanceID\fR is an internal 32\-bit integer counter that may be read by a vertex shader as \fBgl_InstanceID\fR\&. .PP \fBglDrawArraysInstancedBaseInstance\fR has the same effect as: .sp .if n \{\ .RS 4 .\} .nf if ( mode or count is invalid ) generate appropriate error else { for (int i = 0; i < primcount ; i++) { instanceID = i; glDrawArrays(mode, first, count); } instanceID = 0; } .fi .if n \{\ .RE .\} .PP Specific vertex attributes may be classified as \fIinstanced\fR through the use of \fBglVertexAttribDivisor\fR()\&. Instanced vertex attributes supply per\-instance vertex data to the vertex shader\&. The index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated as: gl _ InstanceID divisor + baseInstance\&. Note that \fIbaseinstance\fR does not affect the shader\-visible value of \fBgl_InstanceID\fR\&. .SH "ERRORS" .PP \fBGL_INVALID_ENUM\fR is generated if \fImode\fR is not one of the accepted values\&. .PP \fBGL_INVALID_OPERATION\fR is generated if a geometry shader is active and \fImode\fR is incompatible with the input primitive type of the geometry shader in the currently installed program object\&. .PP \fBGL_INVALID_VALUE\fR is generated if \fIcount\fR or \fIprimcount\fR are negative\&. .PP \fBGL_INVALID_OPERATION\fR is generated if a non\-zero buffer object name is bound to an enabled array and the buffer object\*(Aqs data store is currently mapped\&. .SH "VERSION SUPPORT" .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ \fBOpenGL Version\fR T} T{ \fBFunction / Feature Name\fR T}:T{ \fB2\&.0\fR T}:T{ \fB2\&.1\fR T}:T{ \fB3\&.0\fR T}:T{ \fB3\&.1\fR T}:T{ \fB3\&.2\fR T}:T{ \fB3\&.3\fR T}:T{ \fB4\&.0\fR T}:T{ \fB4\&.1\fR T}:T{ \fB4\&.2\fR T}:T{ \fB4\&.3\fR T}:T{ \fB4\&.4\fR T}:T{ \fB4\&.5\fR T} .T& l c c c c c c c c c c c c. T{ \fBglDrawArraysInstancedBaseInstance\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} .TE .sp .SH "SEE ALSO" .PP \fBglDrawArrays\fR(), \fBglDrawElementsInstanced\fR() .SH "COPYRIGHT" .PP Copyright \(co 2011\-2014 Khronos Group\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2011-2014 Khronos Group .br