TEXTUREPROJGRAD(3G)
π TEXTUREPROJGRAD(3G) π
okay bestie, welcome to textureProjGrad β it lives in the 3G section of the manual (the [FIXME: manual] one, yes, we're all doing our best here π«Ά), and it is exactly what it sounds like: a texture lookup, but with projection AND you hand it the gradients yourself. main character energy fr fr.
β¨ NAME β¨
textureProjGrad β perform a texture lookup with projection and explicit gradients π
πΈ DECLARATION πΈ
here's the whole roster, no cap, copied verbatim so you don't have to squint at the spec:
gvec4 textureProjGrad(gsampler1D sampler, vec2 P, float pDx, float pDy);
gvec4 textureProjGrad(gsampler1D sampler, vec4 P, float pDx, float pDy);
gvec4 textureProjGrad(gsampler2D sampler, vec3 P, vec2 pDx, vec2 pDy);
gvec4 textureProjGrad(gsampler2D sampler, vec4 P, vec2 pDx, vec2 pDy);
gvec4 textureProjGrad(gsampler3D sampler, vec4 P, vec3 pDx, vec3 pDy);
float textureProjGrad(sampler1DShadow sampler, vec4 P, float pDx,
float pDy);
float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 pDx,
vec2 pDy);
gvec4 textureProjGrad(gsampler2DRect sampler, vec3 P, vec2 pDx,
vec2 pDy);
gvec4 textureProjGrad(gsampler2DRect sampler, vec4 P, vec2 pDx,
vec2 pDy);
float textureProjGrad(gsampler2DRectShadow sampler, vec4 P, vec2 pDx,
vec2 pDy);
like, ten whole overloads. she's versatile. π
π PARAMETERS π
samplerβ the sampler your texture is bound to, aka where the texels are coming from. she's the plug. πPβ the texture coordinates where we're sampling. the "where tho" of the whole operation.dPdxβ the partial derivative ofPwith respect to window x. yes girl, calculus. we're doing calculus.dPdyβ the partial derivative ofPwith respect to window y. the sibling. the other axis. iconic duo. β¨
π¦ DESCRIPTION π¦
so textureProjGrad does a texture lookup with projection and explicit gradients. two things at once, multitasking queen.
the way it works: the texture coordinates consumed from P β and not including the last component of P, mind you β get divided by the last component of P. classic projection behaviour, we love her.
then, for the shadow forms, that resulting 3rd component of P gets used as Dref. π
once all of that is computed, the lookup just proceeds exactly like textureGrad(), and you pass dPdx and dPdy in as the gradients. that's it. that's the whole vibe. periodt.
π VERSION SUPPORT π
the original was a big fancy table (rip tables, you were so grid-shaped), so here it is as a glow-up list. the columns were the OpenGL Shading Language Version, going 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50 β in that order, bestie:
textureProjGradβ1.10β,1.20β,1.30β,1.40β,1.50β,3.30β,4.00β,4.10β,4.20β,4.30β,4.40β,4.50βtextureProjGrad(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 the rect-shadow flavour showed up late to the party (hi 1.40 π) and the regular one has been here since 1.30. glow-ups all around.
π SEE ALSO π
your homework, bestie β all of these, exactly as written:
texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(), textureGatherOffsets(), textureGrad(), textureGradOffset(), textureLod(), textureLodOffset(), textureOffset(), textureProj(), 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/.
and, once more with feeling (the original literally prints it twice, so we do too, no skipping π«Ά):
Copyright Β© 2011-2014 Khronos Group
okay that's the whole page, you ate that. mwah. π β¨
cute little sign-off: this came from the [FIXME: source] of the TEXTUREPROJGRAD(3G) manual, dated 01/03/2018. stan Khronos. bye bestie π¦π
π¦ 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