GLPOINTSIZE(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

πŸ’… GLPOINTSIZE(3G) β€” like, the whole entire manual page, bestie

okay so. welcome to GLPOINTSIZE(3G), the page where we learn how to make dots bigger. yes that's the whole vibe. ✨ it's a C function, it lives in the 3G manual, and it's about to be your new hyperfixation. let's go 🫢


✨ NAME ✨

glPointSize β€” specify the diameter of rasterized points 🎯

🌸 C SPECIFICATION 🌸

void glPointSize( GLfloat size )

that's it. that's the whole signature. she's simple, she's iconic πŸ’…

πŸŽ€ PARAMETERS πŸŽ€

  • size β€” Specifies the diameter of rasterized points. The initial value is 1. yep, defaults to one. baby steps 🐣

πŸ¦‹ DESCRIPTION πŸ¦‹

k so glPointSize specifies the rasterized diameter of both aliased and antialiased points. no discrimination here, she serves both πŸ’– but ngl, using a point size other than 1 has different effects depending on whether point antialiasing is enabled or not. to turn point antialiasing on and off, you call glEnable and glDisable with argument GL_POINT_SMOOTH. and heads up: point antialiasing is initially disabled. 🚫

if point antialiasing is disabled (the default, remember?), the actual size is determined by rounding the supplied size to the nearest integer. (and if the rounding results in the value 0, it's as if the point size were 1 β€” she refuses to be nothing 😌). if the rounded size is odd, then the center point (x, y) of the pixel fragment that represents the point is computed as:

( ⌊xwβŒ‹+.5, ⌊ywβŒ‹+.5)

where the w subscripts indicate window coordinates. all pixels that lie within the square grid of the rounded size centered at (x, y) make up the fragment. and if the size is even, the center point is:

( ⌊xw+.5βŒ‹, ⌊yw+.5βŒ‹)

and the rasterized fragment's centers are the half-integer window coordinates within the square of the rounded size centered at (x, y). all pixel fragments produced in rasterizing a nonantialiased point are assigned the same associated data β€” that of the vertex corresponding to the point. periodt πŸ‘‘

if antialiasing is enabled, then point rasterization produces a fragment for each pixel square that intersects the region lying within the circle having diameter equal to the current point size and centered at the point's (xw, yw). the coverage value for each fragment is the window coordinate area of the intersection of the circular region with the corresponding pixel square. this value is saved and used in the final rasterization step. the data associated with each fragment is the data associated with the point being rasterized. so, like, soft dots. gorgeous. 🌈

and now the sad part 😭 β€” not all sizes are supported when point antialiasing is enabled. if an unsupported size is requested, the nearest supported size is used. only size 1 is guaranteed to be supported; the others depend on the implementation. if you wanna query the range of supported sizes and the size difference between supported sizes within the range, call glGet with arguments GL_SMOOTH_POINT_SIZE_RANGE and GL_SMOOTH_POINT_SIZE_GRANULARITY. for aliased points, query the supported ranges and granularity with glGet with arguments GL_ALIASED_POINT_SIZE_RANGE and GL_ALIASED_POINT_SIZE_GRANULARITY. iykyk πŸ”

πŸ’€ NOTES πŸ’€

  • the point size specified by glPointSize is always returned when GL_POINT_SIZE is queried. clamping and rounding for aliased and antialiased points have no effect on the specified value. she's honest, she tells you what you set, not what she did with it πŸ™ˆ
  • a non-antialiased point size may be clamped to an implementation-dependent maximum. although this maximum cannot be queried, it must be no less than the maximum value for antialiased points, rounded to the nearest integer value. so there's a ceiling, but it's a mystery ceiling 🎭
  • big deprecated energy: GL_POINT_SIZE_RANGE and GL_POINT_SIZE_GRANULARITY are deprecated in GL versions 1.2 and greater. their functionality has been replaced by GL_SMOOTH_POINT_SIZE_RANGE and GL_SMOOTH_POINT_SIZE_GRANULARITY. rip to the old ones, they served their time πŸ•―οΈ

πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_VALUE is generated if size is less than or equal to 0. so zero and negatives? absolutely not, we do not stan πŸš«πŸ™…β€β™€οΈ
  • GL_INVALID_OPERATION is generated if glPointSize is executed between the execution of glBegin and the corresponding execution of glEnd. read the room, bestie, don't do that in between 😀

⭐ ASSOCIATED GETS ⭐

like, the stuff you can go ask about later πŸ’¬

glGet with argument GL_POINT_SIZE
glGet with argument GL_ALIASED_POINT_SIZE_RANGE
glGet with argument GL_ALIASED_POINT_SIZE_GRANULARITY
glGet with argument GL_SMOOTH_POINT_SIZE_RANGE
glGet with argument GL_SMOOTH_POINT_SIZE_GRANULARITY
glIsEnabled with argument GL_POINT_SMOOTH

πŸ‘‘ SEE ALSO πŸ‘‘

  • glEnable(3G) β€” go read that one next, it's giving sibling energy 🫢

and that's the whole page!! mwah πŸ’‹ this was GLPOINTSIZE(3G), brought to you straight from the 3G manual β€” same name up top, same name down here, no date on this one so don't come for me 🌸 go forth and render some extremely correct dots βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from