Home opengl - glUniform
Post
Cancel

opengl - glUniform

doc

Name

glUniform — Specify the value of a uniform variable for the current program object

C Specification

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
void glUniform1f(	GLint location,
 	GLfloat v0);
 
void glUniform2f(	GLint location,
 	GLfloat v0,
 	GLfloat v1);
 
void glUniform3f(	GLint location,
 	GLfloat v0,
 	GLfloat v1,
 	GLfloat v2);
 
void glUniform4f(	GLint location,
 	GLfloat v0,
 	GLfloat v1,
 	GLfloat v2,
 	GLfloat v3);
 
void glUniform1i(	GLint location,
 	GLint v0);
 
void glUniform2i(	GLint location,
 	GLint v0,
 	GLint v1);
 
void glUniform3i(	GLint location,
 	GLint v0,
 	GLint v1,
 	GLint v2);
 
void glUniform4i(	GLint location,
 	GLint v0,
 	GLint v1,
 	GLint v2,
 	GLint v3);
 
void glUniform1ui(	GLint location,
 	GLuint v0);
 
void glUniform2ui(	GLint location,
 	GLuint v0,
 	GLuint v1);
 
void glUniform3ui(	GLint location,
 	GLuint v0,
 	GLuint v1,
 	GLuint v2);
 
void glUniform4ui(	GLint location,
 	GLuint v0,
 	GLuint v1,
 	GLuint v2,
 	GLuint v3);
 
void glUniform1fv(	GLint location,
 	GLsizei count,
 	const GLfloat *value);
 
void glUniform2fv(	GLint location,
 	GLsizei count,
 	const GLfloat *value);
 
void glUniform3fv(	GLint location,
 	GLsizei count,
 	const GLfloat *value);
 
void glUniform4fv(	GLint location,
 	GLsizei count,
 	const GLfloat *value);
 
void glUniform1iv(	GLint location,
 	GLsizei count,
 	const GLint *value);
 
void glUniform2iv(	GLint location,
 	GLsizei count,
 	const GLint *value);
 
void glUniform3iv(	GLint location,
 	GLsizei count,
 	const GLint *value);
 
void glUniform4iv(	GLint location,
 	GLsizei count,
 	const GLint *value);
 
void glUniform1uiv(	GLint location,
 	GLsizei count,
 	const GLuint *value);
 
void glUniform2uiv(	GLint location,
 	GLsizei count,
 	const GLuint *value);
 
void glUniform3uiv(	GLint location,
 	GLsizei count,
 	const GLuint *value);
 
void glUniform4uiv(	GLint location,
 	GLsizei count,
 	const GLuint *value);
 
void glUniformMatrix2fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix3fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix4fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix2x3fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix3x2fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix2x4fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix4x2fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix3x4fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);
 
void glUniformMatrix4x3fv(	GLint location,
 	GLsizei count,
 	GLboolean transpose,
 	const GLfloat *value);

Parameters

location

Specifies the location of the uniform variable to be modified.

count

For the vector (glUniform*v) commands, specifies the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array.

This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array.

transpose

For the matrix commands, specifies whether to transpose the matrix as the values are loaded into the uniform variable.

v0, v1, v2, v3

For the scalar commands, specifies the new values to be used for the specified uniform variable.

value

For the vector and matrix commands, specifies a pointer to an array of count values that will be used to update the specified uniform variable.

This post is licensed under CC BY 4.0 by the author.