SIGN(3G)

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

πŸ’– SIGN(3G) β€” like, the sign-extraction girlies' moment ✨

okay bestie, welcome to the sign page, section 3G of the manual (yes the manual name is literally [FIXME: manual], we love a placeholder icon πŸŽ€). This is the GLSL function that tells you which way a number is leaning. Let's get into it πŸ’…


🌸 NAME 🌸

sign β€” pull the sign out of the parameter, fr fr


✨ DECLARATION ✨

here's the whole lineup, copy-paste ready, no cap:

genType sign(genType x);

genIType sign(genIType x);

genDType sign(genDType x);

three overloads, three vibes, one function name. iconic.


🫢 PARAMETERS 🫢

  • x β€” the value you're extracting the sign from. that's it, that's the whole job. give her a number, she tells you which way it points πŸ’«

πŸ’€ DESCRIPTION πŸ’€

so here's the tea, and it's genuinely simple:

sign returns -1.0 if x is less than 0.0, 0.0 if x is equal to 0.0, and +1.0 if x is greater than 0.0.

negative, zero, positive. three moods. she's not complicated and honestly? we respect that. periodt. πŸ‘‘


🌈 VERSION SUPPORT 🌈

okay so this is the "when did GLSL start supporting me" part. The function name is on the left, and the OpenGL Shading Language Versions run across: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50. A βœ” means it's there, a - means she has NOT arrived yet, do not @ her 😭

⭐ sign (genType)

  • 1.10 β€” -
  • 1.20 β€” -
  • 1.30 β€” βœ”
  • 1.40 β€” βœ”
  • 1.50 β€” βœ”
  • 3.30 β€” βœ”
  • 4.00 β€” βœ”
  • 4.10 β€” βœ”
  • 4.20 β€” βœ”
  • 4.30 β€” βœ”
  • 4.40 β€” βœ”
  • 4.50 β€” βœ”

⭐ sign (genIType)

  • 1.10 β€” -
  • 1.20 β€” -
  • 1.30 β€” -
  • 1.40 β€” -
  • 1.50 β€” βœ”
  • 3.30 β€” βœ”
  • 4.00 β€” βœ”
  • 4.10 β€” βœ”
  • 4.20 β€” βœ”
  • 4.30 β€” βœ”
  • 4.40 β€” βœ”
  • 4.50 β€” βœ”

⭐ sign (genDType)

  • 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 genType showed up first in 1.30 like an early adopter πŸ¦‹, genIType rolled in at 1.50 🧚, and genDType was fashionably late to the party at 4.00 πŸ’… (double precision girlies, you know how it is).


πŸ‘€ SEE ALSO πŸ‘€

  • abs()

(yes, her bestie. go read that one next, they're a package deal 🫢)


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


ngl the legal girlies did their thing twice here β€” that's two whole COPYRIGHT sections, both present and accounted for, no details skipped, we keep it πŸ’―

and that's the page bestie!! source situation is [FIXME: source], the date on this one is 01/03/2018, and the whole thing signs off as SIGN(3G) β€” same as it opened. bye babe, go extract some signs responsibly πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from