texture - retrieves texels from a texture
Contents
Copyright
Copyright © 2011-2014 Khronos Group
[FIXME: source] 11/18/2024 TEXTURE(3G)
Declaration
gvec4texture(gsampler1Dsampler,floatP,[floatbias]);gvec4texture(gsampler2Dsampler,vec2P,[floatbias]);gvec4texture(gsampler3Dsampler,vec3P,[floatbias]);gvec4texture(gsamplerCubesampler,vec3P,[floatbias]);floattexture(sampler1DShadowsampler,vec3P,[floatbias]);floattexture(sampler2DShadowsampler,vec3P,[floatbias]);floattexture(samplerCubeShadowsampler,vec3P,[floatbias]);gvec4texture(gsampler1DArraysampler,vec2P,[floatbias]);gvec4texture(gsampler2DArraysampler,vec3P,[floatbias]);gvec4texture(gsamplerCubeArraysampler,vec4P,[floatbias]);floattexture(sampler1DArrayShadowsampler,vec3P,[floatbias]);floattexture(gsampler2DArrayShadowsampler,vec4P,[floatbias]);gvec4texture(gsampler2DRectsampler,vec2P);floattexture(sampler2DRectShadowsampler,vec3P);floattexture(gsamplerCubeArrayShadowsampler,vec4P,floatcompare);
Description
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 Dsub and the array layer is specified in P.w.
When compare is not present, the last component of P is used as Dsub and the array layer is specified in
the second to last component of P. (The second component of P is unused for 1D shadow lookups.)
For non-shadow variants, the array layer comes from the last component of P.
Name
texture - retrieves texels from a texture
Parameters
sampler
Specifies the sampler to which the texture from which texels will be retrieved is bound.
P
Specifies the texture coordinates at which texture will be sampled.
bias
Specifies an optional bias to be applied during level-of-detail computation.
compare
Specifies the value to which the fetched texel will be compared when sampling from
gsamplerCubeArrayShadow.
See Also
texelFetch(), texelFetchOffset(), textureGather(), textureGatherOffset(), textureGatherOffsets(),
textureGrad(), textureGradOffset(), textureLod(), textureLodOffset(), textureOffset(), textureProj(),
textureProjGrad(), textureProjGradOffset(), textureProjLod(), textureProjLodOffset(),
textureProjOffset(), textureQueryLod(), textureSize()
Version Support
┌─────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
│ │ OpenGLShadingLanguageVersion │
├─────────────────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
│ Function │ 1.10 │ 1.20 │ 1.30 │ 1.40 │ 1.50 │ 3.30 │ 4.00 │ 4.10 │ 4.20 │ 4.30 │ 4.40 │ 4.50 │
│ Name │ │ │ │ │ │ │ │ │ │ │ │ │
├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│ texture │ - │ - │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│ texture │ - │ - │ - │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
│ (gsampler2DRect{Shadow}) │ │ │ │ │ │ │ │ │ │ │ │ │
├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│ texture (gsampler2DMS, │ - │ - │ - │ - │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
│ gsampler2DMSArray) │ │ │ │ │ │ │ │ │ │ │ │ │
├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│ texture │ - │ - │ - │ - │ - │ - │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
│ (gsamplerCubeArray{Shadow}) │ │ │ │ │ │ │ │ │ │ │ │ │
└─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘
