Light | Dark



textureOffset — perform a texture lookup with offset


gvec4 textureOffset( gsampler2D sampler,
  vec2 P,
  ivec2 offset,
  [float bias]);
gvec4 textureOffset( gsampler3D sampler,
  vec3 P,
  ivec3 offset,
  [float bias]);
float textureOffset( sampler2DShadow sampler,
  vec3 P,
  ivec2 offset,
  [float bias]);
gvec4 textureOffset( gsampler2DArray sampler,
  vec3 P,
  ivec2 offset,
  [float bias]);



Specifies the sampler to which the texture from which texels will be retrieved is bound.


Specifies the texture coordinates at which texture will be sampled.


Specifies offset, in texels that will be applied to P before looking up the texel.


Specifies an optional bias to be applied during level-of-detail computation.


textureOffset performs a texture lookup at coordinate P from the texture bound to sampler with an an additional offset, specified in texels in offset that will be applied to the (u, v, w) texture coordinates before looking up each texel. The offset value must be a constant expression. A limited range of offset values are supported; the minimum and maximum offset values are implementation-dependent and may be determined by querying GL_MIN_PROGRAM_TEXEL_OFFSET and GL_MAX_PROGRAM_TEXEL_OFFSET, respectively.

Note that offset does not apply to the layer coordinate for texture arrays. Also note that offsets are not supported for cube maps.

Version Support

OpenGL ES Shading Language Version
Function Name 1.00 3.00 3.10
textureOffset -
Think you can improve this page? Edit this page on GitHub.