texenv.3gl 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. '\" te
  2. '\"! tbl|eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 24 September 1999
  6. .ds Re Release 1.2.1
  7. .ds Dp Jan 14 18:30
  8. .ds Dm 01 texenv.gl
  9. .ds Xs 19951 8 texenv.gl
  10. .TH GLTEXENV 3G
  11. .SH NAME
  12. .B "glTexEnvf, glTexEnvi, glTexEnvfv, glTexEnviv
  13. \- set texture environment parameters
  14. .SH C SPECIFICATION
  15. void \f3glTexEnvf\fP(
  16. GLenum \fItarget\fP,
  17. .nf
  18. .ta \w'\f3void \fPglTexEnvf( 'u
  19. GLenum \fIpname\fP,
  20. GLfloat \fIparam\fP )
  21. .fi
  22. void \f3glTexEnvi\fP(
  23. GLenum \fItarget\fP,
  24. .nf
  25. .ta \w'\f3void \fPglTexEnvi( 'u
  26. GLenum \fIpname\fP,
  27. GLint \fIparam\fP )
  28. .fi
  29. .EQ
  30. delim $$
  31. .EN
  32. .SH PARAMETERS
  33. .TP \w'\f2target\fP\ \ 'u
  34. \f2target\fP
  35. Specifies a texture environment.
  36. Must be \%\f3GL_TEXTURE_ENV\fP.
  37. .TP
  38. \f2pname\fP
  39. Specifies the symbolic name of a single-valued texture environment parameter.
  40. Must be \%\f3GL_TEXTURE_ENV_MODE\fP.
  41. .TP
  42. \f2param\fP
  43. Specifies a single symbolic constant, one of \%\f3GL_MODULATE\fP,
  44. \%\f3GL_DECAL\fP, \%\f3GL_BLEND\fP, or \%\f3GL_REPLACE\fP.
  45. .SH C SPECIFICATION
  46. void \f3glTexEnvfv\fP(
  47. GLenum \fItarget\fP,
  48. .nf
  49. .ta \w'\f3void \fPglTexEnvfv( 'u
  50. GLenum \fIpname\fP,
  51. const GLfloat \fI*params\fP )
  52. .fi
  53. void \f3glTexEnviv\fP(
  54. GLenum \fItarget\fP,
  55. .nf
  56. .ta \w'\f3void \fPglTexEnviv( 'u
  57. GLenum \fIpname\fP,
  58. const GLint \fI*params\fP )
  59. .fi
  60. .SH PARAMETERS
  61. .TP
  62. \f2target\fP
  63. Specifies a texture environment.
  64. Must be \%\f3GL_TEXTURE_ENV\fP.
  65. .TP
  66. \f2pname\fP
  67. Specifies the symbolic name of a texture environment parameter.
  68. Accepted values are \%\f3GL_TEXTURE_ENV_MODE\fP and \%\f3GL_TEXTURE_ENV_COLOR\fP.
  69. .TP
  70. \f2params\fP
  71. Specifies a pointer to a parameter array that contains
  72. either a single symbolic constant or an RGBA color.
  73. .SH DESCRIPTION
  74. A texture environment specifies how texture values are interpreted
  75. when a fragment is textured.
  76. \f2target\fP must be \%\f3GL_TEXTURE_ENV\fP.
  77. \f2pname\fP can be either \%\f3GL_TEXTURE_ENV_MODE\fP or \%\f3GL_TEXTURE_ENV_COLOR\fP.
  78. .P
  79. If \f2pname\fP is \%\f3GL_TEXTURE_ENV_MODE\fP,
  80. then \f2params\fP is (or points to) the symbolic name of a texture function.
  81. Four texture functions may be specified:
  82. \%\f3GL_MODULATE\fP,
  83. \%\f3GL_DECAL\fP,
  84. \%\f3GL_BLEND\fP, and
  85. \%\f3GL_REPLACE\fP.
  86. .P
  87. A texture function acts on the fragment to be textured using
  88. the texture image value that applies to the fragment
  89. (see \%\f3glTexParameter\fP)
  90. and produces an RGBA color for that fragment.
  91. The following table shows how the RGBA color is produced for each
  92. of the three texture functions that can be chosen.
  93. $C$ is a triple of color values (RGB) and $A$ is the associated alpha value.
  94. RGBA values extracted from a texture image are in the range [0,1].
  95. The subscript $f$ refers to the incoming fragment,
  96. the subscript $t$ to the texture image,
  97. the subscript $c$ to the texture environment color,
  98. and subscript $v$ indicates a value produced by the texture function.
  99. .P
  100. A texture image can have up to four components per texture element
  101. (see \%\f3glTexImage1D\fP, \%\f3glTexImage2D\fP, \%\f3glTexImage3D\fP,
  102. \%\f3glCopyTexImage1D\fP, and \%\f3glCopyTexImage2D\fP).
  103. In a one-component image,
  104. $L sub t$ indicates that single component.
  105. A two-component image uses $L sub t$ and $A sub t$.
  106. A three-component image has only a color value, $C sub t$.
  107. A four-component image has both a color value $C sub t$
  108. and an alpha value $A sub t$.
  109. .sp
  110. .ne
  111. .TS
  112. center tab(:) ;
  113. cb cb s s s
  114. ci c c c c
  115. c c c c c.
  116. _
  117. Base internal:Texture functions
  118. :\%\f3GL_MODULATE\fP:\%\f3GL_DECAL\fP:\%\f3GL_BLEND\fP:\%\f3GL_REPLACE\fP
  119. _
  120. \%\f3GL_ALPHA\fP:$C sub v ~=~ C sub f$:undefined:$C sub v ~=~ C sub f$:$C sub v ~=~ C sub f$
  121. \^ :$A sub v ~=~ A sub f A sub t$:\^:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub t$
  122. _
  123. \%\f3GL_LUMINANCE\fP:$C sub v ~=~ L sub t C sub f$:undefined:$C sub v ~=~ ( 1 - L sub t ) C sub f$:$C sub v ~=~ L sub t$
  124. : : :$+ L sub t C sub c$:
  125. 1: $A sub v ~=~ A sub f$:\^: $A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$
  126. _
  127. \%\f3GL_LUMINANCE\fP:$C sub v ~=~ L sub t C sub f$:undefined:$C sub v ~=~ ( 1 - L sub t ) C sub f $:$C sub v ~=~ L sub t$
  128. \\f3_ALPHA\fP: : : $+ L sub t C sub c$
  129. 2:$A sub v ~=~ A sub t A sub f$:\^:$A sub v ~=~ A sub t A sub f$:$A sub v ~=~ A sub t$
  130. _
  131. \%\f3GL_INTENSITY\fP:$C sub v ~=~ C sub f I sub t$:undefined:$C sub v ~=~ ( 1 - I sub t ) C sub f$ :$C sub v ~=~ I sub t$
  132. : : :$+ I sub t C sub c$
  133. c\^ :$A sub v ~=~ A sub f I sub t$:\^:$A sub v ~=~ ( 1 - I sub t ) A sub f $:$A sub v ~=~ I sub t$
  134. : : :$+ I sub t A sub c$:
  135. _
  136. \%\f3GL_RGB\fP:$C sub v ~=~ C sub t C sub f$:$C sub v ~=~ C sub t$:$C sub v ~=~ (1 - C sub t) C sub f $:$C sub v ~=~ C sub t$
  137. : : : $+ C sub t C sub c$
  138. 3:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub f$
  139. _
  140. \%\f3GL_RGBA\fP:$C sub v ~=~ C sub t C sub f$:$C sub v ~=~ ( 1 - A sub t ) C sub f $:$C sub v ~=~ (1 - C sub t) C sub f $:$C sub v ~=~ C sub t$
  141. : :$+ A sub t C sub t$: $+ C sub t C sub c$
  142. 4:$A sub v ~=~ A sub t A sub f$:$A sub v ~=~ A sub f$:$A sub v ~=~ A sub t A sub f$:$A sub v ~=~ A sub t$
  143. _
  144. .TE
  145. .bp
  146. If \f2pname\fP is \%\f3GL_TEXTURE_ENV_COLOR\fP,
  147. \f2params\fP is a pointer to an array that holds an RGBA color consisting of four
  148. values.
  149. Integer color components are interpreted linearly such that the most
  150. positive integer maps to 1.0,
  151. and the most negative integer maps to -1.0.
  152. The values are clamped to the range [0,1] when they are specified.
  153. $C sub c$ takes these four values.
  154. .P
  155. \%\f3GL_TEXTURE_ENV_MODE\fP defaults to \%\f3GL_MODULATE\fP and
  156. \%\f3GL_TEXTURE_ENV_COLOR\fP defaults to (0, 0, 0, 0).
  157. .SH NOTES
  158. \%\f3GL_REPLACE\fP may only be used if the GL version is 1.1 or greater.
  159. .P
  160. Internal formats other than 1, 2, 3, or 4 may only be used if the GL
  161. version is 1.1 or greater.
  162. .P
  163. When the \%\f3GL_ARB_multitexture\fP extension is supported, \%\f3glTexEnv\fP controls
  164. the texture environment for the current active texture unit, selected by
  165. \%\f3glActiveTextureARB\fP.
  166. .sh ERRORS
  167. \%\f3GL_INVALID_ENUM\fP is generated when \f2target\fP or \f2pname\fP is not
  168. one of the accepted defined values,
  169. or when \f2params\fP should have a defined constant value
  170. (based on the value of \f2pname\fP)
  171. and does not.
  172. .P
  173. \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glTexEnv\fP
  174. is executed between the execution of \%\f3glBegin\fP
  175. and the corresponding execution of \%\f3glEnd\fP.
  176. .SH ASSOCIATED GETS
  177. \%\f3glGetTexEnv\fP
  178. .SH SEE ALSO
  179. \%\f3glActiveTextureARB(3G)\fP,
  180. \%\f3glCopyPixels(3G)\fP,
  181. \%\f3glCopyTexImage1D(3G)\fP,
  182. \%\f3glCopyTexImage2D(3G)\fP,
  183. \%\f3glCopyTexSubImage1D(3G)\fP,
  184. \%\f3glCopyTexSubImage2D(3G)\fP,
  185. \%\f3glCopyTexSubImage3D(3G)\fP,
  186. \%\f3glTexImage1D(3G)\fP,
  187. \%\f3glTexImage2D(3G)\fP,
  188. \%\f3glTexImage3D(3G)\fP,
  189. \%\f3glTexParameter(3G)\fP,
  190. \%\f3glTexSubImage1D(3G)\fP,
  191. \%\f3glTexSubImage2D(3G)\fP,
  192. \%\f3glTexSubImage3D(3G)\fP