TEXTUREGATHEROFFSETS(3G)
π TEXTUREGATHEROFFSETS π
okay bestie, so this is the textureGatherOffsets page from section 3G of the manual β like, the OpenGL Shading Language function pages. It's giving very much "grab four texels at once, but with YOUR OWN custom offsets". Let's get into it π¦
β¨ NAME β¨
textureGatherOffsets β gathers four texels from a texture with an array of offsets π
π DECLARATION π
no cap, here's exactly how you call her:
gvec4 textureGatherOffsets(gsampler2D sampler, vec2 P, ivec2 offsets[4],
[int comp]);
gvec4 textureGatherOffsets(gsampler2DArray sampler, vec3 P,
ivec2 offsets[4], [int comp]);
gvec4 textureGatherOffsets(gsampler2DRect sampler, vec3 P,
ivec2 offsets[4], [int comp]);
vec4 textureGatherOffsets(gsampler2DShadow sampler, vec2 P, float refZ,
ivec2 offsets[4]);
vec4 textureGatherOffsets(gsampler2DArrayShadow sampler, vec3 P,
float refZ, ivec2 offsets[4]);
vec4 textureGatherOffsets(gsampler2DRectShadow sampler, vec3 P,
float refZ, ivec2 offsets[4]);
πΈ PARAMETERS πΈ
samplerβ the sampler your texture is bound to, aka the thing we're stealing texels out of π«ΆPβ the texture coordinates where the sampling happens. your little address in texture-space β¨compβ which component of the source texture gets used to build the resulting vector. pick your fighter πrefZβ the reference Z value that the comparison uses in the shadow forms. yes ma'am, comparison time πoffsetsβ an array of offsets from the texture coordinateP, and these are the spots we gather the texels from. literally a lil lineup of coordinates π
π DESCRIPTION π
okay so textureGatherOffsets operates identically to textureGatherOffset(), EXCEPT β and this is the whole main character moment β offsets is what decides where the four texels get sampled from. π
Each of the four texels comes from taking the offset in offsets, applying it as a (u, v) coordinate offset to P, finding the four-texel GL_LINEAR footprint that lands on, and then selecting texel i0i0 of that footprint. Four offsets, four texels, one function. iconic behavior fr fr π
β οΈ heads up bestie: the values you put in offsets must be set with constant integral expressions. not vibes, not runtime math. constant. integral. expressions. periodt.
π VERSION SUPPORT π
so textureGatherOffsets rolled up in OpenGL Shading Language version 4.00 and has been eating ever since. here's the whole timeline, no skipping:
- OpenGL Shading Language 1.10 β
-(not here yet π) - OpenGL Shading Language 1.20 β
- - OpenGL Shading Language 1.30 β
- - OpenGL Shading Language 1.40 β
- - OpenGL Shading Language 1.50 β
- - OpenGL Shading Language 3.30 β
- - OpenGL Shading Language 4.00 β β present and thriving β¨
- OpenGL Shading Language 4.10 β β
- OpenGL Shading Language 4.20 β β
- OpenGL Shading Language 4.30 β β
- OpenGL Shading Language 4.40 β β
- OpenGL Shading Language 4.50 β β
π¦ SEE ALSO π¦
the whole friend group, go say hi π
texelFetch()texelFetchOffset()texture()textureGather()textureGatherOffset()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 whole page bestie!! this lil cutie came from [FIXME: source] and the date on it is 01/03/2018, and it lives in section 3G as TEXTUREGATHEROFFSETS. mwah, go gather some texels πβ¨
π¦ 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