'\" t .\" Title: glSamplerParameter .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 01/03/2018 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLSAMPLERPARAMETER" "3G" "01/03/2018" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" glSamplerParameter \- set sampler parameters .SH "C SPECIFICATION" .HP \w'void\ glSamplerParameterf('u .BI "void glSamplerParameterf(GLuint\ " "sampler" ", GLenum\ " "pname" ", GLfloat\ " "param" ");" .HP \w'void\ glSamplerParameteri('u .BI "void glSamplerParameteri(GLuint\ " "sampler" ", GLenum\ " "pname" ", GLint\ " "param" ");" .HP \w'void\ glSamplerParameterfv('u .BI "void glSamplerParameterfv(GLuint\ " "sampler" ", GLenum\ " "pname" ", const\ GLfloat\ *\ " "params" ");" .HP \w'void\ glSamplerParameteriv('u .BI "void glSamplerParameteriv(GLuint\ " "sampler" ", GLenum\ " "pname" ", const\ GLint\ *\ " "params" ");" .HP \w'void\ glSamplerParameterIiv('u .BI "void glSamplerParameterIiv(GLuint\ " "sampler" ", GLenum\ " "pname" ", const\ GLint\ *" "params" ");" .HP \w'void\ glSamplerParameterIuiv('u .BI "void glSamplerParameterIuiv(GLuint\ " "sampler" ", GLenum\ " "pname" ", const\ GLuint\ *" "params" ");" .SH "PARAMETERS" .PP \fIsampler\fR .RS 4 Specifies the sampler object whose parameter to modify\&. .RE .PP \fIpname\fR .RS 4 Specifies the symbolic name of a sampler parameter\&. \fIpname\fR can be one of the following: \fBGL_TEXTURE_WRAP_S\fR, \fBGL_TEXTURE_WRAP_T\fR, \fBGL_TEXTURE_WRAP_R\fR, \fBGL_TEXTURE_MIN_FILTER\fR, \fBGL_TEXTURE_MAG_FILTER\fR, \fBGL_TEXTURE_BORDER_COLOR\fR, \fBGL_TEXTURE_MIN_LOD\fR, \fBGL_TEXTURE_MAX_LOD\fR, \fBGL_TEXTURE_LOD_BIAS\fR \fBGL_TEXTURE_COMPARE_MODE\fR, or \fBGL_TEXTURE_COMPARE_FUNC\fR\&. .RE .PP \fIparam\fR .RS 4 For the scalar commands, specifies the value of \fIpname\fR\&. .RE .PP \fIparams\fR .RS 4 For the vector commands (\fBglSamplerParameter*v\fR), specifies a pointer to an array where the value or values of \fIpname\fR are stored\&. .RE .SH "DESCRIPTION" .PP \fBglSamplerParameter\fR assigns the value or values in \fIparams\fR to the sampler parameter specified as \fIpname\fR\&. \fIsampler\fR specifies the sampler object to be modified, and must be the name of a sampler object previously returned from a call to \fBglGenSamplers\fR()\&. The following symbols are accepted in \fIpname\fR: .PP \fBGL_TEXTURE_MIN_FILTER\fR .RS 4 The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element\&. There are six defined minifying functions\&. Two of them use the nearest one or nearest four texture elements to compute the texture value\&. The other four use mipmaps\&. .sp A mipmap is an ordered set of arrays representing the same image at progressively lower resolutions\&. If the texture has dimensions 2 n \(mu 2 m, there are max ⁡ n m + 1 mipmaps\&. The first mipmap is the original texture, with dimensions 2 n \(mu 2 m\&. Each subsequent mipmap has dimensions 2 k \- 1 \(mu 2 l \- 1, where 2 k \(mu 2 l are the dimensions of the previous mipmap, until either k = 0 or l = 0\&. At that point, subsequent mipmaps have dimension 1 \(mu 2 l \- 1 or 2 k \- 1 \(mu 1 until the final mipmap, which has dimension 1 \(mu 1\&. To define the mipmaps, call \fBglTexImage1D\fR(), \fBglTexImage2D\fR(), \fBglTexImage3D\fR(), \fBglCopyTexImage1D\fR(), or \fBglCopyTexImage2D\fR() with the \fIlevel\fR argument indicating the order of the mipmaps\&. Level 0 is the original texture; level max ⁡ n m is the final 1 \(mu 1 mipmap\&. .sp \fIparams\fR supplies a function for minifying the texture as one of the following: .PP \fBGL_NEAREST\fR .RS 4 Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured\&. .RE .PP \fBGL_LINEAR\fR .RS 4 Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured\&. These can include border texture elements, depending on the values of \fBGL_TEXTURE_WRAP_S\fR and \fBGL_TEXTURE_WRAP_T\fR, and on the exact mapping\&. .RE .PP \fBGL_NEAREST_MIPMAP_NEAREST\fR .RS 4 Chooses the mipmap that most closely matches the size of the pixel being textured and uses the \fBGL_NEAREST\fR criterion (the texture element nearest to the center of the pixel) to produce a texture value\&. .RE .PP \fBGL_LINEAR_MIPMAP_NEAREST\fR .RS 4 Chooses the mipmap that most closely matches the size of the pixel being textured and uses the \fBGL_LINEAR\fR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value\&. .RE .PP \fBGL_NEAREST_MIPMAP_LINEAR\fR .RS 4 Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the \fBGL_NEAREST\fR criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap\&. The final texture value is a weighted average of those two values\&. .RE .PP \fBGL_LINEAR_MIPMAP_LINEAR\fR .RS 4 Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the \fBGL_LINEAR\fR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap\&. The final texture value is a weighted average of those two values\&. .RE .sp As more texture elements are sampled in the minification process, fewer aliasing artifacts will be apparent\&. While the \fBGL_NEAREST\fR and \fBGL_LINEAR\fR minification functions can be faster than the other four, they sample only one or four texture elements to determine the texture value of the pixel being rendered and can produce moire patterns or ragged transitions\&. The initial value of \fBGL_TEXTURE_MIN_FILTER\fR is \fBGL_NEAREST_MIPMAP_LINEAR\fR\&. .RE .PP \fBGL_TEXTURE_MAG_FILTER\fR .RS 4 The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element\&. It sets the texture magnification function to either \fBGL_NEAREST\fR or \fBGL_LINEAR\fR (see below)\&. \fBGL_NEAREST\fR is generally faster than \fBGL_LINEAR\fR, but it can produce textured images with sharper edges because the transition between texture elements is not as smooth\&. The initial value of \fBGL_TEXTURE_MAG_FILTER\fR is \fBGL_LINEAR\fR\&. .PP \fBGL_NEAREST\fR .RS 4 Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured\&. .RE .PP \fBGL_LINEAR\fR .RS 4 Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured\&. These can include border texture elements, depending on the values of \fBGL_TEXTURE_WRAP_S\fR and \fBGL_TEXTURE_WRAP_T\fR, and on the exact mapping\&. .RE .sp .RE .PP .PP \fBGL_TEXTURE_MIN_LOD\fR .RS 4 Sets the minimum level\-of\-detail parameter\&. This floating\-point value limits the selection of highest resolution mipmap (lowest mipmap level)\&. The initial value is \-1000\&. .RE .PP .PP \fBGL_TEXTURE_MAX_LOD\fR .RS 4 Sets the maximum level\-of\-detail parameter\&. This floating\-point value limits the selection of the lowest resolution mipmap (highest mipmap level)\&. The initial value is 1000\&. .RE .PP .PP \fBGL_TEXTURE_WRAP_S\fR .RS 4 Sets the wrap parameter for texture coordinate s to either \fBGL_CLAMP_TO_EDGE\fR, \fBGL_MIRRORED_REPEAT\fR, \fBGL_REPEAT\fR, or \fBGL_MIRROR_CLAMP_TO_EDGE\fR\&. \fBGL_CLAMP_TO_BORDER\fR causes the s coordinate to be clamped to the range \-1 2N 1 + 1 2N, where N is the size of the texture in the direction of clamping\&.\fBGL_CLAMP_TO_EDGE\fR causes s coordinates to be clamped to the range 1 2N 1 \- 1 2N, where N is the size of the texture in the direction of clamping\&. \fBGL_REPEAT\fR causes the integer part of the s coordinate to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern\&. \fBGL_MIRRORED_REPEAT\fR causes the s coordinate to be set to the fractional part of the texture coordinate if the integer part of s is even; if the integer part of s is odd, then the s texture coordinate is set to 1 \- frac ⁡ s, where frac ⁡ s represents the fractional part of s\&. \fBGL_MIRROR_CLAMP_TO_EDGE\fR causes the the s coordinate to be repeated as for \fBGL_MIRRORED_REPEAT\fR for one reptition of the texture, at which point the coordinate to be clamped as in \fBGL_CLAMP_TO_EDGE\fR\&. Initially, \fBGL_TEXTURE_WRAP_S\fR is set to \fBGL_REPEAT\fR\&. .RE .PP .PP \fBGL_TEXTURE_WRAP_T\fR .RS 4 Sets the wrap parameter for texture coordinate t to either \fBGL_CLAMP_TO_EDGE\fR, \fBGL_MIRRORED_REPEAT\fR, \fBGL_REPEAT\fR, or \fBGL_MIRROR_CLAMP_TO_EDGE\fR\&. See the discussion under \fBGL_TEXTURE_WRAP_S\fR\&. Initially, \fBGL_TEXTURE_WRAP_T\fR is set to \fBGL_REPEAT\fR\&. .RE .PP \fBGL_TEXTURE_WRAP_R\fR .RS 4 Sets the wrap parameter for texture coordinate r to either \fBGL_CLAMP_TO_EDGE\fR, \fBGL_MIRRORED_REPEAT\fR, \fBGL_REPEAT\fR, or \fBGL_MIRROR_CLAMP_TO_EDGE\fR\&. See the discussion under \fBGL_TEXTURE_WRAP_S\fR\&. Initially, \fBGL_TEXTURE_WRAP_R\fR is set to \fBGL_REPEAT\fR\&. .RE .PP \fBGL_TEXTURE_BORDER_COLOR\fR .RS 4 The data in \fIparams\fR specifies four values that define the border values that should be used for border texels\&. If a texel is sampled from the border of the texture, the values of \fBGL_TEXTURE_BORDER_COLOR\fR are interpreted as an RGBA color to match the texture\*(Aqs internal format and substituted for the non\-existent texel data\&. If the texture contains depth components, the first component of \fBGL_TEXTURE_BORDER_COLOR\fR is interpreted as a depth value\&. The initial value is 0\&.0 , 0\&.0 , 0\&.0 , 0\&.0\&. .RE .PP \fBGL_TEXTURE_COMPARE_MODE\fR .RS 4 Specifies the texture comparison mode for currently bound textures\&. That is, a texture whose internal format is \fBGL_DEPTH_COMPONENT_*\fR; see \fBglTexImage2D\fR()) Permissible values are: .PP \fBGL_COMPARE_REF_TO_TEXTURE\fR .RS 4 Specifies that the interpolated and clamped r texture coordinate should be compared to the value in the currently bound texture\&. See the discussion of \fBGL_TEXTURE_COMPARE_FUNC\fR for details of how the comparison is evaluated\&. The result of the comparison is assigned to the red channel\&. .RE .PP \fBGL_NONE\fR .RS 4 Specifies that the red channel should be assigned the appropriate value from the currently bound texture\&. .RE .sp .RE .PP \fBGL_TEXTURE_COMPARE_FUNC\fR .RS 4 Specifies the comparison operator used when \fBGL_TEXTURE_COMPARE_MODE\fR is set to \fBGL_COMPARE_REF_TO_TEXTURE\fR\&. Permissible values are: .TS allbox tab(:); lB lB. T{ \fB Texture Comparison Function \fR T}:T{ \fB Computed result \fR T} .T& l l l l l l l l l l l l l l l l. T{ \fBGL_LEQUAL\fR T}:T{ result = 1\&.0 0\&.0 ⁢\ \&\ \& r <= D t r > D t T} T{ \fBGL_GEQUAL\fR T}:T{ result = 1\&.0 0\&.0 ⁢\ \&\ \& r >= D t r < D t T} T{ \fBGL_LESS\fR T}:T{ result = 1\&.0 0\&.0 ⁢\ \&\ \& r < D t r >= D t T} T{ \fBGL_GREATER\fR T}:T{ result = 1\&.0 0\&.0 ⁢\ \&\ \& r > D t r <= D t T} T{ \fBGL_EQUAL\fR T}:T{ result = 1\&.0 0\&.0 ⁢\ \&\ \& r = D t r ≠ D t T} T{ \fBGL_NOTEQUAL\fR T}:T{ result = 1\&.0 0\&.0 ⁢\ \&\ \& r ≠ D t r = D t T} T{ \fBGL_ALWAYS\fR T}:T{ result = 1\&.0 T} T{ \fBGL_NEVER\fR T}:T{ result = 0\&.0 T} .TE .sp 1 where r is the current interpolated texture coordinate, and D t is the texture value sampled from the currently bound texture\&. result is assigned to R t\&. .RE .SH "NOTES" .PP \fBglSamplerParameter\fR is available only if the GL version is 3\&.3 or higher\&. .PP If a sampler object is bound to a texture unit and that unit is used to sample from a texture, the parameters in the sampler are used to sample from the texture, rather than the equivalent parameters in the texture object bound to that unit\&. This introduces the possibility of sampling from the same texture object with different sets of sampler state, which may lead to a condition where a texture is \fIincomplete\fR with respect to one sampler object and not with respect to another\&. Thus, completeness can be considered a function of a sampler object and a texture object bound to a single texture unit, rather than a property of the texture object itself\&. .PP \fBGL_MIRROR_CLAMP_TO_EDGE\fR is available only if the GL version is 4\&.4 or greater\&. .SH "ERRORS" .PP \fBGL_INVALID_VALUE\fR is generated if \fIsampler\fR is not the name of a sampler object previously returned from a call to \fBglGenSamplers\fR()\&. .PP \fBGL_INVALID_ENUM\fR is generated if \fIparams\fR should have a defined constant value (based on the value of \fIpname\fR) and does not\&. .SH "ASSOCIATED GETS" .PP \fBglGetSamplerParameter\fR() .SH "VERSION SUPPORT" .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ \fBOpenGL Version\fR T} T{ \fBFunction / Feature Name\fR T}:T{ \fB2\&.0\fR T}:T{ \fB2\&.1\fR T}:T{ \fB3\&.0\fR T}:T{ \fB3\&.1\fR T}:T{ \fB3\&.2\fR T}:T{ \fB3\&.3\fR T}:T{ \fB4\&.0\fR T}:T{ \fB4\&.1\fR T}:T{ \fB4\&.2\fR T}:T{ \fB4\&.3\fR T}:T{ \fB4\&.4\fR T}:T{ \fB4\&.5\fR T} .T& l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c l c c c c c c c c c c c c. T{ \fBglSamplerParameterIiv\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ \fBglSamplerParameterIuiv\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ \fBglSamplerParameterf\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ \fBglSamplerParameterfv\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ \fBglSamplerParameteri\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} T{ \fBglSamplerParameteriv\fR T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} .TE .sp 1 .SH "SEE ALSO" .PP \fBglGenSamplers\fR(), \fBglBindSampler\fR(), \fBglDeleteSamplers\fR(), \fBglIsSampler\fR(), \fBglBindTexture\fR(), \fBglTexParameter\fR() .SH "COPYRIGHT" .PP Copyright \(co 2010\-2014 Khronos Group\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2010-2014 KhronosGroup .br