TEXELFETCHOFFSET(3G)
β¨ NAME β¨
texelFetchOffset β bestie, it performs a lookup of a single texel within a texture with an offset. that's the whole vibe π
okay first things first, housekeeping: this page is TEXELFETCHOFFSET(3G) β that's the title and the manual section, section 3G for the GLSL girlies. and ngl the header up there literally says [FIXME: manual], so if the docs feel a lil unfinished, that's why. not our problem, we move π
π DECLARATION π
here's the full roster of overloads, copy-pasted with love, don't touch a character:
gvec4 texelFetchOffset(gsampler1D sampler, int P, int lod, int offset);
gvec4 texelFetchOffset(gsampler2D sampler, ivec2 P, int lod,
int offset);
gvec4 texelFetchOffset(gsampler3D sampler, ivec3 P, int lod,
int offset);
gvec4 texelFetchOffset(gsampler2DRect sampler, ivec2 P, int offset);
gvec4 texelFetchOffset(gsampler1DArray sampler, ivec2 P, int lod,
int offset);
gvec4 texelFetchOffset(gsampler2DArray sampler, ivec3 P, int lod,
int offset);
lowkey a whole lineup. six of them. each one ate π
π¦ PARAMETERS π¦
samplerβ the sampler that the texture is bound to, aka the one we're pulling texels out of. this is your main character right here.Pβ the texture coordinates where we're sampling. where the texel lives, basically.lodβ if it's present, it says which level-of-detail inside the texture we're fetching the texel from. sometimes she's not invited to the party (looking at you,gsampler2DRect).offsetβ the offset, measured in texels, that gets applied toPbefore we go looking up the texel. so we shift first, then we fetch. order matters, bestie.
πΈ DESCRIPTION πΈ
okay so texelFetchOffset performs a lookup of a single texel from texture coordinate P in the texture bound to sampler. literally one texel. not a filter, not a vibe, one texel.
before fetching that texel, the offset specified in offset is added to P. so it's P plus the offset, then go get it.
offset must be a constant expression. no cap. it cannot be some runtime variable you cooked up at the last minute. constant. expression. periodt. β
for the array forms, the array layer is specified in the last component of P. so like, the last number in your coordinate vector is the layer. iykyk.
the lod parameter (if present) specifies the level-of-detail from which the texel will be fetched.
and the sample parameter specifies which sample within the texel will be returned when reading from a multi-sample texture. yes, we know sample isn't in the parameter list above β it's just out here living its truth in the description. we report, we don't question. π
π VERSION SUPPORT π
so which GLSL versions ship which overload? let's do a vibe check on the timeline, one function at a time. β¨
the base texelFetchOffset
- 1.10 β
-(nope, not yet) - 1.20 β
-(still nope) - 1.30 β
β(she's here!! π) - 1.40 β
β - 1.50 β
β - 3.30 β
β - 4.00 β
β - 4.10 β
β - 4.20 β
β - 4.30 β
β - 4.40 β
β - 4.50 β
β
texelFetchOffset (gsampler2DRect)
- 1.10 β
- - 1.20 β
- - 1.30 β
- - 1.40 β
β(rect said hi in 1.40 π) - 1.50 β
β - 3.30 β
β - 4.00 β
β - 4.10 β
β - 4.20 β
β - 4.30 β
β - 4.40 β
β - 4.50 β
β
texelFetchOffset (gsampler2DMS, gsampler2DMSArray)
- 1.10 β
- - 1.20 β
- - 1.30 β
- - 1.40 β
- - 1.50 β
β(the multisample girlies arrived in 1.50 π«Ά) - 3.30 β
β - 4.00 β
β - 4.10 β
β - 4.20 β
β - 4.30 β
β - 4.40 β
β - 4.50 β
β
π SEE ALSO π
the whole friend group, go say hi:
texelFetch()texture()textureGather()textureGatherOffset()textureGatherOffsets()textureGrad()textureGradOffset()textureLod()textureLodOffset()textureOffset()textureProj()textureProjGrad()textureProjGradOffset()textureProjLod()textureProjLodOffset()textureProjOffset()textureQueryLod()textureSize()
π COPYRIGHT π
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. http://opencontent.org/openpub/.
Copyright Β© 2011-2014 Khronos Group
and that's the page bestie!! πβ¨ the source is [FIXME: source] (iconic placeholder behavior) and the date on this baddie is 01/03/2018. slay, go fetch some texels, and remember: constant expression, or it's over. ππ
π¦ where this page comes from
- ubuntu jammy: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- ubuntu noble: opengl-4-man-doc 1.0~svn33624-1 Β· SGI-Free-Software-B-License-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms