TEXELFETCHOFFSET(3G)

πŸ“¦
version 1.0~svn33624 Β· 4 versions
, in ubuntu jammy, ubuntu noble

✨ 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 to P before 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 Β© 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