TEXTUREGATHER(3G)
β¨ NAME β¨
textureGather β gathers four texels from a texture π§ (this is the 3G manual page, so like, GLSL shader function territory, iykyk)
π DECLARATION π
okay bestie, here's the whole roster, every single overload, no skips:
gvec4 textureGather(gsampler2D sampler, vec2 P, [int comp]);
gvec4 textureGather(gsampler2DArray sampler, vec3 P, [int comp]);
gvec4 textureGather(gsamplerCube sampler, vec3 P, [int comp]);
gvec4 textureGather(gsamplerCubeArray sampler, vec4 P, [int comp]);
gvec4 textureGather(gsampler2DRect sampler, vec3 P, [int comp]);
vec4 textureGather(gsampler2DShadow sampler, vec2 P, float refZ);
vec4 textureGather(gsampler2DArrayShadow sampler, vec3 P, float refZ);
vec4 textureGather(gsamplerCubeShadow sampler, vec3 P, float refZ);
vec4 textureGather(gsamplerCubeArrayShadow sampler, vec4 P, float refZ);
vec4 textureGather(gsampler2DRectShadow sampler, vec3 P, float refZ);
πΈ PARAMETERS πΈ
samplerβ the sampler that the texture you're stealing texels from is bound to. it's giving "who am I even sampling" energy πPβ the texture coordinates, like the spot where the sampling happens. the coordinates, periodt.compβ which component of the source texture gets used to build the resulting vector. pick your fighter πrefZβ the reference Z value, used for the comparison in the shadow forms. only shows up for the shadow girlies.
π DESCRIPTION π
so textureGather returns this value, verbatim, no cap:
vec4(Sample_i0_j1(P, base).comp,
Sample_i1_j1(P, base).comp,
Sample_i1_j0(P, base).comp,
Sample_i0_j1(P, base).comp);
If comp is specified, its value must be a constant integer expression with a value of 0, 1, 2, or 3 β identifying the x, y, z or w component of the four-component vector lookup result for each texel, respectively. (Yes, that's x, y, z, w in order, bestie, matching 0, 1, 2, 3 π«Ά)
If comp is not specified, it gets treated as 0, which selects the x component of each texel to generate the result. default behaviour, love that for you β¨
π VERSION SUPPORT π
which OpenGL Shading Language versions let textureGather in the club? here's the vibe check on the function named textureGather:
1.10β β not invited1.20β β not invited1.30β β not invited1.40β β not invited1.50β β not invited3.30β β not invited4.00β βοΈ she's here π4.10β βοΈ4.20β βοΈ4.30β βοΈ4.40β βοΈ4.50β βοΈ
so from 4.00 onward it's main character energy π
π¦ SEE ALSO π¦
the whole friend group, go read these too:
texelFetch(), texelFetchOffset(), texture(), 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 whole page, bestie π₯Ή this came from the [FIXME: source] and it's dated 01/03/2018 β so if you ever need to cite it, that's the receipt. mwah π
β¨
π¦ 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