MAX(3G)

πŸ“¦
version 1.0~svn33624 Β· 4 versions
, in ubuntu jammy, ubuntu noble

✨ MAX(3G) β€” bestie edition ✨

okay so this is max, from section 3G of the manual (that's the OpenGL/GLSL corner of the world, iykyk πŸŽ€). she's a tiny function with a big heart and she only has one job: pick the bigger number. that's it. that's the whole vibe. πŸ’…


🌸 NAME 🌸

max β€” return the greater of two values


πŸ¦‹ DECLARATION πŸ¦‹

here's every single way you can call her. all of these are real, don't skip any:

genType max(genType x, genType y);

genType max(genType x, float y);

genDType max(genDType x, genDType y);

genDType max(genDType x, double y);

genIType max(genIType x, genIType y);

genIType max(genIType x, int y);

genUType max(genUType x, genUType y);

genUType max(genUType x, uint y);

like yes she's flexible, she contains multitudes, main character energy fr fr πŸ‘‘


πŸ’– PARAMETERS πŸ’–

  • x β€” the first value you wanna compare. drop it in.
  • y β€” the second value you wanna compare. drop it in too.

🌈 DESCRIPTION 🌈

so max returns the maximum of the two parameters. like, she looks at both of them and goes "okay which one of you is bigger".

and the actual rule, no cap: it returns y if y is greater than x, otherwise it returns x.

that's the whole thing. she ate and left no crumbs. ✨


πŸ‘‘ VERSION SUPPORT πŸ‘‘

not every flavor of max showed up on day one, so here's the receipts for every OpenGL Shading Language version. (the original had this in a cute lil grid β€” we're doing it as lists because tables are not the vibe here 🫢)

max (genType) πŸ’œ

  • 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 β€” βœ”

day one icon, always been there, never left πŸ’…

max (genIType) πŸ“

  • 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 β€” βœ”

showed up in 1.30 and has been thriving ever since 🌸

max (genUType) 🧚

  • 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 β€” βœ”

same glow-up timeline as her int sister, periodt ✨

max (genDType) πŸ”₯

  • 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 β€” βœ”

the double-precision girlie is the late bloomer of the group, arriving in 4.00 and absolutely slaying from there πŸ˜­πŸ’–


πŸŽ€ SEE ALSO πŸŽ€

  • min()
  • abs()

go say hi, they're all besties πŸ’œ


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 was [FIXME: source], dated 01/03/2018, and this lil manpage signs off as MAX(3G). go compare some numbers, ily, bye πŸ’…βœ¨

πŸ“¦ where this page comes from