TEXTUREGATHER(3G)

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

✨ 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 invited
  • 1.20 β€” ❌ not invited
  • 1.30 β€” ❌ not invited
  • 1.40 β€” ❌ not invited
  • 1.50 β€” ❌ not invited
  • 3.30 β€” ❌ not invited
  • 4.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 Β© 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