texelFetch - OpenGL ES 3.2 Reference Pages

## Name

texelFetch — perform a lookup of a single texel within a texture

## Declaration

`gvec4 texelFetch(` | gsampler2D sampler,
| ivec2 P,
| int lod`)`;

`gvec4 texelFetch(` | gsampler3D sampler,
| ivec3 P,
| int lod`)`;

`gvec4 texelFetch(` | gsampler2DArray sampler,
| ivec3 P,
| int lod`)`;

`gvec4 texelFetch(` | gsampler2DMS sampler,
| ivec2 P,
| int sample`)`;

`gvec4 texelFetch(` | gsampler2DMSArray sampler,
| ivec3 P,
| int sample`)`;

`gvec4 texelFetch(` | gsamplerBuffer sampler,
| int P`)`;

## Parameters

`P`

  Specifies the texture coordinates at which texture will be sampled.

`lod`

  If present, specifies the level-of-detail within the texture from which the texel will be fetched.

`sample`

  For multisampled fetches, specifies which sample within the texel from which the data will be returned.

## Description

`texelFetch` performs a lookup of a single texel from texture coordinate `P` in the texture bound to `sampler`. The array layer is specified in the last component of `P` for array forms. The `lod` parameter (if present) specifies the level-of-detail from which the texel will be fetched. The `sample` specifies which sample within the texel will be returned when reading from a multi-sample texure.

## Version Support

| OpenGL ES Shading Language Version
--- | ---
Function Name | 1.00 | 3.00 | 3.10 | 3.20
texelFetch | - | ✔ | ✔ | ✔
texelFetch (gsampler2DMS) | - | - | ✔ | ✔
texelFetch (gsampler2DMSArray, gsamplerBuffer) | - | - | - | ✔

## See Also

texelFetchOffset, texture, textureGrad, textureGradOffset, textureLod, textureLodOffset, textureOffset, textureProj, textureProjGrad, textureProjGradOffset, textureProjLod, textureProjLodOffset, textureProjOffset, textureSize

## Copyright

Copyright © 2011-2015 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. http://opencontent.org/openpub/.