textureOffset(3) perform a texture lookup with offset


gvec4 textureOffset(gsampler1D sampler, float P, int offset, [float bias]);
gvec4 textureOffset(gsampler2D sampler, vec2 P, ivec2 offset, [float bias]);
gvec4 textureOffset(gsampler3D sampler, vec3 P, ivec3 offset, [float bias]);
gvec4 textureOffset(gsampler2DRect sampler, vec2 P, ivec2 offset);
float textureOffset(sampler2DRectShadow sampler, vec3 P, ivec2 offset);
float textureOffset(sampler1DShadow sampler, vec3 P, int offset, [float bias]);
float textureOffset(sampler2DShadow sampler, vec4 P, ivec2 offset, [float bias]);
gvec4 textureOffset(gsampler1DArray sampler, vec2 P, int offset, [float bias]);
gvec4 textureOffset(gsampler2DArray sampler, vec3 P, ivec2 offset, [float bias]);
float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset);
float textureOffset(sampler2DArrayShadow sampler, vec4 P, vec2 offset);



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.


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.


OpenGL Shading Language Version
Function Name 1.10 1.20 1.30 1.40 1.50 3.30 4.00 4.10 4.20 4.30 4.40 4.50
textureOffset - -
textureOffset (gsampler2DRect{Shadow}) - - -


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


Copyright © 2012-2014 Khronos Group