logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

textureOffset - perform a texture lookup with offset

Declaration

gvec4textureOffset(gsampler1Dsampler,floatP,intoffset,[floatbias]);gvec4textureOffset(gsampler2Dsampler,vec2P,ivec2offset,[floatbias]);gvec4textureOffset(gsampler3Dsampler,vec3P,ivec3offset,[floatbias]);gvec4textureOffset(gsampler2DRectsampler,vec2P,ivec2offset);floattextureOffset(sampler2DRectShadowsampler,vec3P,ivec2offset);floattextureOffset(sampler1DShadowsampler,vec3P,intoffset,[floatbias]);floattextureOffset(sampler2DShadowsampler,vec4P,ivec2offset,[floatbias]);gvec4textureOffset(gsampler1DArraysampler,vec2P,intoffset,[floatbias]);gvec4textureOffset(gsampler2DArraysampler,vec3P,ivec2offset,[floatbias]);floattextureOffset(sampler1DArrayShadowsampler,vec3P,intoffset);floattextureOffset(sampler2DArrayShadowsampler,vec4P,vec2offset);

Description

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.

Name

       textureOffset - perform a texture lookup with offset

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.

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

See Also

texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(),
       textureGatherOffsets(), textureGrad(), textureGradOffset(), textureLod(), textureLodOffset(),
       textureProj(), textureProjGrad(), textureProjGradOffset(), textureProjLod(), textureProjLodOffset(),
       textureProjOffset(), textureQueryLod(), textureSize()

Version Support

       ┌──────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │                          │        OpenGLShadingLanguageVersion                                            │
       ├──────────────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name                     │      │      │      │      │      │      │      │      │      │      │      │      │
       ├──────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ textureOffset            │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       ├──────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ textureOffset            │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       │ (gsampler2DRect{Shadow}) │      │      │      │      │      │      │      │      │      │      │      │      │
       └──────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also