FWIDTH(3G)

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

πŸ’… FWIDTH πŸ’… (section 3G, she's giving graphics-shader realness)

okay so bestie, gather round, because today we're talking about fwidth from manual section 3G. yes the manual name is right there in the title, we're not copying the whole header line, we're just vibing. periodt. ✨


🌸 NAME 🌸

fwidth β€” return the sum of the absolute value of derivatives in x and y

like, it's a derivative-summing girlie and she's built different, no cap πŸ’–


πŸŽ€ DECLARATION πŸŽ€

here's exactly what she looks like when you summon her, copy these character for character bestie:

genType fwidth(genType p);

genType fwidthCoarse(genType p);

genType fwidthFine(genType p);

three flavors. one iconic family. obsessed πŸ¦‹


🌈 PARAMETERS 🌈

  • p β€” the expression you wanna take the partial derivative of. that's it, that's the whole assignment. she's the input, you're the one deciding what gets differentiated πŸ’œ

✨ DESCRIPTION ✨

okay so here's the tea β˜• β€” these functions are available only in the fragment shader. like, fragment shader only, don't try her anywhere else, she will not show up. πŸ™ˆ

what they do: they return the sum of the absolute derivatives in x and y, using local differencing, for the input argument p.

and here's the equivalence breakdown, because the way that these are literally just other functions added together is so satisfying:

  • fwidth is equivalent to abs(dFdx(p)) + abs(dFdy(p))
  • fwidthCoarse is equivalent to abs(dFdxCoarse(p)) + abs(dFdyCoarse(p))
  • fwidthFine is equivalent to abs(dFdxFine(p)) + abs(dFdyFine(p))

see? abs + abs. she's an absolute value girlie twice over and honestly? slay. πŸ”₯


πŸ‘‘ VERSION SUPPORT πŸ‘‘

the glow-up timeline, aka which OpenGL Shading Language Version said "yes queen" to each function. βœ”οΈ means she ate, - means she wasn't invited yet πŸ’€

🧚 fwidth

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

she's been here since the beginning and she's never leaving. main character energy fr fr 🌟

πŸ¦‹ fwidthCoarse, fwidthFine

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

ngl the coarse/fine duo showed up fashionably late β€” literally nothing until 4.50 and then bam, both of them at once. iconic entrance honestly πŸŽ€


πŸ’– SEE ALSO πŸ’–

  • dFdx()

(go say hi, she's the whole reason fwidth works the way she does. iykyk 🫢)


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 πŸ’… the source is [FIXME: source], the date on it is 01/03/2018, and it belongs to manual section 3G. we love a slightly-unfinished source tag, she's got mystery, she's got aura 🌸 bye pookie, go call dFdx() πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from