TEXELFETCH(3G)
π NAME π
okay bestie, say hi to texelFetch β she performs a lookup of a single texel within a texture. one texel. that's her whole job and she does it flawlessly π
this is page TEXELFETCH(3G) btw, so you know she's an OpenGL Shading Language girlie.
β¨ DECLARATION β¨
here's every single signature, no skips, no edits, all nine of them:
gvec4 texelFetch(gsampler1D sampler, int P, int lod);
gvec4 texelFetch(gsampler2D sampler, ivec2 P, int lod);
gvec4 texelFetch(gsampler3D sampler, ivec3 P, int lod);
gvec4 texelFetch(gsampler2DRect sampler, ivec2 P);
gvec4 texelFetch(gsampler1DArray sampler, ivec2 P, int lod);
gvec4 texelFetch(gsampler2DArray sampler, ivec3 P, int lod);
gvec4 texelFetch(gsamplerBuffer sampler, int P);
gvec4 texelFetch(gsampler2DMS sampler, ivec2 P, sample sample);
gvec4 texelFetch(gsampler2DMSArray sampler, ivec3 P, sample sample);
πΈ PARAMETERS πΈ
samplerβ this is the sampler the texture is bound to, aka the one you're pulling texels out of. you gotta tell her where the goods live π«ΆPβ the texture coordinates at which the texture will be sampled. like, the address of the texel you're obsessed with.lodβ if it's there, it specifies the level-of-detail within the texture from which the texel will be fetched. no lod, no mip levels, iykyk.sampleβ for multisampled fetches only, this specifies which sample within the texel will be returned. one texel, many samples, she picks one for you π
π DESCRIPTION π
so what does texelFetch actually do? she performs a lookup of a single texel from texture coordinate P in the texture bound to sampler. that's it, that's the whole vibe.
for the array forms, the array layer lives in the last component of P β don't forget her, she's easy to lose π
the lod parameter, if present, specifies the level-of-detail from which the texel will be fetched. and the sample specifies which sample within the texel will be returned when reading from a multi-sample texture.
π VERSION SUPPORT π
here's the β¨era timelineβ¨ of when each form of texelFetch entered the OpenGL Shading Language Version chat. β means she's there, - means she has not arrived yet.
texelFetchβ1.10:-,1.20:-,1.30:β,1.40:β,1.50:β,3.30:β,4.00:β,4.10:β,4.20:β,4.30:β,4.40:β,4.50:βtexelFetch(gsampler2DRect,gsamplerBuffer) β1.10:-,1.20:-,1.30:-,1.40:β,1.50:β,3.30:β,4.00:β,4.10:β,4.20:β,4.30:β,4.40:β,4.50:βtexelFetch(gsampler2DMS,gsampler2DMSArray) β1.10:-,1.20:-,1.30:-,1.40:-,1.50:β,3.30:β,4.00:β,4.10:β,4.20:β,4.30:β,4.40:β,4.50:β
π₯ SEE ALSO π₯
run, don't walk, to these sisters:
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 π (yes bestie, she said it twice π)
Copyright Β© 2011-2014 Khronos Group
and that's the whole page, periodt. this was[FIXME: source], dated01/03/2018, and the icon herself isTEXELFETCH(3G). go fetch some texels, you absolute main character ππβ¨
π¦ 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