9
.ds Xs 53966 9 build3dmipmaplevels.gl
10
.TH GLUBUILD3DMIPMAPLEVELS 3G
12
.B "gluBuild3DMipmapLevels
13
\- builds a subset of three-dimensional mipmap levels
16
GLint \f3gluBuild3DMipmapLevels\fP(
19
.ta \w'\f3GLint \fPgluBuild3DMipmapLevels( 'u
20
GLint \fIinternalFormat\fP,
29
const void \fI*data\fP )
36
.TP \w'\fIinternalFormat\fP\ \ 'u
38
Specifies the target texture. Must be \%\f3GL_TEXTURE_3D\fP.
41
Requests the internal storage of the texture image. The most
42
current version of the SGI implementation of GLU does not check this
43
value for validity before passing it on to the underlying OpenGL
44
implementation. A value that is not accepted by the OpenGL
45
implementation will lead to an OpenGL error. The benefit of not
46
checking this value at the GLU level is that OpenGL extensions can add
47
new internal texture formats without requiring a revision of the GLU
48
implementation. Older implementations of GLU check this value and
49
raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
57
\%\f3GL_LUMINANCE4\fP,
58
\%\f3GL_LUMINANCE8\fP,
59
\%\f3GL_LUMINANCE12\fP,
60
\%\f3GL_LUMINANCE16\fP,
61
\%\f3GL_LUMINANCE_ALPHA\fP,
62
\%\f3GL_LUMINANCE4_ALPHA4\fP,
63
\%\f3GL_LUMINANCE6_ALPHA2\fP,
64
\%\f3GL_LUMINANCE8_ALPHA8\fP,
65
\%\f3GL_LUMINANCE12_ALPHA4\fP,
66
\%\f3GL_LUMINANCE12_ALPHA12\fP,
67
\%\f3GL_LUMINANCE16_ALPHA16\fP,
69
\%\f3GL_INTENSITY4\fP,
70
\%\f3GL_INTENSITY8\fP,
71
\%\f3GL_INTENSITY12\fP,
72
\%\f3GL_INTENSITY16\fP,
90
\f2width\fP, \f2height\fP, \f2depth\fP
91
Specifies in pixels the width, height and depth respectively, of the texture
92
image. These should be a power of 2.
95
Specifies the of the pixel data.
97
\%\f3GL_COLOR_INDEX\fP,
98
\%\f3GL_DEPTH_COMPONENT\fP,
107
\%\f3GL_LUMINANCE\fP, or
108
\%\f3GL_LUMINANCE_ALPHA\fP.
111
Specifies the data type for \f2data\fP.
113
\%\f3GL_UNSIGNED_BYTE\fP,
116
\%\f3GL_UNSIGNED_SHORT\fP,
118
\%\f3GL_UNSIGNED_INT\fP,
121
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
122
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
123
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
124
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
125
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
126
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
127
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
128
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
129
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
130
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
131
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, or
132
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP.
135
Specifies the mipmap level of the image data.
138
Specifies the minimum mipmap level to pass to \f3glTexImage3D\fP.
141
Specifies the maximum mipmap level to pass to \f3glTexImage3D\fP.
144
Specifies a pointer to the image data in memory.
146
\%\f3gluBuild3DMipmapLevels\fP builds a subset of prefiltered three-dimensional texture maps of
147
decreasing resolutions called a mipmap. This is used for the antialiasing of
148
texture mapped primitives.
150
A return value of zero indicates success, otherwise a GLU error code is
151
returned (see \%\f3gluErrorString\fP).
153
A series of mipmap levels from \f2base\fP to \f2max\fP is built by
154
decimating \f2data\fP in half along both dimensions until size $1 ~times~ 1
155
~times~ 1$ is reached. At each level, each texel in the halved mipmap
156
level is an average of the corresponding eight texels in the larger
157
mipmap level. (If exactly one of the dimensions is 1, four texels are
158
averaged. If exactly two of the dimensions are 1, two texels are
159
averaged.) \f3glTexImage3D\fP is called to load these mipmap levels
160
from \f2base\fP to \f2max\fP. If \f2max\fP is larger than the highest mipmap
161
level for the texture of the specified size, then a GLU error code is
162
returned (see \%\f3gluErrorString\fP) and nothing is loaded.
164
For example, if \f2level\fP is 2 and \f2width\fP is 16, \f2height\fP is 8 and \f2depth\fP
165
is 4, the following levels are possible: $16 ~times~ 8 ~times~ 4$, $8 ~times~
166
4 ~times~ 2$, $4 ~times~ 2 ~times~ 1$, $2 ~times~ 1 ~times~ 1$,
167
$1 ~times~ 1 ~times~ 1$.
168
These correspond to levels 2 through 6 respectively. If \f2base\fP is
169
3 and \f2max\fP is 5, then only mipmap levels $8 ~times~ 4 ~times~ 2$, $4
170
~times~ 2 ~times~ 1$ and $2 ~times~ 1 ~times~ 1$ are loaded. However, if
171
\f2max\fP is 7 then an error is returned and nothing is loaded, since
172
\f2max\fP is larger than the highest mipmap level which is, in this case,
175
The highest mipmap level can be derived from the formula
176
${log sub 2} ( max ("width","height","depth")^{2 sup "level"})$.
178
See the \f3glTexImage1D\fP reference page for a description of the
179
acceptable values for \f2format\fP parameter. See the \f3glDrawPixels\fP
180
reference page for a description of the acceptable values
181
for \f2type\fP parameter.
183
\%\f3gluBuild3DMipmapLevels\fP is only available if the GLU version is 1.3 or greater.
185
Formats \%\f3GL_BGR\fP, and \%\f3GL_BGRA\fP, and types
186
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
187
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
188
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
189
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
190
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
191
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
192
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
193
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
194
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
195
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
196
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
197
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP are only available if the GL version
200
\%\f3GLU_INVALID_VALUE\fP is returned if \f2level\fP > \f2base\fP, \f2base\fP < 0,
201
\f2max\fP < \f2base\fP or \f2max\fP is > the highest mipmap level for \f2data\fP.
203
\%\f3GLU_INVALID_VALUE\fP is returned if \f2width\fP, \f2height\fP, or \f2depth\fP is < 1.
205
\%\f3GLU_INVALID_ENUM\fP is returned if \f2internalFormat\fP, \f2format\fP, or \f2type\fP is not
208
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2type\fP is \%\f3GL_UNSIGNED_BYTE_3_3_2\fP or \%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP
209
and \f2format\fP is not \%\f3GL_RGB\fP.
211
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2type\fP is \%\f3GL_UNSIGNED_SHORT_5_6_5\fP or \%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP
212
and \f2format\fP is not \%\f3GL_RGB\fP.
214
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2type\fP is \%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP or \%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP
215
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
217
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2type\fP is \%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP or \%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP
218
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
220
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2type\fP is \%\f3GL_UNSIGNED_INT_8_8_8_8\fP or \%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP
221
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
223
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2type\fP is \%\f3GL_UNSIGNED_INT_10_10_10_2\fP or \%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP
224
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
226
\f3glDrawPixels(3G)\fP,
227
\f3glTexImage1D(3G)\fP,
228
\f3glTexImage2D(3G)\fP,
229
\f3glTexImage3D(3G)\fP,
230
\%\f3gluBuild1DMipmaps(3G)\fP,
231
\%\f3gluBuild2DMipmaps(3G)\fP,
232
\%\f3gluBuild3DMipmaps(3G)\fP,
233
\%\f3gluErrorString(3G)\fP,
234
\f3glGetTexImage(3G)\fP,
235
\f3glGetTexLevelParameter(3G)\fP,
236
\%\f3gluBuild1DMipmapLevels(3G)\fP,
237
\%\f3gluBuild2DMipmapLevels(3G)\fP