ANY(3G)

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

✨ 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 Β© 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


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