TEXTUREPROJLOD(3G)

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

πŸ’– textureProjLod β€” the projected texture lookup with explicit LOD, bestie πŸ’–

okay so this is a page from the 3G manual, and honestly? it's a whole vibe. it's the textureProjLod era of your shader life and we're gonna get through it together, no cap ✨


🌸 NAME 🌸

textureProjLod β€” perform a texture lookup with projection and explicit level-of-detail

like, you're sampling a texture, but you're also projecting, and you're telling it which LOD to use instead of letting it guess. main character behavior tbh πŸ‘‘


πŸŽ€ DECLARATION πŸŽ€

the whole squad of overloads, verbatim, don't touch a single character:

gvec4 textureProjLod(gsampler1D sampler, vec2 P, float lod);

gvec4 textureProjLod(gsampler1D sampler, vec4 P, float lod);

gvec4 textureProjLod(gsampler2D sampler, vec3 P, float lod);

gvec4 textureProjLod(gsampler2D sampler, vec4 P, float lod);

gvec4 textureProjLod(gsampler3D sampler, vec4 P, float lod);

float textureProjLod(sampler1DShadow sampler, vec4 P, float lod);

float textureProjLod(sampler2DShadow sampler, vec4 P, float lod);

seven of them. seven little icons. and every single one ate πŸ’…


πŸ¦‹ PARAMETERS πŸ¦‹

  • sampler β€” the sampler that's got the texture you're pulling texels out of all bound up in it. it's the plug, fr.
  • P β€” the texture coordinates where the sampling is gonna happen. where we're looking, bestie.
  • lod β€” the explicit level-of-detail you're fetching texels from. you're not asking the universe to pick, you're picking. assertive. love that for you.

✨ DESCRIPTION ✨

so textureProjLod does a texture lookup with projection, and it does it from an explicitly specified level-of-detail. key words: explicitly specified. no guessing games πŸ’€

here's the tea on the math, and it's lowkey the whole plot twist:

  • the texture coordinates consumed from P β€” and note that this is not including the last component of P β€” get divided by the last component of P. that's the projection, that's the move 🫢
  • the resulting 3rd component of P in the shadow forms is used as Dref. yes, shadow forms get a Dref out of it. that's just what happens.
  • once all that's computed, the texture lookup proceeds as in textureLod(), with lod used to specify the level-of-detail from which the texture will be sampled.

so: divide, get your Dref if you're shadow-coded, then hand it off to the textureLod() pipeline like a relay baton. iconic 🌈


⭐ VERSION SUPPORT ⭐

the original page ships this as a big grid, and we are not losing a single cell of it. here's the whole thing, version by version, for textureProjLod:

  • OpenGL Shading Language Version 1.10 β€” - (nope, not yet πŸ™ˆ)
  • OpenGL Shading Language Version 1.20 β€” - (still nope πŸ™ˆ)
  • OpenGL Shading Language Version 1.30 β€” βœ” (it's here!! πŸŽ‰)
  • OpenGL Shading Language Version 1.40 β€” βœ”
  • OpenGL Shading Language Version 1.50 β€” βœ”
  • OpenGL Shading Language Version 3.30 β€” βœ”
  • OpenGL Shading Language Version 4.00 β€” βœ”
  • OpenGL Shading Language Version 4.10 β€” βœ”
  • OpenGL Shading Language Version 4.20 β€” βœ”
  • OpenGL Shading Language Version 4.30 β€” βœ”
  • OpenGL Shading Language Version 4.40 β€” βœ”
  • OpenGL Shading Language Version 4.50 β€” βœ”

so basically it showed up in 1.30 and never left. loyal. committed. that's a bestie πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, they're all in the group chat:

texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(), textureGatherOffsets(), textureGrad(), textureGradOffset(), textureLod(), textureLodOffset(), textureOffset(), textureProj(), textureProjGrad(), textureProjGradOffset(), 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


aaaand that's the page, bestie πŸŽ€ source was marked [FIXME: source], dated 01/03/2018, and the whole thing lives under the 3G manual. go project something gorgeous. mwah πŸ’…πŸŒΈ

πŸ“¦ where this page comes from