texture — retrieves texels from a texture
gvec4 texture( | gsampler2D sampler, |
| vec2 P, | |
[float bias]); |
gvec4 texture( | gsampler3D sampler, |
| vec3 P, | |
[float bias]); |
gvec4 texture( | gsamplerCube sampler, |
| vec3 P, | |
[float bias]); |
float texture( | sampler2DShadow sampler, |
| vec3 P, | |
[float bias]); |
float texture( | samplerCubeShadow sampler, |
| vec4 P, | |
[float bias]); |
gvec4 texture( | gsampler2DArray sampler, |
| vec3 P, | |
[float bias]); |
float texture( | gsampler2DArrayShadow sampler, |
vec4 P); |
samplerSpecifies the sampler to which the texture from which texels will be retrieved is bound.
PSpecifies the texture coordinates at which texture will be sampled.
biasSpecifies an optional bias to be applied during level-of-detail computation.
texture samples texels from the texture bound to sampler at texture
coordinate P. An optional bias, specified in bias is included in
the level-of-detail computation that is used to choose mipmap(s) from which to sample.
For shadow forms, when compare is present, it is used as
. When P.wcompare is
not present, the last component of P is used as
P.
For non-shadow variants, the array layer comes from the last component of P.