1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glGenerateMipmap">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glGenerateMipmap
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGenerateMipmap
</refname>
17 <refpurpose>generate mipmaps for a specified texture target
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGenerateMipmap
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
27 <!-- eqn: ignoring delim $$ -->
28 <refsect1 id=
"parameters"><title>Parameters
</title>
31 <term><parameter>target
</parameter></term>
34 Specifies the target to which the texture whose mimaps to generate is bound.
<parameter>target
</parameter> must
35 be
<constant>GL_TEXTURE_1D
</constant>,
<constant>GL_TEXTURE_2D
</constant>,
<constant>GL_TEXTURE_3D
</constant>,
36 <constant>GL_TEXTURE_1D_ARRAY
</constant>,
<constant>GL_TEXTURE_2D_ARRAY
</constant> or
37 <constant>GL_TEXTURE_CUBE_MAP
</constant>.
43 <refsect1 id=
"description"><title>Description
</title>
45 <function>glGenerateMipmap
</function> generates mipmaps for the texture attached
46 to
<parameter>target
</parameter> of the active texture unit. For cube map textures,
47 a
<constant>GL_INVALID_OPERATION
</constant> error is generated if the texture
48 attached to
<parameter>target
</parameter> is not cube complete.
51 Mipmap generation replaces texel array levels
52 <inlineequation><mml:math>
53 <!-- eqn: level sub base + 1: -->
56 <mml:mi mathvariant=
"italic">level
</mml:mi>
62 </mml:math></inlineequation>
64 <inlineequation><mml:math>
66 <mml:mi mathvariant=
"italic">q
</mml:mi>
68 </mml:math></inlineequation>
69 with arrays derived from the
70 <inlineequation><mml:math>
71 <!-- eqn: level sub base + 1: -->
74 <mml:mi mathvariant=
"italic">level
</mml:mi>
78 </mml:math></inlineequation>
79 array, regardless of their previous contents. All other mimap arrays,
81 <inlineequation><mml:math>
82 <!-- eqn: level sub base + 1: -->
85 <mml:mi mathvariant=
"italic">level
</mml:mi>
89 </mml:math></inlineequation>
90 array, are left unchanged by this computation.
93 The internal formats of the derived mipmap arrays all match those of the
94 <inlineequation><mml:math>
95 <!-- eqn: level sub base + 1: -->
98 <mml:mi mathvariant=
"italic">level
</mml:mi>
102 </mml:math></inlineequation>
103 array. The contents of the derived arrays are computed by repeated, filtered
105 <inlineequation><mml:math>
106 <!-- eqn: level sub base + 1: -->
109 <mml:mi mathvariant=
"italic">level
</mml:mi>
110 <mml:mi>base
</mml:mi>
113 </mml:math></inlineequation>
114 array. For one- and two-dimensional texture arrays, each layer is filtered
118 <refsect1 id=
"errors"><title>Errors
</title>
120 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>target
</parameter> is not
121 one of the accepted texture targets.
124 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>target
</parameter> is
125 <constant>GL_TEXTURE_CUBE_MAP
</constant> and the texture bound to the
<constant>GL_TEXTURE_CUBE_MAP
</constant>
126 target of the active texture unit is not cube complete.
129 <refsect1 id=
"seealso"><title>See Also
</title>
131 <citerefentry><refentrytitle>glTexImage2D
</refentrytitle></citerefentry>,
132 <citerefentry><refentrytitle>glBindTexture
</refentrytitle></citerefentry>,
133 <citerefentry><refentrytitle>glGenTextures
</refentrytitle></citerefentry>
136 <refsect1 id=
"Copyright"><title>Copyright
</title>
138 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
139 This material may be distributed subject to the terms and conditions set forth in
140 the Open Publication License, v
1.0,
8 June
1999.
141 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.