TEXTUREGRADOFFSET(3G)
π TEXTUREGRADOFFSET π
okay so bestie, this is the TEXTUREGRADOFFSET(3G) page β a whole manual page about one (1) GLSL function and honestly? she's serving. grab a snack, we're doing texture lookups with explicit gradients and an offset. no cap. π«Ά
β¨ NAME β¨
textureGradOffset β perform a texture lookup with explicit gradients and offset.
that's it. that's the whole job. iconic behavior. π
π DECLARATION π
okay so there are literally twelve overloads and every single one of them is here, verbatim, do not come for me:
gvec4 textureGradOffset(gsampler1D sampler, float P, float dPdx,
float dPdy, int offset);
gvec4 textureGradOffset(gsampler2D sampler, vec2 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
gvec4 textureGradOffset(gsampler3D sampler, vec3 P, vec3 dPdx,
vec3 dPdy, ivec3 offset);
gvec4 textureGradOffset(gsampler2DRect sampler, vec2 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
float textureGradOffset(gsampler2DRectShadow sampler, vec3 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
float textureGradOffset(sampler1DShadow sampler, vec3 P, float dPdx,
float dPdy, int offset);
float textureGradOffset(sampler2DShadow sampler, vec3 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
gvec4 textureGradOffset(gsampler1DArray sampler, vec2 P, float dPdx,
float dPdy, int offset);
gvec4 textureGradOffset(gsampler2DArray sampler, vec3 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
float textureGradOffset(sampler1DArrayShadow sampler, vec3 P,
float dPdx, float dPdy, int offset);
float textureGradOffset(sampler2DArrayShadow sampler, vec3 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
slay. π
πΈ PARAMETERS πΈ
samplerβ the sampler you're working with. it's the thing the texture you're pulling texels out of is bound to, so likeβ¦ pick the right one bestie. πPβ the texture coordinates where the sampling happens. this is where you're pointing.dPdxβ the partial derivative ofPwith respect to window x. yes, a real derivative. math class showed up. πdPdyβ the partial derivative ofPwith respect to window y. same energy, other axis.offsetβ the offset that gets applied to the texture coordinates before sampling. so it moves first, then the lookup happens. important order, don't skip it. π
π¦ DESCRIPTION π¦
textureGradOffset does a texture lookup at coordinate P, pulling from the texture bound to sampler, and it uses explicit texture coordinate gradients β the ones you hand it in dPdx and dPdy. so no automatic derivative nonsense, you're the main character here, you supply them. β¨
you also pass an explicit offset in offset. so this function is basically two vibes in a trench coat: it takes dPdx and dPdy exactly the way textureGrad() does, and it takes offset exactly the way textureOffset() does. that's the whole concept. two functions, one function. the way that it just combines them. π₯
π VERSION SUPPORT π
here's the receipts, broken out so you can actually read them (the original is a big grid and I love her but a girl needs a list):
textureGradOffsetβ1.10-,1.20-,1.30β,1.40β,1.50β,3.30β,4.00β,4.10β,4.20β,4.30β,4.40β,4.50βtextureGradOffset(gsampler2DRect{Shadow}) β1.10-,1.20-,1.30-,1.40β,1.50β,3.30β,4.00β,4.10β,4.20β,4.30β,4.40β,4.50β
so like, the 2DRect shadow variant didn't show up until 1.40, and the base one landed in 1.30. 1.10 and 1.20 are giving nothing for this function. π
π SEE ALSO π
your homework, bestie, all of it:
texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(), textureGatherOffsets(), textureGrad(), textureLod(), textureLodOffset(), textureOffset(), textureProj(), textureProjGrad(), textureProjGradOffset(), textureProjLod(), textureProjLodOffset(), textureProjOffset(), textureQueryLod(), textureSize()
iykyk. π§
π 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/.
and again, because the page says it twice and I respect the bit:
Copyright Β© 2011-2014 Khronos Group
okay that's the page!! π one last thing for the sign-off: this came out of [FIXME: source], dated 01/03/2018, and it's the TEXTUREGRADOFFSET(3G) page. take care of her, she's been through a lot of overloads. 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