SMOOTHSTEP(3G)
β¨ SMOOTHSTEP β¨ (a 3G moment, bestie)
okay so real talk, this is the manual page for smoothstep, and it lives in section 3G of the manual. she's a GLSL girlie, she's iconic, and she's about to make your thresholds look β¨expensiveβ¨.
πΈ NAME πΈ
smoothstep β perform Hermite interpolation between two values
π DECLARATION π
like, here's the whole lineup, copy-paste ready:
genType smoothstep(genType edge0, genType edge1, genType x);
genType smoothstep(float edge0, float edge1, genType x);
genDType smoothstep(genDType edge0, genDType edge1, genDType x);
genDType smoothstep(double edge0, double edge1, genDType x);
π¦ PARAMETERS π¦
edge0β the value of the lower edge of the Hermite function. the bottom of the vibe window π«Άedge1β the value of the upper edge of the Hermite function. the top of the vibe window πxβ the source value you're interpolating from. the main character of the equation, no cap π
π DESCRIPTION π
okay so smoothstep does smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. literally the moment when your value is chillin' inside the window and she hands you a buttery-smooth number instead of a harsh jump. this is the serve when you want a threshold function with a smooth transition β no jagged edges, only vibes π
smoothstep is equivalent to exactly this, and I mean exactly:
genType t; /* Or genDType t; */
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
π¨ warning, bestie, this one matters: results are undefined if edge0 β₯ edge1. like, don't do it. she will not save you. that's a chaos moment, not a slay moment π
π VERSION SUPPORT π
the table didn't survive the glow-up (no tables in this chat, sorry π₯Ί) but every single cell did, i promise. β means she's supported, - means she isn't there yet.
smoothstep (genType) β across OpenGL Shading Language Version 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50:
1.10β-1.20β-1.30ββ1.40ββ1.50ββ3.30ββ4.00ββ4.10ββ4.20ββ4.30ββ4.40ββ4.50ββ
smoothstep (genDType) β same twelve versions, same order:
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 like, genType showed up in 1.30 and genDType was fashionably late to the party in 4.00. we respect the journey πβ¨
π₯ SEE ALSO π₯
mix()step()
go read those too, they're her sisters and they also ate π
π 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!! π source situation is the ever-mysterious [FIXME: source], dated 01/03/2018, and this whole thing is filed under SMOOTHSTEP(3G) β go forth and interpolate smoothly, ily π«Άπβ¨
π¦ 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