INTERPOLATEATSAMPLE(3G)
π interpolateAtSample (3G) β the manual page, but make it make sense
okay bestie, gather round, because we're talking about interpolateAtSample from the 3G manual section β yes, the GLSL one, the one that lets you grab a varying at one specific sample's location instead of just vibing at the pixel center. it's giving precision. it's giving β¨multisampleβ¨.
β¨ NAME β¨
interpolateAtSample β sample a varying at the location of a specified sample π
π DECLARATION π
the glow-up comes in four flavors, one per vector size. all of them, exactly as written:
float interpolateAtSample(float interpolant, int sample);
vec2 interpolateAtSample(vec2 interpolant, int sample);
vec3 interpolateAtSample(vec3 interpolant, int sample);
vec4 interpolateAtSample(vec4 interpolant, int sample);
π«Ά PARAMETERS π«Ά
interpolantβ the varying you want sampled. like, this is the thing getting evaluated, at the location of samplesample.sampleβ the index of the sample whose location is gonna be used to sampleinterpolant. you're basically pointing at a sample and going "her. use her location. π "
π DESCRIPTION π
so here's the tea: interpolateAtSample returns the value of the input varying interpolant, sampled at the location of sample number sample. that's it, that's the whole vibe. π¦
but wait β if multisample buffers are not available, the input varying gets evaluated at the center of the pixel instead. no samples, no problem, you just get the middle.
and if sample sample does not exist? π the position used to interpolate the input varying is undefined. not a typo, not a glitch β genuinely undefined. do not pass a sample index that isn't real, bestie, that's not a vibe check you want to fail.
π VERSION SUPPORT π
here's the "is this even available in my GLSL version" breakdown, because nobody wants to be caught out here. this is interpolateAtSample's whole support story, every single version listed:
1.10β-(nope, not here)1.20β-1.30β-1.40β-1.50β-3.30β-4.00ββ(she arrived π )4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ
so like, everything from 4.00 onward is a yes, and everything before is a hard no. the function is literally the main character starting at 4.00. periodt. π
π SEE ALSO π
your girl does not exist in a vacuum, go check her sisters:
interpolateAtCentroid()interpolateAtOffset()
iykyk π§
Β©οΈ 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 (again, yes, for real) Β©οΈ
Copyright Β© 2011-2014 Khronos Group
and that's the page, bestie π this was pulled from [FIXME: source], dated 01/03/2018, and yeah, it's still INTERPOLATEATSAMPLE(3G) at the end of the day π kthanksbye, go interpolate 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