TEXTUREPROJLOD(3G)
π 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 ofPβ get divided by the last component ofP. that's the projection, that's the move π«Ά - the resulting 3rd component of
Pin the shadow forms is used asDref. 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(), withlodused 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 π
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
- 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