TEXTUREQUERYLOD(3G)
β¨ TEXTUREQUERYLOD β¨ (3G)
okay bestie, gather round, because we're talking about textureQueryLod β a lil OpenGL shading language function that does the math of figuring out which mipmap level you'd be sampling from, without actually sampling anything. it's giving "asking the question, not answering it" π
πΈ NAME πΈ
textureQueryLod β compute the level-of-detail that would be used to sample from a texture π
π¦ DECLARATION π¦
here's the whole roster of overloads, no cap, all of them, exactly as written:
vec2 textureQueryLod(gsampler1D sampler, float P);
vec2 textureQueryLod(gsampler2D sampler, vec2 P);
vec2 textureQueryLod(gsampler3D sampler, vec3 P);
vec2 textureQueryLod(gsamplerCube sampler, vec3 P);
vec2 textureQueryLod(gsampler1DArray sampler, float P);
vec2 textureQueryLod(gsampler2DDArray sampler, vec2 P);
vec2 textureQueryLod(gsamplerCubeArray sampler, vec3 P);
vec2 textureQueryLod(gsampler1DShadow sampler, float P);
vec2 textureQueryLod(gsampler2DShadow sampler, vec2 P);
vec2 textureQueryLod(gsamplerCubeShadow sampler, vec3 P);
vec2 textureQueryLod(gsampler1DArrayShadow sampler, float P);
vec2 textureQueryLod(gsampler2DArrayShadow sampler, vec2 P);
vec2 textureQueryLod(gsamplerCubeArrayShadow sampler, vec3 P);
no i did not typo gsampler2DDArray β that's literally what it says up there, and we are keeping it exactly as is, periodt. π₯
π PARAMETERS π
samplerβ the sampler that the texture you're interrogating is bound to. like, "which texture are we gossiping about" πPβ the texture coordinates where you want the level-of-detail looked up. the where of it all π
π DESCRIPTION π
okay so this one is fragment shader only β you literally cannot use it anywhere else, and that's just the rules bestie π
textureQueryLod computes the level-of-detail that would be used to sample from a texture. it doesn't sample. it just does the vibes check on which LOD would get picked.
- the mipmap array(s) that would be accessed come back in the x component of the return value β¨
- the computed level-of-detail relative to the base level comes back in the y component π«
β οΈ and listen β if you call this on an incomplete texture, the result of the operation is undefined. undefined is not a vibe. it is a "we genuinely cannot tell you what happens" situation. don't do it. π
π VERSION SUPPORT π
so like, the original had this whole gorgeous grid of GLSL versions, and we're breaking it down by version because a table is not the format we're doing today. same facts, cuter delivery:
function name: textureQueryLod
- 1.10 β nope,
- - 1.20 β nope,
- - 1.30 β nope,
- - 1.40 β nope,
- - 1.50 β nope,
- - 3.30 β nope,
- - 4.00 β β
- 4.10 β β
- 4.20 β β
- 4.30 β β
- 4.40 β β
- 4.50 β β
so basically: she arrived in 4.00 and has been slaying ever since. before that? not a thing. β
π SEE ALSO π
the whole friend group, fr fr:
texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(), textureGatherOffsets(), textureGrad(), textureGradOffset(), textureLod(), textureLodOffset(), textureOffset(), textureProj(), textureProjGrad(), textureProjGradOffset(), textureProjLod(), textureProjLodOffset(), textureProjOffset(), 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
and that's the whole page, bestie π«Ά this was TEXTUREQUERYLOD(3G), source stamped [FIXME: source], dated 01/03/2018 β so if you need to cite her, that's the receipt. go forth and query those LODs responsibly π
β¨
π¦ 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