TEXTUREPROJOFFSET(3G)
β¨ TEXTUREPROJOFFSET β¨
okay bestie, pull up a chair, we're doing the 3G manual page for textureProjOffset and honestly? it's giving math but make it cute. it does a texture lookup with projection and an offset. two things. at once. iconic behavior fr fr π
πΈ NAME πΈ
textureProjOffset β perform a texture lookup with projection and offset π¦
π DECLARATION π
here's the whole cast list, no cap. copy these exactly, bestie, don't get creative:
gvec4 textureProjOffset(gsampler1D sampler, vec2 P, int offset,
[float bias]);
gvec4 textureProjOffset(gsampler1D sampler, vec4 P, int offset,
[float bias]);
gvec4 textureProjOffset(gsampler2D sampler, vec3 P, ivec2 offset,
[float bias]);
gvec4 textureProjOffset(gsampler2D sampler, vec4 P, ivec2 offset,
[float bias]);
gvec4 textureProjOffset(gsampler3D sampler, vec4 P, ivec3 offset,
[float bias]);
float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset,
[float bias]);
float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset,
[float bias]);
gvec4 textureProjOffset(gsampler2DRect sampler, vec3 P, ivec2 offset);
gvec4 textureProjOffset(gsampler2DRect sampler, vec4 P, ivec2 offset);
float textureProjOffset(gsampler2DRectShadow sampler, vec4 P,
ivec2 offset);
see how the 2DRect girlies don't get a bias? yeah. noted. π
π PARAMETERS π
samplerβ the sampler your texture is bound to. like, the one the texels are gonna be retrieved from. she's the source of truth, periodt.Pβ the texture coordinates where the sampling is gonna happen. the where, basically.offsetβ the offset that gets applied toPbefore sampling goes down. yes, before. that's the whole point of the function, bestie.biasβ an optional little bias that gets applied while the level-of-detail computation is happening. optional. she's invited but she doesn't have to come.
π DESCRIPTION π
okay so textureProjOffset does a texture lookup with projection. here's the tea:
the texture coordinates consumed from P β and we're not including the last component of P here β get divided by the last component of P. classic projection move, we love a divide π«
then, in the shadow forms, that resulting 3rd component of P is used as Dref. (yes, Dref. the drama component.)
after all that math is computed, the texture lookup proceeds exactly like it does in textureOffset(), with the offset being used to offset the computed texture coordinates. so it's like textureOffset() but the coordinates did a little glow-up first. slay. π¦
β VERSION SUPPORT β
vibe check on who's allowed to use this, by OpenGL Shading Language Version:
textureProjOffset
- 1.10 β
-π - 1.20 β
-π - 1.30 β β
- 1.40 β β
- 1.50 β β
- 3.30 β β
- 4.00 β β
- 4.10 β β
- 4.20 β β
- 4.30 β β
- 4.40 β β
- 4.50 β β
textureProjOffset (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 2DRect version showed up late to the party in 1.40. fashionably late. we respect it. β¨
π«Ά SEE ALSO π«Ά
the whole friend group, go say hi:
texelFetch(), texelFetchOffset(), texture(), textureGather(), textureGatherOffset(), textureGatherOffsets(), textureGrad(), textureGradOffset(), textureLod(), textureLodOffset(), textureOffset(), textureProj(), textureProjGrad(), textureProjGradOffset(), textureProjLod(), textureProjLodOffset(), 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
okay that's the whole page, you ate that π
this one's from the [FIXME: source], dated 01/03/2018, and it lives under the TEXTUREPROJOFFSET(3G) banner β so if you ever need to cite it, that's the receipts. mwah π no cap.
π¦ 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