TEXTURELOD(3G)
πΈ TEXTURELOD(3G) πΈ
okay bestie, sit down, hydrate, and let me tell you about textureLod from the 3G manual π
this one is so good and honestly lowkey underrated. it's giving "texture lookup but make it β¨explicitβ¨."
π NAME π
textureLod β perform a texture lookup with explicit level-of-detail
π¦ DECLARATION π¦
here's the whole lineup, no notes, exactly as written:
gvec4 textureLod(gsampler1D sampler, float P, float lod);
gvec4 textureLod(gsampler2D sampler, vec2 P, float lod);
gvec4 textureLod(gsampler3D sampler, vec3 P, float lod);
gvec4 textureLod(gsamplerCube sampler, vec3 P, float lod);
float textureLod(sampler1DShadow sampler, vec3 P, float lod);
float textureLod(sampler2DShadow sampler, vec4 P, float lod);
gvec4 textureLod(gsampler1DArray sampler, vec2 P, float lod);
gvec4 textureLod(gsampler2DArray sampler, vec3 P, float lod);
float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod);
gvec4 textureLod(gsamplerCubeArray sampler, vec4 P, float lod);
π PARAMETERS π
samplerβ the sampler that's got the texture you wanna pull texels out of. it's bound to it, bestie, that's the whole vibe. π«ΆPβ the texture coordinates where the sampling happens. where we're looking, basically. πlodβ the explicit level-of-detail. you're picking it yourself, no guessing. main character energy, honestly. π
β¨ DESCRIPTION β¨
so textureLod does a texture lookup at coordinate P, from the texture bound to sampler, and it uses an explicit level-of-detail exactly as you specified in lod. no auto-derivative nonsense, we're being decisive here. π
lod specifies Ξ»base and sets the partial derivatives as follows:
Ξ΄ u Ξ΄ x = 0 , Ξ΄ v Ξ΄ x = 0 , Ξ΄ w Ξ΄ x = 0 Ξ΄ u Ξ΄ y = 0 , Ξ΄ v Ξ΄ y = 0 , Ξ΄ w Ξ΄ y = 0
like. all zero. every single one. periodt. π
π VERSION SUPPORT π
the original had a whole table (we don't do tables here, we do lists, slay) β so here's every row, every version, every checkmark, nothing skipped:
textureLodβ 1.10:-, 1.20:-, 1.30: β, 1.40: β, 1.50: β, 3.30: β, 4.00: β, 4.10: β, 4.20: β, 4.30: β, 4.40: β, 4.50: βtextureLod(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: βtextureLod(gsamplerCubeArray) β 1.10:-, 1.20:-, 1.30:-, 1.40:-, 1.50:-, 3.30:-, 4.00: β, 4.10: β, 4.20: β, 4.30: β, 4.40: β, 4.50: β
that's OpenGL Shading Language Version, in case you were wondering what the columns were doing. π
πΈ SEE ALSO πΈ
the whole friend group, fr fr:
texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(), textureGatherOffsets(), textureGrad(), textureGradOffset(), textureLodOffset(), textureOffset(), textureProj(), textureProjGrad(), 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/.
Copyright Β© 2011-2014 Khronos Group
and that's the whole page, bestie π the source was [FIXME: source], it was dated 01/03/2018, and it lives under the TEXTURELOD(3G) header. go forth and sample with explicit LOD, you absolute icon π¦β¨
π¦ 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