Opengl42 Quick Reference Card
Opengl42 Quick Reference Card
Page 1
OpenGL Command Syntax [2.3] GL commands are formed from a return type, a name, and optionally up to 4 characters (or character pairs) from the Command Letters table (above), as shown by the prototype:
return-type Name{1234}{b s i i64 f d ub us ui ui64}{v} ([args ,] T arg1 , . . . , T argN [, args]);
The arguments enclosed in brackets ([args ,] and [, args]) may or may not be present. The argument type T and the number N of arguments may be indicated by the command name suffixes. N is 1, 2, 3, or 4 if present, or else corresponds to the type letters from the Command Table (above). If v is present, an array of N items is passed by a pointer. For brevity, the OpenGL documentation and this reference may omit the standard prefixes. The actual names are of the forms: glFunctionName(), GL_CONSTANT, GLtype
OpenGL Operation
Letters are used in commands to denote types. ubyte (8 bits) ushort (16 bits) uint (32 bits) uint64 (64 bits) double (64 bits)
1-bit sign, 5-bit exponent, 10-bit mantissa no sign bit, 5-bit exponent, 6-bit mantissa no sign bit, 5-bit exponent, 5-bit mantissa
enum GetError(void);
Vertex Arrays [2.8] void VertexPointer(int size, enum type, sizei stride, const void *pointer);
void DrawArraysOneInstance(enum mode, int first, sizei count, int instance, uint baseinstance); void DrawArrays(enum mode, int first, type: SHORT, INT, FLOAT, HALF_FLOAT, DOUBLE, sizei count); [UNSIGNED_]INT_2_10_10_10_REV void NormalPointer(enum type, sizei stride, void DrawArraysInstanced(enum mode, int first, sizei count, sizei primcount}; const void *pointer); type: see VertexPointer, plus BYTE void DrawArraysInstancedBaseInstance( void ColorPointer(int size, enum type, enum mode, int first, sizei count, sizei stride, const void *pointer); sizei primcount, uint baseinstance); type: see VertexPointer, plus BYTE, UINT, void DrawArraysIndirect(enum mode, UNSIGNED_{BYTE, SHORT} const void *indirect); void SecondaryColorPointer(int size, void MultiDrawArrays(enum mode, enum type, sizei stride, const void *pointer); const int *first, const sizei *count, type: see ColorPointer sizei primcount); void IndexPointer(enum type, sizei stride, void DrawElements(enum mode, const void *pointer); sizei count, enum type, const void *indices); type: UNSIGNED_BYTE, SHORT, INT, FLOAT, DOUBLE void DrawElementsInstanced(enum mode, void EdgeFlagPointer(sizei stride, sizei count, enum type, const void *indices, const void *pointer); sizei primcount); void FogCoordPointer(enum type, void DrawElementsInstancedBaseInstance( sizei stride, const void *pointer); enum mode, sizei count, enum type, type: FLOAT, HALF_FLOAT, DOUBLE const void *indices, sizei primcount, void TexCoordPointer(int size, enum type, uint baseinstance ); sizei stride, const void *pointer); void type: see VertexPointer void VertexAttribPointer(uint index, int size, DrawElementsInstancedBaseVertex BaseInstance( enum mode, sizei count, enum type, enum type, boolean normalized, const void *indices, sizei primcount, int sizei stride, const void *pointer); basevertex, uint baseinstance); type: see ColorPointer, plus FIXED void DrawElementsOneInstance( void VertexAttribIPointer(uint index, enum mode, sizei count, enum type, int size, enum type, sizei stride, const void *indices, int instance, const void *pointer); uint baseinstance); type: BYTE, SHORT, UNSIGNED_{BYTE, SHORT}, INT, UINT index: [0, MAX_VERTEX_ATTRIBS - 1] void MultiDrawElements(enum mode, sizei *count, enum type, void VertexAttribLPointer(uint index, int size, const void **indices, sizei primcount); enum type, sizei stride, const void *pointer); type: DOUBLE void DrawRangeElements(enum mode, index: see VertexAttribIPointer uint start, uint end, sizei count, enum type, const void *indices); void EnableClientState(enum array); void DrawElementsBaseVertex(enum mode, void DisableClientState(enum array); sizei count, enum type, const void *indices, array: {VERTEX, NORMAL, COLOR, INDEX}_ARRAY, int basevertex); {SECONDARY_COLOR, EDGE_FLAG}_ARRAY, void DrawRangeElementsBaseVertex( FOG_COORD_ARRAY, TEXTURE_COORD_ARRAY enum mode, uint start, uint end, void EnableVertexAttribArray(uint index); sizei count, enum type, const void *indices, void DisableVertexAttribArray(uint index); int basevertex); index: [0, MAX_VERTEX_ATTRIBS - 1] void DrawElementsInstancedBaseVertex( void VertexAttribDivisor(uint index, enum mode, sizei count, enum type, uint divisor); const void *indices, sizei primcount, int basevertex); void ClientActiveTexture(enum texture); index: TEXTUREi (where i is [0, MAX_TEXTURE_COORDS - 1]) void DrawElementsIndirect(enum mode, enum type, const void *indirect); void ArrayElement(int i); void MultiDrawElementsBaseVertex( Enable/Disable(PRIMITIVE_RESTART) enum mode, sizei *count, enum type, void PrimitiveRestartIndex(uint index); const void **indices, sizei primcount, Drawing Commands [2.8.3] [2.8.2] int *basevertex); For all the functions in this section: void InterleavedArrays(enum format, mode: POINTS, LINE_STRIP, LINE_LOOP, LINES, sizei stride, const void *pointer);
POLYGON, TRIANGLE_{STRIP, FAN}, TRIANGLES, QUAD_STRIP, QUADS, LINES_ADJACENCY, {LINE, TRIANGLE}_STRIP_ADJACENCY, PATCHES, TRIANGLES_ADJACENCY type: UNSIGNED_{BYTE, SHORT, INT} format: V2F, V3F, C4UB_{V2F, V3F}, {C3F, N3F}_V3F, C4F_N3F_V3F, T2F_{C4UB, C3F, N3F}_V3F, T2F_V3F, T4F_V4F, T2F_C4F_N3F_{V3F, V4F}
void NormalP3uiv(enum type, uint *normal); Enclose coordinate sets between Begin/End pairs void FogCoord{fd}(T coord); to construct geometric objects. void FogCoord{fd}v(const T coord); void Begin(enum mode); void Color{34}{bsifd ubusui}(T components); void End(void); void Color{34}{bsifd ubusui}v( mode: see Drawing Commands [2.8.3] on this card const T components); Separate Patches void ColorP{34}ui(enum type, uint coords); void PatchParameteri(enum pname, int value); void ColorP{34}uiv(enum type, pname: PATCH_VERTICES const uint *coords); Polygon Edges [2.6.2] void SecondaryColor3{bsifd ubusui}( Flag each edge of polygon primitives as either T components); boundary or non-boundary. void SecondaryColor3{bsifd ubusui}v( void EdgeFlag(boolean flag); const T components); void EdgeFlagv(const boolean *flag); void SecondaryColorP3ui(enum type, uint coords); Vertex Specification [2.7] Vertices have 2, 3, or 4 coordinates, and void SecondaryColorP3uiv(enum type, optionally a current normal, multiple current const uint *coords); texture coordinate sets, multiple current void Index{sifd ub}(T index); generic vertex attributes, current color, current void Index{sifd ub}v(const T index); secondary color, and current fog coordinates. The VertexAttrib* commands specify generic void Vertex{234}{sifd}(T coords); attributes with components of type float void Vertex{234}{sifd}v(const T coords); (VertexAttrib*), int or uint (VertexAttribI*), or void VertexP{234}ui(enum type, uint coords); double (VertexAttribL*d*). void VertexAttrib{1234}{sfd}(uint index, void VertexP{234}uiv(enum type, T values); const uint *coords); type: INT_2_10_10_10_REV, void VertexAttrib{123}{sfd}v(uint index, UNSIGNED_INT_2_10_10_10_REV const T values); void TexCoord{1234}{sifd}(T coords); void VertexAttrib4{bsifd ub us ui}v( uint index, const T values); void TexCoord{1234}{sifd}v(const T coords); void VertexAttrib4Nub(uint index, T values); void TexCoordP{1234}ui(enum type, void VertexAttrib4N{bsi ub us ui}v( uint coords); uint index, const T values); void TexCoordP{1234}uiv(enum type, void VertexAttribI{1234}{i ui}(uint index, const uint *coords); T values); type: see VertexP{234}uiv void VertexAttribI{1234}{i ui}v(uint index, void MultiTexCoord{1234}{sifd}( const T values); enum texture, T coords); void VertexAttribI4{bs ub us}v(uint index, void MultiTexCoord{1234}{sifd}v( const T values); enum texture, const T coords); void VertexAttribL{1234}d(uint index, texture: TEXTUREi (where i is T values); [0, MAX_TEXTURE_COORDS - 1]) void MultiTexCoordP{1234}ui(enum texture, void VertexAttribL{1234}dv(uint index, const T values); enum type, uint coords); void VertexAttribP{1234}ui( void MultiTexCoordP{1234}uiv( uint index, enum type, boolean normalized, enum texture, enum type, const uint *coords); uint value) void Normal3{bsifd}(T coords); void VertexAttribP{1234}uiv(uint index, void Normal3{bsifd}v(const T coords); enum type, boolean normalized, const uint *value); void NormalP3ui(enum type, uint normal);
Vertex Specification
Buffer Objects [2.9-10] void GenBuffers(sizei n, uint *buffers); void DeleteBuffers(sizei n, const uint *buffers); Creating and Binding Buffer Objects [2.9.1] void BindBuffer(enum target, uint buffer);
void BufferData(enum target, sizeiptr size, const void *data, enum usage);
usage: STREAM_{DRAW, READ, COPY}, {DYNAMIC, STATIC}_{DRAW, READ, COPY} target: see BindBuffer
void BindBufferRange(enum target, uint index, uint buffer, intptr offset, sizeiptr size); void BindBufferBase(enum target, uint index, uint buffer);
target: see BindBufferRange target: ATOMIC_COUNTER_BUFFER, {TRANSFORM_FEEDBACK, UNIFORM}_BUFFER
target: PIXEL_{PACK, UNPACK}_BUFFER, {UNIFORM, ARRAY, TEXTURE}_BUFFER, COPY_{READ, WRITE}_BUFFER, DRAW_INDIRECT_BUFFER, ELEMENT_ARRAY_BUFFER, {TRANSFORM_FEEDBACK, ATOMIC_COUNTER}_BUFFER
Mapping/Unmapping Buffer Data [2.9.3] void *MapBufferRange(enum target, intptr offset, sizeiptr length, bitfield access);
access: The logical OR of MAP_{READ, WRITE}_BIT, MAP_INVALIDATE_{BUFFER, RANGE}_BIT, MAP_{FLUSH_EXPLICIT, UNSYNCHRONIZED}_BIT, target: see BindBuffer access: READ_ONLY, WRITE_ONLY, READ_WRITE target: see BindBuffer
void *MapBuffer(enum target, enum access); void FlushMappedBufferRange( enum target, intptr offset, sizeiptr length); boolean UnmapBuffer(enum target);
target: see BindBuffer
www.opengl.org/registry
Page 2
Copying Between Buffers [2.9.5]
void CopyBufferSubData(enum readtarget, enum writetarget, intptr readoffset, intptr writeoffset, sizeiptr size);
readtarget and writetarget: see BindBuffer
All states related to definition of data used by vertex processor is in a vertex array object.
void GenVertexArrays(sizei n, uint *arrays); void DeleteVertexArrays(sizei n, const uint *arrays); void BindVertexArray(uint array);
void GetBufferParameteri64v(enum target, enum pname, int64 *data); void GetBufferSubData(enum target, intptr offset, sizeiptr size, void *data); void GetBufferPointerv(enum target, enum pname, void **params);
target: see BindBuffer pname: BUFFER_MAP_POINTER
void EndQuery(enum target); void BeginQueryIndexed(enum target, uint index, uint id); void EndQueryIndexed(enum target, uint index); void GenQueries(sizei n, uint *ids); void DeleteQueries(sizei n, const uint *ids);
void DrawTransformFeedbackInstanced( enum mode, uint id, sizei primcount); void DrawTransformFeedbackStream( enum mode, uint id, uint stream); void DrawTransformFeedbackStreamInstanced( enum mode, uint id, uint stream, sizei primcount);
void RasterPos{234}{sifd}(T coords); void RasterPos{234}{sifd}v(const T coords); void WindowPos{23}{sifd}(T coords); void WindowPos{23}{sifd}v(const T coords);
void EndConditionalRender(void);
void Rect{sifd}(T x1, T y1, T x2, T y2); void Rect{sifd}v(const T v1[2], const T v2[2]);
Matrices [2.12.1]
void Translate{fd}(T x, T y, T z); void Scale{fd}(T x, T y, T z); void Frustum(double l, double r, double b, double t, double n, double f); void Ortho(double l, double r, double b, double t, double n, double f); void PushMatrix(void); void PopMatrix(void);
void GenTransformFeedbacks(sizei n, uint *ids); void DeleteTransformFeedbacks(sizei n, const uint *ids); void BindTransformFeedback( enum target, uint id);
target: TRANSFORM_FEEDBACK
void GetQueryIndexediv(enum target, uint index, enum pname, int *params); void GetQueryObjectiv(uint id, enum pname, int *params); void GetQueryObjectuiv(uint id, enum pname, uint *params); void GetQueryObjecti64v(uint id, enum pname, int64 *params); void GetQueryObjectui64v(uint id, enum pname, uint64 *params);
pname: QUERY_RESULT{_AVAILABLE}
void LoadMatrix{fd}(const T m[16]); void MultMatrix{fd}(const T m[16]); void LoadTransposeMatrix{fd}(const T m[16]); void MultTransposeMatrix{fd}(const T m[16]); void LoadIdentity(void); void Rotate{fd}(Ty, T x, T y, T z);
void TexGen{ifd}(enum coord, enum pname, T param); void TexGen{ifd}v(enum coord, enum pname, const T params); Enable/Disable(arg);
void EndTransformFeedback(void); void PauseTransformFeedback(void); void ResumeTransformFeedback(void); void DrawTransformFeedback( enum mode, uint id);
void Material{if}(enum face, enum pname, T param); void Material{if}v(enum face, enum pname, const T params);
Enable/Disable(COLOR_MATERIAL) void ColorMaterial(enum face, enum mode); void ClampColor(enum target, enum clamp);
face: FRONT, BACK, FRONT_AND_BACK mode: EMISSION, AMBIENT, DIFFUSE, SPECULAR, AMBIENT_AND_DIFFUSE
face: FRONT, BACK, FRONT_AND_BACK pname: AMBIENT, DIFFUSE, AMBIENT_AND_DIFFUSE, EMISSION, SHININESS, COLOR_INDEXES, SPECULAR
void DepthRangeArrayv(uint first, sizei count, const clampd *v); void DepthRangeIndexed(uint index, clampd n, clampd f); void DepthRange(clampd n, clampd f); void DepthRangef(clampf n, clampd f); void ViewportArrayv(uint first, sizei count, const float *v); void ViewportIndexedf(uint index, float x, float y, float w, float h); void ActiveShaderProgram(uint pipeline, uint program);
void ViewportIndexedfv(uint index, const float *v); void Viewport(int x, int y, sizei w, sizei h);
Enable/Disable(CLIP_DISTANCEi) void ClipPlane(enum p, const double eqn[4]); void GetClipPlane(enum plane, double eqn[4]);
p: CLIP_PLANEi (where i is [0, MAX_CLIP_PLANES - 1])
void Light{if}(enum light, enum pname, T param); void Light{if}v(enum light, enum pname, const T params);
target: CLAMP_{READ, FRAGMENT, VERTEX}_COLOR clamp: TRUE, FALSE, FIXED_ONLY provokeMode: {FIRST, LAST}_VERTEX_CONVENTION mode: SMOOTH, FLAT
void GetActiveUniformBlockiv( uint program, uint uniformBlockIndex, enum pname, int *params);
light: LIGHTi (where i >= 0) pname: AMBIENT, DIFFUSE, SPECULAR,POSITION, SPOT_{DIRECTION, EXPONENT, CUTOFF}, {CONSTANT, LINEAR,QUADRATIC}_ATTENUATION
Queries [6.1.3]
void GetLight{if}v(enum light, enum value, T data); void GetMaterial{if}v(enum face, enum value, T data);
face: FRONT, BACK
void GetProgramBinary(uint program, sizei bufSize, sizei *length, enum *binaryFormat, void *binary); void ProgramBinary(uint program, enum binaryFormat, const void *binary, sizei length);
pname: UNIFORM_BLOCK_{BINDING, DATA_SIZE}, UNIFORM_BLOCK_NAME_{LENGTH, UNIFORM}, UNIFORM_BLOCK_ACTIVE_UNIFORMS_INDICES, or UNIFORM_BLOCK_REFERENCED_BY_x_SHADER, where x may be one of VERTEX, FRAGMENT, GEOMETRY, TESS_CONTROL, or TESS_EVALUATION
void ShaderSource(uint shader, sizei count, const char **string, const int *length); void CompileShader(uint shader); void ReleaseShaderCompiler(void); void DeleteShader(uint shader); void ShaderBinary(sizei count, const uint *shaders, enum binaryformat, const void *binary, sizei length);
void LinkProgram(uint program); void UseProgram(uint program); uint CreateShaderProgramv(enum type, sizei count, const char **strings); void ProgramParameteri(uint program, enum pname, int value);
pname: PROGRAM_SEPARABLE, PROGRAM_BINARY_{RETRIEVABLE_HINT}, value: TRUE, FALSE
Vertex shaders operate on array of 4-component items numbered from slot 0 to MAX_VERTEX_ATTRIBS - 1.
void GetActiveAtomicCounterBufferBindingsiv( uint program, uint bufferBindingIndex, enum pname, int *params);
void GetActiveAttrib(uint program, uint index, sizei bufSize, sizei *length, int *size, enum *type, char *name);
*type returns: FLOAT_{VECn, MATn, MATnxm}, FLOAT, {UNSIGNED_}INT, {UNSIGNED_} INT_VECn
pname: ATOMIC_COUNTER_BUFFER_BINDING, ATOMIC_COUNTER_BUFFER_DATA_SIZE, ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_ {COUNTERS, COUNTER_INDICES}, ATOMIC_ COUNTER_BUFFER_REFERENCED_BY_ {VERTEX, TESS_CONTROL, GEOMETRY, FRAGMENT}_SHADER, UNIFORM_BLOCK_REFERENCED_BY_TESS_ EVALUATION_SHADER
void DeleteProgram(uint program); void GenProgramPipelines(sizei n, uint *pipelines); void DeleteProgramPipelines(sizei n, const uint *pipelines); void BindProgramPipeline(uint pipeline); void UseProgramStages(uint pipeline, bitfield stages, uint program);
int GetAttribLocation(uint program, const char *name); void BindAttribLocation(uint program, uint index, const char *name); int GetUniformLocation(uint program, const char *name); uint GetUniformBlockIndex(uint program, const char *uniformBlockName); void GetActiveUniformBlockName( uint program, uint uniformBlockIndex, sizei bufSize, sizei *length, char *uniformBlockName);
void GetUniformIndices(uint program, sizei uniformCount, const char **uniformNames, uint *uniformIndices); void GetActiveUniformName( uint program, uint uniformIndex, sizei bufSize, sizei *length, char *uniformName); void GetActiveUniform(uint program, uint index, sizei bufSize, sizei *length, int *size, enum *type, char *name);
*type returns: DOUBLE, DOUBLE_{VECn, MATn, MATnxn}, FLOAT, FLOAT_{VECn, MATn, MATnxn}, INT, INT_VECn, UNSIGNED_INT{_VECn}, BOOL, BOOL_VECn, or any value in [Table 2.13] [Table 2.16]
www.opengl.org/registry
Page 3
Tessellation Control Shaders [2.12.1-2] [2.15.1-2] void GetVertexAttrib{d f i}v(uint index, enum pname, T *params); void PatchParameterfv(enum pname, pname: CURRENT_VERTEX_ATTRIB or const float *values);
pname: PATCH_DEFAULT_{INNER, OUTER}_LEVEL VERTEX_ATTRIB_ARRAY_x where x is one of BUFFER_BINDING, DIVISOR, ENABLED, INTEGER, NORMALIZED, SIZE, STRIDE, or TYPE pname: see GetVertexAttrib{d f i}v pname: see GetVertexAttrib{d f i}v
[2.11.9] [2.14.9] int GetSubroutineUniformLocation( uint program, enum shadertype, const char *name); uint GetSubroutineIndex(uint program, enum shadertype, const char *name); void GetActiveSubroutineUniformiv( uint program, enum shadertype, uint index, enum pname, int *values);
pname: {NUM_}COMPATIBLE_SUBROUTINES, UNIFORM_SIZE, UNIFORM_NAME_LENGTH
void GetVertexAttribl{i ui}v(uint index, enum pname, T *params); void GetVertexAttribLdv(uint index, enum pname, double *params); void GetVertexAttribPointerv(uint index, enum pname, void **pointer);
pname: VERTEX_ATTRIB_ARRAY_POINTER
void Uniform{1234}{ifd}v(int location, sizei count, const T value); void Uniform{1234}ui(int location, T value); void Uniform{1234}uiv(int location, sizei count, const T value); void UniformMatrix{234}{fd}v( int location, sizei count, boolean transpose, const T *value); void UniformMatrix{2x3,3x2,2x4,4x2, 3x4,4x3}{fd}v(int location, sizei count, boolean transpose, const T *value); void ProgramUniform{1234}{ifd}( uint program, int location, T value); void ProgramUniform{1234}{ifd}v( uint program, int location, sizei count, const T value); void ProgramUniform{1234}ui( uint program, int location, T value); void ProgramUniform{1234}uiv( uint program, int location, sizei count, const T value); void ProgramUniformMatrix{234}{fd}v( uint program, int location, sizei count, boolean transpose, const float *value); void ProgramUniformMatrixf{2x3,3x2,2x4, 4x2,3x4,4x3}{fd}v( uint program, int location, sizei count, boolean transpose, const float *value);
Uniform Buffer Object Bindings
void GetActiveSubroutineUniformName( uint program, enum shadertype, uint index, sizei bufsize, sizei *length, char *name); void GetActiveSubroutineName( uint program, enum shadertype, uint index, sizei bufsize, sizei *length, char *name);
void GetUniform{f d i ui}v(uint program, int location, T *params); Shader and Program Queries void GetUniformSubroutineuiv( enum shadertype, int location, Shader Queries [6.1.12] [6.1.18] uint *params); boolean IsShader(uint shader); void UniformSubroutinesuiv(enum shadertype, boolean IsProgram(uint program); void GetShaderiv(uint shader, enum pname, sizei count, const uint *indices); void GetProgramiv(uint program, int *params); pname: SHADER_TYPE, {GEOMETRY, VERTEX}_SHADER, enum pname, int *params); Varying Variables [2.11.12] [2.14.12] TESS_{CONTROL, EVALUATION}_SHADER, pname: DELETE_STATUS, LINK_STATUS, void TransformFeedbackVaryings( FRAGMENT_SHADER, {DELETE, COMPILE}_STATUS, VALIDATE_STATUS, INFO_LOG_LENGTH, uint program, sizei count, INFO_LOG_LENGTH, SHADER_SOURCE_LENGTH ATTACHED_SHADERS, ACTIVE_ATTRIBUTES, const char **varyings, enum bufferMode); ACTIVE_ UNIFORMS{_BLOCKS}, void GetShaderInfoLog(uint shader, bufferMode: {INTERLEAVED, SEPARATE}_ATTRIBS ACTIVE_ATTRIBUTES_MAX_LENGTH, sizei bufSize, sizei *length, char *infoLog); ACTIVE_UNIFORM_MAX_LENGTH, void GetTransformFeedbackVarying( TRANSFORM_FEEDBACK_BUFFER_MODE, uint program, uint index, sizei bufSize, void GetShaderSource(uint shader, TRANSFORM_FEEDBACK_ VARYINGS, sizei *length, sizei *size, enum *type, sizei bufSize, sizei *length, char *source); TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, char *name); ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, *type returns NONE, FLOAT{_VECn}, DOUBLE{_VECn}, void GetShaderPrecisionFormat( GEOMETRY_VERTICES_OUT, {UNSIGNED_}INT, {UNSIGNED_}INT_VECn, MATnxm, enum shadertype, enum precisiontype, GEOMETRY_{INPUT, OUTPUT}_TYPE, {FLOAT, DOUBLE}_MATn, {FLOAT, DOUBLE}_MATnxm int *range, int *precision);
shadertype: {VERTEX, FRAGMENT}_SHADER precisiontype: LOW_{FLOAT, INT}, MEDIUM_{FLOAT, INT}, HIGH_{FLOAT, INT}
void GetProgramStageiv(uint program, enum shadertype, enum pname, int *values); boolean IsProgramPipeline(uint pipeline); pname: ACTIVE_SUBROUTINES, ACTIVE_SUBROUTINE_{UNIFORMS, MAX_LENGTH}, void GetProgramPipelineiv(uint pipeline, enum pname, int *params); ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS, ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH void GetProgramInfoLog(uint program, sizei bufSize, sizei *length, char *infoLog); Program Queries [6.1.12] [6.1.18] void GetProgramPipelineInfoLog( void GetAttachedShaders(uint program, sizei uint pipeline, sizei bufSize, maxCount, sizei *count, uint *shaders); sizei *length, char *infoLog);
Multisampling [3.3.1]
Polygons [3.6]
Enable/Disable(target)
[Table 3.3]
void GetMultisamplefv(enum pname, uint index, float *val); void MinSampleShading(clampf value);
Points [3.4]
void ColorTable(enum target, enum internalformat, sizei width, enum format, enum type, const void *data);
void PointSize(float size); void PointParameter{if}(enum pname, T param); void PointParameter{if}v(enum pname, const T params);
pname: POINT_SIZE_MIN, POINT_SIZE_MAX, POINT_DISTANCE_ATTENUATION, POINT_FADE_THRESHOLD_SIZE, POINT_SPRITE_COORD_ORIGIN param, params: The clamp bounds, if pname is POINT_SIZE_{MIN, MAX}; A pointer to coefficients a, b, and c, if pname is POINT_DISTANCE_ATTENUATION; The fade threshold if pname is POINT_FADE_THRESHOLD_SIZE; {LOWER|UPPER}_LEFT if pname is POINT_SPRITE_COORD_ORIGIN.
[3.6.3 - 3.6.4] [3.6.4 - 3.6.5] void PolygonMode(enum face, enum mode); void PolygonOffset(float factor, float units); Enable/Disable(target)
target: POLYGON_OFFSET_{POINT, LINE, FILL}
target: {PROXY_}COLOR_TABLE, {PROXY_}POST_CONVOLUTION_COLOR_TABLE, {PROXY_}POST_COLOR_MATRIX_COLOR_TABLE internalformat: The formats in [Table 3.16] or [Tables 3.17-3.19] except RED, RG, DEPTH_{COMPONENT, STENCIL} base and sized void GetColorTableParameter{if}v( internal formats in those tables, all sized internal enum target, enum pname, T params); formats with non-fixed internal data types as target: see ColorTable discussed in [3.9], and RGB9_E5. pname: COLOR_TABLE_x (where x may be SCALE, format: RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, BIAS, FORMAT, COLOR_TABLE_WIDTH, RED_SIZE, BGRA, LUMINANCE, LUMINANCE_ALPHA GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE, type: see DrawPixels LUMINANCE_SIZE, INTENSITY_SIZE)
Enable/Disable (target)
pname: {UN}PACK_x (where x may be SWAP_BYTES, LSB_FIRST, ROW_LENGTH, SKIP_{PIXELS, ROWS}, ALIGNMENT, IMAGE_HEIGHT, SKIP_IMAGES), UNPACK_COMPRESSED_BLOCK_{WIDTH, HEIGHT, DEPTH, SIZE} param: MAP_{COLOR, STENCIL}, x_ {SCALE, BIAS}, INDEX_{SHIFT, OFFSET}, DEPTH_{SCALE, BIAS}, POST_CONVOLUTION_x_{SCALE, BIAS}, POST_COLOR_MATRIX_x_{SCALE, BIAS}, (where x is RED, GREEN, BLUE, or ALPHA) [Table 3.2]
void CopyColorTable(enum target, enum internalformat, int x, int y, sizei width); void ColorSubTable(enum target, sizei start, sizei count, enum format, enum type, void *data);
target: CONVOLUTION_2D internalformat: see ColorTable format: RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, BGRA, LUMINANCE, LUMINANCE_ALPHA type: BYTE, SHORT, INT, FLOAT, HALF_FLOAT, UNSIGNED_{BYTE, SHORT, INT}
www.opengl.org/registry
Page 4
Rasterization (continued)
void ConvolutionFilter1D(enum target, enum internalformat, sizei width, enum format, enum type, const void *data);
target: CONVOLUTION_1D internalformat, format, type: see ConvolutionFilter2D
Rasterization of Pixel Rectangles [4.3.1] [3.7.5] void DrawPixels(sizei width, sizei height, enum format, enum type, const void *data);
void GetSeparableFilter(enum target, enum format, enum type, void *row, void *column, void *span);
target: SEPARABLE_2D format and type: see GetColorTable
target: HISTOGRAM, PROXY_HISTOGRAM pname: HISTOGRAM_x (where x may be FORMAT, WIDTH, {RED, GREEN, BLUE, ALPHA}_SIZE, LUMINANCE_SIZE, SINK)
void SeparableFilter2D(enum target, enum internalformat, sizei width, sizei height, enum format, enum type, const void *row, const void *column);
target: CONVOLUTION_{1D, 2D}, SEPARABLE_2D pname: {MAX_}CONVOLUTION_{WIDTH, HEIGHT}, CONVOLUTION_x (where x may be FILTER_BIAS, BORDER_COLOR, BORDER_MODE, FILTER_SCALE, FORMAT)
format: {COLOR|STENCIL}_INDEX, RED, GREEN, BLUE, DEPTH_{COMPONENT, STENCIL}, ALPHA, RG, RGB, RGBA, BGR, BGRA, LUMINANCE{_ALPHA} (*_INTEGER formats from {Table 3.6} not supported) type: BITMAP, BYTE, SHORT, INT, FLOAT, HALF_FLOAT, UNSIGNED_{BYTE, SHORT, INT}, or value from [Table 3.5] target: CLAMP_{READ,FRAGMENT, VERTEX}_COLOR clamp: TRUE, FALSE, FIXED_ONLY
void ClampColor(enum target, enum clamp); void PixelZoom(float zx, float zy);
target: MINMAX internalformat: see ColorTable, omitting the values 1, 2, 3, 4 and INTENSITY base and sized internal formats
Histogram Table Specification [3.7.3] Alt. Convolution Filter Spec. Commands void Histogram(enum target, sizei width,
void CopyConvolutionFilter2D(enum target, enum internalformat, int x, int y, sizei width, sizei height);
target: CONVOLUTION_2D internalformat: see ConvolutionFilter2D target: HISTOGRAM, PROXY_HISTOGRAM internalformat: see ColorTable except 1, 2, 3, and 4
void GetMinmax(enum target, boolean reset, enum format, enum type, void *values);
target: MINMAX format and type: see GetColorTable target: MINMAX
target: CONVOLUTION_{1D, 2D}, SEPARABLE_2D pname: CONVOLUTION_BORDER_MODE param: REDUCE, {CONSTANT, REPLICATE_}BORDER
Bitmaps [3.8]
void ResetMinmax(enum target); void GetMinmaxParameter{if}v( enum target, enum pname, T params);
target: MINMAX pname: MINMAX_FORMAT, MINMAX_SINK
void GetHistogram(enum target, boolean reset, enum format, enum type, void *values);
target: HISTOGRAM format and type: see GetColorTable
void Bitmap(sizei w, sizei h, float xb0, float yb0, float xbi, float ybi, const ubyte *data);
Whole Framebuffer
void ColorMask(boolean r, boolean g, boolean b, boolean a); void ColorMaski(uint buf, boolean r, boolean g, boolean b, boolean a); void StencilMask(uint mask); void StencilMaskSeparate(enum face, uint mask); void DepthMask(boolean mask); Clearing the Buffers [4.2.3] void ClearColor(clampf r, clampf g, clampf b, clampf a); void ClearIndex(float index); void ClearDepth(clampd d); void ClearDepthf(clampf d);
face: FRONT, BACK, FRONT_AND_BACK
void ClearStencil(int s); void ClearAccum(float r, float g, float b, float a); void ClearBuffer{if ui}v(enum buffer, int drawbuffer, const T *value) void ClearBufferfi(enum buffer, int drawbuffer, float depth, int stencil);
buffer: DEPTH_STENCIL drawbuffer: 0 buffer: COLOR, DEPTH, STENCIL
Enable/Disable(COLOR_SUM) Fog [3.12] Enable/Disable(FOG) void Fog{if}(enum pname, T param); void Fog{if}v(enum pname, T params);
pname: FOG_MODE, FOG_COORD_SRC, FOG_DENSITY, FOG_START, FOG_END, FOG_COLOR, FOG_INDEX target: FRAGMENT_SHADER_DERIVATIVE_HINT, PERSPECTIVE_CORRECTION_HINT, POINT_SMOOTH_HINT, FOG_HINT, GENERATE_MIPMAP_HINT, TEXTURE_COMPRESSION_HINT, {LINE, POLYGON}_SMOOTH_HINT, hint: FASTEST, NICEST, DONT_CARE
void TexImage3D(enum target, int level, int internalformat, sizei width, sizei height, sizei depth, int border, enum format, enum type, const void *data);
target: TEXTURE_{3D, 2D_ARRAY, CUBE_MAP_ARRAY}, PROXY_TEXTURE_{3D, 2D_ARRAY, CUBE_MAP_ARRAY} internalformat: ALPHA, DEPTH_COMPONENT, DEPTH_STENCIL, LUMINANCE_ALPHA, LUMINANCE, RED, INTENSITY, RG, RGB, RGBA; or a sized internal format from [Tables 3.12-3.13] [Tables 3.17-3.19]; COMPRESSED_{RED_RGTC1,RG_RGTC2}, COMPRESSED_SIGNED_{RED_RGTC1,RG_RGTC2}, or a generic comp. format in [Table 3.14] [Table 3.20] format: COLOR_INDEX, DEPTH_COMPONENT, DEPTH_STENCIL, RED, GREEN, BLUE, ALPHA, RG, RGB, RGBA, BGR, BGRA, LUMINANCE, LUMINANCE_ALPHA, {RED, GREEN, BLUE, ALPHA}_INTEGER, {RG, RGB, RGBA, BGR}_INTEGER, BGRA_INTEGER [Table 3.3] [Table 3.6] type: BITMAP, {UNSIGNED_}BYTE, {UNSIGNED_}SHORT, {UNSIGNED_}INT, HALF_FLOAT, FLOAT, or a value from [Table 3.2] [Table 3.5]
void CopyTexSubImage1D(enum target, int level, int xoffset, int x, int y, sizei width);
target: TEXTURE_1D
void CopyTexImage1D(enum target, int level, enum internalformat, int x, int y, sizei width, int border);
void DeleteTextures(sizei n, const uint *textures); void GenTextures(sizei n, uint *textures); boolean AreTexturesResident(sizei n, uint *textures, boolean *residences); void PrioritizeTextures(sizei n, uint *textures, const clampf *priorities);
void TexSubImage3D(enum target, int level, int xoffset, int yoffset, int zoffset, sizei width, sizei height, sizei depth, enum format, enum type, const void *data);
target: TEXTURE_3D, TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY format and type: see TexImage3D
void CompressedTexImage2D(enum target, int level, enum internalformat, sizei width, sizei height, int border, sizei imageSize, const void *data);
target: see TexImage2D, omitting compressed rectangular texture formats internalformat: see CompressedTexImage3D
void TexImage2D(enum target, int level, int internalformat, sizei width, sizei height, int border, enum format, enum type, const void *data);
void TexSubImage2D(enum target, int level, int xoffset, int yoffset, sizei width, sizei height, enum format, enum type, const void *data);
target: see CopyTexImage2D format and type: see TexImage2D
void CompressedTexImage1D(enum target, int level, enum internalformat, sizei width, int border, sizei imageSize, const void *data); void CompressedTexSubImage3D( enum target, int level, int xoffset, int yoffset, int zoffset, sizei width, sizei height, sizei depth, enum format, sizei imageSize, const void *data); void CompressedTexSubImage2D( enum target, int level, int xoffset, int yoffset, sizei width, sizei height, enum format, sizei imageSize, cont void *data);
target: see TexSubImage2D format: see TexImage2D
target: TEXTURE_{2D, RECTANGLE,CUBE_MAP}, PROXY_TEXTURE_{2D, RECTANGLE,CUBE_MAP}, TEXTURE_1D_ARRAY, PROXY_TEXTURE_1D_ARRAY, TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}, TEXTURE_CUBE_MAP_NEGATIVE}_{X, Y, Z} internalformat, format, and type: see TexImage3D
void TexSubImage1D(enum target, int level, int xoffset, sizei width, enum format, enum type, const void *data);
target: TEXTURE_1D format, type: see TexImage1D
void TexImage1D(enum target, int level, int internalformat, sizei width, int border, enum format, enum type, const void *data);
target: TEXTURE_1D, PROXY_TEXTURE_1D type, internalformat, and format: see TexImage3D
void CopyTexSubImage3D(enum target, int level, int xoffset, int yoffset, int zoffset, int x, int y, sizei width, sizei height);
target: see TexSubImage3D
void DeleteSamplers(sizei count, const uint *samplers); 2011 Khronos Group - Rev. 0711
void CopyTexSubImage2D(enum target, int level, int xoffset, int yoffset, int x, int y, sizei width, sizei height);
www.opengl.org/registry
Page 5
[3.9.20][3.10.22] void BindImageTexture(uint index, uint texture, int level, boolean layered, int layer, enum access, enum format);
access: READ_ONLY, WRITE_ONLY, READ_WRITE format: RGBA{32,16}F, RG{32,16}F, R11F_G11F_B10F, R{32,16}F, RGBA{32,16,8}UI, RGB10_A2UI, RG{32,16,8}UI, R{32,16,8}UI, RGBA{32,16,8}I, RG{32,16,8}I, R{32,16,8}I, RGBA{16,8}, RGB10_A2, RG{16,8}, R{16,8}, RGBA{16,8}_SNORM, RG{16,8}_SNORM, R{16,8}_SNORM [Table 3.21] [Table 3.33]
void TexImage3DMultisample(enum target, sizei samples, int internalformat, sizei width, sizei height, sizei depth, boolean fixedsamplelocations);
target: {PROXY_}TEXTURE_2D_MULTISAMPLE_ARRAY internalformat: ALPHA, RED, RG, RGB, RGBA, DEPTH_{COMPONENT, STENCIL}, STENCIL_INDEX, or sized internal formats corresponding to these base formats
target: TEXTURE_1D, PROXY_TEXTURE_1D internalformat: any of the sized internal color, luminance, intensity, depth, and stencil formats in [Tables 3.12-13] [Table 3.17-19]
target: {PROXY_}TEXTURE_{1D, 2D, 3D}, TEXTURE_BUFFER, PROXY_TEXTURE_CUBE_MAP, {PROXY_}TEXTURE_{1D, 2D}_ARRAY, {PROXY_}TEXTURE_CUBE_MAP_ARRAY, {PROXY_}TEXTURE_RECTANGLE, TEXTURE_CUBE_MAP_{POSITIVE, NEGATIVE}_{X, Y, Z}, {PROXY_}TEXTURE_2D_MULTISAMPLE{_ARRAY} value: TEXTURE_{WIDTH, HEIGHT, DEPTH}, TEXTURE_{BORDER, COMPONENTS, SAMPLES}, TEXTURE_FIXED_SAMPLE_LOCATIONS, TEXTURE_{INTERNAL_FORMAT, SHARED_SIZE}, TEXTURE_COMPRESSED{_IMAGE_SIZE}, TEXTURE_BUFFER_DATA_STORE_BINDING, TEXTURE_x_{SIZE, TYPE} (where x can be RED, GREEN, BLUE, ALPHA, LUMINANCE, INTENSITY, DEPTH, STENCIL)
void TexImage2DMultisample(enum target, sizei samples, int internalformat, sizei width, sizei height, boolean fixedsamplelocations);
target: {PROXY_}TEXTURE_2D_MULTISAMPLE internalformat: see TexImage3DMultisample
void TexStorage2D(enum target, sizei levels, enum internalformat, sizei width, sizei height);
target: TEXTURE_2D, PROXY_TEXTURE_2D, TEXTURE_{RECTANGLE, CUBE_MAP, 1D_ARRAY}, PROXY_TEXTURE_{RECTANGLE, CUBE_MAP, 1D_ARRAY} internalformat: see TexStorage1D
internalformat: must be color-renderable, depthrenderable, or stencil-renderable target: RENDERBUFFER, TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY pname: NUM_SAMPLE_COUNTS, SAMPLES
void GetTexImage(enum tex, int lod, enum format, enum type, void *img);
target: TEXTURE_BUFFER internalformat: R8{I,UI}, R16{F, I, UI}, R32{F, I, UI}, RG8{I, UI}, RG16{F, I, UI}, RG32{F, I, UI}, RGB32{F, I, UI}, RGBA8{I, UI}, RGBA16{F, I, UI}, RGBA32{F, I, UI}
void TexStorage3D(enum target, sizei levels, enum internalformat, sizei width, sizei height, sizei depth);
target: TEXTURE_3D, PROXY_TEXTURE_3D, TEXTURE_{2D, CUBE_MAP}[_ARRAY], PROXY_TEXTURE_{CUBE_MAP, 2D}[_ARRAY] internalformat: see TexStorage1D
tex: TEXTURE_{1, 2}D{_ARRAY}, TEXTURE_3D, TEXTURE_RECTANGLE, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_CUBE_MAP_POSITIVE_{X, Y, Z}, TEXTURE_CUBE_MAP_NEGATIVE_{X, Y, Z} format: see TexImage3D type: BITMAP, {UNSIGNED_}BYTE, UNSIGNED_{SHORT}, {UNSIGNED_}INT, {HALF_}FLOAT, or value from [Table 3.2] [Table 3.5] target: see tex for GetTexImage
Texture Environments & Functions [3.10.17] void TexParameter{if}(enum target, void TexEnv{if}(enum target, enum pname, T param); enum pname, T param); void TexParameter{if}v(enum target, void TexEnv{if}v(enum target, enum pname, const T *params); enum pname, const T params); void TexParameterI{i ui}v(enum target, enum target: TEXTURE_{FILTER_CONTROL, ENV}, pname, const T *params); POINT_SPRITE
target: TEXTURE_{1D,2D,3D}, TEXTURE_{1D,2D}_ARRAY, TEXTURE_RECTANGLE, TEXTURE_CUBE_MAP{_ARRAY} pname: TEXTURE_WRAP_{S, T, R}, TEXTURE_PRIORITY, TEXTURE_{MIN, MAG}_FILTER, TEXTURE_LOD_BIAS, TEXTURE_BORDER_COLOR, DEPTH_TEXTURE_MODE, TEXTURE_{MIN, MAX}_LOD, GENERATE_MIPMAP, TEXTURE_SWIZZLE_{R, G, B, A, RGBA}, TEXTURE_COMPARE_{MODE, FUNC}, TEXTURE_{BASE, MAX}_LEVEL [Table 3.16] [Table 3.22]
void GetTexParameter{if}v(enum target, enum value, T data); void GetTexParameterI{i ui}v(enum target, enum value, T data);
target: TEXTURE_{1D, 2D, 3D,RECTANGLE}, TEXTURE_{1D, 2D}_ARRAY, TEXTURE_CUBE_MAP{_ARRAY} value: TEXTURE_{RESIDENT, PRIORITY}, DEPTH_TEXTURE_MODE, GENERATE_MIPMAP, IMAGE_FORMAT_COMPATIBILITY_TYPE, TEXTURE_IMMUTABLE_FORMAT, TEXTURE_{BASE, MAX}_LEVEL, TEXTURE_BORDER_COLOR, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_{MODE, FUNC}, TEXTURE_{MIN, MAG}_FILTER, TEXTURE_MAX_{LEVEL, LOD}, TEXTURE_MIN_LOD, TEXTURE_SWIZZLE_{R, G, B, A, RGBA}, TEXTURE_WRAP_{S, T, R} [Table 3.16] [Table 3.22]
void GetCompressedTexImage( enum target, int lod, void *img); boolean IsTexture(uint texture);
pname: TEXTURE_LOD_BIAS, TEXTURE_ENV_MODE, TEXTURE_ENV_COLOR, COMBINE_{RGB, ALPHA}, {RGB, ALPHA}_SCALE, COORD_REPLACE, SRCn_RGB, SRCn_ALPHA, OPERANDn_RGB, OPERANDn_ALPHA (where n is [0, 1, 2])
Sampler Queries [6.1.5] boolean IsSampler(uint sampler); void GetSamplerParameter{if}v( uint sampler, enum pname, T *params); void GetSamplerParameterI{i ui}v( uint sampler, enum pname, T *params);
pname: TEXTURE_WRAP_{S, T, R}, TEXTURE_{MIN, MAG}_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_LOD_BIAS, TEXTURE_{MIN, MAX}_LOD, TEXTURE_COMPARE_{MODE, FUNC}
Per-Fragment Operations
Scissor Test [4.1.2]
Enable/Disable(SCISSOR_TEST) Enablei/Disablei(SCISSOR_TEST, uint index) void ScissorArrayv(uint first, sizei count, const int *v); void ScissorIndexed(uint index, int left, int bottom, sizei width, sizei height); void ScissorIndexedv(uint index, int *v); void Scissor(int left, int bottom, sizei width, sizei height); Multisample Fragment Operations [4.1.3] Enable/Disable(target) void SampleCoverage(clampf value, boolean invert); void SampleMaski(uint maskNumber, bitfield mask);
target: SAMPLE_ALPHA_TO_{COVERAGE, ONE}, SAMPLE_{COVERAGE, MASK}, MULTISAMPLE
Framebuffer Objects
void BindFramebuffer(enum target, uint framebuffer); void DeleteFramebuffers(sizei n, const uint *framebuffers); void GenFramebuffers(sizei n, uint *ids);
Renderbuffer Objects
target: RENDERBUFFER
Enable/Disable(BLEND) Enablei/Disablei(BLEND, uint index) void BlendEquation(enum mode); void BlendEquationi(uint buf, enum mode); void BlendEquationSeparate(enum modeRGB, enum modeAlpha);
mode, modeRGB, and modeAlpha: FUNC_ADD, FUNC_{SUBTRACT, REVERSE}_SUBTRACT, MIN, MAX mode, modeRGB, and modeAlpha: see BlendEquationSeparate srd, dst: see BlendFuncSeparate
void BindRenderbuffer(enum target, uint renderbuffer); void DeleteRenderbuffers(sizei n, const uint *renderbuffers); void GenRenderbuffers(sizei n, uint *renderbuffers); void RenderbufferStorageMultisample( enum target, sizei samples, enum internalformat, sizei width, sizei height);
target: RENDERBUFFER internalformat: see TexImage2DMultisample
Synchronization
void BlendEquationSeparatei(uint buf, enum modeRGB, enum modeAlpha); void BlendFunc(enum src, enum dst);
Enable/Disable(STENCIL_TEST) void StencilFunc(enum func, int ref, uint mask); void StencilFuncSeparate(enum face, enum func, int ref, uint mask);
void StencilOp(enum sfail, enum dpfail, enum dppass); void StencilOpSeparate(enum face, enum sfail, enum dpfail, enum dppass);
src, dst, srcRGB, dstRGB, srcAlpha, dstAlpha: ZERO, ONE, SRC_{COLOR, ALPHA}, DST_{COLOR, ALPHA}, SRC_ALPHA_SATURATE, CONSTANT_{COLOR, ALPHA}, ONE_MINUS_SRC_{COLOR, ALPHA}, ONE_MINUS_DST_{COLOR, ALPHA}, ONE_MINUS_CONSTANT_{COLOR, ALPHA}, {ONE_MINUS_}SRC1_ALPHA
Waiting for Sync Objects [5.3.1] [5.7.1] enum ClientWaitSync(sync sync, bitfield flags, uint64 timeout_ns);
timeout_ns: TIMEOUT_IGNORED
face: FRONT, BACK, FRONT_AND_BACK sfail, dpfail, and dppass: KEEP, ZERO, REPLACE, INCR, DECR, INVERT, INCR_WRAP, DECR_WRAP
void BlendFuncSeparatei(uint buf, enum srcRGB, enum dstRGB, enum srcAlpha, enum dstAlpha);
void GetSynciv(sync sync, enum pname, sizei bufSize, sizei *length, int *values);
pname: OBJECT_TYPE, SYNC_{STATUS,CONDITION, FLAGS}
www.opengl.org/registry
Page 6
Attaching Texture Images
void FramebufferTexture(enum target, enum attachment, uint texture, int level); void FramebufferTexture3D(enum target, enum attachment, enum textarget, uint texture, int level, int layer);
target: {DRAW, READ}FRAMEBUFFER, FRAMEBUFFER returns: FRAMEBUFFER_COMPLETE or a constant indicating the violating value
void FramebufferTexture1D(enum target, enum attachment, enum textarget, uint texture, int level);
Framebuffer Object Queries [6.1.13] [6.1.19] boolean IsFramebuffer(uint framebuffer); void GetFramebufferAttachmentParameteriv( enum target, enum attachment, enum pname, int *params);
pname: FRAMEBUFFER_ATTACHMENT_x (where x may be OBJECT_TYPE, OBJECT_NAME, RED_SIZE, GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE, DEPTH_SIZE, STENCIL_SIZE, COMPONENT_TYPE, COLOR_ENCODING, TEXTURE_LEVEL, LAYERED, TEXTURE_CUBE_MAP_FACE, TEXTURE_LAYER)
void FramebufferTexture2D(enum target, enum attachment, enum textarget, uint texture, int level);
void FramebufferTextureLayer(enum target, enum attachment, uint texture, int level, int layer);
target, attachment: see FramebufferTexture3D
(parameters )
target: {DRAW_, READ_}FRAMEBUFFER attachment: FRONT_{LEFT, RIGHT}, BACK_{LEFT,RIGHT}, COLOR_ATTACHMENTi, AUXi, DEPTH, STENCIL, {DEPTH, STENCIL}_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT
(more parameters )
void ReadPixels(int x, int y, sizei width, sizei height, enum format, enum type, void *data);
type: {HALF_}FLOAT, {UNSIGNED_}BYTE, {UNSIGNED_}SHORT, BITMAP, Copying Pixels [4.3.2] [4.3.3] {UNSIGNED_}INT, FLOAT_32_UNSIGNED_INT_24_8_REV, and void CopyPixels(int x, int y, sizei width, sizei height, UNSIGNED_{BYTE, SHORT, INT}_* values from [Table 3.2] [Table 3.5] enum type); type: COLOR, STENCIL, DEPTH, DEPTH_STENCIL void ReadBuffer(enum src);
src: NONE, FRONT{_LEFT, RIGHT}, LEFT, RIGHT, BACK{_LEFT, RIGHT}, void BlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, FRONT_AND_BACK, AUXi (i = [0, AUX_BUFFERS - 1 ]), int dstX0, int dstY0, int dstX1, int dstY1, bitfield mask, enum filter); COLOR_ATTACHMENTi (i = [0, MAX_COLOR_ATTACHMENTS - 1]) mask: Bitwise OR of {COLOR, DEPTH, STENCIL}_BUFFER_BIT filter: LINEAR, NEAREST
Also see DrawPixels, ClampColor, and PixelZoom in the Rasterization section of this reference card.
Evaluators [5.1]
Special Functions
Evaluators provide a means to use a polynomial or rational polynomial mapping to produce vertex, normal, and texture coordinates, and colors. Transformations, lighting, primitive assembly, rasterization, and per-pixel operations are not affected.
void EvalMesh2(enum mode, int p1, int p2, int q1, int q2);
mode: FILL, POINT, LINE
Feedback [5.3]
void Map1{fd}(enum target, T u1, T u2, int stride, int order, T points);
When in feedback mode, framebuffer updates are not performed. Instead, information about primitives that would have otherwise been rasterized is returned to the application via the feedback buffer.
A display list is a group of GL commands and arguments that has been stored for subsequent execution. The GL may be instructed to process a particular display list (possibly repeatedly) by providing a number that uniquely specifies it.
void Map2{fd}(enum target, T u1, T u2, int ustride, int uorder, T v1, T v2, int vstride, int vorder, const T points); void EvalCoord{12}{fd}(T arg); void EvalCoord{12}{fd}v(const T arg); void MapGrid1{fd}(int n, T u1, T u2); void MapGrid2{fd}(int nu, T u1, T u2, int nv, T v1, T v2);
Selection [5.2]
Determine which primitives are drawn into a region of a window. The region is defined by the current model-view and perspective matrices.
void FeedbackBuffer(sizei n, enum type, float void EndList(void); *buffer); type: 2D, 3D, 3D_COLOR, 3D_COLOR_TEXTURE, void CallList(uint n); 4D_COLOR_TEXTURE void CallLists(sizei n, enum type, void PassThrough(float token); const void *lists);
void InitNames(void); void PopName(void); void PushName(uint name); void LoadName(uint name); void GetDoublev(enum pname, double *data); void GetBooleani_v(enum target, uint index, boolean *data); void GetIntegeri_v(enum target, uint index, int *data); void GetFloati_v(enum target, uint index, float *data); void GetInteger64i_v(enum target, uint index, int64 *data); boolean IsEnabled(enum cap);
Timer queries use query objects to track the amount of time needed to fully complete a set of GL commands, or to determine the current time of the GL.
void ListBase(uint base); uint GenLists(sizei s); boolean IsList(uint list); void DeleteLists(uint list, sizei range); ubyte *GetStringi(enum name, uint index);
name: EXTENSIONS index: range is [0, NUM_EXTENSIONS - 1]
A complete list of symbolic constants for states is shown in the tables in [6.2].
void GetBooleanv(enum pname, boolean *data); void GetIntegerv(enum pname, int *data); void GetInteger64v(enum pname, int64 *data); void GetFloatv(enum pname, float *data);
Preprocessor [3.3]
Preprocessor Directives
Preprocessor Operators
Preprocessor operators follow C++ standards. Expressions are evaluated according to the behavior of the host processor, not the processor targeted by the shader.
#version 420 #version 420 profile
#version 420 is required in shaders using version 4.20 of the language. Use profile to indicate core or compatibility. If no profile specified, the default is core. behavior: require, enable, warn, disable extension_name: the extension supported by the compiler, or all
Each number sign (#) can be preceded in its line only by spaces or horizontal tabs. # #define #elif #if #extension #version #ifdef #ifndef #error #include #line #endif #pragma #undef #else
Predefined Macros
__LINE__ __FILE__
Decimal integer constants. FILE says which source string number is being processed, or the path of the string if the string was an included string Integer 1 if the implementation supports the compatibility profile Decimal integer, e.g.: 420
GL_compatibility_profile __VERSION__
www.opengl.org/registry
Page 7
Signed Integer Opaque Types (contd)
isampler2DRect iimage2DRect isampler[1,2]DArray iimage[1,2]DArray isamplerBuffer iimageBuffer isampler2DMS iimage2DMS isampler2DMSArray iimage2DMSArray isamplerCubeArray iimageCubeArray atomic_uint usampler[1,2,3]D uimage[1,2,3]D usamplerCube uimageCube usampler2DRect uimage2DRect usampler[1,2]DArray uimage[1,2]DArray usamplerBuffer uimageBuffer usampler2DMS uimage2DMS int. 2D rectangular texture int. 2D rectangular image integer 1D, 2D array texture integer 1D, 2D array image integer buffer texture integer buffer image int. 2D multi-sample texture int. 2D multi-sample image int. 2D multi-sample array tex. int. 2D multi-sample array image int. cube map array texture int. cube map array image uint atomic counter uint 1D, 2D, or 3D texture uint 1D, 2D, or 3D image uint cube mapped texture uint cube mapped image uint rectangular texture uint rectangular image 1D or 2D array texture 1D or 2D array image uint buffer texture uint buffer image uint 2D multi-sample texture uint 2D multi-sample image Continue
| && ^^ || ?: = += -= *= /= 16. %= <<= >>= &= ^= |= 17. , 11. 12. 13. 14. 15.
Implicit Conversions
int int, uint int, uint, float ivec2|3|4 ivec2|3|4, uvec2|3|4 vec2|3|4 ivec2|3|4, uvec2|3|4 mat2|3|4 mat2x3|2x4 mat3x2|3x4 mat4x2|4x3
-> -> -> -> -> -> -> -> -> -> ->
uint float double uvec2|3|4 vec2|3|4 dvec2|3|4 dvec2|3|4 dmat2|3|4 dmat2x3|2x4 dmat3x2|3x4 dmat4x2|4x3
float[3] foo; float foo[3]; structures and blocks can be arrays supports only 1-dimensional arrays structure members can be arrays Structures struct type-name { members } struct-name[]; in/out/uniform block-name {
// optional variable declaration, optionally an array
Blocks
The following operators are numbered in order of precedence. Relational and equality operators evaluate to Boolean. Also see lessThan(), equal(), etc.
1. 2.
3. 4. 5. 6. 7. 8. 9. 10.
() [] () . ++ --
parenthetical grouping array subscript function call, constructor, structure field, selector, swizzler postfix increment and decrement
bit-wise inclusive or logical and logical exclusive or logical inclusive or selects an entire operand. assignment arithmetic assignments sequence
In addition to array numeric subscript syntax, names of vector and scalar components are denoted by a single letter. Components can be swizzled and replicated. Scalars have only an x, r, or s component. {x, y, z, w} Points or normals {r, g, b, a} {s, t, p, q}
Colors Texture coordinates
Qualifiers
Declarations may have one storage qualifier. (default) local read/write memory, or input parameter global compile-time constant, or read-only function parameter, or read-only local variable linkage into shader from previous stage linkage out of a shader to next stage same as in for vertex shader linkage between a shader, OpenGL, and the application same as in for vertex shader, same as out for fragment shader
Input values copied in at function call time, output values copied out at function return. for function parameters passed into function for function parameters that cannot be written to for function parameters passed back out of function, but not initialized when passed in for function parameters passed both into and out of a function
Atomic Counter Layout Qualifiers [4.4.4.1] binding = integer-constant offset = integer-constant Format Layout Qualifiers [4.4.4.2] One qualifier may be used with variables declared as image to specify the image format.
Auxiliary Storage Qualifiers Some input and output qualified variables can be qualified with at most one additional auxiliary storage qualifier: centroid sampler patch centroid-based interpolation per-sample interpolation per-tessellation-patch attributes
For tessellation control shaders: binding = integer-constant, rgba{32,16}f, rg{32,16}f, r{32,16}f, r11f_g11f_b10f, rgb10_a2{ui}, rgba{16,8}, rg{16,8}, r{16,8}, rgba{32,16,8}i, rg{32,16,8}i,r{32,16,8}i, rgba{32,16,8}ui, rg{32,16,8}ui, r{32,16,8}ui, rgba{16,8}_snorm, rg{16,8}_snorm, r{16,8}_snorm,
Precision qualifiers have no effect on precision; they aid code portability with OpenGL ES: highp, mediump, lowp
For tessellation control shaders: vertices = integer-constant For geometry shader outputs: points, line_strip, triangle_strip, max_vertices = integer-constant, stream = integer-constant Fragment shader outputs: depth_any, depth_greater, depth_less, depth_unchanged
For fragment shaders: index = integer-constant
Qualify outputs from vertex shader and inputs to fragment shader. perspective correct interpolation no interpolation
Declare global variables with same values across entire primitive processed. Examples: uniform vec4 lightPosition; uniform vec3 color = vec3(0.7, 0.7, 0.2);
noperspective linear interpolation The following predeclared variables can be redeclared with an interpolation qualifier: Vertex language: Fragment language: gl_FrontColor gl_Color gl_BackColor gl_SecondaryColor gl_FrontSecondaryColor gl_BackSecondaryColor
Ensures that operations are executed in stated order with operator consistency. Requires two identical multiplies, followed by an add. precise out vec4 Position = a * b + c * d;
www.opengl.org/registry
Page 8
Memory Qualifiers [4.10]
Qualifiers (continued)
Variables qualified as image can have one or more memory qualifiers. coherent reads and writes are coherent with other shader invocations volatile underlying values may be changed by other sources restrict wont be accessed by other code readonly read only writeonly write only
.length() for matrices returns number of columns .length() for vectors returns number of components mat2(vec2, vec2); // 1 col./arg. mat2x3(vec2, float, vec2, float); // col. 2 dmat2(dvec2, dvec2); // 1 col./arg. dmat3(dvec3, dvec3, dvec3); // 1 col./arg.
// scalar * matrix component-wise // scalar * vector component-wise // vector * vector component-wise // matrix +/- matrix comp.-wise // linear algebraic multiply // vector dot product // vector cross product
Shaders communicate with fixed-function OpenGL pipeline stages and other shader executables through built-in input and output variables. Redeclare matching subsets of these variables and blocks to establish matching interfaces when using multiple programs.
Vertex Language
Inputs: in int in int in vec4 in vec4 in vec3 in vec4 in vec4 in float
Inputs: in gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; (... plus deprecated Vertex Language Outputs) } gl_in[gl_MaxPatchVertices]; in int gl_PatchVerticesIn; in int gl_PrimitiveID; in vec3 gl_TessCoord; patch in float gl_TessLevelOuter[4]; patch in float gl_TessLevelInner[2]; Outputs: out gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; (... plus deprecated Vertex Language Outputs) };
Select structure fields or length() method of an array using the period (.) operator. Other operators:
. field or method selector == != equality
=
[]
assignment
indexing (arrays only)
mat4 m; // m is a matrix m[1] = vec4(2.0); // sets 2nd col. to all 2.0 m[0][0] = 1.0; // sets upper left element to 1.0
Array elements are accessed using the array subscript operator ( [ ] ), e.g.: diffuseColor += lightIntensity[3]*NdotL; Declare types with the subroutine keyword:
subroutine returnType subroutineTypeName(type0 arg0, type1 arg1, ..., typen argn);
// n is 0...7
Outputs: out gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; vec4 gl_ClipVertex; vec4 gl_FrontColor; vec4 gl_BackColor; vec4 gl_FrontSecondaryColor; vec4 gl_BackSecondaryColor; vec4 gl_TexCoord[]; float gl_FogFragCoord; };
Geometry Language
Inputs: in gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; (... plus deprecated Vertex Language Outputs) } gl_in[]; in int gl_PrimitiveIDIn; in int gl_InvocationID; Outputs: out gl_PerVertex { vec4 gl_Position; float gl_PointSize; float gl_ClipDistance[]; (... plus deprecated Vertex Language Outputs) }; out int gl_PrimitiveID; out int gl_Layer; out int gl_ViewportIndex;
Associate functions with subroutine types of matching declarations by defining the functions with the subroutine keyword and a list of subroutine types the function matches:
subroutine(subroutineTypeName0, ..., subroutineTypeNameN) returnType functionName(type0 arg0, type1 arg1, ..., typen argn){ ... } // function body
Declare subroutine type variables with a specific subroutine type in a subroutine uniform variable declaration:
subroutine uniform subroutineTypeName subroutineVarName;
Subroutines [6.1.2]
Subroutine type variables are assigned to functions through the UniformSubroutinesuiv command in the OpenGL API.
Built-In Functions
Fragment Language
The following built-in constants with minimum values are provided to all shaders. The actual values used are implementation-dependent, but must be at least the value shown. const int gl_MaxTextureUnits = 2; const int gl_MaxTextureCoords = 8; const int gl_MaxClipPlanes = 8; const int gl_MaxVaryingFloats = 60; const int gl_MaxVertexAttribs = 16; const int gl_MaxVertexUniformComponents = 1024; const int gl_MaxVertexOutputComponents = 64; const int gl_MaxGeometryInputComponents = 64; const int gl_MaxGeometryOutputComponents = 128; const int gl_MaxFragmentInputComponents = 128; const int gl_MaxVertexTextureImageUnits = 16; const int gl_MaxCombinedTextureImageUnits = 80; const int gl_MaxTextureImageUnits = 16; const int gl_MaxImageUnits = 8; const int gl_MaxCombinedImageUnitsAndFragmentOutputs = 8; const int gl_MaxImageSamples = 0; const int gl_MaxFragmentUniformComponents = 1024; const int gl_MaxDrawBuffers = 8; const int gl_MaxClipDistances = 8; const int gl_MaxGeometryTextureImageUnits = 16; const int gl_MaxGeometryOutputVertices = 256; const int gl_MaxGeometryTotalOutputComponents = 1024; const int gl_MaxGeometryUniformComponents = 1024; const int gl_MaxGeometryVaryingComponents = 64; const int gl_MaxTessControlInputComponents = 128; const int gl_MaxTessControlOutputComponents = 128;
Inputs: in vec4 gl_FragCoord; in bool gl_FrontFacing; in float gl_ClipDistance[]; in vec2 gl_PointCoord; in int gl_PrimitiveID; in int gl_SampleID; in vec2 gl_SamplePosition; in int gl_SampleMask[]; in gl_PerFragment { in float gl_FogFragCoord; in vec4 gl_TexCoord[]; in vec4 gl_Color; in vec4 gl_SecondaryColor; }; Outputs: out float gl_FragDepth; out int gl_SampleMask[]; out vec4 gl_FragColor; out vec4 gl_FragData[gl_MaxDrawBuffers];
Functions will not result in a divide-by-zero error. If the divisor of a ratio is 0, then results will be undefined. Component-wise operation. Parameters specified as angle are in units of radians. Tf=float, vecn. Tf radians(Tf degrees) degrees to radians Tf degrees(Tf radians) Tf sin(Tf angle) Tf cos(Tf angle) Tf tan(Tf angle) Tf asin(Tf x) Tf acos(Tf x) Tf atan(Tf y, Tf x) Tf atan(Tf y_over_x) Tf sinh(Tf x) Tf cosh(Tf x) Tf tanh(Tf x) Tf asinh(Tf x) Tf acosh(Tf x) Tf atanh(Tf x) radians to degrees sine cosine tangent arc sine arc cosine arc tangent hyperbolic sine hyperbolic cosine hyperbolic tangent hyperbolic sine hyperbolic cosine hyperbolic tangent
const const const const const const const const const const const const const const const const const const const const const const const
int gl_MaxTessControlTextureImageUnits = 16; int gl_MaxTessControlUniformComponents = 1024; int gl_MaxTessControlTotalOutputComponents = 4096; int gl_MaxTessEvaluationInputComponents = 128; int gl_MaxTessEvaluationOutputComponents = 128; int gl_MaxTessEvaluationTextureImageUnits = 16; int gl_MaxTessEvaluationUniformComponents = 1024; int gl_MaxTessPatchComponents = 120; int gl_MaxPatchVertices = 32; int gl_MaxTessGenLevel = 64; int gl_MaxViewports = 16; int gl_MaxVertexUniformVectors = 256; int gl_MaxFragmentUniformVectors = 256; int gl_MaxVaryingVectors = 15; int gl_MaxVertexAtomicCounters = 0; int gl_MaxTessControlAtomicCounters = 0; int gl_MaxTessEvaluationAtomicCounters = 0; int gl_MaxGeometryAtomicCounters = 0; int gl_MaxFragmentAtomicCounters = 8; int gl_MaxCombinedAtomicCounters = 8; int gl_MaxAtomicCounterBindings = 1; int gl_MinProgramTexelOffset = -7; int gl_MaxProgramTexelOffset = 8;
Component-wise operation. Tf=float, vecn. Tfd= float, vecn, double, dvecn. Tf pow(Tf x, Tf y) xy Tf exp(Tf x) Tf log(Tf x) Tf exp2(Tf x) Tf log2(Tf x) Tfd sqrt(Tfd x) Tfd inversesqrt(Tfd x) ex ln 2x log2 square root inverse square root
minimum value
www.opengl.org/registry
Page 9
Type Abbreviations for Built-in Functions:
Tf=float, vecn. Td =double, dvecn. Tfd= float, vecn, double, dvecn. Tb=bvecn, bool. Tvec=vecn, uvecn, ivecn. Tu=uint, uvecn. Ti=int, ivecn. Tiu=int, ivecn, uint, uvecn. Use of Tn or Tnn within each function call must be the same. In vector types, n is 2, 3, or 4.
These functions operate on vectors as vectors, not component-wise. Tf=float, vecn. Td =double, dvecn. Tfd= float, vecn, double, dvecn.
float length(Tf x) double length(Td x) length of vector
maximum value
float distance(Tf p0, Tf p1) distance between points double distance(Td p0, Td p1) linear blend of x and y true if comps. in a select comps. from y, else from x 0.0 if x < edge, else 1.0 float dot(Tf x, Tf y) double dot(Td x, Td y) dot product
Component-wise operation. Tu=uint, uvecn. Ti=int, ivecn. Tiu=int, ivecn, uint, uvecn. Tu uaddCarry(Tu x, Adds 32-bit uintx and y, Tu y, out Tu carry) returning the sum modulo 232.
Tu usubBorrow( Tu x, Tu y, out Tu borrow) void umulExtended( Tu x, Tu y, out Tu msb, out Tu lsb) void imulExtended( Ti x, Ti y, out Ti msb, out Ti lsb) Tiu bitfieldExtract( Tiu value, int offset, int bits) Subtracts y from x, returning the difference if non-negative, otherwise 232 plus the difference.
Takes the maximum of the value data and the contents of the selected texel. Performs a bit-wise and of the value of data and the contents of the selected texel. Performs a bit-wise or of the value of data and the contents of the selected texel. Performs a bit-wise exclusive or of the value of data and the contents of the selected texel.
vec3 cross(vec3 x, vec3 y) cross product dvec3 cross(dvec3 x, dvec3 y) Tf normalize(Tf x) Td normalize(Td x) vec4 ftransform( ) normalize vector to length 1 invariant vertex transform returns N if dot(Nref, I) < 0, else -N reflection direction I - 2 * dot(N,I) * N refraction vector
Tfd faceforward(Tfd N, Tfd I, Tfd Nref) Tfd reflect(Tfd I, Tfd N) Tfd refract(Tfd I, Tfd N, float eta)
Extracts bits [offset, offset + bits - 1] from value, returns them in the least significant bits of the result.
Tfd clamp(Tfd x, Tfd minVal, Tfd maxVal) Tf clamp(Tf x, float minVal, float maxVal) Td clamp(Td x, double minVal, min(max(x, minVal), double maxVal) maxVal) Tiu clamp(Tiu x, Tiu minVal, Tiu maxVal) Ti clamp(Ti x, int minVal, int maxVal) Tu clamp(Tu x, uint minVal, uint maxVal) Tfd smoothstep(Tfd edge0, Tfd edge1, T x) Tf smoothstep(float edge0, float edge1, Tf x) Td smoothstep(double edge0, double edge1, Td x)
Tiu bitfieldInsert( Returns the insertion the bits Tiu base, Tiu insert, least-significant bits of insert int offset, int bits) into base. Tiu bitfieldReverse( Tiu value) Ti bitCount(Tiu value) Ti findLSB(Tiu value) Ti findMSB(Tiu value) Returns the reversal of the bits of value. Returns the number of bits set to 1. Returns bit number of least significant bit. Returns bit number of most significant bit.
uint imageAtomicExchange( IMAGE_PARAMS, uint data) Copies the value of data. int imageAtomicExchange( IMAGE_PARAMS, int data) uint imageAtomicCompSwap( IMAGE_PARAMS, uint compare, uint data) int imageAtomicCompSwap( IMAGE_PARAMS, int compare, int data)
For the matrix functions, type mat is used in the single-precision floating point functions, and type dmat is used in the double-precision floating point functions. N and M are 1, 2, 3, 4.
mat matrixCompMult(mat x, mat y) component-wise dmat matrixCompMult(dmat x, dmat y) multiply matN outerProduct(vecN c, vecN r) outer product dmatN outerProduct(dvecN c, dvecN r) (where N != M) matNxM outerProduct(vecM c, vecN r) dmatNxM outerProduct(dvecM c, dvecN r) matN transpose(matN m) dmatN transpose(dmatN m) matNxM transpose(matMxN m) dmatNxM transpose(dmatMxN m) float determinant(matN m) double determinant(dmatN m) matN inverse(matN m) dmatN inverse(dmatN m)
Compares the value of compare and contents of selected texel. If equal, the new value is given by data; otherwise, it is taken from the original value loaded from texel.
Available to vertex, geometry, and fragment shaders. See tables on next page.
Ti floatBitsToInt(Tf value) Returns signed int or uint value representing the encoding of a Tu floatBitsToInt(Tf value) floating-point value. Tf intBitsToFloat( Tiu value) Tfd fma(Tfd a, Tfd b, Tfd c) Tfd frexp(Tfd x, out Ti exp) Returns floating-point value of a signed int or uint encoding of a floating-point value. Computes and returns a*b + c. Treated as a single operation when using precise. Splits x into a floating-point significand in the range [0.5, 1.0) and an int. exp. of 2.
The value returned by these functions is the value of an atomic counter. Atomically returns the uint atomicCounterIncrement( value of counter for c, atomic_uint c) then increments.
Atomically decrements uint atomicCounterDecrement( counter for c, then returns atomic_uint c) value of counter for c.
Interpolation fragment-processing functions interpolant Tf interpolateAtCentroid( Return value of pixel and the sampled inside Tf interpolant) primitive. Tf interpolateAtSample( Tf interpolant, int sample) Tf interpolateAtOffset( Tf interpolant, vec2 offset)
Return value of interpolant at the location of sample number sample. Return value of interpolant sampled at fixed offset offset pixel center.
Builds a floating-point number Tfd ldexp(Tfd x, in Ti exp) from x and the corresponding integral exponent of 2 in exp.
Returns noise value. Available to fragment, geometry, and vertex shaders. float noise1(Tf x) vecn noisen(Tf x) where n is 2, 3, or 4
These do not operate component-wise. uint packUnorm2x16(vec2 v) Converts each comp. of v uint packSnorm2x16(vec2 v) into 8- or 16-bit ints, packs uint packUnorm4x8(vec4 v) results into the returned 32-bit uint packSnorm4x8(vec4 v) unsigned integer.
vec2 unpackUnorm2x16( uint p) vec2 unpackSnorm2x16( uint p) vec4 unpackUnorm4x8( uint p) vec4 unpackSnorm4x8( uint p) double packDouble2x32( uvec2 v)
Unpacks 32-bit p into two 16-bit uints, four 8-bit uints, or signed ints. Then converts each component to a normalized float to generate a 2- or 4-component vector.
Compare x and y component-wise. Sizes of the input and return vectors for any particular call must match. Tvec=vecn, uvecn, ivecn. bvecn lessThan(Tvec x, Tvec y) bvecn lessThanEqual(Tvec x, Tvec y) bvecn greaterThan(Tvec x, Tvec y) bvecn greaterThanEqual(Tvec x, Tvec y) bvecn equal(Tvec x, Tvec y) bvecn equal(bvecn x, bvecn y) bvecn notEqual(Tvec x, Tvec y) bvecn notEqual(bvecn x, bvecn y) bool any(bvecn x) bool all(bvecn x) bvecn not(bvecn x) < <= > >= == !=
Only available in geometry shaders. void EmitStreamVertex( Emits values of output variables to current output int stream) primitive stream stream. void EndStreamPrimitive( Completes current output primitive stream stream int stream) and starts a new one. void EmitVertex() void EndPrimitive()
Emits values of output variables to the current output primitive. Completes output primitive and starts a new one.
Loads the texel at the gvec4 imageLoad( P from readonly IMAGE_PARAMS) coordinate image. the image unit
Stores data into the texel at the coordinate P from the image specified by image.
uvec2 unpackDouble2x32( Returns a 2-component vector double v) representation of v. Returns a uint by converting uint packHalf2x16(vec2 v) the components of a twocomponent floating-point vector
true if any component of x is true true if all components of x are true logical complement of x
uint imageAtomicAdd( IMAGE_PARAMS, uint data) Adds the value of data to the contents of the int imageAtomicAdd( selected texel. IMAGE_PARAMS, int data) uint imageAtomicMin( IMAGE_PARAMS, uint data) int imageAtomicMin( IMAGE_PARAMS, int data)
Takes the minimum of the value of data and the contents of the selected texel. Continue
www.opengl.org/registry
Page 10
Available to vertex, geometry, and fragment shaders. gvec4=vec4, ivec4, uvec4. gsampler* =sampler*, isampler*, usampler*.
textureSize functions return dimensions of lod (if present) for the texture bound to sampler. Components in return value are filled in with the width, height, depth of the texture. For array forms, the last component of the return value is the number of layers in the texture array.
int textureSize(gsampler1D sampler, int lod) ivec2 textureSize(gsampler2D sampler, int lod) ivec3 textureSize(gsampler3D sampler, int lod) ivec2 textureSize(gsamplerCube sampler, int lod) int textureSize(sampler1DShadow sampler, int lod) ivec2 textureSize(sampler2DShadow sampler, int lod) ivec2 textureSize(samplerCubeShadow sampler, int lod) ivec3 textureSize(samplerCubeArray sampler, int lod) ivec3 textureSize(samplerCubeArrayShadow sampler, int lod) ivec2 textureSize(gsampler2DRect sampler) ivec2 textureSize(sampler2DRectShadow sampler) ivec2 textureSize(gsampler1DArray sampler, int lod) ivec3 textureSize(gsampler2DArray sampler, int lod) ivec2 textureSize(sampler1DArrayShadow sampler, int lod) ivec3 textureSize(sampler2DArrayShadow sampler, int lod) int textureSize(gsamplerBuffer sampler) ivec2 textureSize(gsampler2DMS sampler) ivec3 textureSize(gsampler2DMSArray sampler)
Projective lookup as described in textureProj offset by offset as described in textureOffset. gvec4 textureProjOffset(gsampler1D sampler, vec{2,4} P, int offset [, float bias]) gvec4 textureProjOffset(gsampler2D sampler, vec{3,4} P, ivec2 offset [, float bias]) gvec4 textureProjOffset(gsampler3D sampler, vec4 P, ivec3 offset [, float bias]) gvec4 textureProjOffset(gsampler2DRect sampler, vec{3,4} P, ivec2 offset) float textureProjOffset(sampler2DRectShadow sampler, vec4 P, ivec2 offset) float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset [, float bias]) float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset [, float bias]) Offset texture lookup with explicit LOD. See textureLod and textureOffset. gvec4 textureLodOffset(gsampler1D sampler, float P, float lod, int offset) gvec4 textureLodOffset(gsampler2D sampler, vec2 P, float lod, ivec2 offset) gvec4 textureLodOffset(gsampler3D sampler, vec3 P, float lod, ivec3 offset) float textureLodOffset(sampler1DShadow sampler, vec3 P, float lod, int offset) float textureLodOffset(sampler2DShadow sampler, vec3 P, float lod, ivec2 offset) gvec4 textureLodOffset(gsampler1DArray sampler, vec2 P, float lod, int offset) gvec4 textureLodOffset(gsampler2DArray sampler, vec3 P, float lod, ivec2 offset) float textureLodOffset(sampler1DArrayShadow sampler, vec3 P, float lod, int offset) Projective texture lookup with explicit LOD. See textureLod and textureOffset.
gvec4 textureProjLod(gsampler1D sampler, vec{2,4} P, float lod) gvec4 textureProjLod(gsampler2D sampler, vec{3,4} P, float lod) gvec4 textureProjLod(gsampler3D sampler, vec4 P, float lod) float textureProjLod(sampler{1,2}DShadow sampler, vec4 P, float lod)
Texture lookup with both explicit gradient and offset, as described in textureGrad and textureOffset.
gvec4 textureGradOffset(gsampler1D sampler, float P, float dPdx, float dPdy, int offset) gvec4 textureGradOffset(gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset) gvec4 textureGradOffset(gsampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy, ivec3 offset) gvec4 textureGradOffset(gsampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset) float textureGradOffset(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset) float textureGradOffset(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy, int offset) float textureGradOffset(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset) gvec4 textureGradOffset(gsampler1DArray sampler, vec2 P, float dPdx, float dPdy, int offset) gvec4 textureGradOffset(gsampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset) float textureGradOffset(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy, int offset) float textureGradOffset(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset)
Texture lookup both projectively as in textureProj, and with explicit gradient as in textureGrad.
gvec4 textureProjGrad(gsampler1D sampler, vec{2,4} P, float dPdx, float dPdy) gvec4 textureProjGrad(gsampler2D sampler, vec{3,4} P, vec2 dPdx, vec2 dPdy) gvec4 textureProjGrad(gsampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy) gvec4 textureProjGrad(gsampler2DRect sampler, vec{3,4} P, vec2 dPdx, vec2 dPdy) float textureProjGrad(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy) float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy) float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy)
textureQueryLod functions return the mipmap array(s) that would be accessed in the x component of the return value. Returns the computed level of detail relative to the base level in the y component of the return value.
vec2 textureQueryLod(gsampler1D sampler, float P) vec2 textureQueryLod(gsampler2D sampler, vec2 P) vec2 textureQueryLod(gsampler3D sampler, vec3 P) vec2 textureQueryLod(gsamplerCube sampler, vec3 P) vec2 textureQueryLod(gsampler1DArray sampler, float P) vec2 textureQueryLod(gsampler2DArray sampler, vec2 P) vec2 textureQueryLod(gsamplerCubeArray sampler, vec3 P) vec2 textureQueryLod(sampler1DShadow sampler, float P) vec2 textureQueryLod(sampler2DShadow sampler, vec2 P) vec2 textureQueryLod(samplerCubeShadow sampler, vec3 P) vec2 textureQueryLod(sampler1DArrayShadow sampler, float P) vec2 textureQueryLod(sampler2DArrayShadow sampler, vec2 P) vec2 textureQueryLod(samplerCubeArrayShadow sampler, vec3 P)
Texture lookup projectively and with explicit gradient as in textureProjGrad, as well as with offset as in textureOffset.
gvec4 textureProjGradOffset(gsampler1D sampler, vec{2,4} P, float dPdx, float dPdy, int offset) gvec4 textureProjGradOffset(gsampler2D sampler, vec{3,4} P, vec2 dPdx, vec2 dPdy, ivec2 offset) gvec4 textureProjGradOffset(gsampler2DRect sampler, vec{3,4} P, vec2 dPdx, vec2 dPdy, ivec2 offset) float textureProjGradOffset(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset) gvec4 textureProjGradOffset(gsampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy, ivec3 offset) float textureProjGradOffset(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy, int offset) float textureProjGradOffset(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, vec2 offset)
Use texture coordinate P to do a lookup in the texture bound to sampler. For shadow forms, when compare is present, it is used as Dref and the array layer comes from P.w. For non-shadow forms, the array layer comes from the last component of P. gvec4 texture(gsampler1D sampler, float P [, float bias]) gvec4 texture(gsampler2D sampler, vec2 P [, float bias]) gvec4 texture(gsampler3D sampler, vec3 P [, float bias]) gvec4 texture(gsamplerCube sampler, vec3 P [, float bias]) float texture(sampler{1D,2D}Shadow sampler, vec3 P [, float bias]) float texture(samplerCubeShadow sampler, vec4 P [, float bias]) gvec4 texture(gsampler1DArray sampler, vec2 P [, float bias]) gvec4 texture(gsampler2DArray sampler, vec3 P [, float bias]) gvec4 texture(gsamplerCubeArray sampler, vec4 P [, float bias]) float texture(sampler1DArrayShadow sampler, vec3 P [, float bias]) float texture(sampler2DArrayShadow sampler, vec4 P) gvec4 texture(gsampler2DRect sampler, vec2 P) float texture(sampler2DRectShadow sampler, vec3 P) float texture(gsamplerCubeArrayShadow sampler, vec4 P, float compare)
Offset projective texture lookup with explicit LOD. See textureProj, textureLod, and textureOffset. gvec4 textureProjLodOffset(gsampler1D sampler, vec{2,4} P, float lod, int offset) gvec4 textureProjLodOffset(gsampler2D sampler, vec{3,4} P, float lod, ivec2 offset) gvec4 textureProjLodOffset(gsampler3D sampler, vec4 P, float lod, ivec3 offset) float textureProjLodOffset(sampler1DShadow sampler, vec4 P, float lod, int offset) float textureProjLodOffset(sampler2DShadow sampler, vec4 P, float lod, ivec2 offset) Texture lookup as in texture but with explicit gradients. gvec4 textureGrad(gsampler1D sampler, float P, float dPdx, float dPdy) gvec4 textureGrad(gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy) gvec4 textureGrad(gsampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy) gvec4 textureGrad(gsamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy) gvec4 textureGrad(gsampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy) float textureGrad(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy) float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy) float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy) gvec4 textureGrad(gsampler1DArray sampler, vec2 P, float dPdx, float dPdy) gvec4 textureGrad(gsampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy) float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy) float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy) gvec4 textureGrad(gsamplerCubeArray sampler, vec4 P, vec3 dPdx, vec3 dPdy)
These functions take components of a floatingpoint vector operand as a texture coordinate, determine a set of four texels to sample from the base level of detail of the specified texture image, and return one component from each texel in a four-component result vector.
gvec4 textureGather(gsampler2D sampler, vec2 P [, int comp]) gvec4 textureGather(gsampler2DArray sampler, vec3 P [, int comp]) gvec4 textureGather(gsamplerCube sampler, vec3 P [, int comp]) gvec4 textureGather(gsamplerCubeArray sampler, vec4 P[, int comp]) gvec4 textureGather(gsampler2DRect sampler, vec3 P [, int comp]) vec4 textureGather(sampler2DShadow sampler, vec2 P, float refZ) vec4 textureGather(sampler2DArrayShadow sampler, vec3 P, float refZ) vec4 textureGather(samplerCubeShadow sampler, vec3 P, float refZ) vec4 textureGather(samplerCubeArrayShadow sampler, vec4 P, float refZ) vec4 textureGather(sampler2DRectShadow sampler, vec2 P, float refZ)
www.opengl.org/registry
Page 11
Blue blocks indicate various buffers that feed or get fed by the OpenGL pipeline. Green blocks indicate features new or significantly changed with OpenGL 4.x.
OpenGL Pipeline
A typical program that uses OpenGL begins with calls to open a window into the framebuffer into which the program will draw. Calls are made to allocate a GL context which is then associated with the window, then OpenGL commands can be issued. The heavy black arrows in this illustration show the OpenGL pipeline. In order to fully take advantage of modern OpenGL, pay close attention to how to most efficiently use the new buffer types.
www.opengl.org/registry
Page 12
OpenGL Reference Card Index
The following index shows each item included on this card along with the page on which it is described. The color of the row in the table below is the color of the pane to which you should refer. DeleteProgram{Pipelines} 2 GetColorTable{Parameter*} 3 ResetMinmax 4 A M 2 GetCompressedTexImage 5 ResumeTransformFeedback 2 Accum 4 DeleteQueries Macros 6 5 GetConvolutionFilter 4 Rotate* 2 ActiveShaderProgram 2 DeleteRenderbuffers Map* 6 4 GetConvolutionParameter* 4 ActiveTexture 4 DeleteSamplers MapGrid* 6 S 2 GetDoublev 6 AlphaFunc 5 DeleteShader MapBuffer{Range} 1 SampleCoverage 5 5 GetError 1 Angle Functions 8 DeleteSync Material* 2 SampleMaski 5 DeleteTextures 4 GetFloat* 6 AreTexturesResident 4 Matrices 2 Sampler Queries 5 DeleteTransformFeedbacks 2 GetFragData* 3 Arrays 8 Matrix Examples 8 SamplerParameter* 4 DeleteVertexArrays 2 GetFramebufferAttachment... 6 ArrayElement 1 Matrix Functions 9 Scale* 2 DepthFunc 5 GetHistogram{Parameter}* 4 Atomic-Counter Functions 9 MatrixMode 2 Scissor{Indexed}* 5 DepthMask 4 GetInteger* 6 AttachShader 2 MemoryBarrier 3 ScissorArrayv 5 DepthRange* 2 GetInteger64v 6 MemoryBarrier 9 SecondaryColor{P}3* 1 B Derivative Functions 9 GetIntegerv 3 Memory Qualifiers 8 SecondaryColorPointer 1 Begin 1 DetachShader 2 GetInternalFormativ 5 Minmax 4 SelectBuffer 6 BeginConditionalRender 2 Display Lists 6 GetLight* 2 MinSampleShading 3 SeparableFilter2D 4 BeginQuery{Indexed} 2 Dithering 5 GetMap* 6 Mult{Transpose}Matrix* 2 ShadeModel 2 BeginQuery 5 DrawArrays* 1 GetMaterial* 2 MultiDraw{Arrays, Elements} 1 Shaders and Programs 2,3 BeginTransformFeedback 2 DrawBuffer{s} 4 GetMinmax{Parameter}* 4 MultiDrawElementsBaseVertex 1 Shader{Binary, Source} 2 BindAttribLocation 2 DrawElements* GetMultisamplefv 3 1 Multisample Fragment 5 State and State Requests 6 BindBuffer* 1 DrawPixels GetPixelMap* 3 4 Multisample Textures 5 Statements 8 BindFramebuffer 5 DrawRangeElements{BaseVertex} 1 GetPointerv 6 Multisampling 3 StencilFunc{Separate} 5 BindFragData* 3 DrawTransformFeedback* GetPolygonStipple 3 2 MultiTexCoord{P}* 1 StencilMask{Separate} 4 BindImageTexture 5 Drawing Commands GetProgram* 3 1 StencilOp{Separate} 5 BindProgramPipeline 2 N GetProgramBinary 2 Stippling 3 BindRenderbuffer 5 E NewList 6 GetQuery* 2 Storage Qualifiers 7 1 BindSampler 4 EdgeFlagPointer Noise Functions 9 GetRenderbufferParameteriv 6 Structures 8 1 BindTexture 4 EdgeFlag{v} Normal{P}3* 1 GetSamplerParameter* 5 Subroutine Uniform Variables 3 1 BindTransformFeedback 2 EnableClientState NormalPointer 1 GetSeparableFilter 4 Subroutines 8 1 BindVertexArray 2 EnableVertexAttribArray GetShader* 3 O Synchronization 5 1 Bitmap 4 End GetString* 6 Occlusion Queries 5 6 BlendColor 5 EndList T GetSubroutineIndex 3 OpenGL Pipeline Diagram 11 1 BlendEquation{Separate}* 5 Errors Tessellation Diagram 11 GetSubroutineUniformLocation 3 OpenGL Shading Language 6-11 6 BlendFunc{Separate}* 5 Eval{Coord, Mesh, Point}* TexBuffer 5 GetSync* 5 Operators 7 Evaluators 6 BlitFramebuffer 6 TexCoord{P}* 1 GetTex{Env, Gen}* 5 Operators and Constructors 8 Exponential Functions 8 Buffer Objects 1,2 TexCoordPointer 1 GetTexImage 5 Ortho 2 Buffer Textures 5 F Texel/Texture Lookup Functions 10 GetTex{Level}Parameter* 5 P Buffer{Sub}Data 1 FeedbackBuffer TexEnv* 5 6 GetTransformFeedbackVarying 3 Pack/Unpack Functions 9 TexGen* 2 FenceSync 5 GetUniform* 2,3 C Parameter Qualifiers 7 TexImage* 4 5 GetVertexAttrib* 3 CallList{s} 6 Finish PassThrough 6 TexImage*Multisample 5 2 GL Command Syntax 1 CheckFramebufferStatus 6 Flatshading PatchParameterfv 3 TexStorage{1, 2, 3}D 5 1 ClampColor 2,4 Floating-point Numbers H PatchParameteri 1 TexSubImage* 4 Floating-Point Pack/Unpack Func. 9 Clear 4 Hint 4 PauseTransformFeedback 2 TexParameter* 5 Flush 5 ClearAccum 4 Histogram 4 Pipeline Diagram 11 Texture Coordinates 2 FlushMappedBufferRange 1 ClearBuffer* 4 Pixel{Map, Store, Transfer}* 3 10-11 Texture/Texel Functions Fog* 4 I ClearColor 4 PixelZoom 4 Texture Queries 10 FogCoord* 1 Image Functions 9 ClearDepth{f} 4 PointParameter* 3 Texturing 4,5 FogCoordPointer 1 Implicit Conversions 7 ClearIndex 4 PointSize 3 Timer Queries 6 Fragment Operations 5 Index* 1 ClearStencil 4 Polygon Edges 1 Transform Feedback 2 Fragment Processing Functions 9 IndexMask 4 ClientActiveTexture 1 Polygon{Mode, Offset} 3 TransformFeedbackVaryings 3 Fragment Shaders 3 IndexPointer 1 ClientWaitSync 5 PolygonStipple 3 Translate* 2 Framebuffer 4 InitNames 6 ClipPlane 2 Precise & Precision Qualifiers 7 Trigonometry Functions 8 Framebuffer Objects 5,6 Integer Functions 9 Color{P}* 1 Predefined Macros 6 Types 7 FramebufferRenderbuffer 5 InterleavedArrays 1 ColorMask{i} 4 Preprocessor 6 FramebufferTexture* 6 Interpolation Functions 9 U ColorMaterial 2 PrimitiveRestartIndex 1 FrontFace 3 Interpolation Qualifiers 7 Uniform Qualifiers 7 ColorPointer 1 PrioritizeTextures 4 Frustum 2 Invariant Qualifiers 7 Uniform Variables 2,3 ColorSum 4 Program {Pipeline} Objects 2 IsBuffer 2 Uniform* 3 Color{Sub}Table 3 G Program Queries 3 IsEnabled* 6 UniformBlockBinding 3 1 ColorTableParameter* 3 GenBuffers ProgramBinary 2 IsFramebuffer 6 UniformMatrix* 3 5 Command Letters 1 GenerateMipmap ProgramParameteri 2 IsList 6 UniformSubroutines* 3 5 Common Functions 8,9 GenFramebuffers ProgramUniform{Matrix}* 3 IsProgram{Pipeline} 3 UnmapBuffer 1 6 CompileShader 2 GenLists ProvokingVertex 2 IsQuery 2 UseProgram{Stages} 2 2 CompressedTexImage* 4 GenProgramPipelines {Push, Pop}Attrib 6 IsRenderbuffer 6 2 CompressedTexSubImage* 4,5 GenQueries {Push, Pop}ClientAttrib 6 V IsSampler 5 5 Constants 8 GenRenderbuffers {Push, Pop}Matrix 2 ValidateProgram{Pipeline} 3 IsShader 3 4 Constructors 8 GenSamplers {Push, Pop}Name 6 Variables 8 IsSync 5 4 ConvolutionFilter* 3,4 GenTextures Varying Variables 3 IsTexture 5 Q 2 ConvolutionParameter* 4 GenTransformFeedbacks Vector Components 7 IsTransformFeedback 2 Qualifiers 7,8 2 CopyBufferSubData 2 GenVertexArrays Vector & Matrix 8 IsVertexArray 2 QueryCounter 6 9 CopyColor{Sub}Table 3 Geometric Functions Vector Relational Functions 9 Iteration and Jumps 8 CopyConvolutionFilter* 4 Geometry & Follow-on Diagram 11 R Vertex & Tessellation Diagram 11 9 L CopyPixels 6 Geometry Shader Functions Rasterization 3,4 Vertex Arrays 1 Layout Qualifiers 7 CopyTexImage* 4 GetActiveAtomicCounterBuffer... 2 RasterPos* 2 Vertex Attributes 2 2 Length 8 CopyTexSubImage* 4 GetActiveAttrib ReadBuffer 6 Vertex{P}* 1 3 Light* 2 CreateProgram 2 GetActiveSubroutine* ReadPixels 6 VertexAttrib* 1 2,3 LightModel* 2 CreateShader{Programv} 2 GetActiveUniform* Rect* 2 VertexAttrib*Pointer 1 3 Line{Stipple, Width} 3 Cube Map Texture Select 5 GetAttachedShaders Relational Functions 9 VertexAttribDivisor 1 2 LinkProgram 2 CullFace 3 GetAttribLocation ReleaseShaderCompiler 2 VertexPointer 1 GetBoolean* 6 ListBase 6 Renderbuffer Object Queries 6 Viewport* 2 D GetBufferParameter* 2 LoadIdentity 2 RenderbufferStorage{Multisample} 5 DeleteBuffers 1 W GetBufferPointerv 2 Load{Transpose}Matrix* 2 RenderMode 6 DeleteFramebuffers 5 WaitSync 5 GetBufferSubData 2 LoadName 6 ResetHistogram 4 DeleteLists 6 WindowPos* 2 GetClipPlane 2 LogicOp 5
OpenGL is a registered trademark of Silicon Graphics International, used under license by Khronos Group. The Khronos Group is an industry consortium creating open standards for the authoring and acceleration of parallel computing, graphics and dynamic media on a wide variety of platforms and devices. See www.khronos.org to learn more about the Khronos Group. See www.opengl.org to learn more about OpenGL.
www.opengl.org/registry