TEXTUREPROJGRADOFFSE(3G)
π textureProjGradOffset β the TEXTUREPROJGRADOFFSE(3G) glow-up π
okay bestie, sit down, hydrate, because we're doing a texture lookup with projection, explicit gradients AND an offset all at once. it's giving "overachiever" and honestly? we love that for us. π¦
β¨ NAME β¨
textureProjGradOffset β perform a texture lookup with projection, explicit gradients and offset π
πΈ DECLARATION πΈ
here's the whole lineup, exactly as it is, no notes, no edits, periodt:
gvec4 textureProjGradOffset(gsampler1D sampler, vec2 P, float dPdx,
float dPdy, int offset);
gvec4 textureProjGradOffset(gsampler1D sampler, vec4 P, float dPdx,
float dPdy, int offset);
gvec4 textureProjGradOffset(gsampler2D sampler, vec3 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
gvec4 textureProjGradOffset(gsampler2D sampler, vec4 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
gvec4 textureProjGradOffset(gsampler3D sampler, vec4 P, vec3 dPdx,
vec3 dPdy, ivec3 offset);
float textureProjGradOffset(sampler1DShadow sampler, vec4 P, float dPdx,
float dPdy, int offset);
float textureProjGradOffset(sampler2DShadow sampler, vec4 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
gvec4 textureProjGradOffset(gsampler2DRect sampler, vec3 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
gvec4 textureProjGradOffset(gsampler2DRect sampler, vec4 P, vec2 dPdx,
vec2 dPdy, ivec2 offset);
float textureProjGradOffset(gsampler2DRectShadow sampler, vec4 P,
vec2 dPdx, vec2 dPdy, ivec2 offset);
look at all those overloads. main character energy, every single one. π
π PARAMETERS π
samplerβ the sampler your texture is bound to, aka the one we're pulling texels out of. it's the plug. πPβ the texture coordinates where the sampling is gonna happen. the "where we at" of it all.dPdxβ the partial derivative ofPwith respect to window x. yes, a real math thing, we're doing calculus at the function call, slay. β¨dPdyβ the partial derivative ofPwith respect to window y. same vibe, other axis. πoffsetβ the offsets, in texels, at which the texture gets sampled relative to the projection ofP. so it'sP's projection but shifted, lowkey. π
π«Ά DESCRIPTION π«Ά
textureProjGradOffset does a texture lookup with projection and explicit gradients and offsets. all three. at once. iconic.
here's the tea on the projection part: the texture coordinates taken from P β not including the last component of P β get divided by the last component of P. that's the whole projection moment. β¨
then, in the shadow forms, the resulting 3rd component of P gets used as Dref.
and after all those values are computed? the lookup just proceeds like it does in textureGradOffset(), handing over dPdx and dPdy as the gradients, and offset as the offset. so basically: do the projection, then let textureGradOffset() cook. π₯
π VERSION SUPPORT π
here's the vibe check across every GLSL version, bestie. no table, just receipts. π
textureProjGradOffset
- GLSL
1.10β-(not invited π) - GLSL
1.20β-(still not invited π) - GLSL
1.30β β - GLSL
1.40β β - GLSL
1.50β β - GLSL
3.30β β - GLSL
4.00β β - GLSL
4.10β β - GLSL
4.20β β - GLSL
4.30β β - GLSL
4.40β β - GLSL
4.50β β
textureProjGradOffset (gsampler2DRect{Shadow})
- GLSL
1.10β-π - GLSL
1.20β-π - GLSL
1.30β-π - GLSL
1.40β β - GLSL
1.50β β - GLSL
3.30β β - GLSL
4.00β β - GLSL
4.10β β - GLSL
4.20β β - GLSL
4.30β β - GLSL
4.40β β - GLSL
4.50β β
so the Rect shadow version is a little late to the party (arrives at 1.40, fashionably, as always π
) while the main one showed up at 1.30 and never left. obsessed.
π¦ SEE ALSO π¦
the whole friend group, go say hi:
texelFetch()texelFetchOffset()texture()textureGather()textureGatherOffset()textureGatherOffsets()textureGrad()textureGradOffset()textureLod()textureLodOffset()textureOffset()textureProj()textureProjGrad()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
okay so full disclosure: the man page header spells itTEXTUREPROJGRADOFFSEand the footer says[FIXME: source]and01/03/2018, and I'm not gonna pretend that's not a whole mood. the title ate, the typo ate, we move. π
and that's the page, bestie. [FIXME: source] β 01/03/2018, straight from the TEXTUREPROJGRADOFFSE(3G) zone. go sample something gorgeous. π§β¨
π¦ 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