build3dmipmaplevels.3gl 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. '\" e
  2. '\"! eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 6 March 1997
  6. .ds Re Release 1.2.0
  7. .ds Dp May 02 11:53
  8. .ds Dm 37 build3dmi
  9. .ds Xs 53966 9 build3dmipmaplevels.gl
  10. .TH GLUBUILD3DMIPMAPLEVELS 3G
  11. .SH NAME
  12. .B "gluBuild3DMipmapLevels
  13. \- builds a subset of three-dimensional mipmap levels
  14. .SH C SPECIFICATION
  15. GLint \f3gluBuild3DMipmapLevels\fP(
  16. GLenum \fItarget\fP,
  17. .nf
  18. .ta \w'\f3GLint \fPgluBuild3DMipmapLevels( 'u
  19. GLint \fIinternalFormat\fP,
  20. GLsizei \fIwidth\fP,
  21. GLsizei \fIheight\fP,
  22. GLsizei \fIdepth\fP,
  23. GLenum \fIformat\fP,
  24. GLenum \fItype\fP,
  25. GLint \fIlevel\fP,
  26. GLint \fIbase\fP,
  27. GLint \fImax\fP,
  28. const void \fI*data\fP )
  29. .fi
  30. .EQ
  31. delim $$
  32. .EN
  33. .SH PARAMETERS
  34. .TP \w'\fIinternalFormat\fP\ \ 'u
  35. \f2target\fP
  36. Specifies the target texture. Must be \%\f3GL_TEXTURE_3D\fP.
  37. .TP
  38. \f2internalFormat\fP
  39. Requests the internal storage of the texture image. The most
  40. current version of the SGI implementation of GLU does not check this
  41. value for validity before passing it on to the underlying OpenGL
  42. implementation. A value that is not accepted by the OpenGL
  43. implementation will lead to an OpenGL error. The benefit of not
  44. checking this value at the GLU level is that OpenGL extensions can add
  45. new internal texture formats without requiring a revision of the GLU
  46. implementation. Older implementations of GLU check this value and
  47. raise a GLU error if it is not 1, 2, 3, or 4 or one of the following
  48. symbolic constants:
  49. \%\f3GL_ALPHA\fP,
  50. \%\f3GL_ALPHA4\fP,
  51. \%\f3GL_ALPHA8\fP,
  52. \%\f3GL_ALPHA12\fP,
  53. \%\f3GL_ALPHA16\fP,
  54. \%\f3GL_LUMINANCE\fP,
  55. \%\f3GL_LUMINANCE4\fP,
  56. \%\f3GL_LUMINANCE8\fP,
  57. \%\f3GL_LUMINANCE12\fP,
  58. \%\f3GL_LUMINANCE16\fP,
  59. \%\f3GL_LUMINANCE_ALPHA\fP,
  60. \%\f3GL_LUMINANCE4_ALPHA4\fP,
  61. \%\f3GL_LUMINANCE6_ALPHA2\fP,
  62. \%\f3GL_LUMINANCE8_ALPHA8\fP,
  63. \%\f3GL_LUMINANCE12_ALPHA4\fP,
  64. \%\f3GL_LUMINANCE12_ALPHA12\fP,
  65. \%\f3GL_LUMINANCE16_ALPHA16\fP,
  66. \%\f3GL_INTENSITY\fP,
  67. \%\f3GL_INTENSITY4\fP,
  68. \%\f3GL_INTENSITY8\fP,
  69. \%\f3GL_INTENSITY12\fP,
  70. \%\f3GL_INTENSITY16\fP,
  71. \%\f3GL_RGB\fP,
  72. \%\f3GL_R3_G3_B2\fP,
  73. \%\f3GL_RGB4\fP,
  74. \%\f3GL_RGB5\fP,
  75. \%\f3GL_RGB8\fP,
  76. \%\f3GL_RGB10\fP,
  77. \%\f3GL_RGB12\fP,
  78. \%\f3GL_RGB16\fP,
  79. \%\f3GL_RGBA\fP,
  80. \%\f3GL_RGBA2\fP,
  81. \%\f3GL_RGBA4\fP,
  82. \%\f3GL_RGB5_A1\fP,
  83. \%\f3GL_RGBA8\fP,
  84. \%\f3GL_RGB10_A2\fP,
  85. \%\f3GL_RGBA12\fP, or
  86. \%\f3GL_RGBA16\fP.
  87. .TP
  88. \f2width\fP, \f2height\fP, \f2depth\fP
  89. Specifies in pixels the width, height and depth respectively, of the texture
  90. image. These should be a power of 2.
  91. .TP
  92. \f2format\fP
  93. Specifies the of the pixel data.
  94. Must be one of
  95. \%\f3GL_COLOR_INDEX\fP,
  96. \%\f3GL_DEPTH_COMPONENT\fP,
  97. \%\f3GL_RED\fP,
  98. \%\f3GL_GREEN\fP,
  99. \%\f3GL_BLUE\fP,
  100. \%\f3GL_ALPHA\fP,
  101. \%\f3GL_RGB\fP,
  102. \%\f3GL_RGBA\fP,
  103. \%\f3GL_BGR\fP,
  104. \%\f3GL_BGRA\fP,
  105. \%\f3GL_LUMINANCE\fP, or
  106. \%\f3GL_LUMINANCE_ALPHA\fP.
  107. .TP
  108. \f2type\fP
  109. Specifies the data type for \f2data\fP.
  110. Must be one of
  111. \%\f3GL_UNSIGNED_BYTE\fP,
  112. \%\f3GL_BYTE\fP,
  113. \%\f3GL_BITMAP\fP,
  114. \%\f3GL_UNSIGNED_SHORT\fP,
  115. \%\f3GL_SHORT\fP,
  116. \%\f3GL_UNSIGNED_INT\fP,
  117. \%\f3GL_INT\fP,
  118. \%\f3GL_FLOAT\fP,
  119. \%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
  120. \%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
  121. \%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
  122. \%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
  123. \%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
  124. \%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
  125. \%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
  126. \%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
  127. \%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
  128. \%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
  129. \%\f3GL_UNSIGNED_INT_10_10_10_2\fP, or
  130. \%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP.
  131. .TP
  132. \f2level\fP
  133. Specifies the mipmap level of the image data.
  134. .TP
  135. \f2base\fP
  136. Specifies the minimum mipmap level to pass to \f3glTexImage3D\fP.
  137. .TP
  138. \f2max\fP
  139. Specifies the maximum mipmap level to pass to \f3glTexImage3D\fP.
  140. .TP
  141. \f2data\fP
  142. Specifies a pointer to the image data in memory.
  143. .SH DESCRIPTION
  144. \%\f3gluBuild3DMipmapLevels\fP builds a subset of prefiltered three-dimensional texture maps of
  145. decreasing resolutions called a mipmap. This is used for the antialiasing of
  146. texture mapped primitives.
  147. .P
  148. A return value of zero indicates success, otherwise a GLU error code is
  149. returned (see \%\f3gluErrorString\fP).
  150. .P
  151. A series of mipmap levels from \f2base\fP to \f2max\fP is built by
  152. decimating \f2data\fP in half along both dimensions until size $1 ~times~ 1
  153. ~times~ 1$ is reached. At each level, each texel in the halved mipmap
  154. level is an average of the corresponding eight texels in the larger
  155. mipmap level. (If exactly one of the dimensions is 1, four texels are
  156. averaged. If exactly two of the dimensions are 1, two texels are
  157. averaged.) \f3glTexImage3D\fP is called to load these mipmap levels
  158. from \f2base\fP to \f2max\fP. If \f2max\fP is larger than the highest mipmap
  159. level for the texture of the specified size, then a GLU error code is
  160. returned (see \%\f3gluErrorString\fP) and nothing is loaded.
  161. .P
  162. For example, if \f2level\fP is 2 and \f2width\fP is 16, \f2height\fP is 8 and \f2depth\fP
  163. is 4, the following levels are possible: $16 ~times~ 8 ~times~ 4$, $8 ~times~
  164. 4 ~times~ 2$, $4 ~times~ 2 ~times~ 1$, $2 ~times~ 1 ~times~ 1$,
  165. $1 ~times~ 1 ~times~ 1$.
  166. These correspond to levels 2 through 6 respectively. If \f2base\fP is
  167. 3 and \f2max\fP is 5, then only mipmap levels $8 ~times~ 4 ~times~ 2$, $4
  168. ~times~ 2 ~times~ 1$ and $2 ~times~ 1 ~times~ 1$ are loaded. However, if
  169. \f2max\fP is 7 then an error is returned and nothing is loaded, since
  170. \f2max\fP is larger than the highest mipmap level which is, in this case,
  171. 6.
  172. .P
  173. The highest mipmap level can be derived from the formula
  174. ${log sub 2} ( max ("width","height","depth")^{2 sup "level"})$.
  175. .P
  176. See the \f3glTexImage1D\fP reference page for a description of the
  177. acceptable values for \f2format\fP parameter. See the \f3glDrawPixels\fP
  178. reference page for a description of the acceptable values
  179. for \f2type\fP parameter.
  180. .SH NOTES
  181. \%\f3gluBuild3DMipmapLevels\fP is only available if the GLU version is 1.3 or greater.
  182. .P
  183. Formats \%\f3GL_BGR\fP, and \%\f3GL_BGRA\fP, and types
  184. \%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
  185. \%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
  186. \%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
  187. \%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
  188. \%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
  189. \%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
  190. \%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
  191. \%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
  192. \%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
  193. \%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
  194. \%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
  195. \%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP are only available if the GL version
  196. is 1.2 or greater.
  197. .SH ERRORS
  198. \%\f3GLU_INVALID_VALUE\fP is returned if \f2level\fP > \f2base\fP, \f2base\fP < 0,
  199. \f2max\fP < \f2base\fP or \f2max\fP is > the highest mipmap level for \f2data\fP.
  200. .P
  201. \%\f3GLU_INVALID_VALUE\fP is returned if \f2width\fP, \f2height\fP, or \f2depth\fP is < 1.
  202. .P
  203. \%\f3GLU_INVALID_ENUM\fP is returned if \f2internalFormat\fP, \f2format\fP, or \f2type\fP is not
  204. legal.
  205. .P
  206. \%\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
  207. and \f2format\fP is not \%\f3GL_RGB\fP.
  208. .P
  209. \%\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
  210. and \f2format\fP is not \%\f3GL_RGB\fP.
  211. .P
  212. \%\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
  213. and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
  214. .P
  215. \%\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
  216. and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
  217. .P
  218. \%\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
  219. and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
  220. .P
  221. \%\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
  222. and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
  223. .SH SEE ALSO
  224. \f3glDrawPixels(3G)\fP,
  225. \f3glTexImage1D(3G)\fP,
  226. \f3glTexImage2D(3G)\fP,
  227. \f3glTexImage3D(3G)\fP,
  228. \%\f3gluBuild1DMipmaps(3G)\fP,
  229. \%\f3gluBuild2DMipmaps(3G)\fP,
  230. \%\f3gluBuild3DMipmaps(3G)\fP,
  231. \%\f3gluErrorString(3G)\fP,
  232. \f3glGetTexImage(3G)\fP,
  233. \f3glGetTexLevelParameter(3G)\fP,
  234. \%\f3gluBuild1DMipmapLevels(3G)\fP,
  235. \%\f3gluBuild2DMipmapLevels(3G)\fP