MOD(3G)
π MOD(3G) β the mod() glow-up π
okay bestie, so this is from the 3G manual section, and it's literally all about mod β computing the value of one parameter modulo another. yes, THE modulo. the one that makes your brain go brrr. let's get into it π¦
β¨ NAME β¨
mod β compute value of one parameter modulo another
it's giving "remainder but make it β¨floorβ¨" and we're obsessed.
π DECLARATION π
here's the full roster, no cap β every single overload, exactly as it comes:
genType mod(genType x, float y);
genType mod(genType x, genType y);
genDType mod(genDType x, double y);
genDType mod(genDType x, genDType y);
four whole signatures. main character energy fr fr π
πΈ PARAMETERS πΈ
xβ Specify the value to evaluate.
that's the vibe. you hand it x, it does the thing. periodt.
π§ DESCRIPTION π§
so mod returns the value of x modulo y. and like, the way it's actually computed is:
x - y * floor()(x/y)
not me writing it out exactly like that, because that IS exactly what the manpage says and we do not play with the math π. it's floor-based, which is why it behaves differently from a plain truncating remainder β that's the whole personality of this function, lowkey iconic.
π VERSION SUPPORT π
okay so this is the part where the original had a big sparkly table, and we're gonna keep every single crumb of it because the facts do NOT change, only the vibe does π
β mod (genType)
supported β in literally every OpenGL Shading Language version listed:
- 1.10 β
- 1.20 β
- 1.30 β
- 1.40 β
- 1.50 β
- 3.30 β
- 4.00 β
- 4.10 β
- 4.20 β
- 4.30 β
- 4.40 β
- 4.50 β
every single one. she ate and left no crumbs π
π mod (genDType)
this one's a late bloomer, no shade:
- 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, dash dash dash dash dash dash and THEN the glow-up at 4.00. we love a redemption arc π¦
π«Ά SEE ALSO π«Ά
go check out the siblings bestie, they're family:
modf()floor()
π 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!! π this was MOD(3G) from the [FIXME: source] source, dated 01/03/2018 β yeah the placeholder is still in there, we don't ask questions, we just vibe πβ¨ mwah, go forth and modulo 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