MAX(3G)
β¨ 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 π
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 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
- 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