TEXTUREPROJGRAD(3G)

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

πŸ’– 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 of P with respect to window x. yes girl, calculus. we're doing calculus.
  • dPdy β€” the partial derivative of P with 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 Β© 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