ANY(3G)
β¨ ANY(3G) β¨
okay bestie, welcome to any(3G) π
this is the manual page for the GLSL function any, and no cap, it's one of the most useful lil glow-ups in your shader toolbox. let's get into it π«Ά
πΈ NAME πΈ
any β check whether any element of a boolean vector is true π
π DECLARATION π
bool any(bvec x);
π PARAMETERS π
xβ the vector you're testing for truth, bestie. it's giving "show me what you got" energy π
β¨ DESCRIPTION β¨
any returns true if any element of x is true, and false otherwise. that's it. that's the whole vibe. π
it is functionally equivalent to this, fr fr:
bool any(bvec x) { // bvec can be bvec2, bvec3 or bvec4
bool result = false;
int i;
for (i = 0; i < x.length(); ++i) {
result |= x[i];
}
return result;
}
so like, it just walks the whole vector and ORs everything together until something hits true and the result is locked in π₯ note that bvec can be bvec2, bvec3 or bvec4 β pick your fighter π¦
π VERSION SUPPORT π
any is supported in literally every OpenGL Shading Language version listed here, and it's a full sweep, no notes πβ¨
- Function name:
any - OpenGL Shading Language versions:
1.10,1.20,1.30,1.40,1.50,3.30,4.00,4.10,4.20,4.30,4.40,4.50 - Support: β in all twelve. every single one. iconic behavior π
π SEE ALSO π
all()not()
go read those too, they're the friend group π«Ά
π 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 π
Copyright Β© 2011-2014 Khronos Group
aaaand that's the page bestie π
this was [FIXME: source], dated 01/03/2018, and the manual section is ANY(3G) β anyway, go forth and any() responsibly, you absolute main character ππ
π¦ 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